Jump to content

iniread sectionname help


Kyme
 Share

Recommended Posts

hello guys

i have an little problem, i have an ini read from internet function, but i don't know how to make other to read section names

could you guys please help me with this please?

ini example

[user1]
ID=id1
Pass=password1
[user2]
ID=id2
Pass=password2
[user3]
ID=id3
Pass=password3

and here is the ini key reader

Func _InetIniRead($s_url, $v_section, $v_key, $v_default = -1)
    If $v_default = -1 Or $v_default = Default Then $v_default = ""
    Local $s_text = _INetGetSource($s_url)
    If $s_text = "" Then Return SetError(1, 0, $v_default)
    $s_text = @CRLF & $s_text & @CRLF
    $v_section = StringStripWS($v_section, 7)
    Local $a_data = StringRegExp($s_text, "(?s)(?i)\n\s*\[\s*" & $v_section & "\s*\]\s*\r\n(.*?)(?m:\[|\z)", 3)
    If IsArray($a_data) = 0 Then Return SetError(2, 0, $v_default)
    Local $a_read = StringRegExp(@LF & $a_data[0], "(?s)(?i)\n\s*" & $v_key & "\s*=(.*?)\r", 1)
    If IsArray($a_read) = 0 Then Return SetError(3, 0, $v_default)
    Return $a_read[0]
EndFunc

could you please help me with an function for section read?

thank you

Link to comment
Share on other sites

Search the example forum for _IniString().

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Search the example forum for _IniString().

i found it, but nothing helpful, what i need is to tell me the section names, in the ini will be alot of section names, unknown, and what i need to do it's to catch them all and put them in listview
Link to comment
Share on other sites

But isn't _IniString_ReadSectionNames what you're looking for? Please check again.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I don't think you're dumb, just take that extra second to check. You're welcome.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

one more question, could you help me to do an FOR segment for it, i really don't know the FOR thing and all the time it's an obstacle for me

here is my script

$var =  _INetGetSource('http://home.kymy32.co.cc/data.txt')
$RTArray = IniReadSectionNamesText($var,True)
_ArrayDisplay($RTArray, "Section Names")

i would like to make it with msgbox to be able to set it to listview and i really don't have any clue how to use FOR -> $RTArray[0] $RTArray[1] $RTArray[2] etc

nevermind...how i see it is an perfect example in help @for

FOR $element IN $aArray
$string = $string & $element &"|"
NEXT
Edited by Kyme
Link to comment
Share on other sites

Have a look at the example for the native IniReadSectionNames to become acquainted with For Loops. Plus, MsgBox's have nothing to do with adding to a ListView, look at GUICtrlCreateListViewItem to achieve this.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Have a look at the example for the native IniReadSectionNames to become acquainted with For Loops. Plus, MsgBox's have nothing to do with adding to a ListView, look at GUICtrlCreateListViewItem to achieve this.

i got it, i can use similar to this but how to make it to don't get error incorect nr for subscripts, i mean to automate it $i=$i+1 until it's the last? the "10" to be N where N it's the last array

$file =  _INetGetSource('http://asdasd/data.txt')
$ssection = IniReadSectionNamesText($file,True)

$SectionData = ""
For $i = 1 To 10
GUICtrlCreateListViewItem($ssection[$i], $listview)
Next
Edited by Kyme
Link to comment
Share on other sites

like this >>

For $i = 1 To $ssection[0] ; Where index 0 is the number of items.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

like this >>

For $i = 1 To $ssection[0] ; Where index 0 is the number of items.

sorry taking you precious time, i'm dumb...i really don't get the FOR thing

i don't see where is the wrong, but it is wrong somewhere, 0 rezults in listview

For $i = 1 To $ssection[0]
GUICtrlCreateListViewItem($ssection[$i], $listview)
Next
Edited by Kyme
Link to comment
Share on other sites

We're going to need more code as I don't know how you're creating the ListView. Is an Array returned? Use _ArrayDisplay to check.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

We're going to need more code as I don't know how you're creating the ListView. Is an Array returned? Use _ArrayDisplay to check.

$gui = GUICreate("ListBiew items", 400, 320, -1, -1, -1)
$listview = GUICtrlCreateListView("ID|Date", 10, 10, 380, 280)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)  
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 188)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 188)
GUISetState()
$button = GUICtrlCreateButton ("install",165,290,70,20)
$file =  _INetGetSource('http://aaaaaa/data.txt')
$ssection = IniReadSectionNamesText($file,True)

For $i = 1 To $ssection[0]
GUICtrlCreateListViewItem($ssection[$i], $listview)
Next
GUICtrlSendMsg($ListView, 0, 0, 100)
Do
    $msg = GUIGetMsg()
if $msg = $button Then
  $test= _StringBetween(GUICtrlRead(GUICtrlRead($listview)), '', '|')
  write()
EndIf
Until $msg = $GUI_EVENT_CLOSE

i used listview because i need the $button to make the write of keys below that section, could you please help be with it, honest i don't know the for thing, and i think i will never understand it, always don't work...

Edited by Kyme
Link to comment
Share on other sites

What's IniReadSectionNamesText? My advice is to check an array is being returned and make sure to read the help file carefully.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

What's IniReadSectionNamesText? My advice is to check an array is being returned and make sure to read the help file carefully.

here's the the script, _arraydisplay works like hell, but the problem it's with listview, i don't know why

#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <String.au3>
#include <inet.au3>
#include <IE.au3>

$gui = GUICreate("ListBiew items", 400, 320, -1, -1, -1)
$listview = GUICtrlCreateListView("ID|Data", 10, 10, 380, 280);,$LVS_SORTDESCENDING)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)   ; to allow drag and dropping
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 188)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 188)
GUISetState()
$button = GUICtrlCreateButton ("install",165,290,70,20)
$file =  _INetGetSource('http://www.autoitscript.com/autoit3/files/beta/update.dat')
$ssection = IniReadSectionNamesText($file,True)
_ArrayDisplay($ssection)
$SectionData = ""
For $i = 1 To $ssection[0]
GUICtrlCreateListViewItem($ssection[$i], $listview)
Next
GUICtrlSendMsg($ListView, 0, 0, 100)
Do
    $msg = GUIGetMsg()
if $msg = $button Then
        
  $test= _StringBetween(GUICtrlRead(GUICtrlRead($listview)), '', '|')
  Global $idselector=$test[0]
  write()
EndIf
Until $msg = $GUI_EVENT_CLOSE

Func IniReadSectionNamesText($Text,$Binary = False)
if ($Binary) Then $Text = BinaryToString($Text)
$TLen = StringLen($Text)
Local $RTArray[1][2] , $UBound = 0
For $A = 1 To $TLen
$CharA = StringMid($Text,$A,2)
if (StringIsCRLF($CharA) Or $A = 1) Then
$A = StringExceedsCRLF($Text,$A)
For $B = $A To $TLen
$CharB = StringMid($Text,$B,1)
if (Not CharIsSpace($CharB)) Then
For $C = $B To $TLen
$CharC = StringMid($Text,$C,1)
if (StringCompare($CharC,"[") = 0) Then
For $D = $C + 1 To $TLen
$CharD = StringMid($Text,$D,1)
if (Not CharIsSpace($CharD)) Then
For $E = $D To $TLen
$CharE = StringMid($Text,$E,1)
if (Not CharIsSpace($CharE)) Then
For $F = $E To $TLen
$CharF = StringMid($Text,$F,1)
if (StringCompare($CharF,"]") = 0) Then
if ($F = $TLen) Then
$UBound += 1
ReDim $RTArray[$UBound]
$RTArray[$UBound - 1] = StringMid($Text,$D,$F - $D)
Return $RTArray
EndIf
For $G = $F + 1 To $TLen
$CharG = StringMid($Text,$G,1)
$CharH = StringMid($Text,$G,2)
if (Not CharIsSpace($CharG)) Then
if (StringIsCRLF($CharH)) Then
$UBound += 1
ReDim $RTArray[$UBound]
$RTArray[$UBound - 1] = StringMid($Text,$D,$F - $D)
ExitLoop 6
Else
if ($G = $TLen) Then
$UBound += 1
ReDim $RTArray[$UBound]
$RTArray[$UBound - 1] = StringMid($Text,$D,$F - $D)
Return $RTArray
EndIf
ExitLoop 6
EndIf
EndIf
if ($G = $TLen) Then
$UBound += 1
ReDim $RTArray[$UBound]
$RTArray[$UBound - 1] = StringMid($Text,$D,$F - $D)
Return SetError(0,0,$RTArray)
EndIf
Next
Else
EndIf
if ($F = $TLen) Then
if ($UBound > 0) Then
Return SetError(0,0,$RTArray)
Else
Return SetError(1,0,$RTArray)
EndIf
EndIf
Next
EndIf
if ($E = $TLen) Then
if ($UBound > 0) Then
Return SetError(0,0,$RTArray)
Else
Return SetError(1,0,$RTArray)
EndIf
EndIf
Next
EndIf
if ($D = $TLen) Then
if ($UBound > 0) Then
Return SetError(0,0,$RTArray)
Else
Return SetError(1,0,$RTArray)
EndIf
EndIf
Next
Else
ExitLoop 2
EndIf
if ($C = $TLen) Then
if ($UBound > 0) Then
Return SetError(0,0,$RTArray)
Else
Return SetError(1,0,$RTArray)
EndIf
EndIf
Next
EndIf
if ($B = $TLen) Then
if ($UBound > 0) Then
Return SetError(0,0,$RTArray)
Else
Return SetError(1,0,$RTArray)
EndIf
EndIf
Next
EndIf
if ($A = $TLen) Then
if ($UBound > 0) Then
Return SetError(0,0,$RTArray)
Else
Return SetError(1,0,$RTArray)
EndIf
EndIf
Next
if ($UBound > 0) Then
Return SetError(0,0,$RTArray)
Else
Return SetError(1,0,$RTArray)
EndIf
EndFunc
Func StringIsCRLF($String)
if StringCompare($String,@CRLF) = 0 Then Return 1
Return 0
EndFunc
Func StringExceedsCRLF($Text,$Pos)
$A = $Pos
$TLen = StringLen($Text)
While $A <> $TLen
$CharA = StringMid($Text,$A,1)
if StringCompare($CharA,@CR) <> 0 And _
StringCompare($CharA,@LF) <> 0 Then ExitLoop
$A += 1
WEnd
Return $A
EndFunc
Func CharIsSpace($CharA)
if StringCompare($CharA," ") = 0 Then Return 1
Return 0
EndFunc

nvm i found the problem, it was from selector reader, i found an sweet udf and it works like hell :D

#include <Inet.au3>
#include <Array.au3>
#include "IniString.au3"
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListViewConstants.au3>
#include <String.au3>
#include <IE.au3>
$gui = GUICreate("ListBiew items", 400, 320, -1, -1, -1)
$listview = GUICtrlCreateListView("ID|Data", 10, 10, 380, 280)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 188)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 188)
GUISetState()
$button = GUICtrlCreateButton ("install",165,290,70,20)
$sSource_Mem_Ini = _InetGetSource("http://www.autoitscript.com/autoit3/files/beta/update.dat")
$aReadSectionNames = _IniString_ReadSectionNames($sSource_Mem_Ini)
For $i = 1 To $aReadSectionNames[0]
GUICtrlCreateListViewItem($aReadSectionNames[$i], $listview)
Next

Do
    $msg = GUIGetMsg()
if $msg = $button Then
      

$test= _StringBetween(GUICtrlRead(GUICtrlRead($listview)), '', '|')
MsgBox(0,"",$test[0])
EndIf
Until $msg = $GUI_EVENT_CLOSE

thank you guinness for the your effort, i think i got the FOR thing thank's to you, i gonna save that damn segment to know next time, i wish you an good night and all good on the world

Regards, Emanuel

Edited by Kyme
Link to comment
Share on other sites

You're welcome, I hoped you would work it out yourself as like I said I don't think you're dumb you just have to spend that extra time debugging your script. What was the UDF you found?

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

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