Hi Roger,
I finally updated my eXpress from version 240 to 254 (I know, I am a bad boy...). There is one quite major issue with the 'Added automatic record-locking when creating a DCGET that is aliased into a database' feature which was added. Problem is, that all my edit screens (and I am talking about hundreds and hundreds of them) are using the following syntax (simplified):
LOCAL aFields := {}
IF ( cAlias )->( LOCKREC() )
aFields := ( cAlias )->( SCATTER() )
...
@ nRow, nCol XDCGET aFields[ ( cAlias )->( FIELDPOS( "FIELDNAME" ) ) ]
...
( cAlias )->( UNLOCKREC() )
ENDIF
Well, as you can see, the DCGET line has the file alias, but not in the form you expect it in your program, e.g. ( cAlias )->FIELDNAME - and this now triggers the error on each field.
Roger, would it be possible to add a GET-SET function to _dcgetbx.prg, so I do not have to remember to change this program each time I get the future eXpress update? Function can default to .T. (perform auto-lock), so no other user will be affected.
Below is my suggested GETSETFUNCTION and 4 spots (2 functions) in the _dcgetbx.prg you have to adjust:
_dcgetbx.prg
GETSETFUNCTION DC_AutoLockEditedRecord DEFAULT .T.
in FUNCTION DC_GetAnchorCB()
around line 6963
CASE DC_AutoLockEditedRecord() .AND. ;
'->' $ cVarName .AND. !Upper(Left(cVarName,3)) == 'M->' .AND. ;
!Upper(Left(cVarName,8)) == 'MEMVAR->' .AND. ;
!Upper(Left(cVarName,7)) == 'FIELD->'
...
in FUNCTION DC_GetValidate()
around line 8267
IF lLocked := DC_AutoLockEditedRecord() .AND. ;
(oXbp:isDerivedFrom('DC_XbpGet') .AND. !Empty(oXbp:dataAlias) .AND. ;
!((oXbp:dataAlias)->(RecNo()) $ (oXbp:dataAlias)->(dbRLockList())))
(oXbp:dataAlias)->(dbRLock())
ENDIF
around line 8371
IF lLocked := DC_AutoLockEditedRecord() .AND. ;
(oXbp:isDerivedFrom('DC_XbpGet') .AND. !Empty(oXbp:dataAlias) .AND. ;
!((oXbp:dataAlias)->(RecNo()) $ (oXbp:dataAlias)->(dbRLockList())))
(oXbp:dataAlias)->(dbRLock())
ENDIF
around line 8381
IF lLocked := DC_AutoLockEditedRecord() .AND. ;
(oXbp:isDerivedFrom('DC_XbpGet') .AND. !Empty(oXbp:dataAlias) .AND. ;
!((oXbp:dataAlias)->(RecNo()) $ (oXbp:dataAlias)->(dbRLockList())))
(oXbp:dataAlias)->(dbRLock())
ENDIF
Automatic record locking for aliased DCGETs
Re: Automatic record locking for aliased DCGETs
You asked for this just at the right time.
I plan to release build 255 when I get back to my office (about Feb 1).
The Get-Set function is something I will add for you.
For now, (build 254) this is what you need to do:
1. Make the following change to the file \exp19\source\dclipx\_DCGETBX.PRG:
Was:
Is:
2. Rebuild DCLIPX.DLL by running BUILD19.BAT or BUILD19_SL1.BAT.
I plan to release build 255 when I get back to my office (about Feb 1).
The Get-Set function is something I will add for you.
For now, (build 254) this is what you need to do:
1. Make the following change to the file \exp19\source\dclipx\_DCGETBX.PRG:
Was:
Code: Select all
CASE '->' $ cVarName .AND. !Upper(Left(cVarName,3)) == 'M->' .AND. ;
!Upper(Left(cVarName,8)) == 'MEMVAR->' .AND. ;
!Upper(Left(cVarName,7)) == 'FIELD->'
Code: Select all
CASE '->' $ cVarName .AND. !Upper(Left(cVarName,3)) == 'M->' .AND. ;
!Upper(Left(cVarName,8)) == 'MEMVAR->' .AND. ;
!Upper(Left(cVarName,7)) == 'FIELD->' .AND. .f.
The eXpress train is coming - and it has more cars.
Re: Automatic record locking for aliased DCGETs
Thanks Roger, I appreciate it. I already ‘pre’adjusted the _dcgetbx.prg as per my suggested example above and it works perfectly.