string emp_id
blob emp_pic //設定Blob變數
emp_id = '123'
Selectblob pic into :emp_pic from emp where id=:emp_id; //選取Blob的資料
//將Blob資料指定給ole_1的objectdata
ole_1.objectdata = emp_pic
Activate | Just before the window becomes active |
Clicked | User clicks in an unoccupied area of the window (any area with no visible, enabled control) |
Close | When window is closed. |
CloseQuery | When you remove a window from display (close it) |
Deactivate | When window becomes inactive. |
DoubleClicked | When user double-clicks in an unoccupied area of the window (any area with no visible, enabled object). |
DragDrop | When a dragged control is dropped on the window. |
DragEnter | Dragged control enters the window. |
DragLeave | Dragged control leaves the window. |
DragWithin | Dragged control is within the window. |
Hide | Just before the window is hidden. |
HotLinkAlarm | After a DDE server app has sent (changed) data and the client DDE application has received it. |
Key | When user presses a key and the insertion point is not in RichTextEdit or DataWindow edit control. |
MouseDown | When the user presses the left mouse button in an unoccupied area of the window (any area with no visible,enabled object). |
MouseMove | When the pointer is moved within the window. |
MouseUp | When user releases the left mouse button in an unoccupied window area (any area with no visible, enabled object). |
Open | When a script executes the Open function for a window. |
Other | When a Windows message occurs that is not a PowerBuilder event. |
RButtonDown | When right mouse button is pressed in an unoccupied window area (any area with no visible, enabled object). |
RemoteExec | When a DDE client application has sent a command.See the platform note at the beginning of this section |
RemoteHotLinkStart | When a DDE client application wants to start a hot link. |
RemoteHotLinkStop | When a DDE client application wants to end a hot link. |
RemoteRequest | When a DDE client application requests data. |
RemoteSend | When a DDE client application has sent data.S |
Resize | When the user or a script opens or resizes a window. |
Show | When a script executes the Show function for this window. The event occurs just before the window is displayed. |
SystemKey | When the insertion point is not in a line edit and the user presses ALT or ALT + another key |
Timer | When a specified number of seconds elapses after the Timer function has been called. |
ToolbarMoved | In an MDI frame window, when the user moves the FrameBar or SheetBar |
Put this function in an ancestor window:
Function: wf_center()
int iScreenHt, iScreenWid
environment le_env
// Get screen size from environment
GetEnvironment( le_env )
iScreenHt = PixelsToUnits( le_env.ScreenHeight, YPixelsToUnits! )
iScreenWid = PixelsToUnits( le_env.ScreenWidth, XPixelsToUnits! )
// Centre me!
this.Move( ( iScreenWid - this.Width ) / 2, ( iScreenHt - this.Height ) / 2 )
Structure: str_wsadata
unsignedinteger version
unsignedinteger highversion
character description[257]
character systemstatus[129]
nsignedinteger maxsockets
unsignedinteger maxupddg
string vendorinfo
External function declarations:
function int WSAStartup (uint UIVerionrequested, ref str_wsadata lpWSAdata)library "wsock32.DLL"
function int WSACleanup() library "wsock32.DLL"
function int WSAGetLastError() library "wsock32.DLL"
function int gethostname(ref string name, int namelen) library "wsock32.DLL"
function string GetHost(string lpszhost,ref blob lpszaddress) library "pbws32.dll"
PowerScript code:
String ls_ipaddress, ls_hostname
Blob{4} lb_hostadress
Integer li_version, li_rc
str_wsadata lstr_wsadata
ls_hostname = Space(128)
li_version = 257
If WSAStartup(li_version, lstr_wsadata) = 0 Then
If GetHostName(ls_hostname, Len(ls_hostname)) <>
li_rc = WSAGetLastError()
Else
GetHost(ls_hostname, lb_hostadress)
ls_ipaddress = String(Asc(String(BlobMid(lb_hostadress, 1, 1)))) + "."
ls_ipaddress += String(Asc(String(BlobMid(lb_hostadress, 2, 1)))) + "."
ls_ipaddress += String(Asc(String(BlobMid(lb_hostadress, 3, 1)))) + "."
ls_ipaddress += String(Asc(String(BlobMid(lb_hostadress, 4, 1))))
li_rc = 0
End If
Else
li_rc = WSAGetLastError()
End If
WSACleanup()