[futurebasic] Re: [FB] Font not changing

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 2005 : Group Archive : Group : All Groups

From: Joe Smith <jsmithxx@...>
Date: Wed, 24 Aug 2005 21:44:15 -0400
Your code is poorly organized...it seems that all the FN's can be combined
into a single FN. Regardless, if you set up a small segament of code to test
what you are trying to do, sufficient error messages will be generated to
enable you to track your error. Use variables that describe what they
are..for example...f% should be something like fontNo. I've restructured
some of yours code and introduced global variables because I didn't know
where some of these values were coming from.  This works:
// Globals
dim f%, s%, ss%
dim save
dim restOfInstr
dim restofInstr$

// Functions
Local Fn AssignPgmValuesToGlobals
Save = 1     ' Window ID
restOfInstr = _monaco
s%   = 12' font size
ss%  = _boldBit' font face
restofInstr$ = "I dont know"
End Fn


LOCAL FN cmdFont 
// Must not use a name that was already defined
f% = restOfInstr
END FN

LOCAL FN cmdPRINT
WINDOW save
FN cmdFont
TEXT f%,s%,ss%
PRINT restofInstr$

END FN

LOCAL FN cmdWIN 
save = restofInstr
WINDOW save
Fn cmdFont
TEXT f%

END FN

Fn AssignPgmValuesToGlobals
FN cmdWIN 'sets save & font
FN cmdPRINT 'sets up window name & display

// Event handler

do
handleevents
until mouse(_down)


If you are not going to use global variables, make sure that the variables
(xxxx)  in your function calls (FN doSomethin(xxxx) are not the same as
those you use elsewhere...become confusing to you & the complier.

Hope this helps

Joe 

=============================================

 

> Why isn't the font changing in the output window
> 
> LOCAL FN cmdFont (restofInstr)
> f% = restOfInstr
> END FN
> 
> LOCAL FN cmdPRINT (restofInstr$)
> WINDOW save
> FN cmdFont (f%)
> TEXT f%,s%,ss%
> PRINT restofInstr$
> 
> END FN
> 
> LOCAL FN cmdWIN (restOfInstr)
> save = restofInstr
> WINDOW save
> Fn cmdFont (restOfInstr)
> TEXT f%
> 
> END FN
> 
> --
>