Jump to content

Having problems using iniwrite


logonui
 Share

Recommended Posts

Does anybody know how to create an ini file using iniwrite that pulls data from many input controls.

CODE
#include <GUIConstants.au3>

#include <Array.au3>

#include <GuiListView.au3>

#include <misc.au3>

GUICreate("ICTM Job List",740,575)

$font="Arial"

GUISetBkColor(0x00484F7B)

GUISetFont(9,400,0,$font)

$FileMenu=GuiCtrlCreateMenu("&File")

GUICtrlCreateMenuitem("E&xit",$FileMenu)

$EditMenu=GuiCtrlCreateMenu("&Edit")

$HelpMenu=GuiCtrlCreateMenu("&Help")

GUICtrlCreateMenuItem("&About",$HelpMenu)

$tab=GUICtrlCreateTab (5,5,730,545)

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Tab1 New Job>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

$tab1=GUICtrlCreateTabitem("New Jobs")

GUICtrlSetState(-1,$GUI_SHOW)

GUICtrlCreateLabel("Job Number", 30,50,150,20)

$tab1Job=GUICtrlCreateInput("", 30,70,150,20)

GUICtrlCreateLabel("Date", 30,95,150,20)

$tab1Date=GuiCtrlCreateDate("", 30, 115, 200, 20)

GUICtrlCreateLabel("Time", 30,140,150,20)

$tab1Username=GUICtrlCreateInput("", 30,160,150,20)

GuiCtrlCreateGroup("Software / Hardware / Other", 30,190,200,80)

$tab1Software=GuiCtrlCreateRadio("Software",40,205,100)

GuiCtrlSetState(-1, $GUI_CHECKED)

$tab1Hardware=GuiCtrlCreateRadio("Hardware",40,225,100)

$tab1Other=GuiCtrlCreateRadio("Other",40,245,100)

GUICtrlCreateGroup("",-99,-99,1,1)

GUICtrlCreateLabel("Room", 30,275,150,20)

$tab1Room=GUICtrlCreateInput ("", 30,295,150,20)

GUICtrlCreateLabel("User", 30,320,150,20)

$tab1User=GUICtrlCreateInput ("", 30,340,150,20)

GUICtrlCreateLabel("WS / NB Number", 30,365,150,20)

$tab1CompNo=GUICtrlCreateInput ("", 30,385,150,20)

GUICtrlCreateLabel("Priority", 30,410,150,20)

$tab1Priority=GUICtrlCreateInput ("", 30,430,150,20)

GUICtrlCreateLabel("Description Of problem",300,50,150,20)

$tab1Description=GUICtrlCreateEdit("",300,70,400,105, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_MULTILINE + $ES_WANTRETURN)

GUICtrlCreateLabel("Diagnosis / Recommended Action",300,185,200,20)

$tab1Diagnosis=GUICtrlCreateEdit("",300,205,400,105, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_MULTILINE + $ES_WANTRETURN)

GUICtrlCreateLabel("Action Taken",300,320,200,20)

$tab1Action=GUICtrlCreateEdit("",300,340,400,105, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_MULTILINE + $ES_WANTRETURN)

$tab1Save=GUICtrlCreateButton("Save",290,470,100,50)

IniWrite("Y:\Utils\JobList\Data\JobList.ini","Jobs","1","test")

I want to be able to create a new key with the $tab1Job variable and a value that is made up from the rest of the input and edit controls in the format of

[Jobs]

1=$tab1Date,$tab1Username,$tab1Software/$tab1Hardware/$tab1Other,$tab1Room,$tab1User,$tab1CompNo,$tab1Priority, and so on.....

I am quite new to autoit so I am still at the stage where I have to look up the help file for practically every line I write so so explanations would be great

Cheers

Lee

Link to comment
Share on other sites

Did you try:

$val1 = GUICtrlRead($tab1Date)
$val2 = GUICtrlRead($tab1Username)

IniWrite("MyINIFile.ini", "Jobs", "val", $val1 & "," & $val2)

;etc etc
IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
Share on other sites

You're welcome. Can you elaborate a bit more on your next issue?

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
Share on other sites

Sorry, you'll have to be more specific. What exactly is it that you want done, and what have you done to try and do that so far?

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
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...