[已解决]求教怎么定义一个让用户输入的数组长度
本帖最后由 没有知道 于 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
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] = $danyuan & "单元"
For $y = 1 To $hushu
$d[$x] = $x & "楼"
$d[$x][$y+1] = $x & "0" & $y
Next
Next
_ArrayDisplay($d)
EndSwitch
WEnd GUICtrlSetLimit($input1, 10)
帮助文件告诉我的。$input1限制输入10个字符 数组建立后,可以按需要 ReDim ReDim $b[你要重新定义的长度][你要重新定义的长度] 谢谢,问题解决了
页:
[1]