[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Dates in local procedures



One thing that I tried is to declare the variable within the procedure
itself.  For example:

        Begin-Procedure Test($From, $Thru)
        declare-variable
                DATE $from $thru
        end-declare

        If $FromDate > $ThruDate
           Show 'Test2: From date is greater than Thru date'  ! Does display
        End-if
        End-Procedure

> -----Original Message-----
> From: Ed Kelly [SMTP:ed_kelly@HOTMAIL.COM]
> Sent: Thursday, October 05, 2000 5:42 PM
> To:   SQR-USERS@list.iex.net
> Subject:      Dates in local procedures
>
> How do you get SQR to treat a local variable as a date?  It looks like
> dates
> passed to a local variable are converted to string.  Here's a code
> fragments:
>
> Begin-Setup
> Declare-variable
>    Date $Fromdate $Thrudate
> End-Declare
> End-Setup
>
> . . . . . .
>
> Begin-Procedure Main
> Let $FromDate = StrToDate('Jan 01 1995','Mon dd, YYYY')
> Let $ThruDate = StrToDate('Aug 01 1995','Mon dd, YYYY')
>
> If $FromDate > $ThruDate
>    Show 'Test1: From date is greater than Thru date'  ! Does not display
> End-if
>
> Do Test ($Fromdate, $ThruDate)
> End-Procedure
>
> Begin-Procedure Test($From, $Thru)
> If $FromDate > $ThruDate
>    Show 'Test2: From date is greater than Thru date'  ! Does display
> End-if
> End-Procedure
>
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.