Listing 1: Modifying sample Department table

ALTER TABLE "dba"."department" ADD ( "dept_text" varchar(4000) NULL DEFAULT NULL ) ;

UPDATE department
SET dept_text = 'When in the Course of human events, it becomes necessary for one people to
dissolve the political bands which have connected them with another, and to assume among the
powers of the earth, the separate and equal station to which the Laws of Nature and of
Nature's God entitle them, a decent respect to the opinions of mankind requires that they
should declare the causes which impel them to the separation.'
WHERE dept_id = 100 ;

UPDATE department
SET dept_text = 'We hold these truths to be self-evident, that all men are created equal, that
they are endowed by their Creator with certain unalienable Rights, that among these are Life,
Liberty and the pursuit of Happiness.   That to secure these rights, Governments are
instituted among Men, deriving their just powers from the consent of the governed, --That
whenever any Form of Government becomes destructive of these ends, it is the Right of the
People to alter or to abolish it, and to institute new Government, laying its foundation
on such principles and organizing its powers in such form, as to them shall seem most
likely to effect their Safety and Happiness.'
WHERE dept_id = 200 ;

UPDATE department
SET dept_text = 'Prudence, indeed, will dictate that Governments long established should not be
changed for light and transient causes; and accordingly all experience hath shewn, that
mankind are more disposed to suffer, while evils are sufferable, than to right themselves by
abolishing the forms to which they are accustomed. But when a long train of abuses and
usurpations, pursuing invariably the same Object evinces a design to reduce them under
absolute Despotism, it is their right, it is their duty, to throw off such Government, and
to provide new Guards for their future security. Such has been the patient sufferance of
these Colonies; and such is now the necessity which constrains them to alter their
former Systems of Government. The history of the present King of Great Britain is a
history of repeated injuries and usurpations, all having in direct object the
establishment of an absolute Tyranny over these States. To prove this, let Facts be
submitted to a candid world.'
WHERE dept_id = 300 ;

UPDATE department
SET dept_text = 'He has refused his Assent to Laws, the most wholesome and necessary for the
public good. He has forbidden his Governors to pass Laws of immediate and pressing importance,
unless suspended in their operation till his Assent should be obtained; and when so
suspended, he has utterly neglected to attend to them.'
WHERE dept_id = 400 ;

UPDATE department
SET dept_text = 'He has refused to pass other Laws for the accommodation of large districts of
people, unless those people would relinquish the right of Representation in the Legislature, a
right inestimable to them and formidable to tyrants only.'
WHERE dept_id = 500 ;
  

Listing 2: Local External Function Declarations

function long ChooseFont ( ref s_choosefont cf ) Library "comdlg32.dll" Alias For 
 "ChooseFontW"
subroutine copymemory ( ref s_logfont d, long s, long l ) library 'kernel32.dll' alias for
 RtlMoveMemory
subroutine copymemory ( long d, s_logfont s, long l ) library 'kernel32.dll' alias for
 RtlMoveMemory
function ulong GlobalAlloc(ulong uFlags, long dwBytes ) library 'kernel32.dll'
function ulong GlobalLock(ulong hMem ) library 'kernel32.dll'
function ulong GlobalUnlock(ulong hMem ) library 'kernel32.dll'
function ulong GlobalFree(ulong hMem ) library 'kernel32.dll'


Listing 3: LogFont Structure Definition

global type s_logfont from structure
	long		lfheight
	long		lfwidth
	long		lfescapement
	long		lforientation
	long		lfweight
	byte		lfitalic
	byte		lfunderline
	byte		lfstrikeout
	byte		lfcharset
	byte		lfoutprecision
	byte		lfclipprecision
	byte		lfquality
	byte		lfpitchandfamily
	character	lffacename[32]
end type


Listing 4: ChooseFont Structure Defintion

global type s_choosefont from structure
	long		lstructsize
	ulong		hwnd
	ulong		hdc
	long		lplogfont
	long		ipointsize
	long		flags
	long		rgbcolors
	long		lcustdata
	long		lpfnhook
	string		templatename
	ulong		hinstance
	string		lpszstyle
	integer		nfonttype
	integer		missingalignment
	long		nsizemin
	ulong		nsizelong
