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 »

coderJeff wrote:If I can make a suggestion...
Add a section for "Platform Differences" to Identifier Rules and move all the warnings and notes there. Then link there from Sub/Function or where ever.
OK, Done: Identifier Rules, SUB, FUNCTION.
Also added link in CONSTRUCTOR (Module) / DESTRUCTOR (Module) documentation pages.

Now the real question is:
Can something be done for the compiler to emit intelligible error messages under such special configurations (due to the user's choice of symbols under certain circumstances), rather than experiencing errors from the assembler, or more obscure runtime errors or simply buggy results?
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Wiki improvements

Post by dodicat »

coder Jeff
I tried a while ago to build fbide from source.
One has to get the exact mingw and the exact dev-c++ and the exact wx widgets. (looks like)
I used the makefile provided with a different mingw (can't remember, 4xx something), I nearly got there.
I was going to do away with tolower() in the run.cpp (I think that was the file).
It was all on XP at the time.
I think fbide is still the most popular one (Could be wrong these days)
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

coderJeff wrote:I think there was also notes about local variables and goto labels for LT* named symbols. Also there was a forum post about 'KS' or something on linux that conflicted with a public symbol in ncurses or termcap (or something).
Do you have more information on this subject and/or links to the forum?
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Wiki improvements

Post by SARG »

@fxm double thanks :
- report of incorrect adding in the list.
- update of documentation
fxm wrote:Can something be done for the compiler to emit intelligible error messages under such special configurations (due to the user's choice of symbols under certain circumstances), rather than experiencing errors from the assembler, or more obscure runtime errors or simply buggy results?
I agree especially for problems during the execution.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

Because FreeBASIC supports online assembler (with several possible formats), it does not seem contradictory to me that it outputs error messages when there is a name conflict between assembler symbols (of the one used) and the user symbols in the Basic code part.
Manpcnin
Posts: 46
Joined: Feb 25, 2007 1:43
Location: N.Z.

Re: Wiki improvements

Post by Manpcnin »

fxm wrote:Added __FB_OPTIMIZE__ intrinisic define:
- KeyPgDdfboptimize → fxm [new page '__FB_OPTIMIZE__']
- CatPgDddefines → fxm [added link to new page '__FB_OPTIMIZE__']
- CatPgFullIndex → fxm [added link to new page '__FB_OPTIMIZE__']
- CatPgFunctIndex → fxm [added link to new page '__FB_OPTIMIZE__']
- PrintToc → fxm [added link to new page '__FB_OPTIMIZE__']
Thank you fxm!
dodicat wrote:regarding the __FB_OPTIMIZE__ , I really thought that the request was for being able to set an optimisation level in the code and not necessarily the command line.
#lang "fb"
#optimize "-Wc O3"
Or something.
This would be nice for fbide users everywhere.
Nah that is what I was asking for. It also just makes sense from an consistency point of view. We have __FB_VECTORIZE__ and __FB_FPMODE__: we should have __FB_OPTIMIZE__ too. Although being able to set compiler flags from within a source file would be nice. I'm sure it would run into complications when compiling multi-file projects though.
counting_pine
Site Admin
Posts: 6323
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: Wiki improvements

Post by counting_pine »

dodicat wrote:coder Jeff
I tried a while ago to build fbide from source.
One has to get the exact mingw and the exact dev-c++ and the exact wx widgets. (looks like)
I used the makefile provided with a different mingw (can't remember, 4xx something), I nearly got there.
I was going to do away with tolower() in the run.cpp (I think that was the file).
It was all on XP at the time.
I think fbide is still the most popular one (Could be wrong these days)
For what it’s worth, I cleaned up the code a little, and got it to compile on Ubuntu 12.04 a few years ago: viewtopic.php?t=12380#p256528
coderJeff
Site Admin
Posts: 4313
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: Wiki improvements

Post by coderJeff »

fxm wrote:Now the real question is:
Can something be done for the compiler to emit intelligible error messages under such special configurations (due to the user's choice of symbols under certain circumstances), rather than experiencing errors from the assembler, or more obscure runtime errors or simply buggy results?
Seems simple enough. I will try starting with a reserved word list and an error message.

The other example I remember was for shared variables:
'dword ptr [K2]' is not a valid base/index expression

With a reported bug at sf.net: #515 Reserved variable names (0.21.1)
TeeEmCee
Posts: 375
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: Wiki improvements

Post by TeeEmCee »

Some changes for FB 1.09:

On https://www.freebasic.net/wiki/wikka.ph ... ndsZstring
Note: By declaring a type (directly or indirectly) as Extends Zstring (in addition to defining a suitable Cast operator only), this promotes it fully compatible even with Strptr/Sadd, Lset/Rset, and Select Case, but currently not yet with the built in functions Val/Valint/Vallng/Valuint/Valunlg and Left/Right.
(similar text also exists on https://www.freebasic.net/wiki/KeyPgExtendsWstring)
and in the example:

Code: Select all

'Print "'" & Right(v, 5) & "'"      '' 'Right' does not yet support types with 'Extends Zstring'
Print "'" & Right(Str(v), 5) & "'"  '' workaround (or: 'Right(Type<String>(v), 5)')
This is fixed in FB 1.09 (seems it was https://sourceforge.net/p/fbc/bugs/666/). Left/Right/Val/etc now work.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

You are right.
Thanks.

- KeyPgExtendsZstring → fxm [fully compatibility with string functions since fbc version 1.09]
- KeyPgExtendsWstring → fxm [fully compatibility with string functions since fbc version 1.09]
TeeEmCee
Posts: 375
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: Wiki improvements

Post by TeeEmCee »

(I guess you'll update the example after 1.09 is released)

On https://www.freebasic.net/wiki/CatPgPreProcess '$Include links to the #include article, even though there is a separate https://www.freebasic.net/wiki/KeyPgMetaInclude article.

I should apply for a wiki account.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

Thanks.
Done:
- KeyPgExtendsZstring → fxm [updated comment in second example about compatibility with 'Right()']
- CatPgPreProcess → fxm [corrected link to '$INCLUDE]
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: Wiki improvements

Post by D.J.Peters »

wiki wrote:[Public|Private] Function identifier [CDecl|Pascal|StdCall] [Overload] [Alias external_identifier] [([parameter_list])] [ ByRef ] [As return_type] [Static] [Export]
in case the return type isn't optional it should be:
[Public|Private] Function identifier [CDecl|Pascal|StdCall] [Overload] [Alias external_identifier] [([parameter_list])] [ ByRef ] As return_type [Static] [Export]
or the optional return type should be marked as QBASIC feature
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

Thanks.
Corrected:
- KeyPgFunction → fxm [in Syntax section: function return type is not optional]
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: Wiki improvements

Post by D.J.Peters »

@fxm in Const Member
wiki wrote:Type typename
Declare Const Sub|Function|Property|Operator ...
End Type
Const Sub|Function|... typename ...
...
End Sub|Function|...
should be:
Type typename
Declare Const Sub|Function|Property|Operator ...
End Type
[Const] Sub|Function|... typename ...
...
End Sub|Function|...
if a member is declared as const then "const" is optional in the implementation of the member code.

Joshy
Last edited by D.J.Peters on Oct 14, 2021 15:36, edited 1 time in total.
Post Reply