Displaying Array Elements On-Screen - Forum

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

Displaying Array Elements On-Screen

Hi!

for showing this: [Car(2)] on a label we can use this: [Cars|element:2]

how about showing [Car(2)('price')] ?

Hi @noizen,

I have not found a way to do it but you can do this:

SetVar [myvar] [Car(2)('price')]

And show [myvar] content instead.

noyzen has reacted to this post.
noyzen

To show [Car('price')] you can use [Car.price]

This also works fine:

CreateEmptyObject [objeto]
CreateEmptyObject [objeto(0)]
SetVar [objeto(0).nombre] "Luis"
SetVar [objeto(0).apellidos] "Hernandez"
SetVar [nombre] [objeto(0).nombre]

 

noyzen has reacted to this post.
noyzen

This is possible too:

CreateEmptyObject [objeto]
CreateEmptyObject [objeto.nombre]
CreateEmptyObject [objeto.apellidos]
SetVar [objeto.nombre(0)] "Luis"
SetVar [objeto.apellidos(0)] "Hernandez"
SetVar [nombre] [objeto.nombre(0)]

 

noyzen has reacted to this post.
noyzen

Thank you <3

i will go to test and see what happens

@noyzen, I have finaly found the correct way to work on this.
Take a look at this code:

CreateEmptyArray [car]
CreateEmptyArray [car.model]
CreateEmptyArray [car.price]
SetVar [car.model(0)] "Tesla Model 3"
SetVar [car.price(0)] "38000"
SetVar [car.model(1)] "Jaguar i-Pace"
SetVar [car.price(1)] "79000"

Note that I have used only Arrays.
Now I can use this syntax to show on-screen information:

[car.model|element:0]
[car.price|element:0]
[car.model|element:1]
[car.price|element:1]
noyzen has reacted to this post.
noyzen

I've just updated the online help to reflect this information.
Thanks!

noyzen has reacted to this post.
noyzen
[car.model|element:0]
[car.price|element:0]
[car.model|element:1]
[car.price|element:1]

Yea! that's what i was looking for!
now another part of my app is done.
Thank you very much Luis :)

luishp has reacted to this post.
luishp