Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Split filesnames from _command.
#1
What's the best way to split filenames from command.

I see that filenames that have spaces are inside quotes.
Ones that do not have spaces are not.

I'm working on it, and I know there is a simple way, but I'm just having troubles.

I mean, this just seems clumbsy to me?
Function Function25
Code:
Copy      Help
str s=_command

s.findreplace("'' " "''[]")

str DATA
for int'i 0 numlines(s)
,_s.getl(s)
,if(matchw(_s "*''*"))
,,_s.findreplace("''")
,,DATA.addline(_s)
,,continue
,else
,,_s.findreplace(" " "[]")
,,DATA.addline(_s)
out DATA
Thanks,
Jimmy Vig
#2
Macro drop_files_on_me
Code:
Copy      Help
;/exe
ARRAY(str) a
tok _command a -1 " ''" 4
out a


Forum Jump:


Users browsing this thread: 1 Guest(s)