grabdata( function doesn't work in FormulaFill to access current database

Issue #703 resolved
Jim Rea repo owner created an issue

Suppose you have a database with fields A and B. You would expect that this code:

field B
formulafill grabdata("","A")

would be the same as:

field B
formulafill A

but it isn't -- the first procedure will always grab the value of A on the current record, not the record being scanned by the formulafill.

I think this is a general problem with grabdata( and scanning -- this also doesn't work even if "some value" actually occurs in field A.

select grabdata("","A")="some value"

Yep, here is the line that is causing the problem:

NSInteger currentRecord = [lookupDatabase currentRecord];

This is not adjusted by scanning operations.

This was reported by Dave Thompson in this post:

Comments (5)

  1. Jim Rea reporter

    The grabdata( function now works correctly in database scanning statements like formulafill and select, even when accessing a field in the current database. Fixes issue #703.

    → <<cset 9dbee5fa5c39>>

  2. Jim Rea reporter
    • changed status to open

    Yes, there appears to be an ongoing problem. John Bovenmyer emailed me a file over the weekend that demonstrates the ongoing problem, I'm already working on it.

  3. Jim Rea reporter

    A formulafill that uses a superlookup( with a grabdata( function back into the original database now works correctly. Note that this fix only applies to formulafill -- other scanning operations like select, find, etc. still do not work with this combination, and will be a bit tricky to fix. Fixes issue #703 (again).

    → <<cset a5cdbb18da49>>

  4. Log in to comment