Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


multiple lines in MsgBox?


  • Please log in to reply
20 replies to this topic

#1 Guest_cowsmanaut_*

Guest_cowsmanaut_*
  • Guests

Posted 02 June 2004 - 10:24 PM

how do I get formatted text into a message box?

I can get a single line however I would like to be able to give multiple lines of information. ie:

Welcome (username)
todays date is (date)
it is about (time)
(OK)

can this be done? I've searched the help and looked at topics in here. don't see any direct examples.. perhaps I'm blind?

moo







#2 emmanuel

emmanuel

    No one ever accused me of being normal.

  • Active Members
  • PipPipPipPipPipPip
  • 1,128 posts

Posted 02 June 2004 - 10:44 PM

Just because I already had the file open, here's a freebee:
  MsgBox(0, "Load Forecast Tool options", "/i or /install to install" & @CRLF &  "/u or /uninstall to uninstall" & @CRLF & @CRLF & "Load Forecast Tool written June '04 by Emmanuel Pleshe" & @CRLF & "©2004 Puget Sound Energy. All rights reserved.")


I had underscores at the end of each line, I took them out so as not to confuse you...

Edited by emmanuel, 02 June 2004 - 10:51 PM.

"I'm not even supposed to be here today!" -Dante (Hicks)

#3 bobheart

bobheart

    Make it idiot proof and someone will make a better idiot

  • Active Members
  • PipPipPipPipPipPip
  • 632 posts

Posted 02 June 2004 - 10:45 PM

Heh heh I was going to show this page and I think I was right . weeeeeeeeeeeeee got one .. lol
http://www.autoitscript.com/forum/index.php?showtopic=2848

#4 Guest_cowsmanaut_*

Guest_cowsmanaut_*
  • Guests

Posted 02 June 2004 - 11:04 PM

ok so @CRLF is the carriage return and line break together.. I didn't know you could combine them. That's cool .. should have figured this one out. up untill now I was making a txt file reading from it and the deleting it. I figured there had to be a better way!

One other thing I noticed is that you have a lot of "" & however when I try to do more than 3 &'s I get an error. I'll have to try again.

thanks for the info!

#5 pekster

pekster

    Newfound chai tea convert

  • Active Members
  • PipPipPipPipPipPip
  • 902 posts

Posted 02 June 2004 - 11:11 PM

Many text based applications (such as notepad.exe and MS Word) require the user of both the @CR and @LF character, which AutoIt calls @CRLF. However, when talking about message boxes, you can just use @LF if you would prefer. Or @CR, it doesn't really matter.
"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

#6 emmanuel

emmanuel

    No one ever accused me of being normal.

  • Active Members
  • PipPipPipPipPipPip
  • 1,128 posts

Posted 03 June 2004 - 02:10 AM

ok so @CRLF is the carriage return and line break together.. I didn't know you could combine them. That's cool .. should have figured this one out. up untill now I was making a txt file reading from it and the deleting it. I figured there had to be a better way!

One other thing I noticed is that you have a lot of "" & however when I try to do more than 3 &'s I get an error. I'll have to try again.

thanks for the info!

