[BUG] in source/font.prg and a question
Posted: Wed Jun 19, 2019 9:06 am
Hello,
I'm facing this error in FWH1905:
with this test code:
I found this:
There is no ::cClassName defined.
But I'm searching for a way to save the used font as text (in DBF table) and create the object from that text:
Is there a way to do this?
Thank you in advance
Sincerely
-----------------
Additional info:
I tried the obvious like this:
but then I got this error with FWH1905
Thank you again
I'm facing this error in FWH1905:
Code: Select all
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 06/19/19, 10:53:54
Error description: Warning BASE/1004 Message not found: TFONT:CCLASSNAME
Stack Calls
===========
Called from: source\rtl\tobject.prg => TFONT:ERROR( 0 )
Called from: source\rtl\tobject.prg => TFONT:MSGNOTFOUND( 0 )
Called from: source\rtl\tobject.prg => TFONT:CCLASSNAME( 0 )
Called from: .\source\classes\FONT.PRG => TFONT:SAVETOTEXT( 473 )
Called from: _fontTests.prg => MAIN( 8 )
Code: Select all
#include "Fivewin.ch"
Function Main()
LOCAL oFont, oFile
LOCAL cFontText
oFont := TFont():New("Segoe UI Bold", 0, -10, , , .T., , , , .F., .F.)
cFontText := oFont:SaveToText(0)
? cFontText
oFile := TTxtFile():Create("_fontAsTxt.txt")
oFile:Open()
oFile:AppendLn(cFontText)
oFile:End()
RETURN nil
Code: Select all
cInfo := Space( nIndent ) + "OBJECT " + If( nIndent > 0, "::", "" ) + ;
"oFont AS " + ;
If( nIndent > 0, Upper( Left( ::ClassName(), 2 ) ) + ;
Lower( SubStr( ::ClassName(), 3 ) ), ::cClassName ) + ;
CRLF + CRLF
But I'm searching for a way to save the used font as text (in DBF table) and create the object from that text:
Code: Select all
OBJECT ::oFont AS TFont
::cFaceName = "Segoe UI Bold"
::lBold = .F.
ENDOBJECT
Thank you in advance
Sincerely
-----------------
Additional info:
I tried the obvious like this:
Code: Select all
Function Main()
LOCAL oTest
oTest := TTestFont():New()
XBrowse(oTest)
RETURN nil
CLASS TTestFont
DATA oFont
DATA cFaceName
DATA lBold
METHOD New() CONSTRUCTOR
ENDCLASS
METHOD New() CLASS TTestFont
OBJECT ::oFont AS TFont
::cFaceName = "Segoe UI Bold"
::lBold = .F.
ENDOBJECT
RETURN Self
Code: Select all
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 06/19/19, 11:22:36
Error description: Warning BASE/1005 Message not found: TFONT:_CVARNAME
Stack Calls
===========
Called from: source\rtl\tobject.prg => TFONT:ERROR( 0 )
Called from: source\rtl\tobject.prg => TFONT:MSGNOTFOUND( 0 )
Called from: source\rtl\tobject.prg => TFONT:_CVARNAME( 0 )
Called from: .\source\function\OBJECTS.PRG => SETOBJECT( 12 )
Called from: _fontTests.prg => TTESTFONT:NEW( 33 )
Called from: _fontTests.prg => MAIN( 17 )