Noggin the Nog Posted August 21, 2004 Report Share Posted August 21, 2004 Tied in with my macro in the "capitalize first letter" post, I have been trying to detect a tab, carriage return and line feed in a selected block of text spanning several lines using the If Variable statement. This would be used going through the block of text one character at a time eg If Variable %T3% = tab, cr or lf where %T3% is one character. I found a way to enter the code to detect a tab by very devious means but have been unable to detect cr and lf. Anyone have ideas how to detect all three? Quote Link to comment Share on other sites More sharing options...
Nicolas Posted August 21, 2004 Report Share Posted August 21, 2004 maybe you could use the Variable Set to ASCII Char command to initialize a string variable with the character you're looking for and then compare this variable with yours (%T3%) you should easily find a complete ASCII table but if I remember : ASCII (decimal) code for TAB is 10 ASCII (decimal) code for Carriage Return is 13 ASCII (decimal) code for Line Feed is 10 never tried that so I can't tell you if it really works Quote Link to comment Share on other sites More sharing options...
Noggin the Nog Posted August 21, 2004 Author Report Share Posted August 21, 2004 Hi Nicolas, Yup, the ASCII conversion did the trick thanks. I've never had occasion to use ASCII. I just converted %T3% to its ascii equivalent integer %N3% then added the condition, If Variable N3 = 9 etc. I can easily modify my macro for any common delimiter that is likely to appear before text. 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.