Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rewinding Through Records
Message
From
17/05/1998 11:31:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/05/1998 05:22:34
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00099920
Message ID:
00099988
Views:
19
>>In your prev and next buttons put something like this
* Prev.Mousedown event
>>if nButton = 1
>>  now = seconds()
>>  do while !bof() and mdown()
>>    if seconds() - now > 1
>>	skip -1
>>	thisform.refresh
>>* Update other nav buttons as necessary
>>	now = seconds()
>>    endif
>>  enddo
>>endif
Cetin
>
>One thing about checking for seconds() - don't test this approach around midnight. I've actually had it once, when the value of Now was something less than a second before midnight, and the seconds() reset itself to a little above zero. Never went out of the loop.

Good point Dragan,
Then I would surround the expression with abs(). And I played with this thing via a timer and worked better also letting commandbutton pressed down effect. This is the timer.event code with commandbuttons have cmdPrev-cmdNext (wizard buttons) names :
if !mdown() 
	release all lile oTimerx*
	return
endif
oTimerx = sys(1270)
if !type("oTimerx")	= "O"
	return
endif	
if !inlist(oTimerx.name,"cmdPrev","cmdNext")
	release all lile oTimerx*
	return
endif
nSkipDir = iif(oTimerx.name = "cmdPrev",-1,1)
skip iif(nSkipDir = 1, ;
	iif(!eof(), 1, -1),iif(!bof(), -1, 1))
if oTimerx.name = "cmdPrev" and bof()
  go top
  oTimerx.enabled = .f.
endif
if oTimerx.name = "cmdNext" and eof()
  go bottom
  oTimerx.enabled = .f.
endif
thisform.refresh
This one would be resistant to midnight too. But should be enhanced to avoid default click (moving all click code here maybe) and with a better navrefresh.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform