Jump to content

Sneding multiple inputs to .ini


Glyph
 Share

Recommended Posts

CODE

#include <GuiConstants.au3>
#include <misc.au3>
$user32 = ""
$dates = 7;inputs
$destination = @ScriptDir & "\Laod1.jpg"
$destination2 = @ScriptDir & "\Laod2.jpg"
$destination3 = @ScriptDir & "\Laod3.jpg"
#Region ### START Koda GUI section ### Form=
$form1= GuiCreate("Calender Eventer v0.1", 380, 141,-1, -1)

$Label_1 = GuiCtrlCreateLabel("Day", 20, 10, 40, 20, $SS_CENTER)
$Label_2 = GuiCtrlCreateLabel("Month", 80, 10, 50, 20, $SS_CENTER)
$Label_3 = GuiCtrlCreateLabel("Year", 160, 10, 30, 20, $SS_CENTER)
$Label_4 = GuiCtrlCreateLabel("Event", 260, 10, 40, 20, $SS_CENTER)

$Label_5 = GuiCtrlCreateLabel("Day", 20, 50, 40, 20, $SS_CENTER)
$Label_6 = GuiCtrlCreateLabel("Month", 80, 50, 50, 20, $SS_CENTER)
$Label_7 = GuiCtrlCreateLabel("Year", 160, 50, 30, 20, $SS_CENTER)
$Label_8 = GuiCtrlCreateLabel("Event", 260, 50, 40, 20, $SS_CENTER)

dim $input[8]
$Input[0] = GUICtrlCreateInput(''&@MDAY, 10, 30, 50, 20)
$Input[1] = GUICtrlCreateInput(''&@MON, 70, 30, 60, 20)
$Input[2] = GUICtrlCreateInput(''&@YEAR, 140, 30, 70, 20)
$Input[3] = GUICtrlCreateInput('Type the event here' , 230, 30, 130, 20)

$Input[4] = GUICtrlCreateInput(''&@MDAY, 10, 70, 50, 20)
$Input[5] = GUICtrlCreateInput(''&@MON, 70, 70, 60, 20)
$Input[6] = GUICtrlCreateInput(''&@YEAR, 140, 70, 70, 20)
$Input[7] = GUICtrlCreateInput('Type the event here!' , 230, 70, 130, 20)


Dim $dwy[8] = ['Day','Month','Year','Event']
$Save = GuiCtrlCreateButton("Save", 170, 100, 100, 30)


$Pic_13 = GuiCtrlCreatePic("Calander.gif", 0, 90, 160, 49)
$Pic_14 = GuiCtrlCreatePic("Eventer.gif", 240, 90, 140, 50)
GuiSetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nmsg = GuiGetMsg()
If $nMsg = $GUI_EVENT_CLOSE Then Exit
   
  if $nmsg = $Save then ExitLoop
WEnd

If $nMsg = $Save Then
        Save()
    EndIf

Func Save()
    For $i = 0 To 7
        IniWrite( @ScriptDir & '\Settings.ini', $dwy[$i],$i, GUICtrlRead($input[$i]))
    Next

SplashImageOn("Saved!", $destination,420,300)
Sleep(1500)
SplashOff()

SplashImageOn("Saved!", $destination2,420,300)
Sleep(1500)
SplashOff()

SplashImageOn("Saved!", $destination3,420,300)
Sleep(2000)
SplashOff()
EndFunc

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "Calender", "REG_SZ", @ScriptDir&"\Calender Notification.exe")
Exit

heres what it writes to the ini file

" [Day]

0=10

[Month]

1=12

[Year]

2=2006

[Event]

3=Type the event here

[]

4=10

5=12

6=2006

7=Type the event here!

"

Heres what i want it to write:

[Day]

0=10

4=10

[Month]

1=12

5=12

[Year]

2=2006

6=2006

[Event]

3=Type the event here

7=Type the event here!

tolle indicium

Link to comment
Share on other sites

dim $input[8]
$Input[0] = GUICtrlCreateInput(''&@MDAY, 10, 30, 50, 20)
$Input[4] = GUICtrlCreateInput(''&@MDAY, 10, 70, 50, 20)

$Input[1] = GUICtrlCreateInput(''&@MON, 70, 30, 60, 20)
$Input[5] = GUICtrlCreateInput(''&@MON, 70, 70, 60, 20)

$Input[2] = GUICtrlCreateInput(''&@YEAR, 140, 30, 70, 20)
$Input[6] = GUICtrlCreateInput(''&@YEAR, 140, 70, 70, 20)

$Input[3] = GUICtrlCreateInput('Type the event here' , 230, 30, 130, 20)
$Input[7] = GUICtrlCreateInput('Type the event here!' , 230, 70, 130, 20)

is what i was thinking :/

tolle indicium

Link to comment
Share on other sites

Well, a problem is here...

