Home
About
Download
Register
News
Help
Register
Log In
Forums
Scripts & Popups
Spliting text
Forums
Active Threads
Search
Who's Online
Help
Print Thread
Spliting text
#
137676
17/12/05
12:17 PM
B
bog__
bog__
B
i have problem, if someone tupe, for example
!lvl some*26
or
!lvl loterdas*3885
mine script will set
%alo some*26
or
%alo loterdas*3885
But how do i split it where is * to
%firstword some
and
%secondword 26
Can someone help me?
Copy Link to Clipboard
Re: Spliting text
#
137677
17/12/05
12:34 PM
Joined:
Apr 2003
Posts: 701
Leuven, Belgium
K
Kelder
Hoopy frood
Kelder
Hoopy frood
K
Joined:
Apr 2003
Posts: 701
Leuven, Belgium
$asc(*) returns 42
$gettok(loterdas*3885,1,42) returns loterdas
$gettok(loterdas*3885,2,42) returns 3885
Note that empty tokens are ignored, so $gettok(**********loterdas*****3885***,2,42) still returns 3885
More info: /help $gettok
Copy Link to Clipboard
Re: Spliting text
#
137678
17/12/05
12:37 PM
A
Aenei
Aenei
A
Treating your string as a tokenised list, with the * as the separator character use $gettok:
set %firstword $gettok(%alo,1,42)
set %secondword $gettok(%alo,2,42)
Copy Link to Clipboard
Re: Spliting text
#
137679
17/12/05
12:56 PM
B
bog__
bog__
B
it is working, thanks a lot
Copy Link to Clipboard
Re: Spliting text
#
137680
18/12/05
04:08 AM
Joined:
Feb 2004
Posts: 2,013
Leuven, Belgium
F
FiberOPtics
Hoopy frood
FiberOPtics
Hoopy frood
F
Joined:
Feb 2004
Posts: 2,013
Leuven, Belgium
In addition to the examples with $gettok, it could be a good idea to read up on /tokenize, as it allows you to fill the $N params the way you please.
//tokenize 42 a*b | echo -a 1: $1 -- 2: $2
Copy Link to Clipboard
Hop To
News and Discussions ------
Latest News
General Discussion
Support ------
mIRC Help
Connection Issues
Scripts & Popups
Development ------
Feature Suggestions
Developers
Bug Reports
Print Thread
Switch to Threaded Mode
Show Likes
Link Copied to Clipboard
View Profile
Private Message
Follow User
Forum Posts
View Profile
Private Message
Follow User
Forum Posts
Forum Rules
·
Mark All Read
Contact Us
·
Help
·
mIRC Homepage