Author Topic: How to return a List of Strings from a Modal Form  (Read 172 times)

JBerns

  • Member
  • *
  • Posts: 7
How to return a List of Strings from a Modal Form
« on: January 10, 2023, 05:46:12 AM »
Community,

I have read the Help information that states the dcl-Form-Show function can return a List of Strings:
https://www.opendcl.com/HelpFiles/index.php?lang=ENU&page=Reference/Method/Form/Show.htm

I have a dialog box that collects info into a number of textboxes.
(see attachment)

I would like to use the data after the user presses OK.

I have searched several sites, forums, and LSP examples, but have not found an example of a Modal dialog box that returns a List of Strings.

I would welcome a link to an example.

Thank you for your time and attention. I look forward to your replies.


Regards,
Jerry

Fred Tomke

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2085
  • [ Mr. Bad Guy ]
    • Kommunale Entwicklungsplanung auf digitaler Basis - digital landscape and urban design
Re: How to return a List of Strings from a Modal Form
« Reply #1 on: January 10, 2023, 10:08:42 AM »
Hi, Jerry,

I afraid you misunderstood the documentation of dcl-form-show.
You are right that there's written that return values can be a number, a string, or a list of strings.

But actually, a string is returned by a custom file selection dialog (which is also modal) with single file selection mode and a list of strings (filenames) is returned by a custom file selection dialog in multi file selection mode.

For your case, you have to build a function/command with events - for instance when Ok was pressed - to collect all the data into a variable.

I hope its more clear now.
With regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

JBerns

  • Member
  • *
  • Posts: 7
Re: How to return a List of Strings from a Modal Form
« Reply #2 on: January 12, 2023, 06:02:36 AM »
Fred,

I based my understanding on my experience with other software documentation that reports what functions Return.

I did set a global variable within the OK button function so that I could use the textbox information after the form was closed.

The initial development is complete using an OpenDCL form. Quite a difference between AutoLISP DCL tools, but OpenDCL tools are far superior.

Thanks for your feedback.


Regards,
Jerry