Jose's Read Only Forum 2023

IT-Berater: Theo Gottwald (IT-Consultant) => General Tips and Discussion => Topic started by: Randall Glass on April 08, 2013, 09:25:00 AM

Title: Can't get my program debugged !
Post by: Randall Glass on April 08, 2013, 09:25:00 AM
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 ?
Title: Re: Can't get my program debugged !
Post by: Klaus Henn on April 08, 2013, 11:19:13 AM
try:  UCWord$ = TRIM$( UCASE$(WordZ$(NextToLastWord)))


Title: Re: Can't get my program debugged !
Post by: Theo Gottwald on April 08, 2013, 12:09:28 PM
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.
Title: Re: Can't get my program debugged !
Post by: Randall Glass on April 08, 2013, 05:34:07 PM
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 ?
Title: Re: Can't get my program debugged !
Post by: Theo Gottwald on April 09, 2013, 08:42:11 AM
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.