For each ESL object that is a source object, write an on drag response that calls the drag action statement with the proper dragtype, dragdata, and the correct icon filename.
response to CustomerList_LB
on drag
# ycoord returns the line which the mouse
# was over when the ’on drag’ response
# was triggered
copy (textual line (ycoord) from CustomerList_LB)
to CustomerName_SV
call GetCustomerID( CustomerName_SV, CustomerID_IV )
drag CustomerID_IV type "Customer"
using icon "customer.ico"
The drag action statement should be the last action statement executed in the on drag response. If there are other action statements following the drag action statement, the drag will not actually begin until those actions have been executed.
Although a string literal is used for the dragtype string in the previous example, you would probably want to use a string constant in a larger application: for example:
string constant CustomerDragType_SC is "Customer"
This constant can then be used in both the drag action statement and in the corresponding on dragover and on drop responses.