Jump to content
  • Advertisement
Sign in to follow this  
shoted08

Quick Delphi question.

This topic is 3623 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!