Bob, the problem is with passing the *address* of the structure
MyCOORD to an API procedure. When referencing an instance of a class,
such as MyCOORD, the word that follows *must* be a class word or SWOOP
operator. The SWOOP word ADDR is useful to retrieve the address of an
instance: MyCOORD ADDR leaves the address of MyCOORD on the stack.
This requirement, I believe, has to do with vocabularies among other
things (Rick?). The old CLASS mechanism was a little more tolerant.
Hope this makes sense!
Mike
\ *****************************************************
: INVOKE(C) ( -- )
FreeConsole DROP
AllocConsole DROP
-11 ( STD_OUTPUT_HANDLE) GetStdHandle OUTH !
-10 ( STD_INPUT_HANDLE) GetStdHandle INH !
INH @ 0 SetConsoleMode DROP
OUTH @
BACKGROUND_RED BACKGROUND_GREEN OR BACKGROUND_BLUE OR
BACKGROUND_INTENSITY OR
40 1000 *
\ old 0 MyCOORD COORD_X W! 0 MyCOORD COORD_Y W! MyCOORD drop 0
( new ) 0 MyCOORD COORD_X W! 0 MyCOORD COORD_Y W! MyCOORD ADDR
<<<NEW )
drop ( huh? dropping address? ) 0
( end new )
Attribs
FillConsoleOutputAttribute drop \ Rick, this is the line that
dies.
Z" WebCalendar FTP Transfer" SetConsoleTitle drop
\ old OUTH @ 40 MyCOORD COORD_Y ! 1000 MyCOORD COORD_Y ! MyCOORD
( new ) OUTH @ 40 MyCOORD COORD_Y ! 1000 MyCOORD COORD_Y ! MyCOORD
ADDR ( <<<NEW )
( end new )
SetConsoleScreenBufferSize DROP
OUTH @ ENABLE_PROCESSED_OUTPUT SetConsoleMode DROP
;
----- Original Message -----
From: "Robert Dickow" <dickow_at_uidaho.edu>
To: <sftalk_at_forth.com>
Sent: Wednesday, March 28, 2001 5:20 AM
Subject: [sftalk] Re: Fw: 2.00.3 code fails in 2.2.2
>
> \ Rick, here is my problem code:
> \ ********************************
> \ line 1 - Slightly modified DosBox.f file, Bob Dickow.
> \ This worked under 2.00.3 and earlier, but fails at line 71 under
2.2.2
>
>
====================================================================
> (C) Copyright 1999 FORTH, Inc. www.forth.com
>
> Simple dosbox
>
==================================================================== }
>
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/sftalk -- check them out!
Received on Wed Mar 28 2001 - 08:19:17 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 08-Feb-2012. Archive updated nightly.