[futurebasic] Re: [FB] RECT in other Languages?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2001 : Group Archive : Group : All Groups

From: Geoff Perlman <geoff@...>
Date: Mon, 22 Oct 2001 10:34:00 -0500
On 10/21/01 10:45 PM, "Robert Covington" <artlythere@...> wrote:

> If anyone can supply versions of the below for C, Pascal, Java, RB or
> anything else commonly used in MacDom, that would be a help. I can then
> tailor the output for that language. Globals not necessary, but some DIM
> arrangement is I think.


In REALbasic you'd add a class to your project and call it "Rect" with left,
top, width and height properties. If you want it to be as similar as
possible to the FB code, add a SetRect method to the Rect class that looks
like this:

Sub SetRect(leftvalue as integer, topvalue as integer, widthvalue as
integer, heightvalue as integer)
  left = leftvalue
  top = topvalue
  width = widthvalue
  height = heightvalue
End Sub

Then use the following code:

DIM rect1 as RECT
DIM rect2 as RECT
DIM rect3 as RECT

SetRect(rect1, 0, 0, 200, 300)
SetRect(rect2, 20, 20, 230, 330)
SetRect(rect3, 4, 30, 210, 320)

Geoff Perlman
President & CEO
REAL Software, Inc.
Phone: 512-263-1233 x711
Fax:   512-263-1441