Can't open a dialog box

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

Can't open a dialog box

Post by kmarlowe » Tue Jun 30, 2020 8:11 pm

Was having trouble opening a file for Readln, so I decided to try a simple snippet:

ReadLn>C:\temp\validpings.txt,1,strLine
Show>Hi,strLine

… and this gives me the following error dialog:
"Error in: test
Line: 5 - Cannot Show Dialog HI. Not Found"

I tried a scorched-earth reinstall (deleting directory / registry key first) - same result. Tried rebooting - same result. Starting to think my Readln issue is related to an install problem, but not sure where to go from here. Appreciate ideas. -KLM

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1390
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Can't open a dialog box

Post by Dorian (MJT support) » Tue Jun 30, 2020 8:33 pm

Show displays a dialog created with a Dialog block

What you're looking for is something like :

Code: Select all

ReadLn>C:\temp\validpings.txt,1,strLine
Message>Hi,%strLine%
or

Code: Select all

ReadLn>C:\temp\validpings.txt,1,strLine
MessageModal>Hi,%strLine%
Yes, we have a Custom Scripting Service. Message me or go here

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

Re: Can't open a dialog box

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

Awesome, thanks, yes.

Why does the variable strline not need % in the ReadLn, but needs them in the Message?

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

Re: Can't open a dialog box

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

You're assigning the variable in the first command and referring the variable in the second command.
Let>ME=%Script%

Running: 15.0.27
version history

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

Re: Can't open a dialog box

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

See this example:

Code: Select all

Let>strLine=testLine
ReadLn>C:\temp\validpings.txt,1,%strLine%
MessageModal>Hi,%strLine%
This will show you that the ReadLn command is assigning the variable testLine by referring to the variable strLine. Thus the message text will not work... I think, haven't tested it. :D
Let>ME=%Script%

Running: 15.0.27
version history

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1390
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Can't open a dialog box

Post by Dorian (MJT support) » Thu Jul 02, 2020 1:23 pm

kmarlowe wrote:
Thu Jul 02, 2020 12:26 pm
Why does the variable strline not need % in the ReadLn, but needs them in the Message?
This article in the KB will explain that : Using Variables and When to use Percent Symbols (%variable%)
Yes, we have a Custom Scripting Service. Message me or go here

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