Register | Login
Forum Index > Source Help > compiling error
Author Message
Pages: 1 2 3 4
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[180] - posted: 2011-10-27 21:39:24

windows 7

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

avatar

(send private message)

Posts: 932
Topics: 54

Location:
OverHertz Studio
[181] - posted: 2011-10-27 21:39:51
ohhhh my mistake

Code:
push edi
ecx = @buf;
edi = GetNextLine(ecx); //my mistake :P

while(edi > 0) {
  WriteLn(@LineIn);
 
  add ecx, edi  
  edi = GetNextLine(ecx);
} 

int32 k = edi;
pop edi


that will work smile

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
[182] - posted: 2011-10-27 21:41:32

ok works fine , but i prefer the global version.

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

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[183] - posted: 2011-10-27 23:58:59

pk , here is the final version of GetNextLine function.
Code:
program WIN32CUI 'test';

#include 'console.zir';
#include 'ch.zir';

const buf = loadfs('fpu_opcodes.txt');
char LineIn[1024];

/*************************************************************************/
// return value is the length of line
// strbuf is the source buffer
// dest is the buffer that hold the line extracted from source buffer  
function GetNextLine(char* strbuf; pointer dest)
{ 
  global int32 incr;

  uses esi edi;
  eax = xor;
  
  ecx = incr;
  esi = strbuf;  
  add esi, ecx
  edi = dest;
  
  while(char[esi] != 0)
   {
      if (word[esi] == "\r\n")
       {
         eax += 2; 
         break;
       }
      bl = char[Esi]; 
      char[edi] = bl; 
      eax++; 
      esi++;
      edi++;
   }
  char[edi] = 0; 
  
  add ecx, eax
  incr = ecx;
}
/*************************************************************************/

push edi
edi = GetNextLine(@buf,@LineIn);
while(edi > 0) 
 {
    print('length of line = ', edi:int, '\r\n');
    WriteLn(@LineIn);
    edi = GetNextLine(@buf,@LineIn);
 } 

pop edi

wait_key(nil);

ExitProcess(0);


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

avatar

(send private message)

Posts: 932
Topics: 54

Location:
OverHertz Studio
[184] - posted: 2011-10-28 00:10:32
since the value from getnextline is just checking whether to continue or not, you can use eax

Code:
eax = GetNextLine(@buf,@LineIn);
while(eax) {
    print('length of line = ', eax:int, '\r\n');
    WriteLn(@LineIn);
    eax = GetNextLine(@buf, @LineIn);
} 


smile

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
[185] - posted: 2011-10-28 10:47:02

actually , in the plugin we get a line from Source Buffer then we will start parsing it.

so may we use the line length returned from GetNextLine function in our coming parsing.

i think the next function we can use is the Trim Function, i will try to implement it.


http://www.freewebs.com/ogremagic/index.htm
Pages: 1 2 3 4
create new reply


Quick reply:

Message:



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


Statistics:
Threads: 224 | Posts: 1847 | Members: 50 | Active Members: 50
Welcome to our newest member, NobodyAtWork
const Copyright = '2011-2022 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd