| View previous topic :: View next topic |
| Author |
Message |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Sun May 18, 2008 7:43 am Post subject: [VB6 -> Delphi] ReDim? |
|
|
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 |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sun May 18, 2008 8:56 am Post subject: |
|
|
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 |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Sun May 18, 2008 9:50 am Post subject: |
|
|
| Code: | | multiArray : Array of Array of string; // Multi-dimension array |
I'll mess with it.
Thank you
|
|
| Back to top |
|
 |
|