Passing variables from one form to another in PDWIN 4.5

Passing variables from one form to another in PDWIN 4.5

Post by Applicaties+DBA V67C accou » Sun, 01 May 1994 01:03:55



Can anyone tell me how to pass variables from one form to another in PDWIN 4.5
without losing it's contents? Up to now PDWIN 4.5 still resets the variable
entering a form.

Thanks in advance,

Eric van Leeuwen
Free University Amsterdam
Holland

 
 
 

Passing variables from one form to another in PDWIN 4.5

Post by Jeff Steve » Sun, 01 May 1994 06:15:55


You need to associate a Form variable with the form either through an
"open" or "attach" statement.  Then you can call any of the form's methods,
so you can set variables by calling either a default or a custom method.
The code looks something like this:

var
  otherForm Form
endVar

otherForm.open([formName])
otherForm.[whatever method]()

or

otherForm.[object on form].[whatever method]()

You can also use a library as a repository for global variables
in a similar manner.


|> Can anyone tell me how to pass variables from one form to another in PDWIN 4.5
|> without losing it's contents? Up to now PDWIN 4.5 still resets the variable
|> entering a form.
|>  
|> Thanks in advance,
|>  
|> Eric van Leeuwen
|> Free University Amsterdam
|> Holland

--
----------------------------------------------------------


 
 
 

Passing variables from one form to another in PDWIN 4.5

Post by Steve Dickins » Wed, 04 May 1994 03:14:01



>Subject: Passing variables from one form to another in
>PDWIN 4.5

>account)
>Date: Fri, 29 Apr 94 16:03:55 CET
>Organization: S.A.R.A. Academic Computing Services
>Amsterdam

>Can anyone tell me how to pass variables from one form
>to another in PDWIN 4.5  without losing it's contents?
>Up to now PDWIN 4.5 still resets the variable  entering
>a form.

>Thanks in advance,

>Eric van Leeuwen
>Free University Amsterdam
>Holland

Not sure of the exact mechanics, but there are ENVIRONMENT
variables you can declare, and pass from form to form.

Recent issues of Paradox Informant have discussed this.

 
 
 

Passing variables from one form to another in PDWIN 4.5

Post by Rajesh Singh; EN » Wed, 04 May 1994 04:01:50


Hi;

You can do this by creating a new Library and creating custom methods in the library....Then you will have to open the Library for each of the forms i.e. the form from where you are passing the var. to the form to which it is being passed.....The PARADOX TechFax notes have a document on exactly this problem and they explain the whole thing step by step....

Hope this helped you.

--
Department Of Information Systems Management     4821,Eldon Green
University Of Maryland,Baltimore County,         Baltimore,MD-21227.
Baltimore,MD-21227.                              Tel. # (410)-247-3232.

 
 
 

Passing variables from one form to another in PDWIN 4.5

Post by Donn Ter » Wed, 04 May 1994 07:31:10


: You need to associate a Form variable with the form either through an
: "open" or "attach" statement.  Then you can call any of the form's methods,
: so you can set variables by calling either a default or a custom method.
: The code looks something like this:

: var
:   otherForm Form
: endVar

: otherForm.open([formName])
: otherForm.[whatever method]()

: or

: otherForm.[object on form].[whatever method]()

: You can also use a library as a repository for global variables
: in a similar manner.

As still a relitively new user, I found out the hard way that there's
one other part of this: it requires a "uses" declaration for [whatever method]
if it's one you wrote (exactly if it were a library).  (The system-provided
methods are already implicitly declared.)

This solves nicely just about any "I want to call this form and have it...";
you can always write a custom method and call it from the calling
form, once you figure out the magic.

As a suggestion to the keeper of the FAQ: the concept of calling functions
in other forms belongs in the section on calling calling in general (near
where you discuss the issue of matching of method/procedure names.)

Donn Terry
HP

 
 
 

Passing variables from one form to another in PDWIN 4.5

Post by Iris.Radule.. » Wed, 04 May 1994 10:09:34



Quote:>Can anyone tell me how to pass variables from one form to another in PDWIN 4.5
>without losing it's contents? Up to now PDWIN 4.5 still resets the variable
>entering a form.

Can use a library to store a value in a variable (calling form puts value
in a variable in the form, called form needs to get it from that variable).

There are ways (half-documented in Pdx manuals) to affect
called form's UIObjects from caller form, but it is kludgy and beats the
semi-object orientation of the language (no encapsulation?).

A pretty interesting idea is to store the values in a table - say a one-rec
table, that either form can read & write to. A Borland programmer approved
of this technique, which is not bad at all, except for the added overheads
of opening this "parameter table" in both forms and reading out its values
(TCursor probably the best way to do so). But then, opening library also
adds overheads.

 
 
 

Passing variables from one form to another in PDWIN 4.5

