Or, using the PregexXtra:
on getArgs
cl = list(the commandline)
args = PRegEx_Split(cl,"[\x22 ]+","g")
args.deleteAt(1)
return args
end
On 25-jan-2006, at 12:53, Valentin Schmidt wrote:
here is what I use (for PC projectors). it parses the commandLine
and identifies parameters by analysing spaces and quotes.
e.g. for projector.exe -t xxx -f "c:\some folder\some file.txt" it
returns ["-t", "xxx", "-f", "c:\some folder\some file.txt"]
if you opened a projector by double-clicking an associated file, it
would simply return ["<path to your file>"]
----------------------------------------
-- returns commandline-params as list (without quotes)
----------------------------------------
on getArgs
cl = the commandLine
args = []
cnt = cl.word.count
repeat with i = 1 to cnt
w = cl.word[i]
if w starts QUOTE then
j = i
repeat while the last char of cl.word[j]<>QUOTE
j = j+1
end repeat
w = cl.word[i..j]
w = w.char[2..w.length-1]
i = j
end if
if w<>"" then args.add(w)
end repeat
return args
end
cheers,
valentin
Slava Paperno wrote:
When I double-click a data file that I have associated with a
projector, and the projector is started, is the name of the file I
clicked
communicated to the projector?
Put differently, How does a projector know what command-line
parameter(s) (if any) were used when it was launched?
Thanks,
Slava
[To remove yourself from this list, or to change to digest mode, go
to http://www.penworks.com/lingo-l.cgi To post messages to the list,
email [email protected] (Problems, email
[EMAIL PROTECTED]). Lingo-L is for learning and helping with
programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go
to http://www.penworks.com/lingo-l.cgi To post messages to the
list, email [email protected] (Problems, email owner-
[email protected]). Lingo-L is for learning and helping with
programming Lingo. Thanks!]
Mark Hagers
[EMAIL PROTECTED]
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[email protected] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]