Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004
    Posts
    313

    get text from command line?

    hi all, how would I get the text from the commandline?

    Heres how to do it in C, but I need to do it in lua.

    thanks

    Code:
    strncpy(szText, lpCmdLine, MAX_CHARS - 1);

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    there is a default variable that defines the commandline arguments

    _CommandLineArgs
    A numerically indexed table that contains the command line arguments passed into the AutoPlay application.
    example usage
    Code:
    if _CommandLineArgs then
        local CountArgs=Table.Count(_CommandLineArgs)
        Dialog.Message("CommandLineArgs", CountArgs.." arguments were passed to the exe);
    end
    Last edited by RizlaUK; 07-08-2008 at 07:54 AM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Jul 2004
    Posts
    313
    Thanks Riz, I have never worked with commandline before and I am a little confused.

    Have you seen my post in the dev den? I really need to get the same functionality in Lua.

    if you could have a look and let me know your thoughts it would be greatly appreciated.

    thanks

  4. #4
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Code:
    if _CommandLineArgs then
        if _CommandLineArgs[1] then
             Dialog.Message("Test", "Argument one:\r\n".._CommandLineArgs[1])
        end
    --andsoforth
    end
    or

    Code:
    if _CommandLineArgs then
        for i, ArgString in _CommandLineArgs do
             ListBox.AddItem("ListBoxObject", ArgString, "Data");
    
        end
    end
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

Similar Threads

  1. Replies: 33
    Last Post: 02-02-2007, 12:56 PM
  2. problem with SQLite
    By Jonas DK in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 01-09-2007, 10:37 AM
  3. Example: Loading Paragraph Text Using a Timer
    By Jonas DK in forum AutoPlay Media Studio 5.0 Examples
    Replies: 7
    Last Post: 11-25-2004, 05:10 PM
  4. Writing Text to a File
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-22-2003, 02:02 PM
  5. HOWTO: Display Conditional Text Based Upon a List Box Selection
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-15-2002, 10:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts