DEFINE CLASS TCPClient AS CUSTOM cServer = LOWER( LEFT( SYS(0), AT( "#", SYS(0) ) - 1 ) ) && Local machine name nRemPort = 1001 && Default port to use oConnect = NULL FUNCTION Init( tcServer, tnRemPort ) LOCAL lcServer, lnRemPort WITH This *** Default to local machine name if nothing specified .cServer = IIF( EMPTY( tcServer ), .cServer, tcServer ) *** Remote Port ID defaults to 1001 .nRemPort = IIF( EMPTY( tnRemPort ), .nRemPort, tnRemPort ) *** Create the Connection object .oConnect = CREATEOBJECT( "MSWinsock.WinSock" ) ENDWITH ENDFUNC ENDDEFINE