Author Topic: impossible "case"  (Read 933 times)

0 Members and 1 Guest are viewing this topic.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
impossible "case"
« on: June 05, 2008, 02:34:36 pm »
delete please, figured it out
« Last Edit: June 05, 2008, 02:53:44 pm by DorkeyDear »

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: impossible "case"
« Reply #1 on: June 05, 2008, 04:26:47 pm »
Share it with the world...

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: impossible "case"
« Reply #2 on: June 05, 2008, 05:43:07 pm »
if your really curious, i created an enumerated datatype containing "map" and then I had a string "Map" in a function; had a case statement with "map",but pascal was thinking of it as the "Map" variable.. if only pascal wasn't case insensitive... :(

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: impossible "case"
« Reply #3 on: June 05, 2008, 10:57:22 pm »
 ??? I understand none of what you just said.
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: impossible "case"
« Reply #4 on: June 06, 2008, 07:31:02 am »
Code: [Select]
type
  Blarg = (map, yes, no, good, others); //enumerated stuff

procedure Test(Map: string; Good: Blarg);
begin
  case Good of
    map: WriteLn('A');
    yes: WriteLn('B');
    no: WriteLn('C');
    good: WriteLn('D');
    others: WriteLn('E);
    else WriteLn('F');
  end;
end;

Instead of writing "A" when blarg is "map", it will write F sense its thinking "map" as the variable "Map", not the enumerated number,