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
|