Command line Peramitors

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Command line Peramitors

Post by keyless » Fri Mar 21, 2008 11:37 pm

I want to be able to use command line peramitors to have my program run a certain function when it is started (different from how it normally runs)

I want to be able to use: MyApp.exe -i
and have it run differently then if I used just: MyApp.exe

Is there a way that I can code into the stack script to look for this -i (or however I can have such a peramitor) on open stack?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri Mar 21, 2008 11:54 pm

Hi keyless,

That would be something like:

Code: Select all

on preOpenStack
  if $1 is "-i" then
    -- behave differently
  else
    -- behave normally
  end if
end preOpenStack
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Post by keyless » Sat Mar 22, 2008 7:39 am

Awsome, I knew it had to be easy. Very cool, I see I can have multiple arguments too ($2, $3, $4 etc).

Thanks much Mark

Post Reply

Return to “Talking LiveCode”