SBP ' The Application ' Notes, ' This is a complete demo program ' ' It is set up to check SB30 running an App which has a particular file open ' so........ If you are not using SB30 change the product$= ' replace the masterfile$= with your own file name ' ' the demo 'application' merely opens masterfile$ in sharemode 0 and ' then a while-1 wend loop ' ÿÿmain() ÿÿifok$,masterfile$,product$ ÿ½ ................................................. ÿ½ . . ÿ½ . Replace the file in the next statement . ÿ½ . With your own file . ÿ½ . And the Product in the line after that . ÿ½ . . ÿ½ ................................................. masterfile$ÿ"TASKLOG" product$ÿ"SB30"' here used it to check SB30 - could use SB4W or SBRTS ÿ½ First check if Already running a$ÿCheckIfRunning$() ÿ’ÿ¡ ÿ¡ÿO(a$ÿ"no")ÿp ÿÂ"Quitting","This Application is already running",0 ÿ» ÿ’ÿ¡ ifok$ÿ"Yes"'set me up to reply 'yes' when asked ÿ½ set up the dde eventclass to answer DDE ÿ³ÿÿÿëÿƒDDEProc() ÿÿÿëÿ³ ÿ½ .... ÿ½ .....Demo App ÿ´ÿ™ÿà,0masterfile$ ÿØÿ1 ÿÏÿ›1 ÿÙ ÿ’ÿÿ MainErrTrap: ÿ½ main error trap ÿÂ"Error: "ÿÿ(ÿ&,"."),ÿ((ÿ&),0 ÿ’ ' Function returns the results of requesting value of ifok$ from dde server ' uses a local errortrap (but restores to main trap) ÿÿCheckIfRunning$() ÿ³ÿ_ÿwloglauncherr a$ÿ"NO"' Default value if DDE fails ÿê1 ÿè1,product$,masterfile$ ÿë1,"ifok$",a$' request the value of ifok$ from remote into a$ ÿ…ÿ& ÿê1 ÿ³ÿ_ÿwMainErrTrap' reset error trap CheckIfRunning$ÿa$ ÿ’ÿÿ loglauncherr: ÿ½ special errortrap for here ÿ¡ÿ&ÿ156ÿpÿê1:ÿyÿ± ÿ¡ÿ&ÿ157ÿpÿyÿ± ÿ’' Just in case ' SUB 'DDEProc' ' Because program is running, I must intercept commands ' eg. we must not allow a client to send 'RUN "program" ' all commands are abandoned ÿÿDDEProc(t%,command$,topic$) ÿ¡topic$ÿ""ÿp ÿ½ we got a command - in this environment abandon it ÿ^ ÿ½ a request for information used here to ask for ifok$ ÿÿ ÿ’ÿ¡ ÿ’ÿÿ ' Rest of application