Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: DorkeyDear on June 05, 2008, 02:34:36 pm

Title: impossible "case"
Post by: DorkeyDear on June 05, 2008, 02:34:36 pm
delete please, figured it out
Title: Re: impossible "case"
Post by: Boblekonvolutt on June 05, 2008, 04:26:47 pm
Share it with the world...
Title: Re: impossible "case"
Post by: DorkeyDear 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... :(
Title: Re: impossible "case"
Post by: chutem on June 05, 2008, 10:57:22 pm
 ??? I understand none of what you just said.
Title: Re: impossible "case"
Post by: DorkeyDear 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,