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!

Forms Filenames and NAME

Status
Not open for further replies.

metron9

Programmer
Mar 5, 2002
94
US

I read the following from a search on forms

<<< If you want to call another form from a form use:-

<<< DO FORM MysecondForm NAME oSecondForm LINKED

A form has 2 filenames formname.scx and formname with no extension. It also has a properties NAME In the above
DO FORM i get this one
Mysecondform is this the filename?
NAME this is part of the command
oSecondForm is this the properties NAME?
LINKED is LINKED so if the original form is closed this one will close too?

My second forms file name is searchform
Its properties NAME is oSearchform

I use the following code
do form c:\emini\forms\searchform NAME oSearchform LINKED

If this is correct why do we need two names?
Should I use a variable for the PATH of is there a way to set a default path for Forms, databases, PRG files?




 
metron9 (

'Mysecondform is this the filename?' - Yes

'oSecondForm is this the properties NAME?' - Yes

'is LINKED so if the original form is closed this one will close too?' - No, the form that will close is is the second one, because you are linking the variable oSecondForm to the form, not the two forms togehter.

RELEASE oSecondForm
, (the variable), and in so doing you release the form

If this is correct why do we need two names? - the variable oSecondForm, which you may need to declare PUBLIC, becomes the object reference and can be called from elsewhere in the application with :-

oSecondForm.Refresh()

Should I use a variable for the PATH of is there a way to set a default path for Forms, databases, PRG files? - No, firstly, it's not necessary and secondly you should assume that you do not know where the user is going to install the application.

USE tables\table1 IN 0

or

USE SYS(5) + ADDBS(SYS(2003)) + [tables\table1] IN 0

will open table1 in the tables folder of your application.
HTH

Chris [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top