This may be late, but you may need to make the font in quotes, and return
the name?
Haven't got Mapbasic up to check the syntax, but you know what I mean.
run command "f=makefont("+mid$(""" + StyleAttr(fnt,FONT_NAME) +
""",7,"""+len(fnt)-7)+",0)"
Rob
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Jacques
Paris
Sent: Friday, 23 February 2001 7:07 AM
To: MIL
Subject: MI-L run command
I have a string FNT representing a font clause (Font ("XXX",,,)) and I want
to generate a font variable F from it. In the MapBasic window I prepared the
following statement (I did not include the dims)
run command "f=makefont("+mid$(fnt,7,len(fnt)-7)+",0)"
print f
and it ran successfully. If I do exactly the same thing in a compiled MBX,
it tells me that I cannot use an un-initialized font variable and the print
fails.
Why does it work in one environment and not in the other?
The ,0 added at the end comes from the fact that a font clause obtained from
the FontPicker does not contain always the backcolor parameter while
MakeFont requires always its presence. Another beauty!
Jacques PARIS
e-mail (>>>19.12.00) [EMAIL PROTECTED]
For MapInfo support, see the Paris PC Consult enr. site at
http://www.total.net/~rparis/gisproducts.htm
For MapBasic questions see the J.Paris site at
http://www.total.net/~jakesp/index.htm
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.