Sign in to follow this  
Followers 0
SteveO

Question about an INI file

9 posts in this topic

Okay, I've made a program to read parts of my INI file, and makes them editable in the GUI, one of the fields in the GUI is an Edit box, this works fine, and it writes to the INI file fine, but when I actually call the Value saved in the INI by the program that actually needs to use it, it only returns the first line, if the value is longer than 1 line, it will still only return the first one. Sorry if this isn't clear enough, wasn't really sure how to go about explaining it.


Share this post


Link to post
Share on other sites



Some code, and an example ini might help us out.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Here's the code of the program, that reads the INI, and saves changes to the INI....INI is also below.

#include <GUIConstants.au3>
#include <INIRead.au3>

$Form1 = GUICreate("The Bumping Catalyst v1.4 INI Configuration", 704, 569, 193, 115)
;;GUI Labels
$Label1 = GUICtrlCreateLabel("Numbered Posts Activation :", 16, 32, 138, 17)
$Label2 = GUICtrlCreateLabel("Thank You Message Activation : ", 16, 56, 162, 17)
$Label3 = GUICtrlCreateLabel("Number Symbol : ", 16, 80, 87, 17)
$Label4 = GUICtrlCreateLabel("[Posting Settings]", 16, 112, 86, 17)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$Label5 = GUICtrlCreateLabel("[Catalyst Settings Main]", 16, 16, 115, 17)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$Label6 = GUICtrlCreateLabel("Starting Post Number : ", 16, 128, 113, 17)
$Label7 = GUICtrlCreateLabel("Ending Post Number : ", 16, 152, 110, 17)
$Label8 = GUICtrlCreateLabel("Topic Number : ", 16, 176, 80, 17)
$Label9 = GUICtrlCreateLabel("[Time Randomization Settings]", 16, 208, 147, 17)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$Label10 = GUICtrlCreateLabel("Minimum Cooldown Time : ", 16, 224, 130, 17)
$Label11 = GUICtrlCreateLabel("Maximum Cooldown Time : ", 16, 248, 133, 17)
$Label12 = GUICtrlCreateLabel("[Message Settings]", 16, 280, 94, 17)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$Label13 = GUICtrlCreateLabel("Starting Global BBCODE : ", 16, 296, 129, 17)
$Label14 = GUICtrlCreateLabel("Ending Message BBCODE : ", 16, 320, 139, 17)
$Label15 = GUICtrlCreateLabel("[Numbered Message Settings]", 16, 352, 146, 17)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$Label16 = GUICtrlCreateLabel("Starting Number BBCODE : ", 16, 368, 136, 17)
$Label17 = GUICtrlCreateLabel("Ending Global BBCODE : ", 16, 392, 126, 17)
$Label18 = GUICtrlCreateLabel("[Thank You Message Settings]", 16, 424, 150, 17)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$Label19 = GUICtrlCreateLabel("Thank You Message : ", 16, 440, 112, 17)
$Label20 = GUICtrlCreateLabel("Input the symbol you want to use as a number symbol", 240, 80, 263, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Label21 = GUICtrlCreateLabel("Input the number you want to start your posts on", 320, 128, 231, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Label22 = GUICtrlCreateLabel("Input the number you want you end your posts on", 320, 152, 237, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Label23 = GUICtrlCreateLabel("Input the topic number of the topic you wish to post in", 320, 176, 256, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Label24 = GUICtrlCreateLabel("Input the minimum cooldown time between posts in minutes", 320, 224, 286, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Label25 = GUICtrlCreateLabel("Input the maximum cooldown time between posts in minutes", 320, 248, 289, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Label26 = GUICtrlCreateLabel("Input the starting BBCODE for the post", 320, 296, 186, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Label27 = GUICtrlCreateLabel("Input the ending BBCODE for the Message (Ends before the number is entered)", 320, 320, 378, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Label28 = GUICtrlCreateLabel("Input The Starting BBCODE for the number", 320, 368, 207, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Label29 = GUICtrlCreateLabel("Input the ending BBCODE for the post", 320, 392, 184, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Label30 = GUICtrlCreateLabel("Only Use If Thank You Message Activation is Checked", 368, 440, 264, 17)
GUICtrlSetBkColor(-1, 0xFF0000)

;;GUI Input Boxes
$Gsym = GUICtrlCreateInput($sym, 192, 80, 41, 21)
$Gstartpost = GUICtrlCreateInput($startpost, 192, 128, 121, 21)
$Gendpost = GUICtrlCreateInput($endpost, 192, 152, 121, 21)
$GTopicNumber = GUICtrlCreateInput($TopicNumber, 192, 176, 121, 21)
$Gmincd = GUICtrlCreateInput($mincd, 192, 224, 121, 21)
$Gmaxcd = GUICtrlCreateInput($maxcd, 192, 248, 121, 21)
$Gstartglobalbbcode = GUICtrlCreateInput($startglobalbbcode, 192, 296, 121, 21)
$Gendmsgbbcode = GUICtrlCreateInput($endmsgbbcode, 192, 320, 121, 21)
$Gstartnumbbbcode = GUICtrlCreateInput($startnumbbbcode, 192, 368, 121, 21)
$Gendglobalbbcode = GUICtrlCreateInput($endglobalbbcode, 192, 392, 121, 21)
$Gtymsg = GUICtrlCreateEdit($tymsg, 192, 440, 169, 73)
GUICtrlSetData(-1, $tymsg)

;;Image
$Pic1 = GUICtrlCreatePic("catalysticon.jpg", 592, 8, 81, 137, BitOR($SS_NOTIFY,$WS_GROUP))

;;GUI CheckBoxes
$Gnumbposts = GUICtrlCreateCheckbox("[Checked = Numbered]   [UN-Checked = UN-Numbered]", 192, 32, 289, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
If $numbposts == 1 Then
    GUICtrlSetState($Gnumbposts, $GUI_CHECKED)
    Else
    GUICtrlSetState($Gnumbposts, $GUI_UNCHECKED)
EndIf
$Gtymsgonoff = GUICtrlCreateCheckbox("[Checked = ON]   [UN-Checked = OFF]", 192, 56, 289, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
If $tymsgonoff == 1 Then
    GUICtrlSetState($Gtymsgonoff, $GUI_CHECKED)
    Else
    GUICtrlSetState($Gtymsgonoff, $GUI_UNCHECKED)
EndIf

;;GUI Buttons
$Save = GUICtrlCreateButton("Save INI", 320, 528, 75, 25, 0)
GUISetState(@SW_SHOW)



;;Run Loop
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Save
            $numbpost = GUICtrlRead($Gnumbposts)
             If $numbpost == $GUI_CHECKED Then
                 IniWrite("catalyst.ini", "Catalyst Settings Main", "Numbered Posts Activation", 1)
             Else
                 IniWrite("catalyst.ini", "Catalyst Settings Main", "Numbered Posts Activation", 0)
             EndIf
            
            $tymsgonf = GUICtrlRead($Gtymsgonoff)
             If $tymsgonf == $GUI_CHECKED Then
                 IniWrite("catalyst.ini", "Catalyst Settings Main", "Thank You Message Activation", 1)
             Else
                 IniWrite("catalyst.ini", "Catalyst Settings Main", "Thank You Message Activation", 0)
             EndIf
            IniWrite("catalyst.ini", "Catalyst Settings Main", "Number Symbol", GUICtrlRead($Gsym, 1))
            IniWrite("catalyst.ini", "Posting Settings", "Starting Post Number", GUICtrlRead($Gstartpost, 1))
            IniWrite("catalyst.ini", "Posting Settings", "Ending Post Number", GUICtrlRead($Gendpost, 1))
            IniWrite("catalyst.ini", "Posting Settings", "Topic NUmber", GUICtrlRead($GTopicNumber, 1))
            IniWrite("catalyst.ini", "Time Randomization Settings", "Minimum Cooldown Time", GUICtrlRead($Gmincd, 1))
            IniWrite("catalyst.ini", "Time Randomization Settings", "Maximum Cooldown Time", GUICtrlRead($Gmaxcd, 1))
            IniWrite("catalyst.ini", "Message Settings", "Starting Global BBCODE", GUICtrlRead($Gstartglobalbbcode, 1))
            IniWrite("catalyst.ini", "Message Settings", "Ending Message BBCODE", GUICtrlRead($Gendmsgbbcode, 1))
            IniWrite("catalyst.ini", "Numbered Message Settings", "Starting Number BBCODE", GUICtrlRead($Gstartnumbbbcode, 1))
            IniWrite("catalyst.ini", "Numbered Message Settings", "Ending Global BBCODE", GUICtrlRead($Gendglobalbbcode, 1))
            IniWrite("catalyst.ini", "Thank You Message Settings", "Thank You Message", GUICtrlRead($Gtymsg, 1))
        ;;Save Confirmation
            MsgBox(0, "The Bumping Catalyst v1.4 INI Configuration", "INI File Settings Saved Successfully! =)")
        ExitLoop
    EndSelect
WEnd
ExitoÝ÷ Ù8b²+&ÈH~)^r^NªºS©äbzËꮢ֭¶¢Ûh+-êk¡¹^éåÊØ^~*ì¶X§zÈhÂË©{ayÊy©ò¶§j+zØZYbéì¶)e¢yr¶»-²0°-êÞiØ}êÞÜÈ!¢é]-¢¸§Øb²ö¥¹æ®¶­se´6FÇ7B6WGFæw2ÖåУ³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³°¤çVÖ&W&VB÷7G27FfFöâÓ £³´çVÖ&W&VB÷7G27FfFöâ³Ò5DdDUÒ³ÒDT5DdDUÐ  ¥Fæ²÷RÖW76vR7FfFöâÓ £³´7FfFVBFRFæ²÷RÖW76vRgFW"÷W"'V×2&R6ö×ÆWFVB³Ò5DdDUÒ³ÒDT5DdDUÐ  ¤çVÖ&W"7Ö&öÂÒ0 £³´ÆVfR2Ô2FòWBgV÷C²2gV÷C²7Ö&öÂ&Vf÷&RFR'V×çVÖ&W      ¥µ÷7Fær6WGFæw5У³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³°¥7F'Fær÷7BçVÖ&W"Ó £³´VçFW"FRçVÖ&W"÷RvçBFR'2Fò7F'Böà   ¤VæFær÷7BçVÖ&W"Ó#P £³´VçFW"FRçVÖ&W"÷RvçBFR'2FòVæBöà   ¥F÷2åVÖ&W"Ó#sS3sSp £³´VçFW"FRçVÖ&W"öbFRF÷2÷RvçBFò'V×     ¥µFÖR&æFöÖ¦Föâ6WGFæw5У³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³°¤Öæ×VÒ6ööÆF÷vâFÖRÒãsP £³´Öæ×VÒ÷7B6ööÆF÷vâFÖRâÖçWFW0£³µF22FRÖæ×VÒ6ööÆF÷vâFÖR&WGvVVâ÷7G0   ¤Ö×VÒ6ööÆF÷vâFÖRÒãsP £³´ÖV×VÒ÷7B6ööÆF÷vâFÖRâÖçWFW0£³µF22FRÖ×VÒ6ööÆF÷vâFÖR&WGvVVâ÷7G0     ¥´ÖW76vR6WGFæw5У³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³°¥7F'FærvÆö&Â$$4ôDRÕ¶ÆvãÖ6VçFW%Õ¶%Ð £³´VçFW"÷W"7F'Fær$$4ôDRf÷"FRVçF&RÖW76vR÷"ÆVfR&Ææ°   ¤VæFærÖW76vR$$4ôDRÕ²ö%Õ²öÆvåÐ £³´VçFW"÷W"VæFær$$4ôDRf÷"FRÖW76vRæ÷BFRçVÖ&W"÷"ÆVfR&Ææ°     ¥´çVÖ&W&VBÖW76vR6WGFæw5У³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³°¥7F'FærçVÖ&W"$$4ôDRÕ¶ÆvãÖ6VçFW%Õ¶6öÆ÷#×vFUÐ £³´VçFW"÷W"7F'Fær$$4ôDRf÷"WfW'FærgFW"FRçVÖ&W"÷"ÆVfR&Ææ°£³´äõBU4TBbgV÷C´çVÖ&W&VB÷7G27FfFöâgV÷C²2   ¤VæFærvÆö&Â$$4ôDRÕ²öÆvåÕ²ö6öÆ÷%Ð £³´VçFW"÷W"VæFær$$4ôDRf÷"FRVçF&RÖW76vR÷"ÆVfR&Ææ°£³´äõBU4TBbgV÷C´çVÖ&W&VB÷7G27FfFöâgV÷C²2     ¥µFæ²÷RÖW76vR6WGFæw5У³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³³°¥Fæ²÷RÖW76vRÕ÷W"'V×2fR&VVâ6ö×ÆWFVB'6FÇ7Bb333° £³´VçFW"÷W"Fæ²÷RÖW76vRW&RÂb÷R7FfFVBB&÷fP
Edited by SteveO

Share this post


Link to post
Share on other sites

anyone?


Share this post


Link to post
Share on other sites

anyone?

If it was a working script, maybe someone could help you

It has errors as is, won't run.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

If it was a working script, maybe someone could help you

It has errors as is, won't run.

There are no errors. Of course there will be if you don't have the INIRead.au3 file which i've included in my script to initially read the ini file and place the values in the GUI.......and if you tried removing the INIRead.au3 from the script you'd get more errors, seeing as most if not all of the variables will not be initialized without that file.

But the question is, how would I get the "Thank You Message" value in the INI to output more than 1 line when it's called from the INI...

Edited by SteveO

Share this post


Link to post
Share on other sites

to output more than 1 line

Replace CRLF characters with some special char before writing the value in ini file; after reading a key value in the ini file, replace this special char with CRLF.

Share this post


Link to post
Share on other sites

There are no errors. Of course there will be if you don't have the INIRead.au3 file which i've included in my script to initially read the ini file and place the values in the GUI.......and if you tried removing the INIRead.au3 from the script you'd get more errors, seeing as most if not all of the variables will not be initialized without that file.

But the question is, how would I get the "Thank You Message" value in the INI to output more than 1 line when it's called from the INI...

If the other person's suggestion doesn't fix your problem, then I suggest you supply a link or a copy of the INIRead.au3 being it's not standard include that is installed with AutoIT.

I'm more than willing to help, but as to being thousands of files on the forum I'm not about to search for the non-standard include files also.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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