Getting command line parameters

  1. 3 months ago

    Nathan W

    Jan 20 Pre-Release Testers, Xojo Pro Europe (UK, Jersey)

    Hi

    I am trying to use the system.commandline but I am struggling to work out how to split it out into an array and to strip out so that I only have the parameters and nothing else. I am sure it is not difficult but I am struggling to see the best way to do this.

    Anyone have any examples of how best to do this.

    Thanks

  2. Dave S

    Jan 20 San Diego, California USA

    wouldn't it just be

    dim v() as string = split(system.commandline," ")
    v.remove 0

    and whats left is the "arguments"

  3. Nathan W

    Jan 20 Pre-Release Testers, Xojo Pro Europe (UK, Jersey)

    I will give it a try but I dont think so because I am passing in multiple paths to files and the paths can contain spaces.

  4. Kem T

    Jan 20 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    Check out @Jeremy C 's OptionParser.

    https://github.com/jcowgar/xojo-option-parser

  5. Nathan W

    Jan 20 Pre-Release Testers, Xojo Pro Europe (UK, Jersey)

    Thanks everyone that really helps.

  6. Christian S

    Jan 21 Pre-Release Testers, Xojo Pro, XDC Speakers Germany
    Edited 3 months ago

    with MBS Xojo Plugins ?

    Application.ArgumentsMBS as String()

    that gives an array with arguments for all platforms.

or Sign Up to reply!