I am running into a problem with getting user input and turning it into a variable. The script that I am attempting to use for this is pasted below this paragraph. I have run the same script multiple times and without editing it, I get two different results in the log. This script is as follows:
names default to here(1);
clear log();
close all(journals, no save);
close all(data tables, no save);
defuplim = format(today(),"ddMonyyyy");
deflowlim = format(today() - in days(730), "ddMonyyyy");
New Window("Pick Your Dates in ddMonyyyy format",
<<Modal,
<<return result,
V List Box(
Text Box("Start Date:"),
str1=Text Edit Box(deflowlim),
text box("End Date:"),
str2=Text Edit Box(defuplim)
),
H List Box (Button Box ("OK"), Button Box ("Cancel"))
);
lowlim = str1 << get text;
uplim = str2 << get text;
lowlim=informat(lowlim);
uplim= informat(uplim);
show (lowlim);
show (uplim);
The first result from the log is what I expect the script to produce and is copied and pasted in quotes below:
“
lowlim = 19Jan2015;
uplim = 18Jan2017;
“
The other response I get from the log (again, without editing the script at all) is this:
“
deleted object reference: str2 << get text in access or evaluation of 'Glue' , Names Default To Here( 1 ); /*###*/Clear Log(); /*###*/
Close All( journals, no save ); /*###*/Close All( data tables, no save ); /*###*/
defuplim = Format( Today(), "ddMonyyyy" ); /*###*/deflowlim =
Format( Today() - In Days( 730 ), "ddMonyyyy" ); /*###*/
New Window( "Pick Your Dates in ddMonyyyy format",
<<Modal,
<<return result,
V List Box(
Text Box( "Start Date:" ),
str1 = Text Edit Box( deflowlim ),
Text Box( "End Date:" ),
str2 = Text Edit Box( defuplim )
),
H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
); /*###*/lowlim = str1 << get text; /*###*/uplim = str2 << get text; /*###*/lowlim
= Informat( lowlim ); /*###*/uplim = Informat( uplim ); /*###*/Show( lowlim ); /*###*/
Show( uplim ) /*###*/;
In the following script, error marked by /*###*/
Names Default To Here( 1 ); /*###*/Clear Log(); /*###*/
Close All( journals, no save ); /*###*/Close All( data tables, no save ); /*###*/
defuplim = Format( Today(), "ddMonyyyy" ); /*###*/deflowlim =
Format( Today() - In Days( 730 ), "ddMonyyyy" ); /*###*/
New Window( "Pick Your Dates in ddMonyyyy format",
<<Modal,
<<return result,
V List Box(
Text Box( "Start Date:" ),
str1 = Text Edit Box( deflowlim ),
Text Box( "End Date:" ),
str2 = Text Edit Box( defuplim )
),
H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
); /*###*/lowlim = str1 << get text; /*###*/uplim = str2 << get text; /*###*/lowlim
= Informat( lowlim ); /*###*/uplim = Informat( uplim ); /*###*/Show( lowlim ); /*###*/
Show( uplim ) /*###*/;
“
I’ve toggled off and on the first four lines, but get the same results (a mix of responses) regardless of whether or not they are turned off or on.
Any ideas what may be causing this error?