I have been trying to to debug this code.
CASE "SUB", "FUNCTION"
InSub% = 1
MainZ% = 0
UCWord$ = UCASE$(WordZ$(NextToLastWord))
IF UCWord$ = "PUBLIC" THEN
DeleteWord NextToLastWord
END IF
RESET SubTypeName$()
EXIT SUB
It's like the laws of the universe has been changed.
The debugger says UCWord$ = "PUBLIC", but when it gets to the "IF", it jumps over the "deleteword NextToLastWord" to "RESET SubTypeName$()"
I even put in a MSGBOX and it said that UCWord$ equals public"
Am I living in some weird parallel uinverse ?
I tried the following and this works. It makes no sense!
CASE "SUB", "FUNCTION"
InSub% = 1
MainZ% = 0
UCWord$ = "PUBLIC" 'UCASE$(WordZ$(NextToLastWord))
IF UCWord$ = "PUBLIC" THEN
DeleteWord NextToLastWord
END IF
RESET SubTypeName$()
EXIT SUB
Anyone have any ideas ?
try: UCWord$ = TRIM$( UCASE$(WordZ$(NextToLastWord)))
In such cases, its really a good idea, to trimm all spaces and make sure that the CASE of the strings is equal.
Otherwise thats a open "Padorras box" for errors.
That seems to help.
I don't know what to think about PowerBasic.
Now pbwin.exe is crashing.
It's caused by "#DEBUG DISPLAY ON on the 2nd line".
It causes pbwin.exe to crash.
I commented it out and it stopped crashing.
It was not crashing before with "#DEBUG DISPLAY ON"
I have pbwin 9.05
Anyone else have problems with this ?
If you have a code, that crashes teh compiler, pack it in a zip and sent it to the support@powerbasic.com
Then i believe they will repair it to the next update/version.