I have a skill routine that searches for a given set of instances and will replace those instance automatically. The GUI has (I'm hacking another user's skill) two buttons,
a "find next" button and a "replace" button. I've combined the functions into a single button that's a "replace then get next" function that's a simple call of the two functions
used in the two-button approach. I'd like the system to simply wait 1-2 seconds before going to the "next" instance. I've put the callbacks in the proper order and everything
works correctly EXCEPT, a screen refresh doesn't happen that'll allow me to quickly review the replacement. I've tried using various implementations of "sleep" and hiRegTimer
but can't seem to get anything to work. Code snippet below:
;Merf's replace+next function 323 procedure(mdrReplaceViaNextCB(hButton hForm)324 printf("KM-Replacing...\n")325 mdrReplaceViaCB(hButton hForm)326 hiRedraw()327 printf("Waiting... \n")328 hiRegTimer(mdrShowNextViaInstanceCB(hForm) 100)329 ;mdrShowNextViaInstanceCB(hForm)330 printf("Done!\n")331 );
The code will make the substitution and wait 10 seconds before moving on but the screen doesn't update... what am I missing?
It's hard to know for sure without seeing more of the code, but at least the first argument to hiRegTimer() is wrong in your case. It needs to be in quotation marks as otherwise it will be evaluated immediately (and probably fail when it eventually gets that far):
Note however, the hForm would need to be a global variable - because the expression is going to be evaluated in the global scope - so whatever the form is called. Or you'd have to find that out and construct the right expression with sprintf.
If you get stuck, I suggest you contact customer support because then we could take a look without you having to share the full code in a public forum.