Wiki improvements

Forum for discussion about the documentation project.
Post Reply
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

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]
coderJeff
Site Admin
Posts: 4313
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: Wiki improvements

Post by coderJeff »

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?
------->{{fbdoc item="filename" value="path/file.bas"}}%%(freebasic)
'' source
'' source
'' source
------->%%
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.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

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:
------->{{fbdoc item="filename" value="path/file.bas"}}%%(freebasic)
'' source
'' source
'' source
------->%%Comment about code
But afterwards I got into the habit of doing it systematically, even if it is not really useful.
Does it really bother?
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

I also used to put one tabulation at least inside the 'Examples' section as well (like other sections), even for code blocks.
coderJeff
Site Admin
Posts: 4313
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: Wiki improvements

Post by coderJeff »

fxm wrote:Does it really bother?
Only slightly, and only me. :)

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.
%%------->Comment about code
Anyway, I won't worry about it for now. Thanks for the explanation. I'll commit the changed examples as-is.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

For the .chm, I no longer know.
I would have to try it on occasion.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

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 !
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

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 !
Result:
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' !
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: Wiki improvements

Post by D.J.Peters »

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:

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 }
...
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: Wiki improvements

Post by D.J.Peters »

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

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)
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

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).
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

@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']
coderJeff
Site Admin
Posts: 4313
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: Wiki improvements

Post by coderJeff »

fxm wrote:So I think it is better to create a new documentation page for each one.
Sounds good to me.

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.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: Wiki improvements

Post by D.J.Peters »

@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
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

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 ?
Post Reply