• Welcome to Jose's Read Only Forum 2023.
 

Can't get my program debugged !

Started by Randall Glass, April 08, 2013, 09:25:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Randall Glass

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 ?
Lassar

RadioTelephone Tutor : Get your FCC GROL License plus Radar Endorsement
http://radiotelephonetutor.com

Klaus Henn

try:  UCWord$ = TRIM$( UCASE$(WordZ$(NextToLastWord)))



Theo Gottwald

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.

Randall Glass

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 ?
Lassar

RadioTelephone Tutor : Get your FCC GROL License plus Radar Endorsement
http://radiotelephonetutor.com

Theo Gottwald

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.