tokens
how can i take the first word of a variabled (from the : Lines[i] i want to take the first word, how can i take it?
example on mirc we have $gettok(This is a Sentence,2,32) = is $gettok(SENTENCE,NUMBER OF WORD,CHARACTER (32 = space)) |
Re: tokens
Untested:
PHP Code:
gettok("this is a sequence", szTok, 2, 32); |
Re: tokens
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team Error: Invalid function or declaration on line 184 Error: Invalid expression, assumed zero on line 188 Error: Invalid expression, assumed zero on line 199 Error: Number of arguments does not match definition on line 221 4 Errors. Could not locate output file D:\E\Backup STORE F\Counter Strike Servers\elajtjumperz\cstrike\addons\amxmodx\A mxx Script\Gather-Test.amx (compile failed). Line: 184 PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Re: tokens
PHP Code:
PHP Code:
|
Re: tokens
This should work.
PHP Code:
|
Re: tokens
Simplified (working) version:
PHP Code:
|
Re: tokens
Quote:
Code:
"This is an example"PHP Code:
PHP Code:
Code:
Word 1 | "This" | Length=4 |
Re: tokens
1 Attachment(s)
I forgot to put quotes around the string, so I didn't see the extra space. Sorry :oops:
The problem was the check for nbOfWords, here's the correct code: PHP Code:
|
Re: tokens
PHP Code:
Line 380: if (string[end] == delimiter) Quote:
|
Re: tokens
|
| All times are GMT -4. The time now is 07:24. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.