koden Posted November 20, 2006 Report Share Posted November 20, 2006 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??? Quote Link to comment Share on other sites More sharing options...
kevin Posted November 20, 2006 Report Share Posted November 20, 2006 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" Else Variable Set String %T2% "Variable does not contain numbers" End If Text Box Display: %T2% Quote Link to comment Share on other sites More sharing options...
koden Posted November 20, 2006 Author Report Share Posted November 20, 2006 Okay..thanks..will try this. Quote Link to comment Share on other sites More sharing options...
koden Posted November 28, 2006 Author Report Share Posted November 28, 2006 why will it only see numbers in <>0??? anything is diff. from 0 Also letters. Quote Link to comment Share on other sites More sharing options...
kevin Posted November 28, 2006 Report Share Posted November 28, 2006 If a string contains anything but numbers when you try to convert from a string (T1) to an integer (N1) the result will be 0. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.