{$R-,S+,I+,D+,F-,V+,B-,N-,L+ }
{$M 8000,0,0 }
Program Nsamp8;   {Run Prototyper}

uses dos,tplus;


(*  This program demonstrates how the Nostradamus ProtoTyper can be run
    from within any program using the Turbo Pascal EXEC procedure.

    This sample program executes the the ProtoTyper (PROTO.COM) and tries
    to activate YOURHLP.PTO. You must build the sample prototype YOURHLP.PTO
    with the prototyper before this sample will do anything useful.
    See Chapter 4 for info on building prototypes
*)

var

  proto:string65;
  tphelp:string65;

PROCEDURE TURBOSPAWN(path,cmdline:string);
begin
  exec(path,cmdline);
  if doserror <> 0 then
  begin
    clearscnhome;
    write('DOS error ',doserror,' while running ProtoTyper');
  end;
end;

begin
  setcolorsn(7,0);
  clearscnhome;
  proto:=findpath('PROTO.COM');
  if proto = '' then
  begin
    clearscnhome;
    fastwrite('Unable to locate Proto.com',15,3,1);
    halt;
  end;
  if FileExists('YOURHLP.PTO') = false then
  begin
    clearscnhome;
    fastwrite('You need to build a prototype for this sample',15,3,1);
    halt;
  end;
  proto:=proto+'PROTO.COM';
  tphelp:='YOURHLP.PTO [RS]';
  turbospawn(proto,tphelp);
end.
