|
|
楼主 |
发表于 2011-3-31 22:11:47
|
显示全部楼层
本帖最后由 feicuiboy 于 2011-3-31 22:14 编辑
回复 24# afan
全用数组,不用非数组,这样会不会好些?
这个是您写的第一版,也是数组的- Dim $xx[3], $ini = "配置.ini"
- $xx[0] = IniRead($ini, "尺寸", "B1", "")
- $xx[1] = IniRead($ini, "尺寸", "B2", "")
- $AA = IniRead($ini, "零件通用信息", "A3", "")
- MsgBox(0, '', _Execute($AA, 1) & @LF & _Execute($AA, 2))
- Func _Execute($s_ini, $x)
- Local $sR = StringRegExp($s_ini, '%\$(.+?)\[(\d+)\]%([+-])(\d+(?:\.\d+)?)', 3)
- If @error Then Return SetError(1, 0, '')
- If Not IsDeclared($sR[0]) Then Return SetError(2, 0, '')
- Local $tmp = Eval($sR[0])
- If $x = 1 Then Return Execute($tmp[$sR[1]] & $sR[2] & $sR[3])
- If UBound($sR) <> 8 Then Return SetError(3, 0, '')
- $tmp = Eval($sR[4])
- Return Execute($tmp[$sR[5]] & $sR[6] & $sR[7])
- EndFunc ;==>_Execute
复制代码 |
|