Jump to content

Msgbox with .INI files


Recommended Posts

I am wondering if it is possible to have an entire section of an .ini file read back to a "single" message box. Currently with the "INIREADSECTION" command it sends back one key/value click ok and then the second,...i would like one reply back? the ini file is created with some special scanning software which stores parameters for milling cases.

i am relatively new to autoit but i just need to know a command to point me in the right direction.

$var = IniReadSection("C:\Temp\myfile.ini", "Info")
If @error Then 
    MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
    For $i = 1 To $var[0][0]
        MsgBox(4096, "", "Key: " & $var[$i][0] & @CRLF & "Value: " & $var[$i][1])
    Next
EndIf

if i can get this much to work i would like to eventually get the .ini file be able to be selected as a variable since this .ini file name is unique to each scan the user could browse to the folder and select the correct file and hit ok and have it display the parameters quickly. will this be possible with the use of a $var?

here is a copy of the INI file

[INFO]
PCID=201491
Version=Cercon design 3.0.1.2
SerialNo=100016
Case started=2009-06-23 09:06:25
Last saved=2009-06-23 09:13:03
Data source=External scanner
Jaw=Upper jaw
RestorationType=Coping
Teeth=16c
PatientName=Test Anterior - 3.0.1.2
DentistName=Test Anterior - 3.0.1.2
OperatorName=end user
Remark=
Material=CrO2White


[SCAN]
ScanIsDone=1
ScanFilterType=0
ScanDataRowCount=0
ScanDataColumnCount=0
ReproducingScanNeeded=0
ScanIsInvalid=0


[CAD]
CurrentBridgeCADStep=
AdjustmentType=Auto


[CAM]
MillDestination=Cercon local


[OTHER]
Chapter=CAM

Thanks for any input.

Link to comment
Share on other sites

I am wondering if it is possible to have an entire section of an .ini file read back to a "single" message box. Currently with the "INIREADSECTION" command it sends back one key/value click ok and then the second,...i would like one reply back? the ini file is created with some special scanning software which stores parameters for milling cases.

i am relatively new to autoit but i just need to know a command to point me in the right direction.

$var = IniReadSection("C:\Temp\myfile.ini", "Info")
If @error Then 
    MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
    For $i = 1 To $var[0][0]
        MsgBox(4096, "", "Key: " & $var[$i][0] & @CRLF & "Value: " & $var[$i][1])
    Next
EndIf

if i can get this much to work i would like to eventually get the .ini file be able to be selected as a variable since this .ini file name is unique to each scan the user could browse to the folder and select the correct file and hit ok and have it display the parameters quickly. will this be possible with the use of a $var?

here is a copy of the INI file

Perhaps more like this?
$var = IniReadSection("C:\Temp\myfile.ini", "Info")
If @error Then 
    MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
    $sMsg = ""
    For $i = 1 To $var[0][0]
        $sMsg &= $var[$i][0] & " = " & $var[$i][1] & @CRLF
    Next
    MsgBox(4096, "Result", $sMsg)
EndIf

:)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Excellent!!! Thanks for the quick reply. from what i can tell if i would like to add a file open dialogue box to browse to the folder where the said .ini files will be and then hit "open" and have it generate the given display it looks like i would have to use a GUI of sorts to be able to acheive this? I have a lot of tinkering to do but guidance is always welcome!

Link to comment
Share on other sites

Excellent!!! Thanks for the quick reply. from what i can tell if i would like to add a file open dialogue box to browse to the folder where the said .ini files will be and then hit "open" and have it generate the given display it looks like i would have to use a GUI of sorts to be able to acheive this? I have a lot of tinkering to do but guidance is always welcome!

Sounds like FileOpenDialog(). See help file for it, and the example script there.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...