FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
associative array & procedures
associative array & procedures
Débuté par Scott, 03 juil. 2008 09:49 - 1 réponse
Connectez-vous…
Scott
#1
Posté le 03 juillet 2008 - 09:49
Hello all,
I am running into an issue when trying to pass an associative array to a procedure or return an associative array from a procedure. I am hoping somebody could please shed some light on the issue… I am sure it is something simple 
Example:
this_data is associative array of strings
this_data["Name"]="Scott"
this_data["Email"]="scott@example.com"
arrayProc(this_data)
PROCEDURE arrayProc(LOCAL this_array)
Trace("Name", this_array["Name"])
Trace("Email", this_array["Email"])
Note: I also tried (LOCAL this_array is associative array of strings) and no luck.
This produces the error “Unable to convert element from associative array type to associative array type.” Also If I try it in reverse (procedure creates an array and returns the value) I get the same error.
Thank you in advance for any help you can offer.
Thanks,
Scott
Signaler
0
0
Scott
#2
Posté le 03 juillet 2008 - 09:49
I found the issue...
procedure(LOCAL this_array)
WD doesn't allow you to use LOCAL with an array.
"An array type variable or an object (class instance) cannot become local to a procedure."
I guess i needed a little more RTFM
Thanks,
Scott
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte