Tom, thanks for the suggestion. The 'addr' operator does seems to clear up
the compile problem.
I note, however, that the documentation (reference manual section 10.1.2)
seems to be pretty explicit that referencing the object instance to get its
address, without requiring a method, is valid usage, as in:
POINT BUILDS ORIGIN
ORIGIN 2 CELLS DUMP
-----Original Message-----
From: SF Talk [mailto:sftalk_at_forth.com]
Sent: Friday, November 19, 1999 6:46 PM
To: SF Talk
Subject: Re: [sftalk] Not a value
Date: Fri, 19 Nov 1999 16:26:47 -0700
From: "Tom Dixon" <tom_at_kinshipcom.com>
Subject: Re: [sftalk] Not a value
Whenever you execute and an object, it always needs to have some sort of
method following it. In your example, the interpreter cannot find the
method "Beginpaint" for ps. It can be fixed by putting the method "addr"
after.
: PAINT2 ( - )
HWND ps addr BeginPaint TO hDC
HWND ps addr EndPaint DROP 0 TO hDC ;
> On my system (2.00.1), compiling the fragment below gives the following
> error:
>
> INCLUDE C:\Tmp\test.f Not a value ?
> HWND ps BeginPaint TO hDC
> At line 20 in C:\Tmp\test.f
>
> Not a value ?
>
> The only difference between PAINT1 and PAINT2 is the address passed to
> BeginPaint. In PAINT1, it is calculated by PAD; in PAINT2, it is the
> address of a structure. Why does PAINT2 fail to compile?
>
> ------------------------------------------
>
> 0 VALUE hDC
>
> CLASS PAINTSTRUCT
> VARIABLE Hdc
> CVARIABLE Erase
> RECT BUILDS Paint
> CVARIABLE Restore
> CVARIABLE IncUpdate
> 32 BUFFER: Reserved
> END-CLASS
>
> PAINTSTRUCT BUILDS ps
>
> : PAINT1 ( - )
> HWND PAD BeginPaint TO hDC
> HWND PAD EndPaint DROP 0 TO hDC ;
>
> : PAINT2 ( - )
> HWND ps BeginPaint TO hDC
> HWND ps EndPaint DROP 0 TO hDC ;
>
> ------------------------------------------
.
Received on Fri Nov 19 1999 - 16:26:47 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 09-Feb-2012. Archive updated nightly.