programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Ping

From: <wblake_at_emsys.net>
Date: Mon, 22 Mar 2004 09:20:04 -0500

Can SwiftForth invoke the Windows scripting host?

If so, I would suggest using the Windows Scripting Host to invoke ping fro=
m
Forth using the scripting host's wshell=2Erun method=2E I have done this f=
rom
Visual Basic via the Windows Scripting Host OCX control WSHom=2Eocx in the=

windows/system32 directory=2E

In VB the key is to use a synchronous shell mechanism so that the code can=

examine the results after completion of the shell command=2E The VB "shell=
"
command runs asynchronously and requires some gymnastics to determine its
completion while the wscript run method waits for completion of the shell
command=2E

Here is a VB fragment=2E

Dim sAppToRun=20
sAppToRun =3D "ping machinename > outputfile=2Etxt"
set wshell =3D CreateObject("wscript=2Eshell")=20
'says to run synchronously,=20
wshell=2Erun sAppToRun,,1=20
set wshell=3Dnothing=20

-Wil Blake

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web=2Ecom/ =2E

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Mon Mar 22 2004 - 06:21:05 PST

This archive was generated by hypermail 2.2.0 : Wed Jan 07 2009 - 03:04:12 PST