eus_deus
22-09-2013, 14:55
Всем привет! Итак, рабочий пример
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 629, 478, 433, 177)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 321, 361)
GUICtrlSetData(-1, "")
$Edit2 = GUICtrlCreateEdit("", 336, 8, 289, 361)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("Read INI", 8, 416, 105, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_iniread()
EndSwitch
WEnd
Func _iniread()
$inifile=@ScriptDir& '\test.ini'
$sections=IniReadSectionNames($inifile)
$msg=''
For $i = 1 To $sections[0]
$msg &= $sections[$i] & @CRLF
GUICtrlSetData($Edit1, $msg)
Next
EndFunc
Ini файл в прикрепленных файлах. Задача - загрузка в Edit1 имен секций, но не всех, а в каждом случае своих:
-1. секции, содержащие v_ в имени
-2. секции только на кириллице
-3. другие секции на латинице, кроме тех, что содержат v_
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 629, 478, 433, 177)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 321, 361)
GUICtrlSetData(-1, "")
$Edit2 = GUICtrlCreateEdit("", 336, 8, 289, 361)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("Read INI", 8, 416, 105, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_iniread()
EndSwitch
WEnd
Func _iniread()
$inifile=@ScriptDir& '\test.ini'
$sections=IniReadSectionNames($inifile)
$msg=''
For $i = 1 To $sections[0]
$msg &= $sections[$i] & @CRLF
GUICtrlSetData($Edit1, $msg)
Next
EndFunc
Ini файл в прикрепленных файлах. Задача - загрузка в Edit1 имен секций, но не всех, а в каждом случае своих:
-1. секции, содержащие v_ в имени
-2. секции только на кириллице
-3. другие секции на латинице, кроме тех, что содержат v_