View Full Version : Running macro in OSDD 11.60
Lim Chee Beng
03-09-2003, 10:50 PM
There is a very strange problem in loading the following macros into OSDD 11.60, compared to previous version of ME10.
DEFINE try1
LET LENGTH 1
DISPLAY (STR(LENGTH))
END_DEFINE
DEFINE try2
LET LL 2
DISPLAY (STR(LL))
END_DEFINE
Both "try1" and "try2" works fine in ME10 10.50. But when I updated to OSDD 11.60, running "try1" is not acceptable anymore. The error message is "***LENGTH IS NOT A VALID MACRO NAME". Why does it happen? I thought "LENGTH" is always an valid and acceptable variable's name. :mad:
ChrisE
03-10-2003, 01:18 AM
That's because LENGTH is now a qualifier of the MODEL2D package.
It is a qualifier of the command PRP_CHANGE_ATTR (allowing for changing the attributes of projected reference points)
If you are interested in the keywords and qualifiers of ME10, use the command LIST_KEYWORDS <destination>, where <destination> can either be SCREEN or a filename.
Lim Chee Beng
03-10-2003, 04:53 PM
The interesting thing is that only text format interpreted with the version 11.60 is affected, but binary copy compiled with earlier version seems to be working fine. Thx.
ChrisE
03-11-2003, 11:24 AM
Normally, a macro name is recognized by a capitalized letter followed by small letters.
So "Length" is always treated as a macro name, whereas "LENGTH" is first checked against the list of keywords, and if none is found, interpreted as a macro name.
Your compiled binary code (in a previous version of ME10) didn't recognize "LENGTH" as a keyword by then, and therefore stored it as "Length" into the binary file. That's why the binary file is working, the interpreted not.
Although being totally legal to use Length and LENGTH (one being a macro, the other a keyword) in the same macro, it seems rather dangerous to me :rolleyes:
That's why I tend to prefix all my local variables with an "l", like e.g. LOCAL l_length
....
LET l_length (INQ 101)
vBulletin® v3.7.4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.