Jump to content

Iniwrite question


Go to solution Solved by satanttin,

Recommended Posts

Posted

Hello,

I have a little problem with making a .ini file. i can make it just i want the file name to be the date which u see in the code. it automaticly says 4 while it suppose to be the date of the day it is.

the code is :

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>

Global $sIniFile, $hDate, $hInput, $hUren, $hSave

Opt("GUIOnEventMode", 1)

Load()
guistart()

Func guistart()
$hGUI = GUICreate( "New Window", 659, 592, -1, -1)
$hInput = GUICtrlCreateInput( "", 1, 42, 657, 549)
$hDate = GUICtrlCreateLabel(@MDAY& "-" & @MON& "-" &@YEAR, 256, 1, 144, 23)
$hButton = GUICtrlCreateButton( "Previous", 194, 1, 61, 23)
$hButton2 = GUICtrlCreateButton( "Next", 402, 1, 61, 23)
$hUren = GUICtrlCreateInput( "", 59, 14, 60, 18)
$hLabel2 = GUICtrlCreateLabel( "Uren:", 10, 15, 28, 16)
$hSave = GUICtrlCreateButton( "Save", 576, 5, 79, 33)
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
GUICtrlSetOnEvent($hSave, "Save")
GUICtrlSetOnEvent($hButton, "Previous")
GUICtrlSetOnEvent($hButton, "Previous")
GUISetState()
While 1
WEnd
EndFunc

Func Close()
   Exit
EndFunc

Func load()
        $hDate = IniRead ($sIniFile, "Date", "Name", "Error")
        $hDate = IniRead ($sIniFile, "Date", "Name", "Error")
        $hDate = IniRead ($sIniFile, "Date", "Name", "Error")
        $hDate = IniRead ($sIniFile, "Date", "Name", "Error")
        $hDate = IniRead ($sIniFile, "Date", "Name", "Error")
        $hDate = IniRead ($sIniFile, "Date", "Name", "Error")
EndFunc

Func save()
   IniWrite (@ScriptDir & "\" & $hDate & ".ini" , "Date", "Date", $hDate)
   IniWrite (@ScriptDir & "\" & $hDate & ".ini" , "Date", "Uren", $hUren)
EndFunc

I know the code isn't finished yet just trying to make save work so i continue.

Greetz.

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...