[futurebasic] Re: [FB] PG pg3t text changer FN

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

From: David <David.Cottrell@...>
Date: Mon, 22 Feb 1999 11:11:33 +1100
At 08:50 PM 2/19/99 +1100, Chris wrote:

>This function takes text in an editfield & stores it in the appropriate
pG3t resource,
>if you tweak this function you should be able to change the pG3t recource
before
>opening the window where the editfield is by passing your text to the
eFHndl& & not
>getting what is already in the editfield.
>
>LOCAL FN ChangeEFText(ObjectRef)                  'Change text in EField
>  EDIT FIELD ObjectRef                            'Activate EField
>  theObj = FN pGgetRef(gWhichClass,ObjectRef)     'Get pG3c data on EField
>  GET FIELD eFHndl&,ObjectRef                     'Get handle to text &
style data for
>EField
>  LONG IF eFHndl&                                 'Check handle exists
>    FN pGreplaceRes(eFHndl&,_"pG3t",gObjResID,"")'Replace matching pG3t
rescorce
>    KILL FIELD eFHndl&                            'Kill handle to EField
text & style
>  END IF
>END FN

This is close to what I have as well (I bet all PG users have a set of
functions for manipulating PG's saved resources). The problem I have is
that I don't have an edit field handle to start with (or even a handle to
text). How do I take a string (eg. theString$ = "The file you want to save
to is: DataFile") and build a "fake" edit field handle?

If I only had one option, I could save the text in an edit field in PG.
Make a copy of the pg3t resource, duplicate that, go back to PG, put the
other option in the field, save it, duplicate that, and then switch between
the two duplicated resources any time I want. - Simple eh?