Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[VB6 -> Delphi] ReDim?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Sun May 18, 2008 7:43 am    Post subject: [VB6 -> Delphi] ReDim? Reply with quote

How would I use ReDim in Delphi?
Or another similar function.
I've searched, no success :/

My problem is:
Code:
var
  CollisionMap: array of Boolean;
  CMHeight: integer;
  CMWidth: integer;

procedure CreateCollisionMap();
var
  X,Y: integer;
  TempData: int64;
begin
  CMHeight := frmPics.MapMask.Height;
  CMWidth := frmPics.MapMask.Width;
  CollisionMap(CMWidth - 1, CMHeight - 1); // Gives me error: Statement Expected, but expression of type 'dynamic array' found
// And in VB6 they used ReDim.
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Sun May 18, 2008 8:56 am    Post subject: Reply with quote

I don't know so much about Delphi but I think you should declare CollisionMap as a multidimensional array. I don't know how to do that, but it would mean instead of CollisionMap(x) := bla; you can do CollisionMap(x,y) := bla;
Also, you're declaring the variable in the code, I think you have to do it before. So the compiler is looking for:
CollisionMap(CMWidth - 1, CMHeight - 1) := xxxx;
and you're just declaring it.
Back to top
View user's profile Send private message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Sun May 18, 2008 9:50 am    Post subject: Reply with quote

Code:
 multiArray : Array of Array of string;  // Multi-dimension array

I'll mess with it.
Thank you Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites