I've read a lot of threads regarding comparing records using @RECORD
and OREC (btw-is OREC a global or common insert variable??) and have
put some of the coding and comments together and need some advice.
I will have a commuter mod/promoted mod that for a READ event
on a form…
Forward_Event()
record=Get_Property(@window,"RECORD")
Set_Property(@window,"@ORIG_RECORD")
then for a SAVE event for a form….
Call TRANSACTION_LOGGER()
*
Subroutine Transaction_Logger(void)
*
* Clean edittable values
*
Ctrls=Get_Property(@Window,CtrlMap$)
CtrlCnt=Count(Ctrls,@fm) + (Ctrls # Null$)
For CtrlPntr=1 to CtrlCnt
Type=Get_Property(@Window:".":Ctrls,Type$)If Type=EDITTABLE" THENLines=Get_Property(@Window:".":Ctrls,"ARRAY")Count=Count(Lines,@VM)+(Lines # "")Fknt=Count(Lines,@FM)+1LoopUntil Count=0 or Len(Lines)Count-=1Repeat
Trim blanks outFor I=1 to FkntLines[i]=Field(Lines[i],@VM,1,Count)Next ISet_Property(@Window:".":Ctrls,"ARRAY",Lines)
EndNext CtrlPntr
* Get the orig and "now" record values
Record=Get_Property(@Window,"RECORD")
Orig_record=Get_Property(@Window,"@ORIG_RECORD")
…
Now do the comparing and update my transaction file.
1) am I way off base here?
2) do I need the code in the read or does OI handle the @ORIG_RECORD?
3) how do I get find out what the datafile is for a bound form?
Thanks for any response.
BC
Bruce:
look at the help for orig_xxx, see if that gives you what you want.
To get the bound table, look at the TABLE property of one of the controls (assuming single table form)
Hope this helps.
Bob
Bruce,
Here's a suggestion by Carl Pates for how to find the bound table: . This method is more general since you don't have to know the name of a bound control, or search through controls to find a bound one. Note: Read the next posting too, since Carl's posting contained a small mistake.
- Oystein -