SOLVED!
How to delete/reset an array?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-02-03 11:18 PM
2018-02-03
11:18 PM
i have an array used more than once through a subroutine (sort it). The data stored in array varies, so does the length of the array. The problem is that I access/use array length through vardim1(array).
If in a previous use of the subroutine the array was longer, the array stays the same (longest) length, and the sorting algorithm will sort junk into the array.
So I would need resetting/deleting the existing array (of that name).
Is there a sollution for this? (Without splitting the stuff into different macros that will slower running it.)
GDL/Python/C++ dev
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Accepted Solutions
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-02-04 12:14 AM
2018-02-04
12:14 AM
Just realized that dim can be used multiple times and thus for resetting arrays.
GDL/Python/C++ dev
5 REPLIES 5
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-02-04 12:14 AM
2018-02-04
12:14 AM
Just realized that dim can be used multiple times and thus for resetting arrays.
GDL/Python/C++ dev

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-28 11:26 PM
2019-01-28
11:26 PM
Just a question,
Have you been successful to achieve the same thing for array parameter ?
Have you been successful to achieve the same thing for array parameter ?
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-29 02:54 AM
2019-01-29
02:54 AM
Moonlight wrote:I don't think you can delete just one array parameter easily.
Just a question,
Have you been successful to achieve the same thing for array parameter ?
My understanding and as explained in the other post I think ...
You have to read all of the array values into an new array.
Then reset the original array and then add back all of the values except the one you want.
Effectively you will have deleted the value that you want.
That is about my limit of knowledge with arrays.
I have never actually tried doing this myself.
Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-29 01:12 PM
2019-01-29
01:12 PM
Hi Barry,
I already have done that and it doesn't work, and I don't know why, so I´m open to suggestions
I already have done that and it doesn't work, and I don't know why, so I´m open to suggestions
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-01-29 05:31 PM
2019-01-29
05:31 PM
To Barry,
I have found what is wrong, and I will write it in detail in this link.
https://archicad-talk.graphisoft.com/viewtopic.php?f=6&t=66012
I have found what is wrong, and I will write it in detail in this link.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
