You guys gave me a procedure that I've used for the last 10+ years (and it
has worked well). The procedure calls a program WITH a string that sends
1-command to a [PC to IRlinc] on a com port.

 

In my new case I'm turning the volume of my stereo up or down toward a
predetermined target number (+.5 or -.5 each flash). Occasionally, this
procedure fails and throws up a window-box declaring the error. I just want
to execute it and return true or false. I'll let the calling loop count 3
falses and then abort the loop. Sometimes if I'm printing or if something
unknown running in the background, it slows everything down and I get a
screen full of window boxes. Following I listed the procedure. I commented
out the windowbox but am I on the right track?  Also, how do I capture the
true or false?

 

I call the procedure with 

 

DO c:\alldat2\programs\CALLRemote WITH 'c:\alldat\irctrl\amp-volup.ir'

REPLACE mediaindex.volume WITH mediaindex.volume -0.5

 

PROCEDURE CallRemote(cString)

* Start of Code

LOCAL nSuccess

DECLARE Integer Sleep IN "KERNEL32.DLL" Integer

DECLARE INTEGER ShellExecute IN SHELL32.DLL INTEGER nWinHandle,;

    STRING cOperation, STRING cFileName, STRING cParameters,;

    STRING cDirectory,INTEGER nShowWindow

cOperation = "OPEN"   && For us we always want to open it.

cFilename = "C:\Program Files (x86)\irlinc\irlinc.exe"

cParameters = cString && example "C:\dat\irctrl\amponoff.ir"  

cWorkDir = "c:\alldat2\irctrl\"

nShowWindow = 1  && Normal Window

Sleep(500)

nSuccess =
ShellExecute(0,cOperation,cFilename,cParameters,cWorkDir,nShowWindow) 

Sleep(500)

* A value less than 32 means that there was an error.

IF (nSuccess < 32) THEN

   RETURN .F.  &&   * MESSAGEBOX("Unable To Execute Command")

ELSE

   RETURN .T.   

ENDIF

* End Of Code

ENDPROC

 

Gary Jeurink



--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/025AE90A6746433CBF1ED357724ED0C5@OwnerPC
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to