#!/usr/local/bin/tops -p -s /usr/local/tops/sys -u /opt/mytops/usr/
#!../src/tops -s ../sys -u ../usr

{ File tops_cme1

  November 2011

  This file starts tops to run file cme1.v and collect real time data 
  written to /nfs/solano/equotes.txt by Windows machine solano.

  This file is adapted from /usr/local/tops/usr/tiny.  

  Copyright (c) 2011   D. R. Williamson
}

{ GNU General Public License

Program Tops - a stack-based computing environment
Copyright (C) 1999-2011  Dale R. Williamson

Author: Dale R. Williamson <dale.williamson@prodigy.net>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

------------------------------------------------------------------------

  File: tiny  December 2003
  Copyright (C) 2003  D. R. Williamson

  This script runs the program interactively in a minimal style, 
  like Forth.

  Use .s to display the stack.

---------------------------------------------------------------------- }

\ Starting a keyboard.

no catmsg
"key.v" "Keyboard words" msource
keyboard
keyboard_finish
ok off \ no auto stack display; .s shows the stack

\-----------------------------------------------------------------------

\ Tinyc console.

CATMSG (f) push no catmsg

inline: cprompt ( --- qS) \ the console prompt
   [ "% " "prompt" book ] prompt ;

inline: tinyc (qS --- f) \ prompter runs this word
   [ "tout chars 0> IF nl THEN" "NL" macro ]

   (qS) "bye" over = IF drop "exit" THEN (qS) \ no Good-bye

   nl (qS) main \ run text S
   NL           \ run NL macro
   yes (f)      \ keep prompter running
end

pull (f) catmsg
fence

\-----------------------------------------------------------------------

\ Words.

CATMSG (f) push no catmsg

inline: uclean_tiny ( --- ) \ uclean will run this on exit
\  Cleanup to do:

end

pull (f) catmsg

\-----------------------------------------------------------------------

\ Running tinyc with prompter().

"HOME" env chdir
clear

"cme1.v" source \ runs word START that kicks things off

"tinyc" ptr (ptrRun) \ ptr to tinyc
cprompt (qPrompt)    \ prompt to show
prompter 
exit




