新旧变量 [英] old and new variables

查看:93
本文介绍了新旧变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Everyone,

如果我总是发生一件事,

Hello Everyone,
If i have an event that happens always,

Application.Idle += Myevent;





如果在此活动中每次都有变化,



and if there is a variable that changes every time in this event,

Myevent()
{
   var = value;
}





如何捕获此变量的旧值和新值,然后比较,



在此先感谢,

z3ngew



How can i capture old value and new value of this variable and then compare between,

Thanks in advance,
z3ngew

推荐答案





试试这个:

Hi,

Try this:
int oldVar = aVar; // I use int in this example
                   // I also use aVar instead of var, because var is a keyword
int newVar = value;
// compare

aVariable = newVar;



希望这会有所帮助。


Hope this helps.


这篇关于新旧变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