compile this little sample and try in two differents pc connected in a lan.
Please choice a record in the first PC and in the same record in the second PC.
In the first click Edit, You enter in a second dialog containing two get objects.
Modify the second get (oLast & cLast)
Click in save button
Immediatly in the other PC click Edit button
You do not find the modified values but the old values and yet I initialize the two variables in ths way
cLast := customer->last
cFirst := customer->first
Is not misleading?
Marco
- Code: Select all Expand view RUN
- #include "fivewin.ch"
FUNCTION LISTVIEW()
LOCAL oDlg
LOCAL oBrw
LOCAL oEdita
SET DELETED ON
SET EXCLUSIVE OFF
USE customer
INDEX ON field->first TAG first TO myindex
USE
SELECT 0
USE customer
SET INDEX TO myindex
DEFINE DIALOG oDlg FROM 10 , 10 TO 500 , 500 PIXEL
@ 50 , 1 LISTBOX oBrw FIELDS OF oDlg SIZE 200 , 200 PIXEL
@ 1 , 1 BUTTON oEdita PROMPT "Edit" ACTION formview()
ACTIVATE DIALOG oDlg CENTER
RETURN NIL
FUNCTION FORMVIEW()
LOCAL oDlg
LOCAL oLast , cLast
LOCAL oFirst , cFirst
LOCAL oSave
cLast := customer->last
cFirst := customer->first
DEFINE DIALOG oDlg FROM 10 , 10 TO 300 , 300 PIXEL
@ 1 , 1 GET oFirst VAR cFirst OF oDlg
@ 2 , 1 GET oLast VAR cLast OF oDlg
@ 5 , 4 BUTTON oSave PROMPT "Save" ACTION ( salva( cLast , cFirst ) , oDlg:end() )
ACTIVATE DIALOG oDlg CENTER
RETURN NIL
FUNCTION SALVA( cLast , cFirst )
IF rlock()
REPLACE customer->first WITH cFirst , ;
customer->last WITH cLast
dbcommit()
ENDIF
RETURN NIL