Richard,
Let me try to add some details to Mac's advice:
1. Are you changing a field in the index currently being used by the tCursor, either one of the key fields or a field in the current secondary index? If so, that's why you're not see updates in all your records.
When you update a field that's paret of the current index, the record "flies" to the new location when it's posted. Thus, the record pointer used by the scan loop no longer points to the same location in the table.
If this is what's happening, then you need to replace your scan loop with a loop that tests for the end of record condition, e.g:
Code:
while not tc.eot()
tc.KeyField = atNewValue
tc.next()
endWhile
2. If you aren't modifying a field that's part of the selected index, then you are (as Mac alluded) probably violating some integrity constraint. For example, you might be:
-- Duplicating a value that has a Unique index assiciated with it.
-- Trying to use a value that's below the Min valcheck or above the Max valcheck.
-- Trying to change the field to a value that's not in a lookup table defined with the table.
-- Running into some other integrity contraint declared in the table's structure.
However, I must disagree with Mac about the utility of formally posting changes, for that's the only way to test for this condition and determine what the exact problem is.
In my experience, I have found it helpful to be as explicit with Paradox as possible (and I'm not talking about the language all programmers speak: profanity).
Instead, I'm suggesting that Paradox and ObjectPAL try to be very forgiving environments for the novice and "helpfully" understand situations where you've not been as careful as you might be.
When this happens, you periodically get results that aren't precisely what you expected. These typically take a long time to troubleshoot and, when you've finally nailed the problem, you're often frustrated by what seems to be a silly response by Paradox/ObjectPAL.
In truth, the only way to get exactly what you want out of ObjectPAL is to be as clear as possible in your code. That is, instead of coding: action( dataPostRecord ), you should write point that action to a certain object, e.g. active.action( DataPostRecord ).
Now, I can't really go into all the relevant details at the moment, but this actually applies to the possible scenario I outlined earlier.
To determine if you are accidentally violating an integrity constraint, you need to:
1. Open the form in a Design window.
2. If you do not see the Program menu on the main menu, choose Tools | Settings | Developer Preferences, place a checkmark in the Show Developer menus checkbox on the General tab, and then choose OK.
3. From the Program menu, place checkmarks next to the Program | Compiler Warnings and Program | Compile with Debug settings. (This tells Paradox to provide more detailed information for errors and this extra information can frequently lead you to the source of the problem that generated the error.)
4. Near the start of your code, add the following line:
Code:
errorTrapOnWarnings( Yes )
This tells Paradox to treat all errors the same. The frequently helps you find the actual line of code that failed, instead of the line of code that was confused by the failure.
5. Save and run your code.
Also, keep in mind that Paradox's error dialogs often provide additional details, but only when you click the [>>] button. When enabled, this button displays more specific information about the error. These details frequently explain the specific problem.
In any event, you need to review your code and see if you're changing a field that's part of the current index. That should help you determine your next steps.
Hope this helps...
-- Lance