Jump to content

Saving Edit Box's content to an INI


Recommended Posts

Is it possible to save a multi lined edit box's content to an INI file, i can get it to save but it will be like this

[INFO]
EditBox= First Line
Second Line
Third Line

and it only reads the first line.

<{POST_SNAPBACK}>

ur values are "defined?"

EditBox=FirstLine
EditBox1 = SecondLine
EditBox2 = Third Line
==================
[Section]
[Key] = [Value]
Edited by B3TA_SCR1PT3R

[right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right]

Link to post
Share on other sites

The best thing I can come up with would be to convert line feed and carriage return characters into something else, so that all the text is on one line.

Something like:

$s_EditContent = GuiCtrlRead($ed_Content)
$s_EditContent = StringStripCR($s_EditContent)
$s_EditContent = StringReplace($s_EditContent, @LF, @TAB)

IniWrite('filename.ini', 'Section', 'EditBox', $s_EditContent)

Then when you want it back.

$s_EditRetrieve = IniWrite('filename.ini', 'Section', 'EditBox', '')
$s_EditRetrieve = StringReplace($s_EditRetrieve, @TAB, @CRLF)
Link to post
Share on other sites

The best thing I can come up with would be to convert line feed and carriage return characters into something else, so that all the text is on one line.

Something like:

$s_EditContent = GuiCtrlRead($ed_Content)
$s_EditContent = StringStripCR($s_EditContent)
$s_EditContent = StringReplace($s_EditContent, @LF, @TAB)

IniWrite('filename.ini', 'Section', 'EditBox', $s_EditContent)

Then when you want it back.

$s_EditRetrieve = IniWrite('filename.ini', 'Section', 'EditBox', '')
$s_EditRetrieve = StringReplace($s_EditRetrieve, @TAB, @CRLF)

<{POST_SNAPBACK}>

lol to complicated for me, im gonna just take the multi line out.
Link to post
Share on other sites

lol to complicated for me, im gonna just take the multi line out.

<{POST_SNAPBACK}>

lol ohh man this looks crazy!

If $CURRENT_RUN = 1 Then
If GUICtrlRead($radio1) = $GUI_CHECKED Then
$CurrentFriendNum = GUICtrlRead($F1)
Else
$CURRENT_RUN = $CURRENT_RUN + 1
EndIF
EndIF

If $CURRENT_RUN = 2 Then
If GUICtrlRead($radio2) = $GUI_CHECKED Then
$CurrentFriendNum = GUICtrlRead($F2)
Else
$CURRENT_RUN = $CURRENT_RUN + 1
EndIF
EndIF

If $CURRENT_RUN = 3 Then
If GUICtrlRead($radio3) = $GUI_CHECKED Then
$CurrentFriendNum = GUICtrlRead($F3)
Else
$CURRENT_RUN = $CURRENT_RUN + 1
EndIF
EndIF

If $CURRENT_RUN = 4 Then
If GUICtrlRead($radio4) = $GUI_CHECKED Then
$CurrentFriendNum = GUICtrlRead($F4)
Else
$CURRENT_RUN = $CURRENT_RUN + 1
EndIF
EndIF

If $CURRENT_RUN = 5 Then
If GUICtrlRead($radio5) = $GUI_CHECKED Then
$CurrentFriendNum = GUICtrlRead($F5)
Else
$CURRENT_RUN = $CURRENT_RUN + 1
EndIF
EndIF

If $CURRENT_RUN = 6 Then
If GUICtrlRead($radio6) = $GUI_CHECKED Then
$CurrentFriendNum = GUICtrlRead($F6)
Else
$CURRENT_RUN = $CURRENT_RUN + 1
EndIF
EndIF

If $CURRENT_RUN = 7 Then
If GUICtrlRead($radio7) = $GUI_CHECKED Then
$CurrentFriendNum = GUICtrlRead($F7)
Else
$CURRENT_RUN = $CURRENT_RUN + 1
EndIF
EndIF

If $CURRENT_RUN = 8 Then
If GUICtrlRead($radio8) = $GUI_CHECKED Then
$CurrentFriendNum = GUICtrlRead($F8)
Else
$CURRENT_RUN = $CURRENT_RUN + 1
EndIF
EndIF

If $CURRENT_RUN = 9 Then
If GUICtrlRead($radio9) = $GUI_CHECKED Then
$CurrentFriendNum = GUICtrlRead($F9)
Else
$CURRENT_RUN = $CURRENT_RUN + 1
EndIF
EndIF

If $CURRENT_RUN = 10 Then
If GUICtrlRead($radio10) = $GUI_CHECKED Then
$CurrentFriendNum = GUICtrlRead($F10)
Else
$CURRENT_RUN = $CURRENT_RUN + 1
EndIF
EndIF

If $CURRENT_RUN = 11 Then
If GUICtrlRead($radio11) = $GUI_CHECKED Then
$CurrentFriendNum = GUICtrlRead($F11)
Else
$CURRENT_RUN = $CURRENT_RUN + 1
EndIF
EndIF

If $CURRENT_RUN = 12 Then
If GUICtrlRead($radio12) = $GUI_CHECKED Then
$CurrentFriendNum = GUICtrlRead($F12)
Else
$CURRENT_RUN = $CURRENT_RUN + 1
EndIF
EndIF

lol and it actually works!

Link to post
Share on other sites

This is off memory so im not entirely sure it works but i think you can simplify it with this or something LIKE this;

If $CURRENT_RUN = 1 Then
    for $x = 1 to 12
If GUICtrlRead($radio&$x) = $GUI_CHECKED Then
$CurrentFriendNum = GUICtrlRead($F&$x)
Next
Else
$CURRENT_RUN = $CURRENT_RUN + 1
EndIF
EndIF

But on the other hand, if it works, then it works.

P.S. if you could try it and just tell me what it does that'd be cool to.

Edited by SupraNatural

Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it!

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...