Post by Kuo-Sheng (Kas » Fri, 06 May 1994 14:23:40



: >Can anyone tell me how to pass variables from one form to another in PDWIN 4.5
: >without losing it's contents? Up to now PDWIN 4.5 still resets the variable
: >entering a form.
: >
: Can use a library to store a value in a variable (calling form puts value
: in a variable in the form, called form needs to get it from that variable).

This is supposedly the recommended way, but I absolutely HATE this
method.  :-)  

: There are ways (half-documented in Pdx manuals) to affect
: called form's UIObjects from caller form, but it is kludgy and beats the
: semi-object orientation of the language (no encapsulation?).

It's not hard...  Declare a FORM variable in the VAR section of
THISFORM.  In the OPEN method of THISFORM either ATTACH or OPEN the form
you want to get info from, then just use the FORM variable then the
objectname.  In fact, you can use one form to control the other!  Think
of your own speedbar!

: A pretty interesting idea is to store the values in a table - say a one-rec
: table, that either form can read & write to. A Borland programmer approved
: of this technique, which is not bad at all, except for the added overheads
: of opening this "parameter table" in both forms and reading out its values
: (TCursor probably the best way to do so). But then, opening library also
: adds overheads.

Personally I don't like this idea that much.  I've used itIn the past.  
Just make sure your form will still work without the data being passed
it, or exit gracefully.

I must prefer setting an Environment Variable, or use your own little INI
file by setting the variables the same way.

--Kasey Chang

 
 
 

Passing variables from one form to another in PDWIN 4.5

Post by Andreas M?ll » Fri, 06 May 1994 03:19:00


In article "Re: Passing variables from one form to another in PDWIN 4.5",

Quote:Jeff Stevens writes:

s>You can also use a library as a repository for global variables
s>in a similar manner.
s>
I think another good way is to write a DLL in Pascal. LSLs are hidden
windows (like forms and scripts). We can save this overhead! DLLs are very
fast and You can call them in other programs, too.

Last week I made a small experiment:
(to write a small "deliver" script for my application)

var myFormOrLibrary Form
endVar
...
myFormOrLibrary.load("My.lsl")
myFormOrLibrary.deliver()
myFormOrLibrary.close()

If I start this in a script, a small window appears on the screen.
And I have a new file in my directory: my.fdl.
I must rename it to my.ldl and everything is ok:
LSLs and SSLs are windows!

BTW: The deliver script works fine.

Gruss, Andreas Moeller
## CrossPoint v2.93 ##

 
 
 

Passing variables from one form to another in PDWIN 4.5

Post by Dennis E Dit » Mon, 09 May 1994 23:55:46



Quote:>Can anyone tell me how to pass variables from one form to another in PDWIN 4.5
>without losing it's contents? Up to now PDWIN 4.5 still resets the variable
>entering a form.

>Thanks in advance,

>Eric van Leeuwen
>Free University Amsterdam
>Holland

============
By far the easiest way is to use Environment variables.  The syntax is:

    var = readEnvironmentString("stringname")

    wri*vironmentString("stringname", var)

Note, these are STRINGS.  If var is numeric or date, etc., you would use:

    var = numVal( readEnvironmentString("stringname") )

    wri*vironmentString("stringname", strVal(var) )

(use dateVal where necessary)

This method works well if you're passing a few variables form form to
form.  The environment space that is available to Paradox is a COPY of
the current DOS environment.  Any changes/additions made to the Paradox
'copy' DOES NOT EFFECT the DOS environment space.  Think of it as an
environment space scratch-pad.

If you have lots of data to be passed from form to form, I suggest that
you create a table like this:

       varname        A25
       varvalue       A25   (this could be type N, D, $, M, etc)

Before calling the next form, stuff all values into this table.  Again,
where varvalue is type String, you would have to convert numerics and
dates, etc.  Or, you could create multiple varvalues (1 for each type)
and stuff the value in the appropriate bucket.

Hope this helps.  Good luck.

  -Dennis

 
 
 

1. passing event from one form to another form [4.5]

I have to forms - FORMA and FORMB. FORMA has a newvaluemethod attached
to a listfield. This method read records from a table into the list.
FORMB , called from FORMA, modifies this table - so know I want to
send an event to FORMA, that the table values have changed. Is this
possible? It should be but I can't find it in the documentation.


2. Newbie: normalisation tool(s)/methods ...

3. Passing variables from forms 4.5 -> Reports 2.5

4. The optimizer and Vieww with joins

5. Passing variables between multiple forms - OPAL 4.5

6. 5 second connection

7. Passing variable from one form to another

8. pdwin 4.5 (ODAPI) and Delphi(IDAPI)-coexist???

9. PDWIN 4.5 Floor() method

10. Passing Variable off Form to SQL Pass Through Query

11. Can't get passed the Connect aspect to Forms 4.5

12. Difficulty in passing parameter in Forms 4.5