Le forum (ô combien francophone) des utilisateurs de Powerbuilder.
Je dois écrire une procédure qui prend en argument un tableau de long mais je ne sais pas comment je dois faire.
Pouvez-vous m'aider ?
Merci.
Hors ligne
en gros dans la déclaration de la fonction tu mets Argument type = Long et Argument name = al_tableau[]
et pour l'appel :
Long ll_tableau[]
f_ta_fonction( ll_tableau )
F1 a écrit:
Passing arrays
When an argument is an array, you specify brackets as part of the argument name in the declaration for the function or event.
Variable-size array as an argument
For example, suppose a function named uf_convertarray accepts a variable-size array of integers. If the argument's name is intarray, then for Name enter intarray[ ] and for Type enter integer.
In the script that calls the function, you either declare an array variable or use an instance variable or value that has been passed to you. The declaration of that variable, wherever it is, looks like this:
integer a[]
When you call the function, omit the brackets, because you are passing the whole array. If you specified brackets, you would be passing one value from the array:
uf_convertarray(a)
Fixed-size array as an argument
For comparison, suppose the uf_convertarray function accepts a fixed-size array of integers of 10 elements instead. If the argument's name is intarray, then for Name enter intarray[10], and for Type enter integer.
The declaration of the variable to be passed looks like this:
integer a[10]
You call the function the same way, without brackets:
uf_convertarray(a)
If the array dimensions do not match If the dimensions of the array variable passed do not match the dimensions declared for the array argument, then array-to-array assignment rules apply. For more information, see "Declaring arrays ".
Hors ligne
oui mais c'est une procedure oracle et c'est la le problème.
Hors ligne
Hors ligne