Wiki improvements
Re: Wiki improvements
You are right.
Same principle as for STATIC (Member) for example.
Done:
KeyPgConstMember → fxm [if a member procedure is declared as const then "const" is optional in the implementation of the member code]
Same principle as for STATIC (Member) for example.
Done:
KeyPgConstMember → fxm [if a member procedure is declared as const then "const" is optional in the implementation of the member code]
Re: Wiki improvements
fxm, I was doing a wiki snapshot and extracting the examples.
I noticed that many examples are getting an extra TAB character at the end of the example source listing.
Is that needed for formatting the wiki or CHM? or both?
I noticed that many examples are getting an extra TAB character at the end of the example source listing.
Is that needed for formatting the wiki or CHM? or both?
The tab at the end of the source listing is getting included in the stored example file since everything between '%%(freebasic)...%%' is considered source code.------->{{fbdoc item="filename" value="path/file.bas"}}%%(freebasic)
'' source
'' source
'' source
------->%%
Re: Wiki improvements
This is only useful when one wants to write, for example, a comment below the code without skipping an extra line and with the same tabulation as the code:
Does it really bother?
But afterwards I got into the habit of doing it systematically, even if it is not really useful.------->{{fbdoc item="filename" value="path/file.bas"}}%%(freebasic)
'' source
'' source
'' source
------->%%Comment about code
Does it really bother?
Re: Wiki improvements
I also used to put one tabulation at least inside the 'Examples' section as well (like other sections), even for code blocks.
Re: Wiki improvements
Only slightly, and only me. :)fxm wrote:Does it really bother?
Unexpected that the TAB in source code affects the indent.
This appears to have the same appearance on the wiki. I didn't check CHM.
Anyway, I won't worry about it for now. Thanks for the explanation. I'll commit the changed examples as-is.%%------->Comment about code
Re: Wiki improvements
For the .chm, I no longer know.
I would have to try it on occasion.
I would have to try it on occasion.
Re: Wiki improvements
I'm doing a test on this page:
- ProPgMacros → fxm [to test if there is difference between '%%------->Comment about code' and '------->%%Comment about code' for CHM (tested only for code blocks without associated files)]
The result tomorrow !
- ProPgMacros → fxm [to test if there is difference between '%%------->Comment about code' and '------->%%Comment about code' for CHM (tested only for code blocks without associated files)]
The result tomorrow !
Re: Wiki improvements
Result:fxm wrote:I'm doing a test on this page:
- ProPgMacros → fxm [to test if there is difference between '%%------->Comment about code' and '------->%%Comment about code' for CHM (tested only for code blocks without associated files)]
The result tomorrow !
For a '.chm' file, there is no difference between the two cases.
So I don't know why I started using '------->%%Comment about code' instead of '%%------->Comment about code' !
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: Wiki improvements
Maybe it's only me but why are the optional "[Static]" keyword are not listed in the overloaded member operator section ?
Joshy
Something like this:
Joshy
Something like this:
Code: Select all
{ Type | Class | Union } typename
Declare [Static] Operator Cast () [ ByRef ] As datatype
Declare [Static] Operator @ () [ ByRef ] As datatype Ptr
Declare [Static] Operator assignment_op ( [ ByRef | ByVal ] rhs As datatype )
Declare [Static] Operator [] ( index As datatype ) [ ByRef ] As datatype
Declare [Static] Operator New ( size As UInteger ) As Any Ptr
Declare [Static] Operator New[] ( size As UInteger ) As Any Ptr
Declare [Static] Operator Delete ( buf As Any Ptr )
Declare [Static] Operator Delete[] ( buf As Any Ptr )
End { Type | Class | Union }
...
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: Wiki improvements
Ok I see [Static] means only vars inside the overloaded operators not the operator it self ist static :-)
(only sub/function/data members are allowed to be static)
this isn't allowed i'm right ?
Joshy
(only sub/function/data members are allowed to be static)
this isn't allowed i'm right ?
Joshy
Code: Select all
type udt
declare static operator New(bla bla bla ...)
end udt
implement static operator new
...
' use it
var p = UDT.New(bla bla bla)
Re: Wiki improvements
Currently, member operators and properties cannot be declared as static.
Exception: Although declared inside the type, the member operators New, New[], Delete, and Delete[] are always static, even if not explicitly declared (Static keyword is unnecessary but allowed).
Exception: Although declared inside the type, the member operators New, New[], Delete, and Delete[] are always static, even if not explicitly declared (Static keyword is unnecessary but allowed).
Re: Wiki improvements
@Jeff and the others,
With the commit 'rtlib: sf.net # 950: REDIM PRESERVE does not destroy the correct array elements', 2 new user functions have been added:
ArrayLen() '' return the total number of array elements
ArraySize() '' return the total array size (in bytes)
Although these functions are declared in './inc/fbc-int/array.bi', I think it is better not to add them in the documentation page 'FBARRAY (array descriptor structure and access)' to the existing functions 'ArrayDescriptorPtr()' and 'ArrayConstDescriptorPtr()' because they are not in the same namespace ('FB' instead of 'FBC').
So I think it is better to create a new documentation page for each one. But I could go back if necessary.
[edit]
Done:
- KeyPgArrayLen → fxm [new page 'ARRAYLEN']
- KeyPgArraysize → fxm [new page 'ARRAYSIZE']
- CatPgArray → fxm [added links to 'ARRAYLEN' and 'ARRAYSIZE']
- CatPgFullIndex → fxm [added links to 'ARRAYLEN' and 'ARRAYSIZE']
- CatPgFunctIndex → fxm [added links to 'ARRAYLEN' and 'ARRAYSIZE']
- PrintToc → fxm [added links to 'ARRAYLEN' and 'ARRAYSIZE']
With the commit 'rtlib: sf.net # 950: REDIM PRESERVE does not destroy the correct array elements', 2 new user functions have been added:
ArrayLen() '' return the total number of array elements
ArraySize() '' return the total array size (in bytes)
Although these functions are declared in './inc/fbc-int/array.bi', I think it is better not to add them in the documentation page 'FBARRAY (array descriptor structure and access)' to the existing functions 'ArrayDescriptorPtr()' and 'ArrayConstDescriptorPtr()' because they are not in the same namespace ('FB' instead of 'FBC').
So I think it is better to create a new documentation page for each one. But I could go back if necessary.
[edit]
Done:
- KeyPgArrayLen → fxm [new page 'ARRAYLEN']
- KeyPgArraysize → fxm [new page 'ARRAYSIZE']
- CatPgArray → fxm [added links to 'ARRAYLEN' and 'ARRAYSIZE']
- CatPgFullIndex → fxm [added links to 'ARRAYLEN' and 'ARRAYSIZE']
- CatPgFunctIndex → fxm [added links to 'ARRAYLEN' and 'ARRAYSIZE']
- PrintToc → fxm [added links to 'ARRAYLEN' and 'ARRAYSIZE']
Re: Wiki improvements
Sounds good to me.fxm wrote:So I think it is better to create a new documentation page for each one.
I'm kind of just testing it out, see how I like it. It seemed that the new functions should be in the FB namespace. Maybe in a new ./inc/arrays.bi file instead? Not sure.
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: Wiki improvements
@fxm can you add this info about building import libraries for Windows please ?
Thank you.
Joshy
XXX = name of the lib and def file
32-bit:
drive:\FreeBASIC\bin\win32\dlltool.exe -d XXX.def -l drive:\FreeBASIC\lib\win32\libXXX.dll.a
64-bit:
drive:\FreeBASIC\bin\win64\dlltool.exe -m i386:x86-64 --as-flags --64 -d XXX.def -l drive:\FreeBASIC\lib\win64\libXXX.dll.a
Thank you.
Joshy
XXX = name of the lib and def file
32-bit:
drive:\FreeBASIC\bin\win32\dlltool.exe -d XXX.def -l drive:\FreeBASIC\lib\win32\libXXX.dll.a
64-bit:
drive:\FreeBASIC\bin\win64\dlltool.exe -m i386:x86-64 --as-flags --64 -d XXX.def -l drive:\FreeBASIC\lib\win64\libXXX.dll.a
Re: Wiki improvements
Could you clarify the context and where this syntax information could be inserted in the documentation ?
My feeling:
- As a Note to be added in the Shared Libraries documentation page, at the end of the 'Using Shared Libraries on Windows' paragraph ?
- The aim of this syntax is to create the 'import library' file ('.dll.a') for Windows, from an existing DLL with its '.def' file ?
My feeling:
- As a Note to be added in the Shared Libraries documentation page, at the end of the 'Using Shared Libraries on Windows' paragraph ?
- The aim of this syntax is to create the 'import library' file ('.dll.a') for Windows, from an existing DLL with its '.def' file ?