LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Wed Aug 06, 2003 6:43 pm Post subject: Array Command |
|
|
Hello all. Here is a command called Array. Based on a sub originaly created by cnodnarb.
| Code: |
# Array sub created by cnodnarb turned into a command
# Useage:
# Array <List(Must already exist)>,<delimiter>,<string>
# Returns <List> with string itemized according to <delimiter>
# Resets fieldsep back to original when finished.
#---------------------------------------------------------------------
#define command,array
:array
%t = @fsep()
option fieldsep,%2
list clear,%1
repeat
parse "%a;%b",%3
%%remainder = @substr(%3,@sum(@len(%a),2),@len(%3))
if %a
list add,%1,%a
%3 = %%remainder
end
until @null(%a)
list seek,%1,0
option fieldsep,%t
exit
|
_________________ Chris
Http://theblindhouse.com |
|