Jump to content
Macro Express Forums

Text Box with variables bug?


Recommended Posts

As you see from the following two screenshots, using variables to place data in a text box doesn't work properly.

 

This first macro uses plain text andisplays correctly:

 

<TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\f0\\fs16 Row 1 left side 24 chars Row 1 right side 24 char\\f1 \r\n\\par }\r\n" Left="648" Top="471" Width="521" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

 

MEPro-TextBox.jpg

 

 

 

 

The second macro defines variables first and then uses those in the Text Box display. The result is that an extra CR seems to be inserted, spoiling the layout:

 

<VARIABLE SET STRING Option="\x00" Destination="%Row1Left%" Value="Row 1 left side 24 chars\r\n"/>

<VARIABLE SET STRING Option="\x00" Destination="Row1Right" Value="Row 1 right side 24 char\r\n"/>

<TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\f0\\fs16 %Top%\r\n\\par %Next%\r\n\\par %Row1Left% %Row1Right%\\f1 \r\n\\par }\r\n" Left="648" Top="471" Width="521" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

 

MEPro-TextBoxWithVariables.jpg

 

Seems like a bug to me. Anyone able to confirm please?

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Not a bug. You have CR-LF in your Set String Var commands. In the code below I removed them for you.

<VARIABLE SET STRING Option="\x00" Destination="%Row1Left%" Value="Row 1 left side 24 chars"/>
<VARIABLE SET STRING Option="\x00" Destination="Row1Right" Value="Row 1 right side 24 char"/>
<TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\f0\\fs16 %Row1Left% %Row1Right%\\f1 \r\n\\par }\r\n" Left="648" Top="471" Width="521" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

Link to comment
Share on other sites

Usually I find that folks accidentally pick up the CRLF because they copy from some text editor and many will try to be clever and assume you want the whole line including the CRLF.

 

As for the code that's still broken There are two commands, code and codebox. Code just puts it in a box and the box is as large as the code so if you have a hundred lines it's going to be big. But codebox should make it a set small size and add scroll bars if need be but it does not work for the horizontal scroll. If you play with it in the preview you can see how it's supposed to work. In this case 'code' worked because I didn't have any excessively long lines of code. With this new formatting support in MEP commands can get pretty long.

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