// Create DDELink as property of _app object so that it persists

_app.stockDdeLink = new DdeLink( )

 

if _app.stockDdeLink.initiate("STOCKSERVER","StockHolder")

   // Subsequent program operations completed; link 

   // no longer required 

   _app.stockDdeLink.terminate( ) 

else

   // Link failed; display error 

   msgbox( "Cannot link to STOCKSERVER", "DDE Connection failed", 16 ) 

endif

 

// Later in program, DDE link object needed again

if _app.stockDdeLink.reconnect( )

   // Link OK 

else

   // Link failed; display error 

   msgbox( "Cannot link to STOCKSERVER", "DDE Connection failed", 16 ) 

endif