Jump to content
Macro Express Forums

Text Variable Character Limitation


azimzores

Recommended Posts

OK his is my first post. so far i must say that macro express is awsome. My problem now for a macro i am developing at work when i have the prompt for value pop up i need to have like a 10 character limit or.. OR if there is a way i can have the macro take the first 10 characters of the variable and tet type them into which ever application i need it posted in. Any help would be appreciated.. thanks in advanced

Link to comment
Share on other sites

Hi,

Here's what you want, I think;

<TVAR2:01:02:FFirst 10 characters will be taken from your inputFFCenter:Center><TMVAR2:10:01:01:001:010:><TBOX4:T:1:CenterCenter000278000200:000:Here it is, ready to paste by "Text Type T1"T1=%T1%>
Variable Set String %T1% from Prompt

Variable Modify String: Copy Part of %T1% to %T1%

Text Box Display: Here it is, ready to paste by "Text Type T1"

Best, Randall
Link to comment
Share on other sites

update. basicly i figured one way to do it is to use the prompt variable string and then use the varable string modifier to delete text after 10 characters and stop delet at 50 characters. ... Justr was woundering if their was a way to force the prompt to have a character limitation to it or way to limit the characters/symbols used

Link to comment
Share on other sites

How about this?

 

Variable Set String %T1% from Prompt
Repeat Until %T1% <> %T1%
 Variable Set Integer %N1% from Length of Variable %T1%
 If Variable %N1% < 10
   Break
 Else
   Variable Set String %T1% from Prompt
 End If

 

 

<TVAR2:01:02:FEnter Value HereFFCenter:Center><REP3:08:000002:000001:0001:1:01:T1><IVAR2:01:12:1><IFVAR2:2:01:3:10><BREAK><ELSE><TVAR2:01:02:FCharacters Exceed 10 Count; Please Re-EnterFFCenter:Center><ENDIF>

Link to comment
Share on other sites

Here is an addition to the code I posted to check for symbols... you can modify as needed... this is only an example.

 

Variable Set String %T1% from Prompt

// Here is where the macro checks the length and prompts if too long
Repeat Until %T1% <> %T1%
 Variable Set Integer %N1% from Length of Variable %T1%
 If Variable %N1% < 10
   Break
 Else
   Variable Set String %T1% from Prompt
 End If
 
 // Here is where the macro checks for characters/Symbols
 Variable Set String %T3% "!~@~#~$~%^~&~*~(~)~*~{~}~|~:~"~<~>~?~[~]~\~;~'~,~.~/~-~+~`"
 Repeat Start (Repeat 10 times)
   Variable Modify String: Copy Part of %T1% to %T2%
   If Variable %T3% contains variable %T2%
     Variable Set String %T1% from Prompt
     Break
   End If

 

 

 

<TVAR2:01:02:FEnter Value HereFFCenter:Center><REM2:><REM2:Here is where the macro checks the length and prompts if too long><REP3:08:000002:000001:0001:1:01:T1><IVAR2:01:12:1><IFVAR2:2:01:3:10><BREAK><ELSE><TVAR2:01:02:FCharacters Exceed 10 Count; Please Re-EnterFFCenter:Center><ENDIF><REM2:><REM2:Here is where the macro checks for characters/Symbols><TVAR2:03:01:!~@~#~$~%^~&~*~(~)~*~{~}~|~:~"~<~>~?~[~]~\~;~'~,~.~/~-~+~`><REP3:01:000001:000001:00010:0:01:><TMVAR2:10:02:01:001:001:><IFVAR2:4:03:7:T2><TVAR2:01:02:FPlease enter 10 digits excluding special charactersFFCenter:Center><BREAK><ENDIF>

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...