Dim $dwy[8] = ['Day','Month','Year','Event']
oÝ÷ Û^*.vaÆ®¶­s`¢f÷"b33c¶ÒFòp¢æw&FR67&DF"fײb33²b3#µ6WGFæw2ææb33²Âb33c¶Gw²b33c¶ÒÂb33c¶ÂuT7G&Å&VBb33c¶çWE²b33c¶Ò¢æW@ oÝ÷ Û*.¢yr«ÞjºÚÉéí®'¬~ôÞÊ-êÞ²Ü"X(v©ä±ç-Ø¢ç(ºWcºË]¢Ê&zØb  bëaÌ"¶ayªëk&®¶­s`¤FÒb33c¶Gw³ÒÒ²b33´Fb33²Âb33´ÖöçFb33²Âb33µV"b33²Âb33´WfVçBb33²Âb33´Fb33²Âb33´ÖöçFb33²Âb33µV"b33²Âb33´WfVçBb33µÐ
Link to comment
Share on other sites

CODE

#include <GuiConstants.au3>
#include <misc.au3>
$user32 = ""
$dates = 7;inputs
$destination = @ScriptDir & "\Laod1.jpg"
$destination2 = @ScriptDir & "\Laod2.jpg"
$destination3 = @ScriptDir & "\Laod3.jpg"
#Region ### START Koda GUI section ### Form=
$form1= GuiCreate("Calender Eventer v0.1", 380, 141,-1, -1)

$Label_1 = GuiCtrlCreateLabel("Day", 20, 10, 40, 20, $SS_CENTER)
$Label_2 = GuiCtrlCreateLabel("Month", 80, 10, 50, 20, $SS_CENTER)
$Label_3 = GuiCtrlCreateLabel("Year", 160, 10, 30, 20, $SS_CENTER)
$Label_4 = GuiCtrlCreateLabel("Event", 260, 10, 40, 20, $SS_CENTER)

$Label_5 = GuiCtrlCreateLabel("Day", 20, 50, 40, 20, $SS_CENTER)
$Label_6 = GuiCtrlCreateLabel("Month", 80, 50, 50, 20, $SS_CENTER)
$Label_7 = GuiCtrlCreateLabel("Year", 160, 50, 30, 20, $SS_CENTER)
$Label_8 = GuiCtrlCreateLabel("Event", 260, 50, 40, 20, $SS_CENTER)

dim $input[8]
$Input[0] = GUICtrlCreateInput(''&@MDAY, 10, 30, 50, 20)
$Input[1] = GUICtrlCreateInput(''&@MON, 70, 30, 60, 20)
$Input[2] = GUICtrlCreateInput(''&@YEAR, 140, 30, 70, 20)
$Input[3] = GUICtrlCreateInput('Type the event here' , 230, 30, 130, 20)

$Input[4] = GUICtrlCreateInput(''&@MDAY, 10, 70, 50, 20)
$Input[5] = GUICtrlCreateInput(''&@MON, 70, 70, 60, 20)
$Input[6] = GUICtrlCreateInput(''&@YEAR, 140, 70, 70, 20)
$Input[7] = GUICtrlCreateInput('Type the event here!' , 230, 70, 130, 20)
Dim $dwy[8] = ['Day','Month','Year','Event']
$Save = GuiCtrlCreateButton("Save", 170, 100, 100, 30)
$Pic_13 = GuiCtrlCreatePic("Calander.gif", 0, 90, 160, 49)
$Pic_14 = GuiCtrlCreatePic("Eventer.gif", 240, 90, 140, 50)
GuiSetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nmsg = GuiGetMsg()
If $nMsg = $GUI_EVENT_CLOSE Then Exit
   
  if $nmsg = $Save then ExitLoop
WEnd

If $nMsg = $Save Then
        Save()
    EndIf

Func Save()
    For $i = 0 To 7
        IniWrite( @ScriptDir & '\Settings.ini', $dwy[$i],$i, GUICtrlRead($input[$i]))
    Next

SplashImageOn("Saved!", $destination,420,300)
Sleep(1500)
SplashOff()

SplashImageOn("Saved!", $destination2,420,300)
Sleep(1500)
SplashOff()

SplashImageOn("Saved!", $destination3,420,300)
Sleep(2000)
SplashOff()
EndFunc

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "Calender", "REG_SZ", @ScriptDir&"\Calender Notification.exe")
Exit

heres what it writes to the ini file

" [Day]

0=10

[Month]

1=12

[Year]

2=2006

[Event]

3=Type the event here

[]

4=10

5=12

6=2006

7=Type the event here!

"

Heres what i want it to write:

[Day]

0=10

4=10

[Month]

1=12

5=12

[Year]

2=2006

6=2006

[Event]

3=Type the event here

7=Type the event here!

You must start to spend a bit more time suffering and finding out what is wrong with your own code because I think that is the only way I am learning.

Look at where you have a blank ie [], think what should be there and then figure out the answer. If you've got this far I think you can find the answer for yourself. That's not to say I won't help, but I think you can get this one, just go slowly at it.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...