Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Requests and Feedback

ZirToken

A community discussion post from the original code:zIRON forum.

Replies

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

i was meaning

 boolean ParesFlg = true;  

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

aha yes of course - i have fixed it and sent you PM :)

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

ok i will try it. thanks.

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

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

ok ,very nice.

thanks.

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

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

ok here is what i done till now.

function event_Let() {
  uses edi;
  char buf[2048];
  char line[2048];
  char var[255];
  Dword Len;
  boolean ParesFlg = true;  
  len = Ziron_ExtractLine(@line, 2048);
  // remove 'let' form line
  strFold(@line, 4);
  Ziron_ShowMessage(@line);                // show our entire line for debug purpose
  if(ParesFlg)
   {  
      // get the variable name and hold it in Var 
      Ziron_GetNextToken(); // BTW if i used Ziron_ExpectNextToken(zirIdent); i always getFatalError !!!!!!!!    
      H_strcpy(@var,Ziron_GetStringValue());   
      
      // check for'=' symbol 
      eax = Ziron_ExpectNextToken(zirAssignment);
      if (eax == -1) {
           Ziron_FatalError('Expected =  symbol');
           return true;
      }
 
      // here we start getting what after '=' 
      Ziron_GetNextToken(); 
      Ziron_GetNextToken();  
        
      return true;
   }
  else
   {   
      return false;                           // let Ziron handle the line  
   }   
}

so now i need to know the variable type , if it is a string variable or digital variable

to make action according to it'type

is that possible or not ?

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

i assume Let is for variables that already exist?

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

yes , so what ?

can you please explain more

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

reason i ask is this line:

 Ziron_GetNextToken(); // BTW if i used Ziron_ExpectNextToken(zirIdent); i always getFatalError !!!!!!!!  

if a variable already exists, it is no longer an ident it becomes a zirVar, or zirLocalVar etc...

so you would need to use a switch statement to detect if it is a global or local var, as for detecting the variable type, all variables are the same, they are just by size, floats are an exception, however i guess i could add a function to return the declared variable type string value.