IMPORTANT: Using ListBox, ComboBox and DropDown properly - Page 2 - Forum

Forum Navigation
You need to log in to create posts and topics.

IMPORTANT: Using ListBox, ComboBox and DropDown properly

PreviousPage 2 of 2

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

ya me funciona bien , pero no se el porque que cuando me pasa un dato lo hace triplicado

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

@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.

 

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

luishp has reacted to this post.
luishp
PreviousPage 2 of 2