multitasking

I need for TrueBasic to control another program not written in TB.
(Gnuplot)

The problem is that CHAIN only works with TB programs.

I have a Perl script (compiled) which checks a file and if it finds something in the file, uses it as a command to the other program.

But when the first TB program writes its commands to the output file it does not surrender control so that the other program can run.

The idea is that both TB and the Perl script run continuously and when the user enters a command Perl reads and executes it to run Gnuplot.

Is this possible?

Roger

Comments

Chaining

Hi Roger,

You can chain to any executable program from TB.
Here is the code fragment from the TB editor that chains to other programs. This mode waits until you close the executable program before returning to TB.

LET nextprogram$="!" & executable$
WHEN EXCEPTION IN
CHAIN nextprogram$,RETURN
USE
! Exception handler
END WHEN

If you want to run your TB program immediately then:

LET nextprogram$="!&" & executable$
WHEN EXCEPTION IN
CHAIN nextprogram$,RETURN
USE
! Exception handler
END WHEN

If you want to run a Windows application such as WORD and load up a document file, then use the following:

LET url$="!&rundll32.exe url.dll,FileProtocolHandler "
LET nextprogram$=url$ & filename$ ! e.g. myfile.doc
WHEN EXCEPTION IN
CHAIN nextprogram$,RETURN
USE
! Exception handler
END WHEN

I hope that helps.

Big John

Thanks John, that helps a

Thanks John, that helps a lot.

I guess I'm stuck in DOS mode.

Roger13