HELP! I have never used a case statement before and a unable to get progress 9.1d to run my statement, even in using an example I have in a book.
I am sure that I am just missing something obvious, can anyone tell me why this does not work?
def var x as integer.
x = random(0,5).
display x.
case x :
when 1 then message "one" view-as alert-box info.
otherwise message "???" view-as alert-box info.
end case.
The code works fine for me (10.1C).
What is the message prior to (or just after) the 3583, as 3583 is a very generic message?
Unfortunately I did not get any other message. I am going to assume that CASE does not work in my current version of 9.1D. I used ELSEIF without a problem, CASE just seemed slightly easier.
IIRC the CASE statement has been supported since Version 7.
I suspect there is a missing period (.) in a statement just above the CASE statement that is causing compiler to spew out erroneous error messages..
Try pasting the code I have above, that would not even work for me.
I did copy/paste the code and it works fine.
Try commenting (or completely removing) the CASE block of code and see if the compiler still complains.
Commenting out the CASE block worked fine, but when I uncomment it i get that error.
Can you paste the statements that come before and after the CASE block?
While it is true that 9.1D is ancient, obsolete and unsupported the CASE statement works fine in 9.1D.
I tried your example verbatim with 9.1D and it worked without any error or objection.
The code I pasted is all i tried to run. I was trying to troubleshoot why my program got the same error, but as the error occurs with just this simple code block, I am either doing something wrong, or I have something wrong with my version of progress.
I just copied it and pasted into the 9.1D07 editor. It runs fine.
What service pack of 9.1D are you running? On what platform?
I'm running on SCO UNIX. I don't see a service pack in the information area. Is there an easy way to find out what Service Pack is installed?
In the $DLC directory, there is a file called 'version' - that will contain the information about SP level.
/home/dlc >more version
PROGRESS Version 9.1D as of Wed May 8 16:30:39 EDT 2002
Unpatched 9.1D.
CASE should still work.
Just for kicks try changing the MESSAGE to a plain old MESSAGE -- get rid of the "view-as alert-box info" and see if that helps.
That did nothing either. It must be a patch that we don't have installed.
Vanilla 9.1D is 7 years old. You might want to give some thought to upgrading
But I have a hard time believing that that code doesn't compile. Even on such a clunker of an old release. If it's a bug it's a new one on me.