Register | Login
Forum Index > Requests and Feedback > data section.
Author Message
Pages: 1 2 3 4 5 6 7 8 9 10 11
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[612] - posted: 2011-11-11 20:30:54
searching for . is not enough, since

Code:
#include 'console.zir';


contains a "."... you could use strOffset to do this...

Code:
esi = strCode;

esi = strOffset(esi, '.DATA');
while (char[esi] <> 0) {
    char[esi] = '_';

    esi = strOffset(esi, '.DATA');
}


this is untested but should work.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[613] - posted: 2011-11-11 20:40:32

no it search for '.' in the first position of trimed line.

so the code get the next line from buffer , then it removes unwanted char by H_Trim , then it check the first char of the line if it is '.' then it replace it with '_'

http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[614] - posted: 2011-11-11 21:07:57
yes, i see i did not read correctly, however the way i posted would be much more efficient, and would not be strict on being the first in line....

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[615] - posted: 2011-11-11 21:12:32

ok , but what about the main problem?

http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[616] - posted: 2011-11-11 21:25:36
well, the main file's handle may not always be 0.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[617] - posted: 2011-11-11 21:30:27

so , how to know it's size , or detect the end of it?

http://www.freewebs.com/ogremagic/index.htm
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[618] - posted: 2011-11-11 21:40:27
look at this function
Code:
function FileEntry(DWord handle; char* strCode)
{   
   //preprocess the main file
   if (handle == 0)
    {       
      esi = strCode;
      esi = strOffset(esi, '.DATA');
      while (char[esi] != 0)
       {
           char[esi] = "_";
           esi = strOffset(esi, '.DATA');
       }
      Ziron_ShowMessage(strCode);   
       //set the buffer
      DWord Len;
      Len = H_strlen(strCode);
      Ziron_SetFileBuffer(handle, strCode, Len);  
    }
}


it must show the modified source code befor setfilebuffer function , but it does not
it give this error
Unknown Identifier "." in [testprg.zir]
Code:
.DATA var DB 64 //;

and that mean that the problem is not only the end of main file.

http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[619] - posted: 2011-11-11 21:49:53
Code:
   //preprocess the main file
   if (handle == 0)


as i said before, the main file handle might not be 0

and you wont need Ziron_SetFileBuffer since you directly update the buffer

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1 2 3 4 5 6 7 8 9 10 11
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 19 user(s) online. 0 member(s) and 19 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd