Author Topic: Can't get my program debugged !  (Read 2726 times)

0 Members and 1 Guest are viewing this topic.

Offline Randall Glass

  • Newbie
  • *
  • Posts: 12
    • RadioTelephone Tutor : Get your FCC GROL License plus Radar Endorsement
Can't get my program debugged !
« on: April 08, 2013, 09:25:00 AM »
I have been trying to to debug this code.

Code: [Select]
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!

Code: [Select]
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

Offline Klaus Henn

  • Newbie
  • *
  • Posts: 1
Re: Can't get my program debugged !
« Reply #1 on: April 08, 2013, 11:19:13 AM »
try:  UCWord$ = TRIM$( UCASE$(WordZ$(NextToLastWord)))



Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 966
    • it-berater
Re: Can't get my program debugged !
« Reply #2 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.

Offline Randall Glass

  • Newbie
  • *
  • Posts: 12
    • RadioTelephone Tutor : Get your FCC GROL License plus Radar Endorsement
Re: Can't get my program debugged !
« Reply #3 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 ?
Lassar

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

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 966
    • it-berater
Re: Can't get my program debugged !
« Reply #4 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.