none
Program Arguments RRS feed

  • Question

  • A question for Goto Loop:

    Hi goto I was wondering, in your program

    KTX387-2

    arg1 = Text.ConvertToLowerCase( Program.GetArgument(1) )
    arg2 = Text.ConvertToLowerCase( Program.GetArgument(2) )

    1. Where are these arguments being passed from?; and
    2. why did you pass them?

    And a question for Litdev:

    The sticky has gone for the "Post games for the blog" thread. Is this permanent?

    Thursday, January 23, 2014 12:57 AM
    Moderator

Answers

  • Hi Jibba Jabba!

    I see that this question was directed at Goto Loop but I will try to help =)

    These arguments are passed to program by the command line (e.g. if you called "blah.exe arg1 arg2" then GetArgument(1) would return "Arg1" and GetArgument(2) would return "Arg2"). In Goto Loop's program (nice program BTW!), the first argument seems to indicate if the configuration should be loaded from a file and the second argument indicates if the configuration should be saved to a file.


    Please mark any answers and "vote as helpful" any posts that help you!


    Thursday, January 23, 2014 3:51 AM
    Answerer
  • And also 2: why pass them? e.g. for educational purpose or something I'm yet to discover?

    That was 1st a testbed for asynchronous threads w/ Timer to overcome the lack of some sorta InKey() method for TextWindow.

    Once done, I've decided to experiment w/ other unused methods -> File.GetSettingsFilePath() & Program.GetArgument().

    I wanted to give that game the feature to be configured w/o any recompiling process.

    So, w/ just an ".exe" and a SB's ".dll", it can be forced to either create/load/save or not a ".settings" file.

    So any1 can open and edit the human-readable file to change various game's behaviors like length, speed, stages of the valley!  :D


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

    Thursday, January 23, 2014 8:43 AM
    Answerer

All replies

  • Hi Jibba Jabba!

    I see that this question was directed at Goto Loop but I will try to help =)

    These arguments are passed to program by the command line (e.g. if you called "blah.exe arg1 arg2" then GetArgument(1) would return "Arg1" and GetArgument(2) would return "Arg2"). In Goto Loop's program (nice program BTW!), the first argument seems to indicate if the configuration should be loaded from a file and the second argument indicates if the configuration should be saved to a file.


    Please mark any answers and "vote as helpful" any posts that help you!


    Thursday, January 23, 2014 3:51 AM
    Answerer
  • Hi gungan

    Thanks for reply.

    Yeah it's is a good sample to learn from, I reckon. I like how the settings file is used as well. Write and read contents of the array. I probably would've tried that line by line. The slow way.

    Goto's already explained to me how the argument can be passed to the exe. etc. I'm just curious when it was written and run/tested was it passed from a bat file, shortcut or cmd prompt. The arguments must have started with "t", maybe abc.exe true true?

    And also 2: why pass them? e.g. for educational purpose or something I'm yet to discover?


    Thursday, January 23, 2014 8:15 AM
    Moderator
  • And also 2: why pass them? e.g. for educational purpose or something I'm yet to discover?

    That was 1st a testbed for asynchronous threads w/ Timer to overcome the lack of some sorta InKey() method for TextWindow.

    Once done, I've decided to experiment w/ other unused methods -> File.GetSettingsFilePath() & Program.GetArgument().

    I wanted to give that game the feature to be configured w/o any recompiling process.

    So, w/ just an ".exe" and a SB's ".dll", it can be forced to either create/load/save or not a ".settings" file.

    So any1 can open and edit the human-readable file to change various game's behaviors like length, speed, stages of the valley!  :D


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

    Thursday, January 23, 2014 8:43 AM
    Answerer
  • Thanks
    Thursday, January 23, 2014 9:04 AM
    Moderator