programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: turnkey w/ no window

From: Mike Ghan <MikeGhan_at_logix-controls.com>
Date: Wed, 16 Mar 2005 07:19:51 -0800

I'm not familiar with z-get, but if a filename is interactively
retrieved from user input, you'll need some sort of console or window.
Here is an example console (aka DOS box):

REQUIRES DOSBOX

: ALL-DONE ( -- ) \ Proper cleanup
   'ONSYSEXIT CALLS \ Execute System Exit Chain
   0 ExitProcess ;

: GO ( -- )
   DOS-CONSOLE OPEN-PERSONALITY
   ." The command line contains" CR
   CMDLINE ARGC 0
   ?DO CMDLINE I ARGV TYPE CR
   LOOP
   CR ." Press any key to exit" KEY DROP
   ALL-DONE ;

' GO 'MAIN !

-1 THRESHOLD \ No Xref file

PROGRAM CMDLINE
BYE

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

Hope this helps,
Mike

-----Original Message-----
From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com] On Behalf
Of Anil Rodrigues
Sent: Monday, March 14, 2005 1:53 PM
To: sftalk_at_forth.com
Subject: [sftalk] turnkey w/ no window

Hello all,

After having SF sitting around for 3 years, being intimidated by=3D20
Windows, I am now dipping my toes in the water and maybe I can=3D20 get
somewhere with much hand holding. ( I program just occasionally and
current jargon is still off-putting )

To start I am trying to make a simple TURNKEY utility for customers.
I want to open a data file, format the hex data for printing,=3D20 print
and close. z-get kindly posted by Marc Hawley (1999) works =3D =
perfectly,
( modified as needed) for file selection.

The app is basically-=3D20

 : shpr z-get \ using GetOpenFileName, read to buffer
        hdr \ print header ( using ." ", SPACES, CR,
        nos \ print data ( and .R
           bye=3D20
 ;
 =3D20
 This works fine from the console to print on screen.

 Using the following lifted from printexample.f:

PRINTING +ORDER

: TEST ( -- )
   WINPRINT OPEN-PERSONALITY
   ['] shpr CATCH ( *) \ Catch the app in case of error
   CLOSE-PERSONALITY
   IF ." error running application" THEN ;

PRINTING -ORDER

TEST works fine form the console, prints a nicely formatted page.
And compiles OK using STARTER.
But the compiled program runs with a console background, and needs=3D20
TTY.DLL on the PC.

Trying to use ' TRY 'MAIN ! where TRY calls TEST, and PROGRAM PRS=3D20
gets me into all sorts of trouble; the exe doesnt do anything and doesnt
exit.
This is with a variety of DISPATACHER 0 ExitProcess or other=3D20
combinations used in examples.

Am I on the wrong track and have to have a window for a turnkey?=3D20 I
thought the trouble may be with printing, ( which may be so anyway) but
removing the printing didn't help.

Cheers! Anil
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Wed Mar 16 2005 - 07:21:56 PST

This archive was generated by hypermail 2.2.0 : Wed Jan 07 2009 - 03:04:14 PST