The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Simple MessageBox
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Marco1234

Germany
7 Posts

Posted - 04/12/2002 :  06:09:09 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Can you write a simple MessageBox with an OK buttom an some rows of text?

Mike Buess

USA
3037 Posts

Posted - 04/12/2002 :  08:11:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
There are a several ways to do that, but the easiest is...

type -b "message";

Mike Buess
Origin WebRing Member
Go to Top of Page

eparent

118 Posts

Posted - 04/17/2002 :  09:32:19 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
To display rows of text separate each row with '\n'.

Type -b "this is row1\nthis is row2";

If you want more control over your message box then use the Type.MsgBox method.

Type.MsgBox("this is row1\nthis is row2\n", "msg box title", 0, 0);

The last two arguments are for buttons and icon. For more info see Type object in your LabTalk manual.

Go to Top of Page

tom3m

USA
27 Posts

Posted - 05/21/2002 :  2:19:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I tried copying your Type.MsgBox statement into the script menu and did not get multiple lines of text in the message box. The first command (Type -b...) *does* give multiple lines of text, though. Am I missing something, or is there just one line in the Type.MsgBox method? I like the extra functionality of that method.

I am running Origin 6.1 right now.

Cheers!
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 05/21/2002 :  2:56:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
While eparent's method works in Origin 7.0, apparently it doesn't in Origin 6.1 (I just tried with the same results that you got.) However, you can use this method instead...

%S="line 1
line 2";
Type.MsgBox(%S,"msg box title",0,0);

If you try it from the script window make sure that you highlight both lines of the %S= statement and then press enter.


Mike Buess
Origin WebRing Member
Go to Top of Page

tom3m

USA
27 Posts

Posted - 05/22/2002 :  10:45:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

Thanks very much. That works nicely for me.
I have a script that looks for a certain condition in a set of data files and creates a log worksheet to help inform the user about what the script found, eg. which file names from the input set have the condition and which do not. I wanted the message box to tell them that the script found the condition and also what worksheet to look at to get further info. Two lines in the message box works best, I think.

I am looking at upgrading to Origin 7.0 now.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000