Jump to content
Macro Express Forums

If Variable Contains Then Do...


Recommended Posts

Is there a function that can see the diff. between this:


I have a prompt where I write G12345 or GRPFTRE to a variable


If the variable contains G and 5 numbers then the macro always should run 1.

If the variable contains anything else it should run 2.


How do i do that???

Link to comment
Share on other sites

Here is a sample macro that does this:

// Copy from position 2 to the end of the string variable
Variable Modify String: Copy Part of %T1% to %T1%  // copy from position 2 to position 9999
Variable Modify String: Convert %T1% to integer %N1%

If Variable %N1% <> 0
 Variable Set String %T2% "Variable contains numbers"
 Variable Set String %T2% "Variable does not contain numbers"
End If

Text Box Display: %T2%

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.

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.

  • Create New...