Wiki improvements
Re: Wiki improvements
The fb wiki to chm converter doesn't handle unicode; escaping the characters using html is a work around. I'm not sure what the reason for the column tags are, maybe that's an older work around.
%% ... %% code tags should format correctly in wiki and chm. I think this should be used instead of the column tags.
## ... ## monospace tags should also format correctly in wiki and chm.
%%(freebasic) ... %% code tags will format wrong. The syntax highlighter doesn't handle the escaped html.
The online wiki application itself handles unicode with utf-8 encoding and can be stored directly. But the fb wiki to chm converter doesn't know wstring at all, and doesn't try any conversion from utf-8. Any code examples have the filename action are only stored to plain ascii files, so unicode is not handled correctly there either.
%% ... %% code tags should format correctly in wiki and chm. I think this should be used instead of the column tags.
## ... ## monospace tags should also format correctly in wiki and chm.
%%(freebasic) ... %% code tags will format wrong. The syntax highlighter doesn't handle the escaped html.
The online wiki application itself handles unicode with utf-8 encoding and can be stored directly. But the fb wiki to chm converter doesn't know wstring at all, and doesn't try any conversion from utf-8. Any code examples have the filename action are only stored to plain ascii files, so unicode is not handled correctly there either.
Re: Wiki improvements
But that does not work already in wiki (INSTRREV page for example):coderJeff wrote:%% ... %% code tags should format correctly in wiki and chm. I think this should be used instead of the column tags.
- %%
'A Unicode example:
dim text as wstring*20
text = "Привет, мир!"
print instrrev(text,"ет") ' displays 5
%%
produces:
but not:'A Unicode example:
dim text as wstring*20
text = "Привет, мир!"
print instrrev(text,"ет") ' displays 5'A Unicode example:
dim text as wstring*20
text = "Привет, мир!"
print instrrev(text,"ет") ' displays 5
Re: Wiki improvements
Oops, I missed a step. %% tags with the html escaping only work for chm.
I think I'd like to get rid of the html escaping and look at improving the fbdoc (wiki-> chm converter). Even though fbdoc doesn't know unicode, the wiki's UTF8 should be preserved through most of the string manipulations. Probably just getting lost (converted) in one step. I will investigate.
I think I'd like to get rid of the html escaping and look at improving the fbdoc (wiki-> chm converter). Even though fbdoc doesn't know unicode, the wiki's UTF8 should be preserved through most of the string manipulations. Probably just getting lost (converted) in one step. I will investigate.
Re: Wiki improvements
A next article coming soon (status 'in progress'):
18. How FB supports Sub-Type Polymorphism, demonstrated by Emulation very Close to Real Operating (article of 1 post) Do you have particular requests around this?
18. How FB supports Sub-Type Polymorphism, demonstrated by Emulation very Close to Real Operating (article of 1 post) Do you have particular requests around this?
-
- Posts: 2958
- Joined: Jun 02, 2015 16:24
Re: Wiki improvements
Will you compare that to a template or an interface, just to know the differences?fxm wrote:A next article coming soon (status 'in progress'):
18. How FB supports Sub-Type Polymorphism, demonstrated by Emulation very Close to Real Operating (article of 1 post) Do you have particular requests around this?
Can you also give a word of the size of the udt when it is taken in an inheritance chain (does it keep the private data of the parent and so on)?
Maybe this is off topic. If so I'll ask those questions elsewhere later, otherwise I'm curious of seeing the answer in this context.
Thanks anyway.
Re: Wiki improvements
Read carefully the Extends documentation page.Tourist Trap wrote:Can you also give a word of the size of the udt when it is taken in an inheritance chain (does it keep the private data of the parent and so on)?
(private non-static data fields of base-types are not excluded for the derived-types size computation)
About interfaces and templates, this goes far beyond what FB currently supports and far exceeds the limits I have set for this type of article to be accessible to all.
Re: Wiki improvements
After the vptr / vtbl (vtable) usage for abstract/virtual procedures, why not another article about the RunTime Type Information (RTTI) provided by the built-in OBJECT:
19. How using RTTI from FB built-in OBJECT to extract Typename and those of all Bases of an instance (article of 1 post)
19. How using RTTI from FB built-in OBJECT to extract Typename and those of all Bases of an instance (article of 1 post)
Re: Wiki improvements
It would be extremely useful. You're doing a pretty good job of documenting more advanced uses of the compiler. Thanks!fxm wrote:After the vptr / vtbl (vtable) usage for abstract/virtual procedures, why not another article about the RunTime Type Information (RTTI) provided by the built-in OBJECT:
19. How using RTTI from FB built-in OBJECT to extract Typename and those of all Bases of an instance (article of 1 post)
Re: Wiki improvements
To show the emulated implementation, I think a comparison to a simple non-emulated version is needed. For examplefxm wrote:A next article coming soon (status 'in progress'):
18. How FB supports Sub-Type Polymorphism, demonstrated by Emulation very Close to Real Operating (article of 1 post) Do you have particular requests around this?
B = base type
D = derived type
M = method
Code: Select all
type B extends object
declare constructor()
declare virtual destructor()
declare virtual sub M()
end type
constructor B(): print "B()", hex(cint(@this)): end constructor
destructor B(): print "~B()", hex(cint(@this)): end destructor
sub B.M(): print "B.M()", hex(cint(@this)): end sub
type D extends B
declare constructor()
declare destructor()
declare sub M() override
end type
constructor D(): print "D()", hex(cint(@this)): end constructor
destructor D(): print "~D()", hex(cint(@this)): end destructor
sub D.M(): print "D.M()", hex(cint(@this)): end sub
sub proc( byref obj as B )
'' derived-type method called through base
obj.M()
end sub
scope
print "---- OK"
dim x as D = D()
proc( x )
end scope
scope
print "---- OK"
dim x as D ptr = new D()
proc( *x )
delete x
end scope
scope
print "---- OK"
dim byref x as D = *new D()
proc( x )
delete @x
end scope
scope
print "---- Not OK!, D() is temporary expression"
dim x as B = D() '' D() is temporary
proc( x )
end scope
scope
print "---- OK, but only if destructor B() is virtual"
dim x as B ptr = new D()
proc( *x )
delete x
end scope
scope
print "---- OK, but only if destructor B() is virtual"
dim byref x as B = *new D()
proc( x )
delete @x
end scope
Re: Wiki improvements
Have you had time to read my article already posted since yesterday?
See: viewtopic.php?f=9&t=27617
See: viewtopic.php?f=9&t=27617
Re: Wiki improvements
fxm, OK I read your article now. I missed that when I posted here. Very nice. Yes, you have provided what I was hoping to see; introducing the usage before the explanation. Thanks.
Re: Wiki improvements
A next article coming soon (status 'in progress'):
19. How using RTTI from FB built-in OBJECT to extract Typename and those of all Bases of an instance (article of 1 post)
See preamble at: Index page of tutorial / teaching / pedagogical topics (draft articles for documentation)
19. How using RTTI from FB built-in OBJECT to extract Typename and those of all Bases of an instance (article of 1 post)
See preamble at: Index page of tutorial / teaching / pedagogical topics (draft articles for documentation)
Re: Wiki improvements
CHM contents are html files, string sin CHM internal files are UCS2/UTF16. I happen to be fixing the FPC chm doc tool and compiler this weekend, and it turns out the MS hhc compiler replaces things like ' from HTML topic titles when moving them into indexes, so maybe it does with 4 char escapes too.coderJeff wrote:Oops, I missed a step. %% tags with the html escaping only work for chm.
I think I'd like to get rid of the html escaping and look at improving the fbdoc (wiki-> chm converter). Even though fbdoc doesn't know unicode, the wiki's UTF8 should be preserved through most of the string manipulations. Probably just getting lost (converted) in one step. I will investigate.
Re: Wiki improvements
The full article is now available at:fxm wrote:A next article coming soon (status 'in progress'):
19. How using RTTI from FB built-in OBJECT to extract Typename and those of all Bases of an instance (article of 1 post)
See preamble at: Index page of tutorial / teaching / pedagogical topics (draft articles for documentation)
viewtopic.php?f=9&t=27622
Re: Wiki improvements
About: Index page of tutorial / teaching / pedagogical topics (draft articles for documentation)
I am still waiting for any article proposed by users:
- either provided already written (perhaps only a final formatting to be done for a better integration with the existing articles),
- or provided in the form of a list of references to posts/topics with enough material to be able, after synthesis, to constitute a complete article in itself.
Do not hesitate to participate and do not compare your ideas with the kind of articles I've already written, because I tend to write articles that some might consider too technical or advanced.
I remind you nevertheless that the content of these articles is also intended to perhaps later feed the official documentation (technical and tutorial).
(thanks to Josep Roca and MrSwiss, each for his previous participation)
I am still waiting for any article proposed by users:
- either provided already written (perhaps only a final formatting to be done for a better integration with the existing articles),
- or provided in the form of a list of references to posts/topics with enough material to be able, after synthesis, to constitute a complete article in itself.
Do not hesitate to participate and do not compare your ideas with the kind of articles I've already written, because I tend to write articles that some might consider too technical or advanced.
I remind you nevertheless that the content of these articles is also intended to perhaps later feed the official documentation (technical and tutorial).
(thanks to Josep Roca and MrSwiss, each for his previous participation)