Ok Smart Folks, This one has had me going nuts for over three hours today.
When I run a 'trace' it runs fine! When I use the 'run' command I get a
error
-ERROR- Expression does not return a valid DATE (2158)
-ERROR- SET Error Command (3031)
and my Pause displays as 'Message .vdisplay'
vData_In get set to '03/31/2005Last Date Refreshed:' in a Fetch
After the error a show var at R> shows: (Errors)
vData_In = '03/31/2005Last Date Refreshed:'
vReport_Date_In = '03/31/2005Last Date Refreshed:'
vreport_Date_Text = '3/31/2005'
vCheckForDate = -0-
vRep_Date_Out = -0-
vDisplay = -0-
After the trace My Watch Variables show: (Runs)
vData_In = '03/31/2005Last Date Refreshed:' Text (29)
vReport_Date_In = '03/31/2005Last Date Refreshed:' Text (29)
vreport_Date_Text = '3/31/2005' Text (9)
vCheckForDate = '3/31/2005' Date
vRep_Date_Out = '3/31/2005' Date
vDisplay = 'Updating Last Date Refreshed 3/31/2005' Text(38)
Date Format mm/dd/yy
Date Sequence MMDDYY
Century 19
Version 7.1.80.30228
Again I'm parsing incomming text:
Set Var vData_In Text = Null
Set Var vLength Int = 0
Set Var Report_Date_In Text = Null
Set Var Report_Date_Text Text = Null
Set Var vlocation Int = 0
Set Var vlook_for_length Int = 0
Set Var vNchar Int = 0
Set Var CheckForDate Date
Set Var Rep_Date_Out Date
Set Var vdisplay Text = Null
SET VAR vreport_date_in = .vdata_in
SET VAR vlength = (SLEN(.vreport_date_in))
SET VAR vlocation = (SLOC(.vreport_date_in, .vlook_for))
IF vlocation NE 0 THEN
SET VAR vlook_for_length = (SLEN(.vlook_for))
SET VAR vnchar = (.vlength - .vlook_for_length)
SET VAR vreport_date_text = (SGET(.vreport_date_in, .vnchar, 1))
Set Error Message 2178 OFF
Set Var vCheckForDate = .vreport_date_text
Set Error Message 2178 ON
If vCheckForDate = Null Then
Pause 1 Using "Bad Date"
Else
Set Var vRep_Date_Out = .vCheckForDate
Endif
SET VAR vdisplay = ('Updating Last Date +
Refreshed ' .vreport_date_text)
PAUSE 3 USING .vdisplay
....Do what I have to do....
Endif
WHAT AM I DOING WRONG!! Thanks - Chuck