Recent

Author Topic: TCustomApplication.GetNonOptions behaves oddly  (Read 389 times)

Pluto

  • New Member
  • *
  • Posts: 29
TCustomApplication.GetNonOptions behaves oddly
« on: March 26, 2021, 03:06:23 am »
On Windows, for:

> MyApp.exe --clone=asdf

The following line:

NonOptions:=GetNonOptions('h',['help','clone','sync']);

throws:

Exception at 000000010002C457: EListError:
Option at position 1 does not allow an argument: clone.

Any ideas?

engkin

  • Hero Member
  • *****
  • Posts: 2818
Re: TCustomApplication.GetNonOptions behaves oddly
« Reply #1 on: March 26, 2021, 03:38:28 am »
Try:
Code: Pascal  [Select][+][-]
  1. NonOptions:=GetNonOptions('h',['help','clone:','sync']);

If it takes a value add a single colon :
If the value is optional, add two colons ::

Check the examples in the same folder of the package where TCustomApplication is defined.
« Last Edit: March 26, 2021, 03:53:21 am by engkin »

Pluto

  • New Member
  • *
  • Posts: 29
Re: TCustomApplication.GetNonOptions behaves oddly
« Reply #2 on: March 26, 2021, 04:11:41 pm »
Awesome. Thank you.

 

TinyPortal © 2005-2018