Search found 1438 matches

by St_W
Dec 04, 2018 13:47
Forum: General
Topic: Latest FBC 1.05 gives warning 38 with boolean evaluation
Replies: 5
Views: 279

Re: Latest FBC 1.05 gives warning 38 with boolean evaluation

I'm wondering which build you are effectively using, could you tell us e.g. the Git commit ID it was built from? I'm wondering because the last official build is from January 31, 2016 for Linux: https://sourceforge.net/projects/fbc/files/Binaries%20-%20Linux/ No official updated binary has been publ...
by St_W
Nov 28, 2018 21:44
Forum: Community Discussion
Topic: "A Love Letter To FreeBASIC" Game Dev Competition (Oct 2018 – Feb 2019), 1000 $ 1st prize
Replies: 360
Views: 16302

Re: "A Love Letter To FreeBASIC" Game Dev Competition (Oct 2018 – Jan 2019), 800 $ 1st prize

Tourist Trap wrote:When is the last day to submit something?
The first post in this thread explains it all. The deadline is January 14, 2019 18:00 GMT.
by St_W
Nov 27, 2018 19:01
Forum: Community Discussion
Topic: Dim Byref syntax
Replies: 134
Views: 12882

Re: Dim Byref syntax

[...] As I pointed out earlier, the only way to do it is by directly using pointers. However, this is not very BASIC like, it is more C like. [...] I agree that it is - in general many features that were added to the initial feature-set derived from QBasic are inspired by C or C++. That was the way...
by St_W
Nov 27, 2018 15:53
Forum: Community Discussion
Topic: Dim Byref syntax
Replies: 134
Views: 12882

Re: Dim Byref syntax

This will never compile nor execute because one is not allowed to touch the child reference [...] But it can be easily fixed. Just note that the new operator returns a pointer in FB. type tOne extends object s as string declare constructor() end type constructor tOne() end constructor type tTwo ext...
by St_W
Nov 27, 2018 15:22
Forum: Community Discussion
Topic: Dim Byref syntax
Replies: 134
Views: 12882

Re: Dim Byref syntax

I beg to differ. Control means that you can determine when objects are instantiated. With nested objects that is currently not possible with FB. Individually they can neither be instantiated, null referenced nor deleted. The only workaround is the direct use of pointers. That's what I meant. You in...
by St_W
Nov 27, 2018 14:27
Forum: Community Discussion
Topic: Dim Byref syntax
Replies: 134
Views: 12882

Re: Dim Byref syntax

[...] whereby the programmer is totally responsible for instantiating objects (as it should be) [...] In FB you have full control over the lifecycle of an object, much more than in common OO languages. Most languages nowadays try to relief the programmer from managing the object's lifecycle themsel...
by St_W
Nov 27, 2018 11:50
Forum: Community Discussion
Topic: Nominations for Forum Moderators
Replies: 70
Views: 4567

Re: Nominations for Forum Moderators

Although I'm unsure whether they'd all accept, I'd nominate (or second the nomination for) fxm, PaulSquires, Imortis.
(is there a limit on nominations-per-person?)
by St_W
Nov 26, 2018 16:37
Forum: Community Discussion
Topic: Dim Byref syntax
Replies: 134
Views: 12882

Re: Dim Byref syntax

In general you only need to delete objects you allocated on the Heap, with "new", "allocate", malloc(), etc.
Objects stored on the stack or in a data segment of the application do not need to be deleted.
by St_W
Nov 26, 2018 14:43
Forum: Community Discussion
Topic: Dim Byref syntax
Replies: 134
Views: 12882

Re: Dim Byref syntax

Thanks for the example fxm, I was wrong evidently. I had a look at the C code generated by the C emitter of FB for both return *cptr(tt ptr, 0) (with a byref return value) and dim byref as tt t = *cptr(tt ptr, 0) . The generated code assigns the null pointer to the reference and does...
by St_W
Nov 26, 2018 13:59
Forum: Community Discussion
Topic: Dim Byref syntax
Replies: 134
Views: 12882

Re: Dim Byref syntax

I don't think that you can do that without using pointers explicitly. I would even have expected the application to crash when you " return *cptr(tt ptr, 0) ", because you're returning an object. And this object is constructed from the dereferenced null reference, which should call...
by St_W
Nov 24, 2018 21:35
Forum: General
Topic: Using a DLL
Replies: 8
Views: 328

Re: Using a DLL

Thanks a lot for explaining this behaviour. I would drop the "obviously", though - the linker might as well use the file name of the DLL, or at least check if there is a conflict between file and library name, and issue a warning. Sorry, used the wrong word there, I meant "apparently...
by St_W
Nov 24, 2018 20:39
Forum: Community Discussion
Topic: New website
Replies: 45
Views: 5510

Re: New website

Thanks to whoever (finally) fixed the CSS to make tt tags work again!
by St_W
Nov 24, 2018 20:35
Forum: General
Topic: Using a DLL
Replies: 8
Views: 328

Re: Using a DLL

You are not providing an import library for your dll file, thus FreeBasic (or the GNU Linker "ld", to be more precise) creates a default one for you. And this obviously respects the library name as defined in the DLLs export directory (using dumpbin ConsoleInput.dll /exports ): Dump of fil...
by St_W
Nov 21, 2018 15:53
Forum: General
Topic: Coders
Replies: 52
Views: 1263

Re: Coders

Initializers in FB are limited, for example the issue with your first example is that you can't initialize variable-length strings in UDTs with an initializer. Excluding members from initialization isn't possible - at least I don't know a way to do so either. IMHO your proposed syntax is neither cle...
by St_W
Nov 21, 2018 14:30
Forum: General
Topic: Coders
Replies: 52
Views: 1263

Re: Coders

Munair wrote:BTW, it would be nice if FB would support syntax like [...]

Actually it does:

Code: Select all

type Typed64Bits
    value as string * 8
end type

dim s as Typed64Bits = ("testtest")

print s.value

see also https://freebasic.net/wiki/wikka.php?wakka=KeyPgDim ("initializers")

Go to advanced search