val = Plugin.File.ReadINI("Default", "val", "c:\CadVal.ini")
If Len(val) = 0 Then
val = "1" //初始值
End If
//你的代码
LeftDoubleClick 1
Delay 50
KeyPress "Right", 1
SayString " D01-A0" + val
//下次加1
val = val + 1
Call Plugin.File.WriteINI("Default", "val", val, "c:\CadVal.ini")