Skip 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.

Add a line, delete the first line

Featured Replies

I have a simple script which opens a cash drawer through a receipt printer. Now I would like to keep track of the last 50 (or whatever) times the cash drawer was opened, and who opened it.

The current user's name is stored in a global field--so no problem there.

I would like the cash drawer log to be in a single field in a single-record database file (my configuration file)--again, no problem.

So all I really need to know is, after I add a new line to this field...

set field, cashLog, cashLog & "

PatternCount(cashlog,"

  • Author

Thanks Steve!

That works very well. You just forgot one bracket near the end which I figured out without too much difficulty. Also, you'd actually use "50" not "49" since you use the greater than or equal to symbol (ie: if there are 50 carriage returns, there must be 51 entries). I also modified it so that new entries appear at the top and old ones come off the bottom. Here's my final implementation for anyone who's interested:

Set field, logCashDrawer, TextToDate(Status(CurrentDate)) & " @ " & TextToDate(Status(CurrentTime)) & " - " & globalCurrentUser & "

This might be a case where a global repeating field might do the trick! I recently made an "undo" feature using a global repeating field and two scripts that rippled the data down (save last change) and rippled data up (restore last change). It worked well.

The only challenge here would be that the contents of the global field will be mighty slippery in a multi-user environment. Better would be a related file with either a single record (like a prefs file) and a normal repeating field, or a related file with multiple records one for each state.

  • Author

Yep, in this case I'm using a database file with only one record, which also happens to be my configuration file, where I store all of the user preferences.

It's really slick now that I have it working. The only way a user could open the cash drawer without getting logged is either A) with the key, or : if they manually changed the printer in the print center (to the receipt printer), check the "open drawer" option in the print dialog, then printed something... most people probably won't figure that out.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.