[futurebasic] Re: [FB] Help with FB/PG PICT and TEXT resources

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 1999 : Group Archive : Group : All Groups

From: Rick Brown <rbrown@...>
Date: Sun, 30 May 1999 20:03:23 -0500

Dennis J. Fast wrote:

> Am working on the TEXT,styl  to view.
>
> NOT WORKING:
>
> textHandle = FN GETINDRESOURCE(_"TEXT",170)
> EDIT FIELD(1),&textHandle&,,,
>
> ALSO NOT WORKING:
>
> textHandle = FN GETINDRESOURCE(_"TEXT",170)
> EDIT$(1) = &textHandle&

When you assign text to an edit field using the "&handle&" syntax, FB does not
expect handle& to be the handle to a "TEXT" resource; instead, it expects
handle& to be the handle to something called a ZTXT block, which is something
else entirely.  A ZTXT block is a concept unique to FB, and it combines "TEXT"
and "styl" information together in the same data structure.  Even if there is
no "styl" information, a ZTXT block and a "TEXT" resource are formatted
differently.

Try this instead:

resID% = 170
EDIT$(1) = %resID%

When you use this syntax, FB _does_ expect resID% to indicate a "TEXT"
resource.  It will load the resource and put the text into the field.  And as
an added bonus, FB will at the same time look for a "styl" resource with the
same resID% number; if it finds one, it will apply the style information to the
new text in the field.

- Rick