RavdonikaS
Новичок
- Сообщения
- 68
- Репутация
- 4
Нужно записать в массив прочитанные из GUI значения
В 1 примере работает но длинный код получается
Во 2-ом примере вроде логичнее так записать и код сокращает но ошибка
Почему нельзя присваивать значения массиву как в примере 2?
Подскажите способы более короткого присвоения массиву
В 1 примере работает но длинный код получается
Во 2-ом примере вроде логичнее так записать и код сокращает но ошибка
Почему нельзя присваивать значения массиву как в примере 2?
Подскажите способы более короткого присвоения массиву
Код:
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
HotKeySet("{numpad5}","Register")
#Region ### START Koda GUI section ### Form=
Global $R_One[10]
$Form1 = GUICreate("Form1", 163, 246, 192, 124)
$One1 = GUICtrlCreateInput("", 2, 15, 71, 21)
$One2 = GUICtrlCreateInput("", 2, 40, 71, 21)
$One3 = GUICtrlCreateInput("", 2, 65, 71, 21)
$One4 = GUICtrlCreateInput("", 2, 90, 71, 21)
$One5 = GUICtrlCreateInput("", 2, 115, 71, 21)
$One6 = GUICtrlCreateInput("", 2, 137, 71, 21)
$One7 = GUICtrlCreateInput("", 2, 159, 71, 21)
$One8 = GUICtrlCreateInput("", 2, 181, 71, 21)
$One9 = GUICtrlCreateInput("", 2, 203, 71, 21)
$One10 = GUICtrlCreateInput("", 2, 225, 71, 21)
$Two1 = GUICtrlCreateInput("", 74, 15, 71, 21)
$Two2 = GUICtrlCreateInput("", 74, 40, 71, 21)
$Two3 = GUICtrlCreateInput("", 74, 65, 71, 21)
$Two4 = GUICtrlCreateInput("", 74, 90, 71, 21)
$Two5 = GUICtrlCreateInput("", 74, 115, 71, 21)
$Two6 = GUICtrlCreateInput("", 74, 137, 71, 21)
$Two7 = GUICtrlCreateInput("", 74, 159, 71, 21)
$Two8 = GUICtrlCreateInput("", 74, 181, 71, 21)
$Two9 = GUICtrlCreateInput("", 74, 203, 71, 21)
$Two10 = GUICtrlCreateInput("", 74, 225, 71, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func Register()
$R_One1=GUICtrlRead($One1)
$R_One2=GUICtrlRead($One2)
$R_One3=GUICtrlRead($One3)
$R_One4=GUICtrlRead($One4)
$R_One5=GUICtrlRead($One5)
$R_One6=GUICtrlRead($One6)
$R_One7=GUICtrlRead($One7)
$R_One8=GUICtrlRead($One8)
$R_One9=GUICtrlRead($One9)
$R_One10=GUICtrlRead($One10)
Global $R_One[10]=[$R_One1, $R_One2, $R_One3, $R_One4, $R_One5, $R_One6, $R_One7, $R_One8, $R_One9, $R_One10]
EndFunc
Код:
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
HotKeySet("{numpad5}","Register")
#Region ### START Koda GUI section ### Form=
Global $R_One[11], $One[11]
$Form1 = GUICreate("Form1", 163, 246, 192, 124)
$p=15
For $n=1 To 10 Step 1
$One[$n] = GUICtrlCreateInput("", 2, $p, 71, 21)
$p+=22
Next
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func Register()
For $n=1 To 10 Step 1
$R_One[$n] = GUICtrlRead($One[$n])
Next
EndFunc