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!

Member Avatar for Micheus

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

Thank you Micheus!

Here's what I changed:

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

I added to your rep ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.