Variables and delimiters

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
kmarlowe
Newbie
Posts: 5
Joined: Tue Jun 30, 2020 7:34 pm

Variables and delimiters

Post by kmarlowe » Thu Jul 02, 2020 12:38 pm

Simple script to read a number from a text file and enter it in another window:

ReadLn>U:\validpings.txt,i,nextline /* read the next EE from the file (line i)*/
SetDialogObjectFocus>Reflection Workspace - [VISTA Hampton],
If>line<>##EOF##
sendtext>%nextline%%CR% /* send the EE number */
sendtext>%today%%CR% /* send today's date */
sendtext>i%CR%0

When run, this reads the file, but sends the test "nextline" to the focused window whether I enclose the variable "nextline" in % or not (in fact, if I enclose it, it also sends the %):

Select EQUIPMENT INV. ENTRY NUMBER: %nextline% ??
Select EQUIPMENT INV. ENTRY NUMBER: 7/2/2020 ??
Select EQUIPMENT INV. ENTRY NUMBER: i ??
Select EQUIPMENT INV. ENTRY NUMBER: 0

But the date works. How do I get the value of nextline to send?

Thanks - KLM

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Variables and delimiters

Post by Grovkillen » Thu Jul 02, 2020 12:46 pm

Do you have the comments on the same line as the commands? If so, please move them to a separate line.
Let>ME=%Script%

Running: 15.0.27
version history

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Variables and delimiters

Post by Marcus Tettmar » Thu Jul 02, 2020 12:48 pm

Grovkillen wrote:
Thu Jul 02, 2020 12:46 pm
Do you have the comments on the same line as the commands? If so, please move them to a separate line.
Or if you want those comments, remove the space between the code and the comment, OR set the ignore spaces directive.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

kmarlowe
Newbie
Posts: 5
Joined: Tue Jun 30, 2020 7:34 pm

Re: Variables and delimiters

Post by kmarlowe » Thu Jul 02, 2020 12:51 pm

Yup, that fixed it. Was driving me crazy. Thanks.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts