Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-11

"identifier not found" case probelm

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

rambo waz here
at the moment i have a case where each choice leads off to a procedure. ..
looks like this
repeat
    writeln('Main Menu');
    writeln('1. New Customer Info');
    writeln('2. Withdrawal');
    writeln('3. Returns');
    writeln('4. Money owed by customer');
    writeln('5. Quit the Program');
    readln(menu_choice);
    if menu_choice in [1..5]
    then case menu_choice of 1: new_customer;
                             2: withdraw;
                             3: returns;
                             4: money_owed;
                             5: writeln('stop')
                             end
    else writeln('1..5!")
    until choice = 5

but when i try to run it it comes up with an error saying "identifier not found" and highlights each of the case choices .. i.e. 3: returns; ...................... any help ? :( :( :(

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/identifier-not-found-case-probelm-tp5717460.html Sent from the Free Pascal - General mailing list .
Ewald
to rambo waz here: at the moment i have a case where each choice leads off to a procedure. .. looks like this

Once upon a time, rambo waz here said:

Show quoted text 23 lines
at the moment i have a case where each choice leads off to a procedure. .. looks like this repeat writeln('Main Menu'); writeln('1. New Customer Info'); writeln('2. Withdrawal'); writeln('3. Returns'); writeln('4. Money owed by customer'); writeln('5. Quit the Program'); readln(menu_choice); if menu_choice in [1..5] then case menu_choice of 1: new_customer; 2: withdraw; 3: returns; 4: money_owed; 5: writeln('stop') end else writeln('1..5!") until choice = 5 but when i try to run it it comes up with an error saying "identifier not found" and highlights each of the case choices .. i.e. 3: returns; ...................... any help ? :( :( :(

And where exactly are these functions (`returns`, `withdraw`, etc...) defined? I can't see them either by looking at your code... Perhaps a minimal working example would be handy?

Ewald
Lukasz Sokol
to rambo waz here: at the moment i have a case where each choice leads off to a procedure. .. looks like this
rambo waz here wrote 25 lines
at the moment i have a case where each choice leads off to a procedure. .. looks like this repeat writeln('Main Menu'); writeln('1. New Customer Info'); writeln('2. Withdrawal'); writeln('3. Returns'); writeln('4. Money owed by customer'); writeln('5. Quit the Program'); readln(menu_choice); if menu_choice in [1..5] then case menu_choice of 1: new_customer; 2: withdraw; 3: returns; 4: money_owed; 5: writeln('stop') end else writeln('1..5!") until choice = 5 but when i try to run it it comes up with an error saying "identifier not found" and highlights each of the case choices .. i.e. 3: returns; ...................... any help ? :( :( :(

Maybe try renaming the Returns procedure (e.g. to CashReturns or CreditReturns) I have a feeling this 'returns' may be a keyword...

-L.

Lukasz Sokol
to leledumbo
leledumbo wrote
> I have a feeling this 'returns' may be a keyword... No, it is not, I believe. Reserved words are listed in the docs.

Yeah, I checked too, 'returns' isn't a keyword.

-ENOCRYSTALBALL but /maybe/ the 'returns' is declared 'under' the code in question so it's not known prior to usage....

-L.