May 05, 2024, 11:01:59 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Passing values between forms

Started by Tom Cone Jr, October 02, 2007, 05:48:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tom Cone Jr

I'm just getting started with Emergence Basic and have some questions about passing values between forms.

1) what's the recommended way to open a second form without showing it, assign values to controls in the called form, and then show the called form?  Are the sequences the same if the called form is modal?  modeless?

2) what's the recommended way to pass values from the called form back to the calling form when the user closes the called form?

3) can you point me to reference material or examples that illustrate how controls are addressed dynamically?  I'm trying to get my mind around how object addressing works in Ebasic.

Thanks.


billhsln

I am not 100% sure this is exactly what you are trying to do, but look under "Database" subject "Example of Updating Multiple Tables".  This program opens modals after loading them with data.

Hope this helps,
Bill
When all else fails, get a bigger hammer.

Ionic Wind Support Team

You initialize all controls in response to @IDINITDIALOG if you are using a dialog.

When you use the CREATEDIALOG statment you are creating a template in memory and each CONTROL statement adds a control definition so the OS knows what type of control to create, its size, location, etc.

The dialog and controls don't exist until you use DOMODAL or SHOWDIALOG.  After which Windows sends the @IDINITDIALOG message to your handler before the dialog is shown.

Paul.
Ionic Wind Support Team

Tom Cone Jr

Thanks, Bill & Paul.  I'll check the example mentioned.

I'm probably talking about something that's so simple it's hard for you to understand why I'm asking!

Once the control on a called form is initialized what's the syntax that's used to assign a value to it ?  How do you reference the control's name or number, from a script that's running from a button in the calling form ?   and vice versa.  How do you reference controls in the calling form before the called form closes (so that you can pass values back to the first form from the second one that's being closed) ?

Ionic Wind Support Team

Depends on the control

SETCONTROLTEXT/GETCONTROLTEXT - for edit controls, buttons, etc
SETSTATE/GETSTATE - for checkboxes and radiobuttons

Save off all data in the @IDCLOSEWINDOW handler.   Or in response to your "Close" button.

Paul.
Ionic Wind Support Team

Tom Cone Jr

Paul, yes, thanks.  I see it now.  The example Bill mentioned helped.  Such a simple thing.  Embarrassed to have posted. :-\

Dennisc

Hey Tom, don't be embarrassed to ask questions! That's what this forum is for. We were all EBasic newbies at some stage and some of us still are. Keep asking!!  :)

Dennis
Failure is only the opportunity to begin again more intelligently
www.denniscomninos.com

billhsln

I agree with Dennis, never be embarrassed to ask questions.  That is what the forums are here for.  Even I have asked questions here.

Not only will asking the question help you out, but it might also help someone else who has the same problem.  And since the forums are never deleted, it may help someone in the future.

Take care,
Bill
When all else fails, get a bigger hammer.