PowerBuilder - 在同一事件中使用两个计时器函数调用

发布于 2024-11-06 01:18:00 字数 356 浏览 0 评论 0原文

我试图在同一事件中相继使用两个计时器函数调用,如下所示:

// set up attempt to login again
 Timer(ll_loginDelay(set to 10), this)


// informs server that user is logged in (i.e. does a 'ping')
 Timer(ll_pingRefresh(set to 30), iw_ping)

一个尝试重试登录电话系统,另一个用于刷新有关在任何给定时间登录的人员的报告。如果它们设置为相同的间隔,那么它们就可以工作,如果不是,则第二个就不起作用。知道为什么吗?

谢谢,

tg

i'm trying to use two timer function calls in the same event one after another as thus:

// set up attempt to login again
 Timer(ll_loginDelay(set to 10), this)


// informs server that user is logged in (i.e. does a 'ping')
 Timer(ll_pingRefresh(set to 30), iw_ping)

One attempts a retry for the login to a phone system and the one is used to refresh a report about who's logged in at any given time. If they are set to the same interval then they work, if not the second one doesn't. Any idea why?

Thanks,

tg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

温柔一刀 2024-11-13 01:18:00

目前尚不完全清楚为什么会出现这种行为,但将 ping 等非可视功能放入 Timing 对象等非可视对象中不仅是更好的解决方案,而且还可以解决您的问题。

祝你好运,

特里

It's not entirely clear why you're getting this behaviour, but putting non-visual functionality like a ping in a non-visual object like a Timing object would not only be a better solution, but may also work around your problem.

Good luck,

Terry

揽清风入怀 2024-11-13 01:18:00

一个特定的窗口只能有一个计时器。每次调用该窗口的计时器事件时,您实际上都在重置计时器间隔。很难判断您是否使用不同的窗口来查看您给出的代码。

第二件事要注意的是,窗口计时器要求窗口打开。这个要求似乎很明显,但 Sybase 在文档中特别提到了它,所以我想我也应该提到它。

PowerScript 定时器的 SyBooks Online 文档在 PB 版本 12 中。

SyBooks 联机文档 非示例视觉计时对象。。这不是最好的例子,因为它暗示非视觉是某种标准的非视觉类型的“计时器”,但我不知道该类型的非视觉。我认为这可能是一个普通的旧用户定义的非视觉对象,无论哪种情况,这都是另一种解决方法/解决方案。

祝你好运。

You can only have one timer for a particular window. Each time you call the timer event for that window you are in effect resetting the timer interval. It's hard to tell if you are using different windows looking at the code you've given.

A second thing to be aware of is that a window timer requires the window is open. This requirement seems obvious but Sybase made a point of mentioning it in the documentation so I figured I'd mention it too.

SyBooks Online documentation for PowerScript Timers in PB version 12.

SyBooks Online documentation Example of Non Visual Timing object.. This isn't the greatest example because it implies that the non-visual is some standard non-visual type of "timer" but I wasn't aware of a non-visual of that type. I think it is probably a plain old user defined non-visual, in either case this is another workaround/solution.

Good luck.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文