Page 1 of 1 1
Topic Options
#130846 - 2004-12-08 09:36 PM Split Function
Anonymous
Unregistered


How can I split a variable on a (?

When I try Split1 = Split(Variable,"(")
It gives me an error. Is there a special character that i have to put in front of the (?

Thanks

Top
#130847 - 2004-12-08 09:43 PM Re: Split Function
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
What error do you get? What version of kix are you using? And, just in case you didn't know, variables in kix need to start with a '$'. For example

Code:

$var = "hello(there"
$split1 = split($var, "(")
for each $v in $split1
$v ?
next

_________________________
Eric

Top
#130848 - 2004-12-08 09:58 PM Re: Split Function
Anonymous
Unregistered


Sorry about that I did miss the $ infront of my variable for that Line.

One more question for you though

Now i have two variable and i want to put them in an array with "" around them and seperated by a comma. So i can later go through the array and write a csv list to a file.

But when I try

$txttowrite[$index]="+$split3[1]+'","'+$split1[0]+"

I get errors. I know the syntax is wrong, but don't know the right syntax. I can get it shows the qoutes and comma in the middle, but not on the outside.

Thanks

Top
#130849 - 2004-12-08 09:59 PM Re: Split Function
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Must be a VB'er.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#130850 - 2004-12-08 10:02 PM Re: Split Function
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Use single quotes on the outside if you want to embed double quotes.

$txttowrite[$index]='"'+$split3[1]+'","'+$split1[0]+'"'
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#130851 - 2004-12-08 10:14 PM Re: Split Function
Anonymous
Unregistered


That works.

THanks

Top
#130852 - 2004-12-08 10:14 PM Re: Split Function
Anonymous
Unregistered


That works.

THanks

Top
#130853 - 2004-12-08 10:32 PM Re: Split Function
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You're welcome
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.055 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org