Sign in to follow this  
shoted08

Quick Delphi question.

Recommended Posts

I'm new to programming and Delphi and stuff so if this is in the wrong forum sorry lol. I have two arrays called WinCheckP1[i,j] and WinCheckP2[i,j]. Is it possible to make part of the name a variable so something like this could work. for a : 1 to 2 do WinCheckP a [i,j] I've tried a bunch of stuff but I cant get it to work and I don't want to have double the code because it looks messy. Thanks.

Share this post


Link to post
Share on other sites

type
twincheck = array[0..9,0..9] of integer;
var
a:integer;
WinCheckP : array[1..2] of twincheck;
begin
for a:=1 to 2 do WinCheckP[a][i,j]:=0;

end;

Share this post


Link to post
Share on other sites
Quote:
Original post by tpascal

type
twincheck = array[0..9,0..9] of integer;
var
a:integer;
WinCheckP : array[1..2] of twincheck;
begin
for a:=1 to 2 do WinCheckP[a][i,j]:=0;

end;


Thanks man, it worked great.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this