Guest cowsmanaut Posted June 2, 2004 Share Posted June 2, 2004 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 Link to comment Share on other sites More sharing options...
emmanuel Posted June 2, 2004 Share Posted June 2, 2004 (edited) 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 June 2, 2004 by emmanuel "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
bobheart Posted June 2, 2004 Share Posted June 2, 2004 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 Link to comment Share on other sites More sharing options...
Guest cowsmanaut Posted June 2, 2004 Share Posted June 2, 2004 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! Link to comment Share on other sites More sharing options...
pekster Posted June 2, 2004 Share Posted June 2, 2004 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. [font="Optima"]"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."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
emmanuel Posted June 3, 2004 Share Posted June 3, 2004 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) Link to comment Share on other sites More sharing options...
Valik Posted June 3, 2004 Share Posted June 3, 2004 Concatenate. Link to comment Share on other sites More sharing options...
pekster Posted June 3, 2004 Share Posted June 3, 2004 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? [font="Optima"]"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."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
Valik Posted June 3, 2004 Share Posted June 3, 2004 Please tell me you spelled "opposite" wrong intentionally, otherwise, that's too ironic. Link to comment Share on other sites More sharing options...
pekster Posted June 3, 2004 Share Posted June 3, 2004 (edited) 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 [Edit]: You know your a bad speller when you use a spell check before posting to forums, heh. Edited June 3, 2004 by pekster [font="Optima"]"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."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
Guest Guest Posted June 3, 2004 Share Posted June 3, 2004 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 Link to comment Share on other sites More sharing options...
emmanuel Posted June 3, 2004 Share Posted June 3, 2004 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..mooI wonder if this is something that Tidy could check? "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
Developers Jos Posted June 3, 2004 Developers Share Posted June 3, 2004 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... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
emmanuel Posted June 3, 2004 Share Posted June 3, 2004 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) Link to comment Share on other sites More sharing options...
Amaruq Posted June 7, 2004 Share Posted June 7, 2004 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 ? Link to comment Share on other sites More sharing options...
Developers Jos Posted June 7, 2004 Developers Share Posted June 7, 2004 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) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Amaruq Posted June 7, 2004 Share Posted June 7, 2004 Thanks JdeB ! I will do it like that. Link to comment Share on other sites More sharing options...
Born2Try Posted February 8, 2010 Share Posted February 8, 2010 (edited) 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 . Plz help me . Edited February 8, 2010 by Born2Try Link to comment Share on other sites More sharing options...
bogQ Posted February 8, 2010 Share Posted February 8, 2010 (edited) 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 February 8, 2010 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) 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. Link to comment Share on other sites More sharing options...
ProgAndy Posted February 8, 2010 Share Posted February 8, 2010 This post is from 2004 O_oAnd 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 2004At least this shows that he used the search. SupaNewb 1 *GERMAN* [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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now