What a wonderful place, Lingo-L! Many thanks to all who so nicely and
expertly responded to my question!
Slava
At 06:53 AM 1/25/2006, you 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!]