Jump to content
James Russell

Return In Message()

Recommended Posts

Hey all,

Just wondering if it's possible to put a Return in the Message() Function.

I want to return a concat I currently have:

Message(Concat('Increment Dimmer: ',DimVal,{/Return would go here/},'Increment Channel: ',ChanVal));

Anyone know if/what to put here?

Cheers,

James

Share this post


Link to post

It may not work but it would be:

Message(Concat('Increment Dimmer: ',DimVal,CHR(13),'Increment Channel: ',ChanVal));

but I'm not sure if a message window will properly deal with a return character on both platforms. I have some memory of it working on one platform but not the other.

Kevin

Share this post


Link to post

Are you sure? Try this one:

Message('this is line 1',chr(10),'This is line 2');

It works on Mac for me.

If you need cross platform you may need to switch to CHR(10) [linefeed] or even CHR(13),CHR(10)

Share this post


Link to post

Pat,

This is what I've got at the moment:

Procedure Test;

Begin

Message('This is line 1',chr(10),'This is line 2');

End;

Run (Test);

Results are attached as well as variations to chr(13) and chr(13),chr(10).

It appears that it's identifying those characters as spaces, just judging by chr(13),chr(10) resulting in a double space.

Let me know what you think.

Cheers,

James

Share this post


Link to post

I just copied and pasted your script above into a new blank VW document.

I get two lines of text in VW2011.

In VW2010 I get the same result you do.

Sorry, I think you are out of luck until you upgrade.

Share this post


Link to post

Any news on this? Im also trying to write multiple lines of text into the same message box. None of the above worked for me.

Share this post


Link to post

VW 2011 was the first version that accepted Carriage Return (CR) characters in the Message Window; and Windows and Mac have different codes to accomplish this. The Mac uses CHR(13) for a CR while Windows uses CHR(13), CHR(10).

 

So for Mac:

Message('Line 1', chr(13), 'Line 2'); 

and

Message('Line 1', chr(10), 'Line 2'); 

and

Message('Line 1', chr(13), chr(10), 'Line 2');

 

and for Windows:

Message('Line 1', chr(13), chr(10), 'Line 2');

 

all produce the same output.

 

______________________________________

x + VectorScript Message

______________________________________

Line 1

Line 2

______________________________________

 

HTH,

Raymond

  • Like 2

Share this post


Link to post

I'm using Win 10. Here is some info about your question.

If you want to force a new line in a message box, you can include one of the following: 

The Visual Basic for Applications constant for a carriage return and line feed, vbCrLf.

The character codes for a carriage return and line feed, Chr(13) & Chr(10).

  • Like 1

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...