Page 1 of 1

Reserved Word or Not a Reserved Word?

Posted: Fri Apr 21, 2006 8:50 pm
by oldefoxx
I created a structure union in DWC where I mapped a DW.d over a DC.coord. I later found a problem with the structure not receiving a proper return from one of the API calls. As I tried to figure out what was going on, I chanced to observe that DWC\DW was being handled as a float. As I was
retyping the structure to make sure I had it exactly right, I elected to change
the DW.d to Dw.d, but the Editor immediately changed it back to DW.d, which indicated it was a keyword or constant. Only it appears that it isn't, since I cannot find a reference to it. No syntactical error, no problem with the program compiling and running, but it gives a wrong result where I try to use it in my code.

Posted: Fri Apr 21, 2006 10:10 pm
by netmaestro
The issue there is inline ASM support being checked in compiler options. DW is a keyword in FASM and that's why it's happening that way. You could uncheck "Enable inline ASM support" in your compiler options or, if you need it, you could rename the variable.

Posted: Fri Apr 21, 2006 10:45 pm
by oldefoxx
Interesting. I thought that any reserved word would bring up an corresponding help link if recognized, but when I checked the Flat Assemble we site, their only documentation had to be accessed online. Since the Help
feature in PureBasic is limited to documentation copied into the \PureBasic\Help folder, you have a bit of a problem of getting a handy link to the reference to DW in FASM. It is not an Opcode of ASM, so no help here.

I had mentioned the desireability of being able to have links added to the
Help feature in the IDE, and I guess this is a case where it would have paid off if done interactively rather than just passively.

Posted: Fri Apr 21, 2006 11:27 pm
by Flype
That's why it could be interessant to have a special block for ASM code like DataSection/EndDataSection. For example : AsmSection/EndAsmSection.
This way no need to have an option in the compiler dialog, but maybe it's not possible to implement this.

Posted: Fri Apr 21, 2006 11:40 pm
by Fred
You're right, we will probably add this in the future, to ease the asm integration.