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.

a script to enter numbers like a calculator does? [onscreen keypad entry]

Featured Replies

Hi fmforums!

I'm looking to enter numbers like a calculator does this time round...

The idea:

Script to enter number from onscreen button in this case [1]

firstly, get the quantity variable as text - eg [2] items

then add the character 1 to the variable - eg [21]

then convert the text back to a number [convert to integer]

and drop it back into the quantity box - eg [21] items

I found a custom function that works from brian dunning's website - but it *is* a custom function.

AddTextRight

If there is a way to script it without calling the custom function - it would help me greatly.

here's an example of the script I'm presently using:


Set Error Capture [On]

Set Variable [$A; Value:GetAsText (PrescanInput::Quantity)]

Set Variable [$B; Value:AddTextRight ($A ; 1 ; "1")

Set Field [PrescanInput::Quantity; Int ($]

Commit Records/Requests []

Set Error Capture [Off]

I've also attached an image to show the idea in context - keypad.jpg

If anyone can shed light on how I could do this without a custom function, I would be grateful.

Chris

keypad.jpg

I don't know whether it has been a hard week but I am having trouble understanding what you require.

Do you just need the number [e.g. 21] inserting in the white field via the on-screen keyboard? If so, I think your script can be simplified without any custom functions.

Or do you require something completely different?

Users would need to see the data being entered so I wouldn't use variables unless you get more complex and use layout variables with triggers. But you can use a global field (from anywhere), name it gQuantity and script would be:

Set Field [ gQuantity ; gQuantity & Get ( ScriptParameter ) ]

then create your first button 1 and attach that script. As the parameter type 1. Copy and duplicate for all your buttons then just change the script parameter on each one to parameter 2, parameter 3 etc.

When ready to set the real quantity field attach script to your button of:

Set Field [ Quantity ; gQuantity ]

Set Field [ gQuantity ; "" ]

Edited by Guest

  • 4 years later...

LaRetta, I know this is an old topic but it is close to what I want to achieve. My Question is this. Using your above example it only holds 1 digit not in the example case 2 digits (21) in other words by placing the scripts on each button when that button is depressed the global changes to the stored parameter value so getting double or triple digit numbers doesn't work. Am I missing something? or am I just not reading this as a solution to this double digit question? I am using it as a possible solution for a POS system at a register.

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.