Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FiveWin 1.9.2 - January 97 - // fivewin class tddemlclient demonstration http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
// FiveWin Class TDDEMLClient demonstration

#include "FiveWin.ch"

static oWnd, oClient

//----------------------------------------------------------------------------//

function Main()

   local oBar, cData

   DEFINE WINDOW oWnd TITLE "DDEML Client"

   DEFINE BUTTONBAR oBar 3D OF oWnd

   DEFINE BUTTON OF oBar ;
      ACTION  InitClient() ;
      TOOLTIP "Connect to the Server"

   DEFINE BUTTON OF oBar ;
      ACTION  RequestData() ;
      TOOLTIP "Make a Request"

   DEFINE BUTTON OF oBar ;
      ACTION  oClient:Execute( "Any command" ) ;
      TOOLTIP "Send a command"

   DEFINE BUTTON OF oBar ;
      ACTION If( oClient != nil,;
               ( oClient:End(), oClient := nil ),) ;
      TOOLTIP "Disconnect"

   SET MESSAGE OF oWnd TO "FiveWin - DDEML management" NOINSET

   ACTIVATE WINDOW oWnd

return nil

//----------------------------------------------------------------------------//

function InitClient()

   if oClient == nil

      oClient = TDDEMLClient():New()

      if oClient:NetConnect( "ANTONIO", "DdeMlSvr.exe" )
         MsgInfo( "Connection Established!" )
      else
         MsgInfo( "Cannot connect to server" )
      endif

   endif

return nil

//----------------------------------------------------------------------------//

function RequestData()

   local n

   for n = 1 to 20
      oWnd:Say( n, 2, oClient:Request( "CUSTOMER->Last" ) )
      oClient:Request( "CUSTOMER->( DbSkip() )" )
   next
   SysRefresh()

return nil

//----------------------------------------------------------------------------//

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson