display second value in a variable

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
kevin007
Posts: 40
Joined: Mon Sep 21, 2015 7:46 am

display second value in a variable

Post by kevin007 » Fri May 20, 2016 1:56 pm

Hi All,

I have an variable that contains the following string

1-10
2-15
3-45
5-60


when I give 1 in textfield 10 should display
when I give 2 in textfield 15 should display
when I give 2 in textfield 45 should display
How I do this ? :(
kevin007
--
Thanks
Kevin

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: display second value in a variable

Post by Klaus » Fri May 20, 2016 2:14 pm

Hi Kevin,
when I give 1...
GIVE??? :shock:

Anyway, you can:
...
set itemdel to "-"
...
and then loop through all LINES of your variable and do something
with ITEM 1 and ITEM 2 of each line. Sounds a bit familiar, doesn't it? 8)


Best

Klaus

kevin007
Posts: 40
Joined: Mon Sep 21, 2015 7:46 am

Re: display second value in a variable

Post by kevin007 » Mon May 23, 2016 6:15 am

@Klaus

many Thanks for your idea and it's working :)
--
Thanks
Kevin

Post Reply