Search found 2788 matches

by Tourist Trap
Jan 08, 2020 6:10
Forum: Tips and Tricks
Topic: [Linux] Try/Catch
Replies: 7
Views: 306

Re: [Linux] Try/Catch

]What do you mean by "prevent crashes?" Exception handling should not prevent crashes. As I said about segfaults, crashes are often the only sensible thing to do. I agree with all you say here, but my focus was on the TRY. We try, this goes wrong, so we make a step back and and finally do...
by Tourist Trap
Jan 05, 2020 11:26
Forum: Game Dev
Topic: Game Engine Black Book DOOM
Replies: 2
Views: 218

Re: Game Engine Black Book DOOM

A very interesting work Thanks. Looks very good. I found a chapter on the question of subpixel accuracy: Subpixel Accuracy It is worth mentioning that the engine is subpixel-accurate when calculating the screencoordinates of a wall’s top and bottom edges. Subpixel accuracy is a subtle concept, the ...
by Tourist Trap
Jan 05, 2020 10:59
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 412
Views: 24399

Re: FreeBASIC syntax challenge games

fxm wrote:[edit]
Done:
ProPgNewDelete → fxm [added clarification on 'Operator Placement New/New[]']

For me it's clearer. Thanks.
by Tourist Trap
Jan 04, 2020 21:24
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 412
Views: 24399

Re: FreeBASIC syntax challenge games

Placement New [] does not write the number of elements at the beginning of the memory block, because Delete [] does not have to be and must not be called. Fxm, I was reading the page on New/Delete of the wiki. You write: Instance array created with 'Operator New[] Overload/Expression' must be freed...
by Tourist Trap
Jan 04, 2020 21:09
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 412
Views: 24399

Re: FreeBASIC syntax challenge games

Important extract of this documentation page: Memory is not allocated when using the Placement New operator. Instead, the memory at the specified address is used (the provided memory size must be large enough to contain all the placement). It is incorrect to call Delete Statement on the address. Th...
by Tourist Trap
Jan 04, 2020 20:47
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 412
Views: 24399

Re: FreeBASIC syntax challenge games

Variant on the same idea. Maybe what I was thinking of in my first tries I guess (and still may well be very wrong! when will he learn ahah!): destructor DESTR_UDT() this.dii = -111 end destructor type TESTOBJ as string type BOTTLE as TESTOBJ v as integer u = 999998 end type dim as BOTTLE ptr bb = n...
by Tourist Trap
Jan 04, 2020 20:31
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 412
Views: 24399

Re: FreeBASIC syntax challenge games

I wrote about thirty articles in the Programmer's Guide Hi fxm! I downloaded the last chm, I had them all now, and they render very well in this format as well. Thanks for all this good stuff. But about the last challenge, following the insight from dodicat, what if we try a placement new[] pointin...
by Tourist Trap
Jan 04, 2020 19:43
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 412
Views: 24399

Re: FreeBASIC syntax challenge games

A crude method. create an integer pointer (new integer[1]) just before creating the instance pointer (new typesymbol[a random number] Divide the difference in addresses by (sizeof(integer)) If there is an extra address space inserted by the compiler (for the new[] operator), then the resultant divi...
by Tourist Trap
Jan 04, 2020 17:58
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 412
Views: 24399

Re: FreeBASIC syntax challenge games

Added a third clue to the enigma #25 of post https://www.freebasic.net/forum/viewtopic.php?p=267129#p267129. (a fourth is still in reserve) Hi, I'm seriously discovering this feature. Totally missed it, and still probably have to learn. So here is my try with the last clue of the operator delete[]....
by Tourist Trap
Jan 04, 2020 15:55
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 412
Views: 24399

Re: FreeBASIC syntax challenge games

In addition to be always unsafe, your code (that I does not understand) does not even output the right response on my PC: DESTR_UDT 1703480 4598484 true OBJECT 4598468 4598512 true integer 4598496 4598544 true (with Win32 and gas) I'm on 64 and GCC. It's very surprising that it doesn't work for you...
by Tourist Trap
Jan 04, 2020 15:51
Forum: Beginners
Topic: An error message that I cannot handle
Replies: 7
Views: 181

Re: An error message that I cannot handle

" but what is the purpose of this, I don't get it right now." . . . . well, I am studying freeBasic using the manual on the Internet as my study material. In an attempt to understand the (somewhat extensive) code examples, I try them out. And if they bug out I am lost. This is the origin ...
by Tourist Trap
Jan 04, 2020 15:40
Forum: Beginners
Topic: An error message that I cannot handle
Replies: 7
Views: 181

Re: An error message that I cannot handle

The error line is indicated in the code snippet The code was taken from the FreeBasic manual, as published on the Internet Could someone please bail me out? Hello if you do this 'with ... #print typeOf(.dept) #print typeOf(initDept(24)) you read as a compiler output (not in the program running but ...
by Tourist Trap
Jan 04, 2020 15:21
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 412
Views: 24399

Re: FreeBASIC syntax challenge games

Is there a way to do something by adding a destructor in the encapsulated fake udt? Little free clue: Yes some member must be added in the macro Type, but not a Destructor(). Damn, thank you for all the information. I will use your clue, and I'm obtaining this. Don't ask me why it say the truth, bu...
by Tourist Trap
Jan 04, 2020 11:10
Forum: Tips and Tricks
Topic: [Linux] Try/Catch
Replies: 7
Views: 306

Re: [Linux] Try/Catch

Xusinboy Bekchanov wrote: these keywords are already in vb.net

Yes they are used all the time. Don't know if it's always good, but at least this prevents crashes.
If we could have the same also for windows that would be really a feature I think.
by Tourist Trap
Jan 04, 2020 10:48
Forum: Community Discussion
Topic: FreeBASIC syntax challenge games
Replies: 412
Views: 24399

Re: FreeBASIC syntax challenge games

I got this with your code: Aborting due to runtime error 12 ("segmentation violation" signal) in C:\Users\fxmam\Documents\Mes Outils Personnels\FBIde0.4.6r4_fbc1.08.0\FBIDETEMP.bas::() Two 'DELETE []' for one 'NEW []' ! Have to find where. I didn't see that. EDIT, ahah yes. Is this better...

Go to advanced search