WiSp Posted May 5, 2009 Share Posted May 5, 2009 (edited) Is there a way I can get AutoIt to evaluate the text read from an INI file? What I'd like to do is set up a small help file with a few items in it like: [Help] Item1 = "This is some help text" & @LF & "This is the second line of help text" Item2 = This is item 2's help text, unlike the first Item this has only one line. Item3 = "Item three has a few things such as numbered lists" & @LF & "1. You do not talk about Fight Club" & @LF & "2. YOU DO NOT TALK ABOUT FIGHT CLUB!" & @LF & "3. If this is your first night in the club, you have to fight." When I try to put this in a msgbox it interprets it literally. What I'd like to do is have it do the proper line breaks and such. If this isn't the right method, please let me know the proper way to do what I'd like to accomplish. Thanks, WiSp Edited May 5, 2009 by WiSp Link to comment Share on other sites More sharing options...
Zinthose Posted May 5, 2009 Share Posted May 5, 2009 Simple... $Value = IniRead("iniFile.ini", "Help", "Item1", '"This is some help text" & @LF & "This is the second line of help text"') $Value = Execute($Value) ConsoleWrite($Value & @CRLF) --- TTFN Link to comment Share on other sites More sharing options...
WideBoyDixon Posted May 5, 2009 Share Posted May 5, 2009 Use a special sequence for a new line and then search/replace it after reading: [Help] Item1=This is some help text\r\nThis is the second line of help text Item2=This is item 2's help text, unlike the first Item this has only one line. Item3=Item three has a few things such as numbered lists\r\n1. You do not talk about Fight Club\r\n2. YOU DO NOT TALK ABOUT FIGHT CLUB!\r\n3. If this is your first night in the club, you have to fight. $Value = IniRead("iniFile.ini", "Help", "Item1") $Value = StringReplace($Value, "\r\n", @CRLF) MsgBox(64, "Help", $Value) WBD [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
WiSp Posted May 5, 2009 Author Share Posted May 5, 2009 Both items worked. Thanks! 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