How do you create a non-cgi, faceless, "command line" application?

Mark Wieder mwieder at ahsoftware.net
Sun Oct 17 13:47:31 EDT 2004


Tony-

Sunday, October 17, 2004, 12:52:10 AM, you wrote:

TP> I want to create a command line application that will
TP> work on windows or a flavor of unix. The Unix box is
TP> rack mounted so there is no terminal or GUI running on
TP> it.

put your code in the preOpenStack handler:

on preOpenStack
  start using "someStack"

  -- handle command line arguments here
  put lower($1) into theCommandLine
  if the last char of theCommandLine is space then
    delete the last char of theCommandLine
  end if
  switch char 2 of theCommandLine
   case "t"
      hide this stack
      OpenStack -- do the work
      write field "txtTasks" to stdout
      quit
      break
       
    default
      if theCommandLine is not empty then
        write "$1=" & theCommandLine & "." to stdout
      end if
      break
  end switch
end preOpenStack

-- 
-Mark Wieder
 mwieder at ahsoftware.net



More information about the use-livecode mailing list