How do I start a second program and have it run independent of the first?

48 views
Skip to first unread message

Michael Green

unread,
10:46 AM (12 hours ago) 10:46 AM
to Harbour Users
I want to start a second Harbour program from inside the first. I tried this:
proc main()
store './progname' to outstrv
! @outstrv
return

However, that doesn't work as it is. Advice please. I'm running on FreeBSD.

Alain Aupeix

unread,
2:59 PM (8 hours ago) 2:59 PM
to harbou...@googlegroups.com, Michael Green
Hum, I proceed using hb_ProcessRun() if I need to keep the output of the command,
Else, hb_run()

Example :

local cStdOut:=""
cmd="/usr/"+getenv("home")+"/bin/myprog"
// if I need the output :
hb_Process_Run(cmd,,@cStdOut)
// if I don't need the output and the program must waitthe external program
hb_Run(cmd)
// if I don't need the output and the program must not wait the external program
cmd+=" &"
hb_Run(cmd)


A+
--

Alain Aupeix
Sites web : JujuLand | Pissobi-Lacassagne | Gadel
X.ubuntu 16.04 | H.arbour 3.2.0-1 (r2025-08-22 10:00) | Hw.gui 2.23-8dev (r3792) | G.ramps 5.1.2


Reply all
Reply to author
Forward
0 new messages