the & combines strings (there's a word for it, I've seen it here a couple times, can't spell it for the damned of me, coconate?) you should be able to do as many as you want, just be sure you don't have any without anything between them... show us the code that errors?
"I'm not even supposed to be here today!" -Dante (Hicks)

#7 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 03 June 2004 - 02:13 AM

Concatenate.

#8 pekster

pekster

    Newfound chai tea convert

  • Active Members
  • PipPipPipPipPipPip
  • 902 posts

Posted 03 June 2004 - 03:08 AM

One of the few words I can spell. It's not because I'm that great of a speller (because I am the polar opisite) but because it's a common command in Linux/ Unix. How's that for pathetic?
"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

#9 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 03 June 2004 - 04:04 AM

Please tell me you spelled "opposite" wrong intentionally, otherwise, that's too ironic.

#10 pekster

pekster

    Newfound chai tea convert

  • Active Members
  • PipPipPipPipPipPip
  • 902 posts

Posted 03 June 2004 - 04:46 AM

Yes and no. I spelled it wrong the first time arround, and choose to leave it when my spell check told me it was incorrect. It was too amusing not to leave :D

[Edit]: You know your a bad speller when you use a spell check before posting to forums, heh.

Edited by pekster, 03 June 2004 - 04:46 AM.

"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

#11 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 03 June 2004 - 04:46 AM

Oh I found the issue I had 2 &'s together without anything between them.. I think I had edited out something and missed one.. didn't notice untill after..

moo

#12 emmanuel

emmanuel

    No one ever accused me of being normal.

  • Active Members
  • PipPipPipPipPipPip
  • 1,128 posts

Posted 03 June 2004 - 11:22 AM

Oh I found the issue I had 2 &'s together without anything between them.. I think I had edited out something and missed one.. didn't notice untill after..

moo

I wonder if this is something that Tidy could check?
"I'm not even supposed to be here today!" -Dante (Hicks)

#13 Jos

Jos

    Je maintiendrai

  • Developers
  • 23,351 posts

Posted 03 June 2004 - 03:55 PM

I wonder if this is something that Tidy could check?


Why would you want this when Autoit it reports these errors ?
Tidy up till now only reports errors when it gets confused with the indenting...

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#14 emmanuel

emmanuel

    No one ever accused me of being normal.

  • Active Members
  • PipPipPipPipPipPip
  • 1,128 posts

Posted 03 June 2004 - 08:43 PM

Why would you want this when Autoit it reports these errors ?
Tidy up till now only reports errors when it gets confused with the indenting...

oh, I dunno, I tidy before I compile before I test... it'd tip me off sooner... but I'm guessing most people test before they compile (I don't have the app I'm trying to automate on my pc...)

it's cool, I'm a freak, no worries.
"I'm not even supposed to be here today!" -Dante (Hicks)

#15 Amaruq

Amaruq

    Seeker

  • Active Members
  • 23 posts

Posted 07 June 2004 - 11:41 AM

I'm trying to get the hang of V3, so far so good untill ...
I have to display several msg boxes based on variables, something like MsgBox(0,$Title,$Msg)
Both variables are being read from an ini-file.
The line reads = "Text" & @CRLF & "Text"

When I use this and call the MsgBox I get an exact quote as what I entered.
Can you tell me what I'm doing wrong ?

#16 Jos

Jos

    Je maintiendrai

  • Developers
  • 23,351 posts

Posted 07 June 2004 - 12:22 PM

when you read it from the ini file like:
$txt = iniread($file,$section,$key)

$txt contains '"Text" & @CRLF & "Text"'... in other words: one string...

You could do it this way:
$txt = 'Text\nText'  ; put \n where ever you want a newline. $txt = stringreplace($txt,'\n',@LF) ; replace \n for @LF MsgBox(0,'test',$txt)

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#17 Amaruq

Amaruq

    Seeker

  • Active Members
  • 23 posts

Posted 07 June 2004 - 12:31 PM

Thanks JdeB !
I will do it like that.

#18 Born2Try

Born2Try

    Seeker

  • New Members
  • 3 posts

Posted 08 February 2010 - 06:11 AM

when you read it from the ini file like:

$txt = iniread($file,$section,$key)

$txt contains '"Text" & @CRLF & "Text"'... in other words: one string...

You could do it this way:
$txt = 'Text\nText'  ; put \n where ever you want a newline. $txt = stringreplace($txt,'\n',@LF) ; replace \n for @LF MsgBox(0,'test',$txt)

I have same trouble with new line in iniread . but it happend with GUICtrlCreateLabel

Ex:

$text1 = IniRead("config.ini", "Config", "text1", "Error") $Group_3 = GUICtrlCreateLabel($text1,15,18,210,65)


and Config.ini file :
[config] $text1 = "line1" & @CRLF & "line2" ; << not work with new line


[config] $text1 = "line1\line2" ; << not work too


My English not good . :D Plz help me .

Edited by Born2Try, 08 February 2010 - 06:12 AM.


#19 bogQ

bogQ

    For me, it’s simple - it’s a way of life.

  • Active Members
  • PipPipPipPipPipPip
  • 1,847 posts

Posted 08 February 2010 - 07:36 AM

This post is from 2004 O_o

And to help you use stringreplace like JdeB sugested to replace \n with @CRLF (start testing from the help file on String* commands)

Edit: and next time you shud open your own topic wiht your own problem instead resurecting one that is opened from 2004

Edited by bogQ, 08 February 2010 - 07:39 AM.

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project

Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)

460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 


#20 ProgAndy

ProgAndy

    You need AutoItObject

  • MVPs
  • 2,508 posts

Posted 08 February 2010 - 10:40 AM

This post is from 2004 O_o

And to help you use stringreplace like JdeB sugested to replace \n with @CRLF (start testing from the help file on String* commands)

Edit: and next time you shud open your own topic wiht your own problem instead resurecting one that is opened from 2004

At least this shows that he used the search. :D
*GERMAN* Posted Image [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users