Search found 86 matches

by shadow008
Mar 22, 2024 17:00
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25028

Re: Freebasic 1.20.0 Development

Is it necessary to detail all this in the documentation? (maybe a simple note like above in the Programmer's Guide only?) I don't think it does after giving it some thought. The implicit lifetime functions aren't exposed to the user in any meaningful way right now, so it's not the user's business h...
by shadow008
Mar 22, 2024 15:49
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25028

Re: Freebasic 1.20.0 Development

There are cases where there are no constructors or copy-constructors or destructors (neither explicit nor implicit). That matches my understanding but I will note such is not mentioned in the documentation: https://www.freebasic.net/wiki/ProPgCtorsDtors#COMPCTORDTOR Accounting for that, maybe a fur...
by shadow008
Mar 22, 2024 4:42
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25028

Re: Freebasic 1.20.0 Development

I have a small idea for a feature request: Make procptr() capable of returning the implicit constructor/copy constructor/destructor functions. A call to procptr for a UDT's constructor (et. al.) would get either the explicit default constructor (if defined), or the implicit default one transparently...
by shadow008
Mar 14, 2024 20:29
Forum: General
Topic: typeof works with functions
Replies: 3
Views: 294

Re: typeof works with functions

*Some restrictions apply, see store for details* :D Good points fxm. And overloaded function types can be specifically obtained via the ProcPtr method. #print typeof(ProcPtr(udt.func, function () as any ptr)) #print typeof(ProcPtr(udt.func, function (arg1 as integer) as zstring ptr)) prints out: FUN...
by shadow008
Mar 14, 2024 19:19
Forum: General
Topic: typeof works with functions
Replies: 3
Views: 294

typeof works with functions

For those who didn't know, typeof() can be used with functions, including overloaded and type member functions. I've personally found this valuable to enforce type safety and give more explicit error messages when passing variables to macros that expect a specific type. typeof() doc page: https://ww...
by shadow008
Mar 13, 2024 19:32
Forum: Beginners
Topic: Minesweeper example
Replies: 4
Views: 360

Re: Minesweeper example

PS what sub is exactly responsible for this Matrix of 10x10 Points in a shape of a rectangle when you start the Game? Some issues ago of my example produced only one straight Line of Points ;) thx The sub responsible is printBoard() sub printBoard() cls dim i As Integer, j as integer for i = 0 to r...
by shadow008
Feb 27, 2024 18:55
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25028

Re: Freebasic 1.20.0 Development

Another question: will be possible to use null bytes inside a fixed length string? This would not make any sense as there is no corresponding character to the null (0) byte. Not for printing but still as a null terminator -- in a list of null terminated strings. On windows, REG_MULTI_SZ comes to mi...
by shadow008
Feb 26, 2024 20:21
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25028

Re: Freebasic 1.20.0 Development

Another question: will be possible to use null bytes inside a fixed length string? This would not make any sense as there is no corresponding character to the null (0) byte. What exactly would it print for that character? Furthermore any use of the crt (and certainly a lot of internal FB plumbing) ...
by shadow008
Feb 26, 2024 4:44
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 269
Views: 25028

Re: Freebasic 1.20.0 Development

I'm in favor of removing fixed length "strings" altogether (not fixed length zstrings or wstrings though). I've been meaning to bring this up for a while, but there is no way to handle a fixed length string in a type erased system using a pointer unless you explicitly pun it to a zstring p...
by shadow008
Feb 17, 2024 5:31
Forum: General
Topic: Console window during graphics
Replies: 4
Views: 353

Re: Console window during graphics

I believe you're looking for https://www.freebasic.net/wiki/CompilerOpts

Compile with -s gui to hide the console (windows only).
by shadow008
Feb 12, 2024 6:29
Forum: General
Topic: window closing/odd behavior
Replies: 3
Views: 268

Re: window closing/odd behavior

Not at my computer so I can't test but my WAG is a stack overflow. 75,000 x 24 (sizeof string on 64 bit) =1,800,000 bytes which is rather close to the 2MB default stack size compiling for 64 bit https://freebasic.net/wiki/CompilerOptt If you're on windows you should check the event viewer for the er...
by shadow008
Feb 09, 2024 22:12
Forum: Projects
Topic: FBSerializer serialize types to binary/json
Replies: 1
Views: 476

Re: FBSerializer serialize types to binary/json

Added:
- Deserializing from json
- Validating json against a UDT schema
- Pretty print for formatting json
by shadow008
Jan 19, 2024 4:54
Forum: Projects
Topic: FBSerializer serialize types to binary/json
Replies: 1
Views: 476

FBSerializer serialize types to binary/json

I've finally gotten my serialization framework to the point where there's enough functionality worthy of a release. I've made the interface as "plug and play" friendly as possible so in the majority of cases you write a simple declaration of a UDT and that UDT can then immediately be seria...
by shadow008
Jan 12, 2024 5:43
Forum: General
Topic: [Solved] When/how is a temporary array descriptor created
Replies: 10
Views: 794

Re: [Solved] When/how is a temporary array descriptor created

fbc-int/array.bi '' take care with number of dimensions; fbc may allocate '' a smaller descriptor with fewer than FB_MAXDIMENSIONS '' in dimTb() if it is known at compile time that they '' are never needed. Always respect number of '' dimensions when accessing dimTb() Dammit I even knew that going ...
by shadow008
Jan 12, 2024 3:39
Forum: General
Topic: [Solved] When/how is a temporary array descriptor created
Replies: 10
Views: 794

Re: [Solved] When/how is a temporary array descriptor created

I'd like to focus on that third scenario of static array in a UDT for a minute: #include "fbc-int/array.bi" Using FBC Function DescriptorPtr(Byval p As Any Ptr) As Any Ptr dim as FBARRAY ptr a = p print "Base pointer: ";p print " index_ptr: ";a->index_ptr print " b...