本帖最后由 没有知道 于 2017-4-24 21:19 编辑
怎么可以让$d的数组长度是同过$Input2和$Input3控件输入的来控制#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTreeView.au3>
#include <array.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 680, 353)
$Label1 = GUICtrlCreateLabel("单元", 8, 16, 40, 17)
$Input1 = GUICtrlCreateInput("", 48, 16, 57, 21)
$Label2 = GUICtrlCreateLabel("有楼层", 136, 16, 52, 17)
$Input2 = GUICtrlCreateInput("", 192, 16, 121, 21)
$Label3 = GUICtrlCreateLabel("房号", 336, 16, 28, 17)
$Input3 = GUICtrlCreateInput("", 376, 16, 121, 21)
$Button1 = GUICtrlCreateButton("生成", 520, 16, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Dim $fenxianxiang, $louceng ,$hushu
Local $d[50][11]
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$danyuan=GUICtrlRead($Input1)
$louceng = GUICtrlRead($Input2)
$hushu = GUICtrlRead($Input3)
For $x = 0 To $louceng
$d[$x][0] = $danyuan & "单元"
For $y = 1 To $hushu
$d[$x][1] = $x & "楼"
$d[$x][$y+1] = $x & "0" & $y
Next
Next
_ArrayDisplay($d)
EndSwitch
WEnd
|