Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-12-2001, 11:19 PM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
tokenize help

will tokenize2 +,blah+blah blah return
#t(0) - blah
#t(1) - blah blah

or will it return

#t(0) - blah
#t(1) - blah
#t(2) - blah

and if it returns the latter...how do I get it to return the former? especially if I dont know how many words will be in my string?
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #2  
Old 08-12-2001, 11:33 PM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
what is tokenize used for?
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #3  
Old 08-12-2001, 11:37 PM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
Quote:
Originally posted by ownerofbabylon
what is tokenize used for?
tokenize breaks a string into sections based on words and commas...tokenize2 breaks a string into sections based on "delimiters" which you specify before the string....Im just not sure if it uses spaces and commas too =/
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #4  
Old 08-13-2001, 12:05 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by Xaviar


tokenize breaks a string into sections based on words and commas...tokenize2 breaks a string into sections based on "delimiters" which you specify before the string....Im just not sure if it uses spaces and commas too =/
delims are used as the space. the delim for the normal tokinizing is space. so if you change it like you said it would return what u said o.o
and if you dont know how long ur string is then you can just do tokenscount which returns the number of tokens.
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #5  
Old 08-13-2001, 01:51 AM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
nope dude..I tried...tokenize2 +,blah blah blah; returns
#t(0) - blah
#t(1) - blah
#t(2) - blah
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #6  
Old 08-13-2001, 03:58 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Say you have 2 strings:
setstring this.teststring,This is a test;
setstring this.teststring2,This is "a test";

Now, lets tokenize the first one:
tokenize #s(this.teststring);

This is what it returns:
#t(0) - This
#t(1) - is
#t(2) - a
#t(3) - test

Now, lets tokenize the second string:
tokenize #s(this.teststring2);

This is what it returns:
#t(0) - This
#t(1) - is
#t(2) - a test

As you can see, putting parenthesis around something tells tokenize to count everything inside the parenthesis as 1 token.

As for tokenize2, it will tokenize via space's AND the delimeters, so:

setstring this.teststring3,My computer's name is Samson;
tokenize2 s,#s(this.teststring3);

This is what it returns:
#t(0) - My
#t(1) - computer'
#t(2) - name
#t(3) - i
#t(4) - am
#t(5) - on

Hope that helps
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #7  
Old 08-18-2001, 12:40 AM
NeoNPL NeoNPL is offline
HONEY IM HOME!
NeoNPL's Avatar
Join Date: Jun 2001
Location: Mianus
Posts: 1,361
NeoNPL is on a distinguished road
Send a message via Yahoo to NeoNPL
This is used in the guild managment NPC for kingdoms. I could look at the version i have. if i wasnt so lazy.
Reply With Quote
  #8  
Old 08-18-2001, 09:56 AM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
Quote:
Originally posted by NeoNPL
This is used in the guild managment NPC for kingdoms. I could look at the version i have. if i wasnt so lazy.
No..thats ok..I figured it out a while ago
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #9  
Old 08-18-2001, 05:57 PM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
Xaviar, that name reminds me of Kaviar.
Reply With Quote
  #10  
Old 08-18-2001, 09:42 PM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
I think you mean Caviar...and you would be the third person to say that
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #11  
Old 08-18-2001, 10:12 PM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
base
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.