Read a recent listing from Don Bakke suggesting the saving of @Record to a user-defined property in the form on the Read event. During the Write event, the user-defined property can be access to get ORec and the Record property to get a current @Record.Method worked fine except for the edit tables. My form is stuffing empty rows into the end of my edit tables. Even though no data has been changed from ORec to @Record, the Write event sees them as being different because of the extraneous @VM's.Is there a method, short of stripping the @VM's myself, to get rid of the excess baggage?
Dan..
OI has a nasty habit of populating dbtables with null MV entries to the extent of the size of the array on the form. This has caused mo no end of grief in the past. I do something like this:
*
* CLEAN UP ANY BLANK LINES IN TABLES
*
LINES=GET_PROPERTY(@WINDOW:".DBTABLE_1","ARRAY") ;* SKILLS
COUNT=COUNT(LINES,@VM)+(LINES # "")
FKNT=COUNT(LINES,@FM)+1
LOOP
UNTIL COUNT=0 OR LEN(LINES)COUNT-=1REPEAT
* TRIM BLANKS OUT
FOR I=1 TO FKNT
LINES[i]=FIELD(LINES[i],@VM,1,COUNT)NEXT I
SET_PROPERTY(@WINDOW:".DBTABLE_1","ARRAY",LINES)
…
Hope this helps
Don Miller
C3 Inc.
To add to this briefly ..
In the write event,
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" THEN... do don's stuffEndNext CtrlPntr
This way you don't have to hard code what controls you will process ..
dsig@teleport.com onmouseover=window.status=imagine … a world where ceos dont have hissy-fits with your clients;return(true)"
David Tod Sigafoos ~ SigSolutions
voice: 503-639-8080
To further DSig's suggestion, put all of this in a promoted WRITE event and you have one solution for all forms.
Don:
What is a promoted Write event? Is it like a pre-write or a write-replace in ARev?Thanks.
Dan,
A promoted event (i called it global .. probably why I can't play with the other kids
is routine which you place in the event chain … hummm not quite right.
Anyway .. say you have a section of code that you want to always happen without having to put the source in each screen. An example would be my got/lost focus events or Don's Write event. This way when ever you create a screen the event will work for you automatically.
You can make them application specific or form specific etc.
There are some great threads on doing this so do a search on 'promoted' and see what comes up. I think that cameron wrote a great answer sometime last year .. or maybe it was donB ..
Anyway do a search and if you can't find anything repost and someone will reply
dsig@teleport.com onmouseover=window.status=imagine … ;return(true)"
David Tod Sigafoos ~ SigSolutions
Cell: 503-341-2983
dsig@teleport.com
Actually I was just being lazy so I jumped out there and found
this promote reference There are a lot more … just do a search on 'promote'.
dsig@teleport.com onmouseover=window.status=imagine … ;return(true)"
David Tod Sigafoos ~ SigSolutions
Cell: 503-341-2983
dsig@teleport.com