end type


Listing 5: ChooseFont call

constant integer CF_SCREENFONTS = 1
integer CF_INITTOLOGFONTSTRUCT = 64
integer CF_EFFECTS = 256
integer GMEM_MOVEABLE = 2

/* pointer variable to the logfont structure */
long ll_LogFont

/* needed structures */
s_choosefont 	lstr_choosefont
s_logfont 		lstr_logfont

/* we allocate a piece of memory with the size of the logfont structure */
/* and we lock it */
ll_LogFont = GlobalAlloc ( GMEM_MOVEABLE, 120 )

if ll_LogFont = 0 then
    messagebox('MemError','Unable to alloc memory')
    return -1
end if

ll_LogFont = GlobalLock ( ll_LogFont )

if ll_LogFont = 0 then
    messagebox('MemError','Unable to lock memory')
    return -1
end if


/* initialise the logfont structure */

/* default font is arial */
lstr_logfont.lffacename = 'Arial'

/* Bold */
lstr_logfont.lfweight = 700

/* copy the structure to the allocated piece in memory */
copymemory ( ll_LogFont, lstr_Logfont, 60 )

/* assign the pointer to the fontinfo in memory to the dialog font */
lstr_ChooseFont.lplogfont = ll_LogFont

/* initialise the structure further */
lstr_ChooseFont.lstructsize = 60    // size
lstr_ChooseFont.hwnd = handle(parent)
lstr_ChooseFont.flags = CF_SCREENFONTS+CF_INITTOLOGFONTSTRUCT+CF_EFFECTS

/* call the dialog */
if ChooseFont (lstr_ChooseFont) < 0 then
    /* if failed, release the used memory */
    GlobalUnlock ( ll_LogFont )
    GlobalFree ( ll_LogFont )
    messagebox('ChooseFont','Failed')
    return -1
end if

/* The memory piece now contains the selected log information */
/* Copy this information back to the structure so e can access it */
copymemory ( lstr_LogFont, lstr_ChooseFont.lplogfont, 120 )

/* release the used memory */
GlobalUnlock ( ll_LogFont )
GlobalFree ( ll_LogFont )

/* Display the choose fontname and the size */
st_1.textsize		= - ( lstr_ChooseFont.iPointSize / 10 )
st_1.weight		= lstr_LogFont.lfWeight
st_1.underline		= ( lstr_LogFont.lfUnderline > 0 )
st_1.italic		= (  lstr_LogFont.lfItalic > 0 )
st_1.facename		= lstr_LogFont.lffacename
st_1.textcolor		= lstr_ChooseFont.rgbColors


Listing 6: Imported PBNI Extension Shell

forward
global type soapconnection from nonvisualobject
end type
end forward

global type soapconnection from nonvisualobject native "pbwsclient105.pbx"
public function  string generateproxy(string wsdl, string servicename)
public function  long createinstance(ref powerobject obj, string proxyname, string portname)
public function  long createinstance(ref powerobject obj, string proxyname)
public function  long setoptions(string options)
public function  long setproxyserveroptions(string proxyoptions)
public function  long SetSoapLogFile(string Filename)
public function  long UseIntegratedWindowsAuthentication(boolean useIWA)
public function  long SetClientCertificateFile(string Filename)
public function  long SetTimeout(long Seconds)
public function  long SetBasicAuthentication(string Domain, string userID, string Password)
public function  long SetProxyServer(string hostname, long port, string userID, string
 Password)
public function  long SetProxyServer(string Address, string userID, string Password)
public function  long RemoveAuthentication()
public function  long UseConnectionCache (boolean cache)
end type
global soapconnection soapconnection

on soapconnection.create
call super::create
TriggerEvent( this, "constructor" )
end on

on soapconnection.destroy
TriggerEvent( this, "destructor" )
call super::destroy
end on