Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Init Method

Status
Not open for further replies.

Xaplytz

Programmer
Jun 26, 2000
79
US
I have inside the Init Method
A menu to setup the Form.

But I cannot add a Cancel option
Because the form continue running
Even I put a Release or Unload after the cancel.

Code sample:

Init.
------------------

CASE option ="C"
1 && thisform.unload
2 && Thisform.relase
3 && return
ENDCASE
SELECT sls
SET ORDER TO fid
SELECT qquery
SET RELATION TO fid INTO sls
----------------

123 Neather of these command stop the program.


Does someone has any idea to how quit a form From the Init method.

Thank



 
Hi
I dont understand why you should EXIT from the FORM without running it.
However the syntax is...
------------------

IF option = "C"
Thisform.relase
ENDIF

If the option getting the value "C" before this code is executed. May be the problem lies in that. To check if that is the case... put the code...

WAIT WINDOW option
IF option = "C"
Thisform.relase
ENDIF

This will give you an idea as to options value...

If you are having a button to close the form.., then in the click event of that button, you have to put the code
THISFORM.RELEASE()

Hope this helps you.
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 

CASE option ="C"
1 && thisform.unload
2 && Thisform.relase
3 && return
ENDCASE
SELECT sls
SET ORDER TO fid
SELECT qquery
SET RELATION TO fid INTO sls


Is this pseudo code or do you really have "&&" in the commands?

Dave S.
 
Yes thisform.release() works fine in other events or method
But doesn't work in the &quot;----->INIT<-------&quot; of the forms.
When you are loading a Form It seems like you cannot use
.Release() or .Unload() from the INIT event of the form.
the form continues loading like this lines don't exist.
 
I Tried the follow ways to stop loading the form from the INIT. EVENT OF THE FORM

1st.

CASE option =&quot;C&quot;
thisform.unload
ENCASE


2nd.
CASE option =&quot;C&quot;
thisform.unload
ENCASE

3rd.
CASE option =&quot;C&quot;
thisform.unload
return
ENCASE

4th.
CASE option =&quot;C&quot;
thisform.release
return
ENCASE


When you are loading a Form It seems like you cannot use
.Release() or .Unload() from the -->INIT<--- event of the form.
the form continues loading like this lines don't exist.










 
I hope I am not misunderstanding your question. If you just wish to stop the form from loading - have the Init method return .F. . I think that will stop it in it's tracks.

Steve
 
Steve is correct.

Returning .f. from init will stop the form from loading at that point in the code.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top