how string splitted by comma is store in two 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
irfan
Posts: 20
Joined: Thu Jul 29, 2010 12:49 am

how string splitted by comma is store in two variable

Post by irfan » Mon Sep 27, 2010 1:20 am

hi member,,

i want to split the string into two parts separated by comma and then want to store split parts in two different variables like this.

my script is gieven below..

read from socket tSocket until return
put it into Result
split Result by comma
...Now i want to store splitted part of sting in to two variable .. can any one help me.
one part may be stirng and other will be number .

Regard
Irfan

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

Re: how string splitted by comma is store in two variable

Post by Klaus » Mon Sep 27, 2010 11:19 am

Hi irfan,

you already know this since you used this in the other script that I stoll do not understand!
The magic word is "item"!

The default "itemdelimiter" is already a comma so you can simply do this:
...
read from socket tSocket until return
## RESULT is a reserved word, so you need to use something else!
put it into tResult
put item 1 of tResult into tVariable1
put item 2 of tResult into tVariable2
...


Best

Klaus

irfan
Posts: 20
Joined: Thu Jul 29, 2010 12:49 am

Re: how string splitted by comma is store in two variable

Post by irfan » Mon Sep 27, 2010 3:02 pm

hi klaus


Thank you very much for kind assistance.


Regard
Irfan

Post Reply