Support Forum

PROBLEM function REDIM [Gelöst]

Schlagworte:

Hello

Excuse me for posting my application here, but I know there are specialists here .

I do not understand why REDIM does not work, the table always remains a [1]

REDIM test [ ]

FOR i = 1 TO 4

test [ i ]= i

NEXT i

PARAMETERS test = test

attached test file
Thank you.

Administrateur forum : Allplan.leforum.eu

http://allplan.leforum.eu

Olivier1

Anhänge (3)

Typ: image/jpeg
35-mal heruntergeladen
Größe: 24,66 KiB
Typ: image/jpeg
38-mal heruntergeladen
Größe: 30,91 KiB
Typ: application/xml
907-mal heruntergeladen
Größe: 8,57 KiB

Lösung anzeigen Lösung verbergen

see param_array.png

Anhänge (1)

Typ: image/png
81-mal heruntergeladen
Größe: 107,29 KiB

Hello Olivier,

Pour un tableau créé dans "Paramètres", la fonction REDIM n'opère pas. C'est uniquement pour un tableau créé au cours des scripts.
Pour changer le nombre de valeurs d'un tableau, il suffit de charger une valeur avec l'indice maximum voulu.
Par contre, il n'est pas possible de réduire le nombre de valeurs par la suite sans recréer (et donc remplacer) le tableau avec la fonction de création de variable NEWPARAMETER.
De plus, l'aperçu en bas du script du contenu des tableaux n'est pas mis à jour pour la partie "parameter" après la boucle. Mais si la partie "variable" est correcte, ce sera bien ce qui sera stocké.
Je pense aussi qu'il est préférable de mettre "PARAMETERS test [ i ]= test [ i ]" en cours de boucle plutôt que "PARAMETERS test = test" après la boucle.
___________________________________________

For an array created in "Settings", the REDIM function does not operate. This is only for a table created during the scripts.
To change the number of values in an array, just load a value with the desired maximum index.
On the other hand, it is not possible to reduce the number of values afterwards without recreating (and therefore replacing) the array with the NEWPARAMETER variable creation function.
In addition, the preview at the bottom of the script of the table contents is not updated for the "parameter" part after the loop. But if the "variable" part is correct, it will be what will be stored.
I also think that it is better to put "PARAMETERS test [ i ]= test [ i ]" during the loop rather than "PARAMETERS test = test" after the loop.


see param_array.png

Anhänge (1)

Typ: image/png
81-mal heruntergeladen
Größe: 107,29 KiB

Thanks Nemo it works much better with this information.

Thanks Bertrand , I would also test you solution because I do not know NEWPARAMETER either

--

Merci Nemo ça marche bien mieux avec cette information .

Merci Bertrand , je testerais aussi t'a solution car je ne connais pas non plus NEWPARAMETER

Administrateur forum : Allplan.leforum.eu

http://allplan.leforum.eu

Olivier1

NEWPARAMETER and DELPARAMETER was introduced, to modify the parameters during migration of an SmartPart from one version to another. I can only warn to use them in the normal script flow!


https://connect.allplan.com/ verwendet Cookies  -  Mehr Informationen

Akzeptieren