Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
errordlg multiple lines

Subject: errordlg multiple lines

From: Maxx Chatsko

Date: 15 Jul, 2010 20:25:08

Message: 1 of 7

Hello all,
   I've been playing around with errordlg trying to get multiple lines, but I can't figure it out. I know I've read posts about this before. Suppose I want my errordlg to read the following, with '..Please:' being the last word on the first line in the box.
        "No data on file. Please:
                          1. check excel sheet
                          2. make sure youve entered the correct filename
                          3. another random troubleshooting fix that probably wont work
                          etc. etc "

   errordlg=('txt','Error') ...
      Thanks
      Maxx

Subject: errordlg multiple lines

From: Andy

Date: 15 Jul, 2010 20:38:06

Message: 2 of 7

"Maxx Chatsko" <chatskom@chemimage.com> wrote in message <i1nqr4$r66$1@fred.mathworks.com>...
> Hello all,
> I've been playing around with errordlg trying to get multiple lines, but I can't figure it out. I know I've read posts about this before. Suppose I want my errordlg to read the following, with '..Please:' being the last word on the first line in the box.
> "No data on file. Please:
> 1. check excel sheet
> 2. make sure youve entered the correct filename
> 3. another random troubleshooting fix that probably wont work
> etc. etc "
>
> errordlg=('txt','Error') ...
> Thanks
> Maxx

char(10) will give you a newline. So your txt should look something like:

['No data on file. Please:' char(10) '1. ...' char(10) '2. ...']

Subject: errordlg multiple lines

From: Walter Roberson

Date: 15 Jul, 2010 20:48:02

Message: 3 of 7

Maxx Chatsko wrote:

> I've been playing around with errordlg trying to get multiple lines,
> but I can't figure it out. I know I've read posts about this before.
> Suppose I want my errordlg to read the following, with '..Please:' being
> the last word on the first line in the box.
> "No data on file. Please:
> 1. check excel sheet
> 2. make sure youve entered the correct filename
> 3. another random troubleshooting fix that
> probably wont work
> etc. etc "
>
> errordlg=('txt','Error') ...
> Thanks Maxx


errordlg({'No data on file. Please:', ...
           '1. check excel sheet', ...
           '2. make sure you''ve entered the correct filename', ...
           '3. another random troubleshooting fix that', ...
           'probably won''t work', ...
           'etc. etc..'}, 'Error');

Subject: errordlg multiple lines

From: Maxx Chatsko

Date: 15 Jul, 2010 20:57:16

Message: 4 of 7

"Andy " <myfakeemailaddress@gmail.com>

> char(10) will give you a newline. So your txt should look something like:
>
> ['No data on file. Please:' char(10) '1. ...' char(10) '2. ...']

                   errordlg['No FCI data on file. Possible fixes:' char(10)...
                       ' 1) Update Excel sheet with latest data' char(10)...
                       ' 2) Check Excel sheet filenames match .tif filenames' char(10)...
                       ' To continue, please uncheck FCI box and try again.','ERROR'];

 Gives me an unbalanced () error, but my command lines in editor are not red...

Subject: errordlg multiple lines

From: Andy

Date: 15 Jul, 2010 21:09:05

Message: 5 of 7

"Maxx Chatsko" <chatskom@chemimage.com> wrote in message <i1nsnc$s1k$1@fred.mathworks.com>...
> "Andy " <myfakeemailaddress@gmail.com>
>
> > char(10) will give you a newline. So your txt should look something like:
> >
> > ['No data on file. Please:' char(10) '1. ...' char(10) '2. ...']
>
> errordlg['No FCI data on file. Possible fixes:' char(10)...
> ' 1) Update Excel sheet with latest data' char(10)...
> ' 2) Check Excel sheet filenames match .tif filenames' char(10)...
> ' To continue, please uncheck FCI box and try again.','ERROR'];
>
> Gives me an unbalanced () error, but my command lines in editor are not red...

You need parentheses around the brackets. (The brackets are used to concatenate the pieces of the string. The parentheses are needed to identify the arguments for the function call to errordlg.)

Subject: errordlg multiple lines

From: Walter Roberson

Date: 15 Jul, 2010 21:07:17

Message: 6 of 7

Maxx Chatsko wrote:

> errordlg['No FCI data on file. Possible fixes:'
> char(10)... ' 1) Update Excel sheet with latest
> data' char(10)... ' 2) Check Excel sheet
> filenames match .tif filenames' char(10)...
> ' To continue, please uncheck FCI box and try
> again.','ERROR'];

errodlg is a function, and must not have a '[' right after the function name.

Subject: errordlg multiple lines

From: Maxx Chatsko

Date: 16 Jul, 2010 12:10:21

Message: 7 of 7

Walter Roberson <roberson@hushmail.com>
> errodlg is a function, and must not have a '[' right after the function name.

      Right sorry. I was leaving and just threw it in the code, ran it, and said screw it. Thanks for your help. Andy too!
                  Maxx

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us