Jump to content
Macro Express Forums

Why this odd result?


Recommended Posts

%tAlternative% may truly have length 24, but leading or trailing blanks may be disappearing during the Display. Try this:

 

Set a variable to the asterisk, or a capital X, or anything you like.

Variable Set String %tX% "X"

Then concatenate your new variable to the beginning and end of %tAlternative%, and display your new concatenated variable. You will then be able to see whether there are embedded leading or trailing blanks.

 

Or simply right-trim and left-trim %tAlternative% before setting the length.

Link to comment
Share on other sites

Thanks Bob, you're right. The macro later steps leftward from the end of tAlternative looking for the first '\' . I temporarily added a Text Display to show this character. I also used your suggestion, but simply with Add Text.

 

It seems there are 2 invisible characters at the end of every Excel cell, probably CR LF, because the display continues on a new line. And in a text editor a Backspace just jumps up to the right of the visible string.

 

I'll use Right Trim.

 

--
Terry, East Grinstead, UK

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