Jump to content
Sign in to follow this  
Gif

Ini

Recommended Posts

Gif

$sonw = @DesktopCommonDir &"\oniksodll.ini"
           $ones = IniWriteSection($sonw, "sectionnote", GUICtrlRead($onsetnamek))      
         $twos = IniWriteSection($sonw, "sectionnote2", GUICtrlRead($onsetplacek))  
           $threes = IniWriteSection($sonw, "sectionnote3", GUICtrlRead($date))     
          $fours = IniWriteSection($sonw, "sectionnote4", GUICtrlRead($time))   
           $fives = IniWriteSection($sonw, "sectionnote5", GUICtrlRead($notingonk))
             $item1 = GuiCtrlCreateListViewItem(IniReadSection($sonw, $ones), $mainonset)
                GUISetState(@SW_HIDE, $kongui)

i am pretty sure it has a lot of mistakes but INI is just not my best part of autoit so i need help....

(i am not familiar with INIs)

Edited by c4nm7

Share this post


Link to post
Share on other sites
theguy0000

so what's the problem?


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites
Gif

so what's the problem?

ok as i mentioned im not too familiar with INIs so i will just explain what i want to do. i want the script to write the ini , and then as u can see read the sections and add them to the main gui as GuiCtrlCreateListViewItem under the GuiCtrlCreateListView...this does not works

whatever i instert in the first one the GuiCtrlCreateListViewItem is alwaye returned as 1

any suggestions?

Share this post


Link to post
Share on other sites
eltorro

I believe that you would have to take the array returned by IniReadsection and convert each element to a ListViewItem.

Share this post


Link to post
Share on other sites
PsaltyDS

Also, your variable $ones is just the return code from the IniWriteSection() function, not a string of the section name.

:)


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

Share this post


Link to post
Share on other sites
James

Func _GetUser()
    If FileExists(@ScriptDir & '\names.ini') Then
        $User_index = _GUICtrlListViewGetItemCount($UserList)
        $ImportImage = IniReadSection($UserFile, "Image")
        $ImportName = IniReadSection($UserFile, "Users")
        $ImportPassword = IniReadSection($UserFile, "Password")
        For $a = 1 To $ImportImage[0][0]
            GUICtrlCreateListViewItem($ImportName[$a][1] & "|" & $ImportPassword[$a][1] & "|" & FileGetLongName($ImportImage[$a][1], 1), $UserList)
            GUICtrlSetImage(-1, $ImportImage[$a][1])
            If @error = 1 Then MsgBox(0x10, "Error", "There was an error importing user data.")
        Next
        _GUICtrlListViewSetColumnWidth($UserList, 2, $LVSCW_AUTOSIZE)
    Else
        MsgBox(0x10, "Request Error", "Could not import names. File doesn't exist.")
    EndIf
EndFunc   ;==>_GetUser

There is a excert from my program. Just change the control ID's.

Share this post


Link to post
Share on other sites
Gif

Func _GetUser()
    If FileExists(@ScriptDir & '\names.ini') Then
        $User_index = _GUICtrlListViewGetItemCount($UserList)
        $ImportImage = IniReadSection($UserFile, "Image")
        $ImportName = IniReadSection($UserFile, "Users")
        $ImportPassword = IniReadSection($UserFile, "Password")
        For $a = 1 To $ImportImage[0][0]
            GUICtrlCreateListViewItem($ImportName[$a][1] & "|" & $ImportPassword[$a][1] & "|" & FileGetLongName($ImportImage[$a][1], 1), $UserList)
            GUICtrlSetImage(-1, $ImportImage[$a][1])
            If @error = 1 Then MsgBox(0x10, "Error", "There was an error importing user data.")
        Next
        _GUICtrlListViewSetColumnWidth($UserList, 2, $LVSCW_AUTOSIZE)
    Else
        MsgBox(0x10, "Request Error", "Could not import names. File doesn't exist.")
    EndIf
EndFunc   ;==>_GetUser

There is a excert from my program. Just change the control ID's.

thanks a lot

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  

×