Search found 3323 matches

by MrSwiss
Apr 01, 2020 18:29
Forum: Beginners
Topic: The extra destructor is called
Replies: 11
Views: 75

Re: The extra destructor is called

I think we are talking about different things. No, we don't. You just don't seem to understand the concept of 'temporary' stuff ... Your original code, just without 'temporary': Type rational numerator As Integer denominator As Integer Declare Constructor() Declare Destructor() End Type Constructor...
by MrSwiss
Apr 01, 2020 17:39
Forum: Beginners
Topic: The extra destructor is called
Replies: 11
Views: 75

Re: The extra destructor is called

I understand that, but I'm interested in this question which basically it turns the extra destructor is called Since the temporary 'type' (which takes the data from the locally created/destroyed 'type') is constructed at 'return time', it can only be destroyed in MAIN-code ... (in the Function you ...
by MrSwiss
Apr 01, 2020 17:18
Forum: Beginners
Topic: The extra destructor is called
Replies: 11
Views: 75

Re: The extra destructor is called

*created: 140720577747840 <- @R destroyed 140720577747840 <- @R destroyed 140720577747904 ' the destructor is unnecessary from a hidden constructor No way, except you are aiming at: creating willingly, a memory leak. It is as simple as that: - what has been created (anywhere) - must be destroyed (s...
by MrSwiss
Apr 01, 2020 16:51
Forum: Beginners
Topic: The extra destructor is called
Replies: 11
Views: 75

Re: The extra destructor is called

VANYA wrote:Please explain to me why the destructor is called if the constructor is hidden?

I don't see anything 'hidden', except if you refer to the Functions 'scope'.
1) in Functions scope: ctor/dtor (two times ctor, one dtor)
2) temporary 'type' (Function return) -- dtor in MAIN
by MrSwiss
Apr 01, 2020 16:02
Forum: Beginners
Topic: The extra destructor is called
Replies: 11
Views: 75

Re: The extra destructor is called

@VANYA, nice try, at a April Fool's prank.
by MrSwiss
Mar 20, 2020 19:42
Forum: Beginners
Topic: What's wrong here?
Replies: 4
Views: 330

Re: What's wrong here?

My StringSplit Function, which uses 'strtok' from FB's CRT: ' this is part of my: String_Procs.bi -- (c) 2019, MrSwiss #Include "crt/string.bi" ' needed for: SplitString() Private Function SplitString( _ ' uses CRT's strtok() Function ByRef ssrc As Const String, _ ' string to be searched B...
by MrSwiss
Mar 15, 2020 14:49
Forum: Community Discussion
Topic: Is there any gui designer for freebasic on linux?
Replies: 8
Views: 323

Re: Is there any gui designer for freebasic on linux?

And there is of course, the good old and trusted: FBEdit (with included resource editor)! (just make sure to get version: 1.0.7.6c, earlier builds may crash) Download (german FB site): https://www.freebasic-portal.de/downloads/ides-fuer-freebasic/fbedit-ide-30.html Obviously, Windows only. But may r...
by MrSwiss
Mar 13, 2020 18:29
Forum: Tips and Tricks
Topic: WIN-API without any #Include "..."
Replies: 13
Views: 465

WIN-API without any #Include "..."

Hi all, especially if we're doing a simple console application, it is not necessary to always #Include "Windows.bi". The very same applies of course also, to Frameworks of any 'colour or shape'. Some of us (including myself) simply don't want those approx. 1.5 MB of predefinitions. There i...
by MrSwiss
Mar 09, 2020 0:33
Forum: Community Discussion
Topic: Installing FreeBasic with Scoop on Windows
Replies: 21
Views: 729

Re: Installing FreeBasic with Scoop on Windows

bubacxo wrote:FreeBasic has a platform problem. to me, it's FB's only real problem.

Don't understand where you are aiming at because, FreeBASIC is hosted on SourceForge & GitHub ???
Are 2 platforms insufficent, do you need more?
by MrSwiss
Mar 05, 2020 17:37
Forum: Windows
Topic: debugging network code
Replies: 4
Views: 196

Re: debugging network code

critical fact: the sockaddr data structure port field uses reverse byte order This isn't really news: network byte order = big endian, AMD/Intel CPU's = little endian (all not network related stuff). DEMO code: ' EndianConv-Procs_test1.bas -- (c) 2020-03-05, MrSwiss ' ' compile: -s console (WIN onl...
by MrSwiss
Mar 05, 2020 1:40
Forum: Documentation
Topic: Added Missing Keywords
Replies: 4
Views: 331

Re: Added Missing Keywords

@chris319, whatever 'commands' you issue to "Shell" (FB-KeyWord), are handed over to the OS specific console/terminal processor. Those 'commands' are OS related and not within the scope of FB's documentation. Therfore your additions need to be deleted again, a.s.a.p. (preferably by yoursel...
by MrSwiss
Mar 04, 2020 13:42
Forum: Windows
Topic: debugging network code
Replies: 4
Views: 196

Re: debugging network code

Anybody have any idea why "accept" can take a connection from my own program but not from any other programs? Sorry, but without the 'codes' (server and client), there isn't any way to a decent answer ... (I'm not willing to speculate, without more 'to the point' information.) Additionall...
by MrSwiss
Mar 02, 2020 12:58
Forum: Beginners
Topic: What is the newline character in Free Basic?
Replies: 19
Views: 294

Re: What is the newline character in Free Basic?

@dodicat,
dodicat wrote:NOTE: I use #macro as a convenient way to hold comments, it has nothing to do with running code

I don't see a reason for that, you could simply stick them into a multiline comment: /' ... '/ ???
Seems to me to be a 'clean' solution (as provided by the language itself).
by MrSwiss
Mar 02, 2020 12:30
Forum: Beginners
Topic: What is the newline character in Free Basic?
Replies: 19
Views: 294

Re: What is the newline character in Free Basic?

The test program is just a simple line: print sqr(2) When compiled and run on the terminal by ./test, it print: " 1.414213562373095" Exactly "as expected". Whenever a signed number (interger- or float-type) is 'Print'ed, there is space (for minus sign) kept. (One of the 'built-i...
by MrSwiss
Feb 29, 2020 18:25
Forum: Community Discussion
Topic: CudaText
Replies: 9
Views: 492

Re: CudaText

What? CudaText's lexer is just syntax highlighting support. I don't know why they called it "lexer" but I think it's definitely different from the "lexer" you are talking about. That is clearly an ambigous use of a well defined meaning , which I'd call a "Language specific ...

Go to advanced search