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
Variables and delimiters
Moderators: Dorian (MJT support), JRL
- Grovkillen
- Automation Wizard
- Posts: 1131
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Variables and delimiters
Do you have the comments on the same line as the commands? If so, please move them to a separate line.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Variables and delimiters
Or if you want those comments, remove the space between the code and the comment, OR set the ignore spaces directive.Grovkillen wrote: ↑Thu Jul 02, 2020 12:46 pmDo you have the comments on the same line as the commands? If so, please move them to a separate line.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: Variables and delimiters
Yup, that fixed it. Was driving me crazy. Thanks.