FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
VariantToJSON - Now not working
VariantToJSON - Now not working
Débuté par DerekT, 22 juil. 2017 18:41 - 1 réponse
Connectez-vous…
DerekT
#1
Posté le 22 juillet 2017 - 18:41
WDv22 - 01A220063m
Yesterday this was working fine.
Only thing that has changed is that M$ applied the 'creators update' without so much as a by your leave.
I have a multi-select looper, on save I loop through this and add each selected row to an array and execute the following code.
//If selections have been made IF ArrayCount(clMatching.m_ArrEssentials) > 0 THEN //Store the array content lvArrContent = clMatching.m_ArrEssentials //Update match string with the all selections as JSON clMatching.SET_JSONEssentials = VariantToJSON(lvArrContent) END
Yesterday no problem - today I get the fatal error.....
Error at line 17 of Click btnSave process.
VariantToJSON function called.
The JSON serialization does not allow the 'object' elements.
My understanding that it is supposed to do exactly what the error says it cannot.
I assume that 'object' is referring to the class - I have tried this as a class Property and class Method but get the same error.
Yesterday it saved it as [ { "nID":142 }, { "nID":143 }, { "nID":144 } ]
Any thoughts
Signaler
0
0
DerekT
#2
Posté le 23 juillet 2017 - 13:33
After a bit more playing about my findings are that - much as the error implied - VariantToJSON, or for that matter Serialize(), does not work with class members or methods.
Moved the required variables to the window declaration and revised the code to use these and all works as expected.
Downside is that it does mean that I now require repetitive declarations in all windows that use the class functionality which is a shame.
Interestingly a small test indicates that I could move everything from the Class to a set of Global Procedures and that this would function correctly.
Any clever people out there have an insight why this should be a no-no for classes.
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