How to return a List of Strings from a Modal Form

Started by JBerns, January 10, 2023, 05:46:12 AM

Previous topic - Next topic

JBerns

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

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

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