sub dialogs and parameter passing

From: Erik Spaans <"Erik>
Date: Tue, 24 Jun 2003 22:22:09 +0200

Hello,

I'm trying to figure out how to program with seperate sub dialogs driven by
a main controlling module.

An example: From a main module 'Matrix' I want to start up a dialog 'NeoUi'
with it's attending module 'Neo'. If someone enters say a name in the dialog
I want it to be passed back to the Matrix main program.

The problem I have is that using in the Matrix module
StdCmds.OpenAuxDialog('D:/BlackBox/Ex/Rsrc/NeoUi',''); (* RESOURCE
FILE of NEO *)
starts the dialog, but does not allow for passing parameters back and forth.


>From the Matrix module I obviously have to call a procedure within Neo which
allows passing back the name, i.e. with a parameter. Something like:

MODULE ExMatrix;
IMPORT StdCmds,ExNeo,StdLog;
VAR
name : ExNeo.NAME;

PROCEDURE Do*;
BEGIN
ExNeo.Get(name);
StdLog.String(name);
END Do;

END ExMatrix.
ExMatrix.Do


MODULE ExNeo;
IMPORT Dialog,StdCmds;
TYPE NAME* = ARRAY 20 OF CHAR;
VAR
Dlg* : RECORD
Name* : NAME;
END;

PROCEDURE Get*(OUT name : NAME);
BEGIN
StdCmds.OpenAuxDialog('D:/BlackBox/Ex/Rsrc/NeoUi','NEO'); (*
RESOURCE FILE of NEO *)
name := Dlg.Name;
END Get;

PROCEDURE Accept*;
BEGIN
StdCmds.CloseDialog;
END Accept;

END ExNeo.

But the Get procedure does not 'wait' until a name is entered in the dialog
and the Accept button is clicked before filling name. Instead it returns the
Dlg.name value before it is filled (blank). Only on the second execute does
it return the entered value.
That's obviously not desirable. Besides the whole approach seems rather
convuluted. Can anyone help (example)?

Erik







Received on Tue Jun 24 2003 - 22:22:09 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:29:10 UTC