FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
ArraySeek() issue solved
ArraySeek() issue solved
Débuté par DerekT, 17 jan. 2018 17:27 - 1 réponse
Connectez-vous…
DerekT
#1
Posté le 17 janvier 2018 - 17:27
In my previous post I mentioned an issue of ArraySeek() always returning a value of 1 regardless of whether the sought value existed or not.
Having returned to programming I also noticed that combos bound to the arrays showed no values even though the arrays themselves had content.
My error, no surprise here, as I was using a reversal of the code used to store the JSON content to populate the arrays....
FOR EACH LookupDetail where StringBuild("FK_LUCode = '%1'",s_LUCode) //Fetch and convert the content of the detail (JSON) string s_LUDetailJSON = LookupDetail.LookUpList_JSON; v_LUDetail = JSONToVariant(s_LUDetailJSON) //Assign the variant to the array {"m_Arr" + s_LUCode,indVariable} <- v_LUDetail ENDfollowing a few posts with Andy Stapleton I changed this to
FOR EACH LookupDetail where StringBuild("FK_LUCode = '%1'",s_LUCode) //Fetch and convert the content of the detail (JSON) string s_LUDetailJSON = LookupDetail.LookUpList_JSON // Deserialization to the element Deserialize({"m_Arr" + s_LUCode,indVariable}, s_LUDetailJSON, psdJSON) ENDAll is now working as expected.
Only difference I can see when viewing the arrays in the debugger is that the header of the Value column for each row of the array shows different description
When using JSONToVariant it shows
When using Deserialize it shows //Array of a Structure
The conclusion has to be that variant members are invisible outside of the array itself although I have no idea why this should be or why an array based on a variant always returns the value of 1.
Another lesson learned.
Signaler
0
0
vvido
#2
Membre enregistré
94 messages
Posté le 30 juin 2022 - 16:29
THANKS FOR SHARING !!
WD 26 -- problem still here
Array of structures
ArraySeek always returns 1 when ANY element of the structure is variant. (WD BUG)
I have defined an array of structures. One of structure elements was Variant.
ArraySeek returns 1 even when you search for a value in fields which are not variant !
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