
-----------------------------------
kanetix
Tue Jan 13, 2004 9:26 pm

error trap problem
-----------------------------------
i'm having a error trap problem with my project

here's the code for the main program:

%Main Program
introduction
loop
    loop
        mainMenu
        if operation < 1 or operation > 7 then
            put "invalid input"
        else
            exit
        end if
    end loop
    if operation = 7 then
        exit
    end if
    loop
        userInput
        if amount < 1 then
            put "invalid input"
        else
            exit
        end if
    end loop
    display
end loop
goodBye

Problem is, the "invalid input" never shows, instead whenever you try to put operation as 7 and you press enter it the number just erases ... why?

-----------------------------------
AsianSensation
Tue Jan 13, 2004 10:02 pm


-----------------------------------
eh....post up the rest of your code, we don't know the procedures you declared, so post those up as well.

-----------------------------------
help_wanted
Thu Jan 15, 2004 8:25 pm

mayb
-----------------------------------
k first why do you have 2 loops at once?? :?

-----------------------------------
Thuged_Out_G
Thu Jan 15, 2004 8:40 pm


-----------------------------------
2 loops are used to fake a goto line command...heres an example, i didnt understand this at first either lol

loop
main program...like a menu
put "option 1"
put "option 2"
put "option 3"
get selection

loop
if selection=1 then
put "1"
exit %when you exit this loop, it will go back to the beginning of the first loop
end if
end loop
end loop

therefor you can run your program over and over until the user wants to exit
