[comp.sys.mac.apps] Help needed in 4th Dimension

aqhx@vax5.cit.cornell.edu (06/04/91)

HELP!!!

I have two questions about programming in 4th Dimension that I wish someone can
help me.

Question 1
I have created a Choice Input Layout with choices 0, 1, and 2.  If I input 0, I
will be switched to Layout 0.  If I input 1, I will be switched to Layout 1. 
If I input 2, I will be switched to Layout 2.  In Layout 0, 1, and 2, there is
a field called Choice, where the choice (0,1, or 2) that I have made in Choice
Input Layout will be displayed.  In other word, I don't want to input the
choice again; I want the program to remeber my choice and display it.  How do I
do that?

Question 2
Beside Choice Input Layout, Layout 1, 2, and 3, I also have a Output Layout. 
When I am in User mode, I am in Output Layout first.  But when I want to add a
new record, I am always returned to the last layout that I have finished data
entry.  Instead, I want Choice Input Layout to be the layout that I will be
working with whenever I decide to add a new record.  Can someone tell me how do
I do that?

Any help will be much appreciated.

Tim
e5tx@cornella.cit.cornell.edu

bmug@garnet.berkeley.edu (BMUG) (06/05/91)

In article <1991Jun4.125845.5245@vax5.cit.cornell.edu> aqhx@vax5.cit.cornell.edu writes:
>HELP!!!
>
>I have two questions about programming in 4th Dimension that I wish someone can
>help me.
>
>Question 1
>I have created a Choice Input Layout with choices 0, 1, and 2.  If I input 0, I
>will be switched to Layout 0.  If I input 1, I will be switched to Layout 1. 
>If I input 2, I will be switched to Layout 2.  In Layout 0, 1, and 2, there is
>a field called Choice, where the choice (0,1, or 2) that I have made in Choice
>Input Layout will be displayed.  In other word, I don't want to input the
>choice again; I want the program to remeber my choice and display it.  How do I
>do that?
>
The easiest way to do this is to make each of your input layouts separate
pages.  Then you'd have a button on the first page with a script that
executes "GoTo Page 2" and sets a variable so "myVar:="Choice 1".  On page
2 of your layout you have a nonenterable variable (myVar) which will
display the value you've set.  You'd have another button for your third
page.  myVar can be used elsewhere as a flag if need be.

>Question 2
>Beside Choice Input Layout, Layout 1, 2, and 3, I also have a Output Layout. 
>When I am in User mode, I am in Output Layout first.  But when I want to add a
>new record, I am always returned to the last layout that I have finished data
>entry.  Instead, I want Choice Input Layout to be the layout that I will be
>working with whenever I decide to add a new record.  Can someone tell me how do
>I do that?
>
In this case, you'd use the myVar flag to set the page number of the input
layout when you go to it.  The way I do this is to use an invisible button
on the layout with a script (and the "only if modified" checkbox turned
off) to run my Before phase stuff.  Since myVar has been previously set,
I'd do something like this:

	If(Before)
		Case of
		:(myVar=1)
		GoTo Page(2)
		:(myVar=2)
		GoTo Page(3)
		End case
	End if

This is the barest bones summary of what you need to do; other
enhancements would include buttons on each of your pages to reset your
Choice variable on the fly.

Hope this helps!

John Heckendorn
-- 
                                                             /\
BMUG                      ARPA: bmug@garnet.berkeley.EDU    A__A
1442A Walnut St., #62     BITNET: bmug@ucbgarne             |()|
Berkeley, CA  94709       Phone: (415) 549-2684             |  |