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
Joined:
Dec 2004
Posts: 40
B
bog__
OP
Ameglian cow
OP
bog__
Ameglian cow
B
Joined:
Dec 2004
Posts: 40
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
Joined:
Nov 2005
Posts: 42
England
A
Aenei
Ameglian cow
Aenei
Ameglian cow
A
Joined:
Nov 2005
Posts: 42
England
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
Joined:
Dec 2004
Posts: 40
B
bog__
OP
Ameglian cow
OP
bog__
Ameglian cow
B
Joined:
Dec 2004
Posts: 40
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,019
Leuven, Belgium
FiberOPtics
Hoopy frood
FiberOPtics
Hoopy frood
Joined:
Feb 2004
Posts: 2,019
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
Gone.
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
View Profile
Private Message
Follow User
Forum Posts
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