0

Man, I'm so new. I'm trying to script something for a game. so here's what I got:

program twars;

const
  Color = $FFFFFFFF;

  FISTS   =  0;
  DEAGLES =  1;
  MP5     =  2;
  AK74    =  3;
  STEYR   =  4;
  SPAS    =  5;
  RUGER   =  6;
  M79     =  7;
  BARRETT =  8;
  MINIMI  =  9;
  MINIGUN = 10;
  SOCOM   = 11;
  KNIFE   = 12;
  SAW     = 13;
  LAW     = 14;
  FLAME   = 15;
  ARROW   = 16;

 


type

       tClasses = record
                name,info,tip: string;
                weap: array[0..16] of boolean;
              end;

var
           c: tClasses;


procedure placekeeper;
begin
end;

begin
c[1].name   := 'Pyro';
c[1].info   := 'Flame';
c[1].tip    := 'burn';
c[1].weap   := [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false];
end;

This doesn't work apparently. =\
thanks for reading!

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by jamesbond110
0

jamesbond110, see this points:
- that "end" in the program main block must be ended with point (.), not a semicolon (;)
- your "c" variable is defined like a tClasses (a record type), so You can't index them like it was a array type.
- if You want store n tClasses records You must declare "c" as array[...] of tClasses, otherwise You must remove the indexer "[1]":
c[1].name => c.name

Bye

0

Thank you Micheus!

Here's what I changed:

var
           c: array[1..2] of tClasses;

I added to your rep ;)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.