LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

MessagePopup function

Hi.

When I use the MessagePopup function with a big message, my program don't look that good. I need a mettod to split the message in 2 or 3 lines. I tried with "\n" but I gess it isn't the right choice.

This is only an example:
MessagePopup("Message","Hello people of the world! How do you feel in this afternoon?");

My message is much longer than this.

Thanks.
0 Kudos
Message 1 of 8
(3,949 Views)
Hi,

I do not see any reason why the MessagePopup function does not suit for your application.
With the use of \n , you can split your message into different lines how much ever big it is.

Regards,
Siddu
0 Kudos
Message 2 of 8
(3,941 Views)
Are you sure you tried with \n?
Because this is the solution, there is no problem using \n.

Try this, it works fine:

MessagePopup("Message","Hello people of the world!\nHow do you feel in this afternoon?");
0 Kudos
Message 3 of 8
(3,937 Views)
Yes.
I have tried it and it works great.

MessagePopup("Message","Hello people of the world!\nHow do you feel in this afternoon?");

Sheetal
Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 4 of 8
(3,924 Views)
I've had the same problem as tmaxial. When I use \n to input a carriage return in my strings the result is, in front of the second line of my messages, the visualization of lots of strange characters.
Thanks for help.
0 Kudos
Message 5 of 8
(3,868 Views)
The \n character should work as advertised. If it's giving erratic behavior, I would try changing fonts or character sets to see if the system settings you're using are causing trouble. In most cases, however, \n should just do a carriage return and not add extra characters.
Jeremy L.
National Instruments
0 Kudos
Message 6 of 8
(3,839 Views)
Did you create the string as a signle literal constant, e.g. "Line 1\nLine2" or did you build it using sprintf() or strcat(), etc.?
If you built the string, it's possible that the string for your first line is not properly terminated so the string includes the junk in memory until it finds a \0.
0 Kudos
Message 7 of 8
(3,833 Views)
I think Al S is in right: the problem was there.... at least in my case.
Thanks.
Regards...
0 Kudos
Message 8 of 8
(3,797 Views)