Quote from juancarlos on May 8, 2020, 9:24 pmsi ya me funciona hago la busqueda le doy click al boton y le tengo de dar otra vez al boton y ya aparece , el codigo esta puesto en la pestañe de un solo click
para depurar o seguir como van las variables hago un paragragh y hay meto las varibles y lo voy viendo , el unico pero que se bloquea el la pagina si meto un array, probare con la consolelog
muchas gracias
si ya me funciona hago la busqueda le doy click al boton y le tengo de dar otra vez al boton y ya aparece , el codigo esta puesto en la pestañe de un solo click
para depurar o seguir como van las variables hago un paragragh y hay meto las varibles y lo voy viendo , el unico pero que se bloquea el la pagina si meto un array, probare con la consolelog
muchas gracias
Quote from juancarlos on May 9, 2020, 1:53 pmya me funciona bien , pero no se el porque que cuando me pasa un dato lo hace triplicado
ya me funciona bien , pero no se el porque que cuando me pasa un dato lo hace triplicado

Quote from lesanch on June 9, 2021, 4:40 amHello @Luis_hp, @Gaev
Please can any of you help me with this, i can't realize what i'm doing wrong, I'm getting values from an Oracle database with PHP, until that point everything is fine. Those values returned and populate OK the variable [Data] showed in container separated by pipes |.
example: apples|friends|dogs|cats|etc...
When i try to put those returned values from [Data] to a combo or listbox i'm doing this:
CreateEmptyArray [user_nom_array]
SetVar [user_nom_array] [Data]
ArrayLen [user_nom_array] [array_length]StrParse "[user_nom_array]" "|" [user_name_array]
CreateEmptyArray [lista_user]
Loop 0 [array_length] [x]
Math "[user_name_array(x)]+1" 0 [user_name_array(x)]
ArrayAddItem [lista_user] [user_name_array(x)]
EndLoopbut even ArrayLen function is calculating ZERO length always, from that point nothing works.
Regards and many thanks,
Sam
Hello @Luis_hp, @Gaev
Please can any of you help me with this, i can't realize what i'm doing wrong, I'm getting values from an Oracle database with PHP, until that point everything is fine. Those values returned and populate OK the variable [Data] showed in container separated by pipes |.
example: apples|friends|dogs|cats|etc...
When i try to put those returned values from [Data] to a combo or listbox i'm doing this:
CreateEmptyArray [user_nom_array]
SetVar [user_nom_array] [Data]
ArrayLen [user_nom_array] [array_length]
StrParse "[user_nom_array]" "|" [user_name_array]
CreateEmptyArray [lista_user]
Loop 0 [array_length] [x]
Math "[user_name_array(x)]+1" 0 [user_name_array(x)]
ArrayAddItem [lista_user] [user_name_array(x)]
EndLoop
but even ArrayLen function is calculating ZERO length always, from that point nothing works.
Regards and many thanks,
Sam

Quote from luishp on June 9, 2021, 6:57 am@lesanch try this instead of your first 4 lines:
SetVar [user_nom_array] [Data] StrParse "[user_nom_array]" "|" [user_name_array] ArrayLen [user_name_array] [array_length]Regards.
@lesanch try this instead of your first 4 lines:
SetVar [user_nom_array] [Data] StrParse "[user_nom_array]" "|" [user_name_array] ArrayLen [user_name_array] [array_length]
Regards.

Quote from lesanch on June 10, 2021, 12:53 amHi Luis, well indeed was more easier than the last example i put in this post, but it tooks me several hours decifer this :-), i'm a little bit rusty. If can help some one i let here the code, this connects to an Oracle Database using PHP code and retrieve the usernames inside a table and puts its inside an array for later pass it to an listbox.
Only for consider i don't know why this only works if i put the code inside SUCCESS (Data,status) Form. If i put this in a PushButton does not work. Of course first two lines goes inside the FORM , i'm referring to the rest.
SetVar [ReturnStatus] [Status]
SetObjectHTML "Container1" [Data]SetVar [user_nom_array] [Data]
StrParse "[user_nom_array]" "|" [user_name_array]
ArrayLen [user_name_array] [array_length]CreateEmptyArray [lista_user]
Loop 0 [array_length] [x]
ArrayAddItem [lista_user] "[user_name_array([x])]"
EndLoopAs usual thank you very much for your limit time.
Regards,
Sam
Hi Luis, well indeed was more easier than the last example i put in this post, but it tooks me several hours decifer this :-), i'm a little bit rusty. If can help some one i let here the code, this connects to an Oracle Database using PHP code and retrieve the usernames inside a table and puts its inside an array for later pass it to an listbox.
Only for consider i don't know why this only works if i put the code inside SUCCESS (Data,status) Form. If i put this in a PushButton does not work. Of course first two lines goes inside the FORM , i'm referring to the rest.
SetVar [ReturnStatus] [Status]
SetObjectHTML "Container1" [Data]
SetVar [user_nom_array] [Data]
StrParse "[user_nom_array]" "|" [user_name_array]
ArrayLen [user_name_array] [array_length]
CreateEmptyArray [lista_user]
Loop 0 [array_length] [x]
ArrayAddItem [lista_user] "[user_name_array([x])]"
EndLoop
As usual thank you very much for your limit time.
Regards,
Sam