Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
Back to article list Search Articles Add Comment Printer friendly Direct link Par2: Incremental locator delay 2001-11-16 -- Kevin Erskine This is a template solution -- letting CW do what it wants....
Generated Code.... Blue code is standard CW generated code..
BRW1::Sort0:Locator.TakeKey PROCEDURE
ReturnValue BYTE,AUTO
!--- ! (BGN) Incremental Locator Delay
!---
!--- In order to reduce file I/O for Incremental locators, take the keycode and
!--- if there are more in the buffer continue until no more
!---
DelayUntilTime LONG(0) ! Delay Field
eStdDelayTime EQUATE(35) ! 35/100 of a second
!---
CODE
!---
LOOP ! Loop until no KeyCodes in Buffer
!-
ReturnValue = PARENT.TakeKey()
!-
DelayUntilTime = CLOCK() + eStdDelayTime ! Set Delay Time
LOOP WHILE NOT KEYBOARD() | ! Pause Until A KeyCode
AND ABS(CLOCK() - DelayUntilTime) <= eStdDelayTime ! OR TimeOut
YIELD() ! Give other Processes time
END
!-
IF KEYBOARD() ! Is there another KeyCode
ASK ! Get Next KeyCode
CYCLE ! Process KeyCode
ELSE
BREAK ! All Done
END
!-
END
!--- ! (END) Incremental Locator Delay
RETURN ReturnValue
Template Code...
#!=============================================================================
#!=== (BGN) - Incremental Locator Delay
#!=============================================================================
#AT(%LocatorMethodDataSection),WHERE(INSTRING(', TakeKey',%EmbedParameters,1,1) AND %LocatorType =
'Incremental')
!--- #
Today is November 21, 2024, 7:13 am This article has been viewed 35206 times.
|
|