Skip to content

Instantly share code, notes, and snippets.

@seanbamforth
Created August 7, 2015 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanbamforth/bea28e1bf8b9ffe9462e to your computer and use it in GitHub Desktop.
Save seanbamforth/bea28e1bf8b9ffe9462e to your computer and use it in GitHub Desktop.
SplitToArray.pkg
Function SplitToArray Global String sVal String sChar Returns String[]
String[] astVal
String sHold
Integer iCount
Integer iPos
Integer iBreak
Integer iMax
Move (Length(sVal)) to iMax
Move (Length(sChar)) to iBreak
Move 0 to iCount
Repeat
Move (Pos(sChar,sVal)) to iPos
If (iPos<>0) Begin
Move (Left(sVal,iPos-1)) to astVal[iCount]
Move (Mid(sVal,iMax,(iPos+iBreak))) to sVal
End
Else Begin
Move sVal to astVal[iCount]
End
Increment iCount
Until (iPos=0)
Function_Return astVal
End_Function // Split
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment