Yoko

All sides of Injection
It is currently 2026-01-16 14:39:02

All times are UTC+02:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
 Post subject: STRING ARGUMENTS HELP!!
PostPosted: 2010-04-18 19:34:02 
Offline

Joined: 2009-03-10 09:43:01
Posts: 78
Hellooooo!

123,456,789

How can i get the valour of the "FISRT,SECOND" (123456) arguments and "THIRD" (789) argument

tile = 123,456,789
i want:
fs = 123456
t = 789

Thanks to all!


Top
   
PostPosted: 2010-04-18 21:22:03 
Offline
Expert!
User avatar

Joined: 2005-04-23 10:19:43
Posts: 388
Something like this:

Code:
sub test()
   var string="123,456,789"
   dim resArray[3]
   Split(string,",",resArray)
   var a = resArray[0]+resArray[1]
   var b = resArray[2]
endsub

Sub Split(string,delim,sArray)
   var LastAdd = 1
   var tempString = "";
   var i

   for i = 0 to Len(string)
      If not string[i] == delim then
        tempString = tempString + string[i]
      End if
      If string[i] == delim or Len(string) == i then
        If not tempString == "" then
          sArray[LastAdd] = tempString
          tempString = "";
          LastAdd = LastAdd + 1
        End if
      End if      
   next
   sArray[0] = LastAdd - 1
   return sArray
End sub


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited