Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #538
2011-11-09 21:16:07 UTC
i guess i could add a function to return the declared variable type string value. i think it is good idea so , if the var type is string and found something like that
char var[1024];
H_strcpy(var,'geust');
Let myvar = 'welcome' + var + 'here ..'
and if it is digital so ziron will handle it.
http://www.freewebs.com/ogremagic/index.htm
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #539
2011-11-09 21:23:58 UTC
i have re-updated the package, i've added 2 new pf functions
Ziron_GetID - this function can be called when the current token type is a variable.
and
Ziron_GetVarTypeString - pass the id to this function and it will return the string value of the data's type.
let me know...
Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #540
2011-11-09 21:27:48 UTC
can i use something like this
Ziron_ExpectNextToken(zironVar or zironLocalVar);
http://www.freewebs.com/ogremagic/index.htm
Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #541
2011-11-09 21:40:14 UTC
eax = Ziron_GetID();
ecx = Ziron_GetVarTypeString(eax);
Ziron_ShowMessage(ecx);
very nice , now we need something like 'strcmp in C' to compare the returned value from Ziron_GetVarTypeString against variables such as int32 char ....etc
http://www.freewebs.com/ogremagic/index.htm
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #542
2011-11-09 21:40:35 UTC
no, but i plan to add something to accept more types at a later time, for now you can just do:
eax = Ziron_GetNextToken();
case (eax) {
state zirVar:
state zirLocalVar:
state zirLocalParam:
break;
default:
FatalError('Unexpected token ....
return true;
}
//since it did not return we know it had to be one of the 3 :)
//rest of code here.
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #543
2011-11-09 21:42:58 UTC
now we need something like 'strcmp in C' to compare the returned value from Ziron_GetVarTypeString against variables such as int32 char ....etc good idea, i will get with that :)
Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #544
2011-11-09 21:44:03 UTC
can i check variable type only by Ziron_GetID ?
http://www.freewebs.com/ogremagic/index.htm
Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #545
2011-11-09 21:53:44 UTC
i mean something like enum , so we can check returned value of Ziron_GetID against enum.
http://www.freewebs.com/ogremagic/index.htm