dynamic arrays not dynamic

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-07-05 05:10 PM
‎2004-07-05
05:10 PM
num=60
DIM xx[num]
If you try this, even in ArchiCAD 8.1, it still doesnt work, you still get an error message saying that you must put a valid number into the brackets e.g.
DIM xx[60]
I havent really chased this one with Gs as i havent needed it, but I wanted it today and couldnt use it.
Perhaps the object works, but the error checking routine still reports an error. That is still the case with built in Material definitions.
--:David Nicholson-Cole GDLA:--
http://sustainabletallbuildings.blogspot.com
http://chargingtheearth.blogspot.com
http://sustainabletallbuildings.blogspot.com
http://chargingtheearth.blogspot.com
5 REPLIES 5
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-07-05 05:35 PM
‎2004-07-05
05:35 PM
David,
I have made variable arrays successfully with the format:
DIM matthews_variable_array [ ][ ]
I forget now, but I think a space character is required inside each pair of brackets (I don't feel like launching AC right now to check).
HTH,
Matthew
I have made variable arrays successfully with the format:
DIM matthews_variable_array [ ][ ]
I forget now, but I think a space character is required inside each pair of brackets (I don't feel like launching AC right now to check).
HTH,
Matthew

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-07-05 05:42 PM
‎2004-07-05
05:42 PM
Matthew wrote:I know how you feel......
David,
I have made variable arrays successfully with the format:
DIM matthews_variable_array [ ][ ]
I forget now, but I think a space character is required inside each pair of brackets (I don't feel like launching AC right now to check).
But are you saying that putting NOTHING but a space in the brackets works??? that would create an array without limits!!
--:David Nicholson-Cole GDLA:--
http://sustainabletallbuildings.blogspot.com
http://chargingtheearth.blogspot.com
http://sustainabletallbuildings.blogspot.com
http://chargingtheearth.blogspot.com

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-07-05 06:58 PM
‎2004-07-05
06:58 PM
But are you saying that putting NOTHING but a space in the brackets works??? that would create an array without limits!!This is exactly what the GDL User Manual says...
If you use empty square brachets, the GDL interpreter evaluates the needed size during the compilation.
Chapter 11
Expressions and Functions
...
Dynamic arrays
...
Variable expressions cannot be used as dimensions. If they are missing, the array is declared to be dynamic (one or both dimensions).
...
Parameter arrays do not have to be declared in the script and they are
dynamic by default.
...
For dynamic arrays there is no limitation for the actual index value. During the interpretation, when a non-existing dynamic array element is given a value, the necessary quantity of memory is allocated and the missing elements are all set to 0 (numerical). Warning! This may cause an
unexpected out of memory error in some cases.
_________________
--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-07-05 11:42 PM
‎2004-07-05
11:42 PM
david wrote:Shucks, David, I thought that's what you wanted. You do have to be careful not to fill it too much though. A billion values could fill up the available RAM
But are you saying that putting NOTHING but a space in the brackets works??? that would create an array without limits!!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-07-07 04:08 AM
‎2004-07-07
04:08 AM
david wrote:In a way, yes. But the size of the array would be the last row of array that have been assigned a value. For example:
But are you saying that putting NOTHING but a space in the brackets works??? that would create an array without limits!!
DIM xx[][]
FOR i=1 to num1
FOR j=1 to num2
xx
NEXT j
NEXT i
The size of this particular array is num1xnum2 and it can be retrieved using GDL syntax:
VARDIM1(XX)=num1
VARDIM2(XX)=num2
Howard Phua
Win 10, Archicad 19 INT
Win 10, Archicad 19 INT