Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Not sure if I

This is the way I did it. Buttons pass parameter to scipt which sets the number of records to skip. Stops when first or last record is reached.

Freeze Window

If [ Get ( ScriptParameter ) = -1 ]

Go to Record/Request/Page [ Previous ]

Else If [ Get ( ScriptParameter ) = 1 ]

Go to Record/Request/Page [ Next ]

Else If [ Get ( ScriptParameter ) < 0 ]

Set Field [ Globals::g_Counter; 1 ]

Loop

Go to Record/Request/Page [ Previous; Exit after last ]

Set Field [ Globals::g_Counter; Globals::g_Counter + 1 ]

Exit Loop If [ Globals::g_Counter > Abs ( Get ( ScriptParameter ) ) ]

End Loop

Else

Set Field [ Globals::g_Counter; 1 ]

Loop

Go to Record/Request/Page [ Next; Exit after last ]

Set Field [ Globals::g_Counter; Globals::g_Counter + 1 ]

Exit Loop If [ Globals::g_Counter > Abs ( Get ( ScriptParameter ) ) ]

End Loop

End If

  • Author

I was thinking more in terms of this one-line script:

Go to Record/Request/Page [Get (RecordNumber) + 10]

Which works but for two problems:

An annoying pop-up window appears with the number of the record I

You could try this one-line script using get record number via calculation (new in FM7).

JumpBack10 script:

Go To Record/Request/Page [ No dialog;

If(Get ( RecordNumber ) < 10; 1; Get(RecordNumber) - 10) ]

Here's the Forward ...

If(Get(RecordNumber) > Get ( FoundCount ) - 10; Get(FoundCount); Get(RecordNumber) + 10) ]

Be sure to click 'No Dialog'. You could duplicate the above scripts for Jump50 and just change the number. wink.gif

Combining all the above I came up with the following:

Freeze Window

If [ Get ( ScriptParameter ) < 0 ]

If [ Get ( RecordNumber ) > Get ( ScriptParameter ) ]

Go to Record/Request/Page [ Get ( RecordNumber ) + Get ( ScriptParameter ) ] [ No dialog ]

Else

Go to Record/Request/Page [ First ]

End If

Else If [ Get ( RecordNumber ) < Get ( FoundCount ) - Get ( ScriptParameter ) ]

Go to Record/Request/Page [ Get ( RecordNumber ) + Get ( ScriptParameter ) ] [ No dialog ]

Else

Go to Record/Request/Page [ Last ]

End If

End If

  • Author

Beautiful, that

  • Author

Thanks again RalphL. I used Moonshadow

I learned from this too and now have a better script in my database.

  • Author

And this is what to do if you want to go 10 records backwards:

Go To Record/Request/Page [No dialog; If ( Get ( RecordNumber ) < 10; 1 ; Get ( RecordNumber ) - 10) ]

Here's another solution. This allows you to use the same previous and next buttons.

Next:

If [ Get ( ActiveModifierKeys ) = 1 ]

Loop

Go to Record/Request/Page

[ Next; Exit after last ]

Pause/Resume Script [ Duration (seconds): 0 ]

Exit Loop If [ Get ( ActiveModifierKeys ) &#8800; 1 ]

End Loop

Else

Go to Record/Request/Page

[ Next ]

End If

Previous:

If [ Get ( ActiveModifierKeys ) = 1 ]

Loop

Go to Record/Request/Page

[ Previous; Exit after last ]

Pause/Resume Script [ Duration (seconds): 0 ]

Exit Loop If [ Get ( ActiveModifierKeys ) &#8800; 1 ]

End Loop

Else

Go to Record/Request/Page

[ Previous ]

End If

Saves a little layout space and the number of records is no longer hard-coded to 10, just release the modifier key when you have reached your destination.

The minus sign is part of my script parameter for going back. The script parameter thus shows both direction and number of records to move. I have 3 button in each direction for 1, 5 & 10 record jumps.

I confess that the subject of navigation, windowing and displays, within an FM7 file, is of particular interest to me. Ralph, Michael - thanks guys ... I plan on playing with both of your ideas; and also playing with the 100 new ideas that have popped into my mind. Vs 7 is incredible...

My calculation is not the best. crazy.gif It would use less math to take advantage of Min() and Max() as The Shadow pointed out in another thread. And using a script parameter would improve it even more.

A forward version, getting the amount to move from the parameter:

Go To Record[ no dialog; Min( Get(FoundCount); Get(RecordNumber)+Get(ScriptParameter) ) ]

A backwards version:

Go To Record[ no dialog; Max( 1; Get(RecordNumber)-Get(ScriptParameter) ) ]

Then each button chooses 10 or 50. And there may be even better ways ... it seems there always are. wink.gif

  • Author

I

  • 3 weeks later...

Here's one, it scripts movement to the next/previous letter in the alphabet from your current record.

Michael,

I really like this concept. I've just implemented it. Thanks for the trick. I wanted to give the user a little more time to see the record, so I changed the pause duration. In FM7 you can pause for fractional parts of seconds. In FM 6, :01 was the shortest pause you could have. Now you can set it to .1, or whatever.

Having said that, the quickest pause that it actually seems to be able to execute is about .5. That is, even if I set it to .1, it seems incapable of pausing for anything less than half a second.

Anyone else notice this, or is once again tied to the slow screen redraws?

Thanks again,

Dan

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.