Jump to content
Macro Express Forums

Limit Keystorkes In Variable Set String


johnboy691

Recommended Posts

Is there any way to prevent entry of more than say 12 characters into a Variable Set String prompt?

 

I have a Variable Set String prompt ask for a from and to date. The processor enters the date as follows... 010107010507. When it then prints this result in the program it prints 010107 in the first field and then 010507 in the second field. (Because, once a date fills up all available positions in a field the program automatically moves to the next field.)

 

What happens is some processors key so fast they start typing the next prompts data into this from to date prompt. example 01010701050755.00

 

If they do this it throws the entry off once it goes to the other program.

 

So, can I restrict the number of characters that can print in a Variable Set String prompt?

 

Thanks,

John

Link to comment
Share on other sites

Is there any way to prevent entry of more than say 12 characters into a Variable Set String prompt?
Not ahead of time. You can, however, limit it after the fact. Something like this:
Variable Set String %T1% from Prompt
Variable Set Integer %N1% from Length of Variable %T1%
If Variable %N1% > 12
 Sound Wave File: error.wav
 Text Box Display: Error: Too many characters
Else
 // Do normal macro stuff here
End If

You could put this inside a repeat loop so the macro automatically asks for the information again.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...