Page 1 of 1

[string] manipulation

Posted: 2006-03-12 12:49:30
by dafee
with our .c when i write
.c prova 12345
our guild can see this
Image

Is possible to take the number ONLY from that string and use it like a variable?

Posted: 2006-03-13 09:24:49
by admir
Mid (string,position,number of words) position from 0
LTrim - delete left spases
RTrim - delete right spases
Trim - delete left and right spases

use

Code: Select all

if uo.injournal('Dago MegaDeatH') then 
..
        s=uo.JournalSerial(uo.InJournal('Dago MegaDeatH')-1)
                   fraza=uo.journal(uo.InJournal('Dago MegaDeatH')-1)
                   uo.print("lench of this fraza "+str(len(fraza)))
                   for i=0 to (len(fraza)-3)
                         l=mid(fraza,i,3)
                         if l == 'va ' then     #search the string 'va ' of(proVA 123)
                              sec1=i+3  #start position of '12345'
                         end if
                   next
                   sec2=number_lench #lench '123456'  - lench=6
        variable=mid(fraza,sec1,sec2)
..
end if

Posted: 2006-03-13 10:54:52
by dafee
:shock:
it's possible?!?!
thanks a lot anyway you are crazy, beleave me!!!