Sign in to follow this  
Followers 0
modernes

Storing multi-line string

6 posts in this topic

Hi,

I created a script that generates an email message, but I'm stuck as how to store the signature. I tried to save the signature in an ini file, but because there is more than one line in the signature, the iniread function only reads the first line. Any ideas?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$siggy = "Line 1" & @CRLF & "line 2" & @crlf & "line3" & @crlf & "line 4"
;do w/e

$siggy would look like this in an email or a txt file:

line 1

line 2

line3

line 4

--hope this helps

~cdkid

Edited by cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

You could store it with delimiter then do StringSplit to read.

Share this post


Link to post
Share on other sites

The problem is that the user is inputting the multi-line string into an editbox field and I need to store it somehow.

Share this post


Link to post
Share on other sites

Joon gave a good idea here for you modernes.

$String = StringReplace(GUICtrlRead($Edit1), @LF, Chr(01))
IniWrite('FilePath', 'Section', 'Key', $String)

On extraction:

$sSplit = StringSplit(IniRead('FilePath', 'Section', 'Key', 'Not Found'), Chr(01))
$TestTheory = ''
For $i = 1 To Ubound($sSplit) - 1
    $TestTheory = $TestTheory & $sSplit[$i] & @LF
Next
MsgBox(0, 'Testing', $TestTheory)
Untested, and typed in the forum box...

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Sweet - I finally got it! Thanks for everyone's help!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0