ZirToken
A community discussion post from the original code:zIRON forum.
Replies
aha yes of course - i have fixed it and sent you PM :)
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
i assume Let is for variables that already exist?
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.