Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Repeating Dialog Box output

4 views
Skip to first unread message

Paul Raymond

unread,
Nov 22, 2000, 3:00:00 AM11/22/00
to
I am in the process of creating two dialog boxes whereby the 2nd dialog box
can be repated as many times as the user requires. The output to screen
needs to be in the same sequence as the user inputs. The problem is the
output doesn't follow the input sequence. What am I doing wrong? Would it
be better to write to a temp file? My code with test input fields is below.

(Start of Dialog No.1 (Macro No.1))
Box1="CreateUnitTrust"
Title="Create Unit Trust data file"
TrustName=""

DIALOGDEFINE (Box1;50;50;400;280;1+2+16+512;Title)
DIALOGADDTEXT (Box1;0;8;10;70;8;1;"Trust Name:")
DIALOGADDEDITBOX (Box1;"Edit1";60;5;150;12;1;TrustName;50)
DialogAddPushButton (Box1;"AddUnitholder"; 8; 260; 100; 15; 0; "Add
Unitholders")
DIALOGDISPLAY (Box1;"Edit1")

vResult:=MacroDialogResult
If(vResult=0) //
Quit
Endif

If(vResult=1) // OK Button
WriteUnitTrustText()
Quit
Endif

If(vResult=2) // Close window/Esc key/Cancel Button
Quit
Endif

If(vResult= "AddUnitholder")
WriteUnitTrustText()
DIALOGDESTROY (Box1)
Nest("Macro2")
EndIf

LABEL (WriteUnitTrustText)
Type (+TrustName) MergeCode (Codes: EndField!)
RETURN

(Start of Macro2)
Box2="Dlg1"
Title="Add Unitholder"
UnitholderCompanyName=""

DIALOGDEFINE (Box2;50;50;400;280;1+2+16+512;Title)
DIALOGADDTEXT (Box2;0;8;10;70;8;1;"Company Name:")
DIALOGADDEDITBOX (Box2;"Edit1";80;10;150;12;1;UnitholderCompanyName;50)
DialogAddPushButton (Box2;"AddUnitholder"; 8; 260; 100; 15; 0; "Add Another
Unitholder")
DIALOGDISPLAY (Box2;"Edit1")

vResult:=MacroDialogResult
If(vResult=0) //
Quit
Endif
If(vResult=1) // OK Button
WriteUnitholderText()
Wait (10)
InsertEndRecord()
Endif

If(vResult=2) // Close window/Esc key/Cancel Button
Quit
Endif

If(vResult= "AddUnitholder")
WriteUnitholderText()
DIALOGDESTROY (Box2)
Nest("AddTrustUnitholder")
EndIf

LABEL (WriteUnitholderText)
Type (+UnitholderCompanyName) MergeCode (Codes: EndField!)
RETURN

Regards-
Paul Raymond


Paul Raymond

unread,
Nov 22, 2000, 3:00:00 AM11/22/00
to
I fixed my own problem. A missing Quit command in LABEL
(WriteUnitholderText). Any other help to improve my code would still be
appreciated
Paul
.


Paul Raymond <paulr...@atlascompanies.com.au> wrote in message
news:3a1b20d8@cnews...

James M Moore

unread,
Dec 7, 2000, 3:00:00 AM12/7/00
to
It kind of depends on what you were looking for. The easiest way to make a
dialog repeatedly display is by looping over the section of code which tells
the dialog to show.

I've modified your code:

//=========begin


Box1="CreateUnitTrust"
Title="Create Unit Trust data file"
TrustName=""

DIALOGDEFINE (Box1;50;50;400;280;1+2+16+512;Title)
DIALOGADDTEXT (Box1;0;8;10;70;8;1;"Trust Name:")
DIALOGADDEDITBOX (Box1;"Edit1";60;5;150;12;1;TrustName;50)
DialogAddPushButton (Box1;"AddUnitholder"; 8; 260; 100; 15; 0; "Add
Unitholders")


Label( RepeatingSection) //NEW
TrustName = "" //NEW: To erase what was in the edit control previously.
DIALOGDISPLAY (Box1;"Edit1")

vResult:=MacroDialogResult
If(vResult=0) //
Quit
Endif

If(vResult=1) // OK Button
WriteUnitTrustText()
Quit
Endif

If(vResult=2) // Close window/Esc key/Cancel Button
Quit
Endif

If(vResult= "AddUnitholder")
WriteUnitTrustText()
// DIALOGDESTROY (Box1) //REMOVED
// Nest("Macro2") //REMOVED
Go( RepeatingSection) //NEW
EndIf

LABEL (WriteUnitTrustText)
Type (+TrustName) MergeCode (Codes: EndField!)
RETURN

//=========end

If you are interested in knowing more, let me know.

Have a nice day!
James

JamesMM.vcf
0 new messages