myaction = inputbox("Enter C to Copy or P to Paste")
if lower(myaction) = "c"
javascript:void(0)
wait window "copying fields..." nowait
wait window "copying fields..." nowait
public mydata
mydata = createobject("empty")
addproperty(mydata,"user1",rental.user1)
addproperty(mydata,"user2",rental.user2)
addproperty(mydata,"user3",rental.user3)
addproperty(mydata,"user6",rental.user6)
addproperty(mydata,"notes1",rental.notes1)
endif
if lower(myaction) = "p"
wait window "pasting fields..." nowait
if vartype(mydata) = "o"
rescreen.isediting = .t.
gather name mydata memo
release mydata
endif
rescreen.refresh
endif
NOTES
- This script crams both the Copy and Paste actions into one button (the left click Script button) with a prompt to decide which action to take. You could also easily split this into two scripts and put the Copy action in the left click and the Paste action in the right click and drop the prompt code.
- You can revise a script like this to work with any of the ZP databases and with any number of fields.
- Note that the Paste option puts you into Edit Mode, which means you can Cancel the Edit to negate the paste.