Created
August 7, 2015 11:38
-
-
Save seanbamforth/bea28e1bf8b9ffe9462e to your computer and use it in GitHub Desktop.
SplitToArray.pkg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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