jargon

token routine from Sparked x86

Sep 12th, 2020
1,411
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function token(subject as string,sep as string=",",index as string="1") as string
  2.     dim as string buffer,Ln
  3.     dim as long o,t,i
  4.    
  5.     buffer=subject:t=0:i=val(index)
  6.    
  7.     if val(index)>0 then
  8.    
  9.         do
  10.             t=t+1
  11.             o=instr(1,buffer,","):Ln=mid(buffer,o+1):buffer=mid(buffer,o+1)
  12.            
  13.         loop until t=val(index)
  14.        
  15.         token=Ln
  16.        
  17.     elseif index="ct" then
  18.        
  19.         do
  20.             t=t+1
  21.             o=instr(1,buffer,","):Ln=mid(buffer,o+1):buffer=mid(buffer,o+1)
  22.        
  23.         loop until o=0
  24.        
  25.         token=str(t)
  26.    
  27.     end if
  28.    
  29. end function
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×