Stuart McLachlan
stuart at lexacorp.com.pg
Fri Sep 5 19:40:04 CDT 2003
On 5 Sep 2003 at 7:48, Rocky Smolin - Beach Access S wrote:
> Must have missed that thread Arthur. What are static functions?
>
Functions which retain the value of their variables between calls.
Something like:
STATIC FUNCTION StartDate(OPTIONAL dteStartDate as Date) as Date
Local dteStore as Date
IF NOT ISNULLl(dteStartDate) Then
dteStore = dteStartDate
END IF
StartDate = dteStore
End FUNCTION
Every time you call the function with a date parameter, it sets its
value. Every time you call it without a parameter, it returns the
last value set.
You can now you user select a start date on a "pick form" somewhere.
When they have picked it, set the value of Startdate() with
something like dteTemp = StartDate(txtStartDate)
Now you can use "=StartDate()" in reports, queries, form filters etc
anywhere you like. It will return the selected value until the user
goes back to the pick form and changes it.
--
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System Support.