News:

  • April 17, 2026, 12:17:01 AM

Login with username, password and session length

Author Topic: Detecting data change  (Read 11380 times)

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Detecting data change
« on: June 11, 2014, 10:35:17 PM »
Given a table of data values, what's the simplest way of detecting a change?

Is there a mass compare where you can compare the table against an archive copy to see if there have been any changes?  AB has FAL (File Arithmetic and Logic) instructions that work on a table, splitting the work over many consecutive scans.

Or just compare one value at a time, continuously, but put the comparison in a low-time-slice task, so only a few comparisons get done each overall scan?

I realize Do-More is so fast, you could probably do all the comparisons every scan and it wouldn't hurt anything, but old habits die hard.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

LWgreys

  • Hero Member
  • *****
  • Posts: 117
Re: Detecting data change
« Reply #1 on: June 11, 2014, 10:48:24 PM »
Try "CHECKSUM" function.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3803
    • Host Engineering
Re: Detecting data change
« Reply #2 on: June 11, 2014, 11:18:39 PM »
I would definitely do it in a Task, then you have complete control over speed of calculation vs. scan time at runtime via the Task's .TimeSlice member.

Do you also need to know WHICH value is the one that changed, or just that A value changed?  Regardless, do it in a Task.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Detecting data change
« Reply #3 on: June 11, 2014, 11:21:21 PM »
Just detecting A change should be adequate, though there will no doubt be apps where I'd want to know which value.

LWGreys, CHECKSUM works awesome.  Very cool idea.  Thanks!
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.