Search found 799 matches

by paul doe
Dec 08, 2018 14:08
Forum: General
Topic: How to fix error 177 ???
Replies: 40
Views: 820

Re: How to fix error 177 ???

Why would Null be part of the object? Sorry, I've written the code in a hurry. The Null reference should be part of the interface, not the derived classes themselves: /' The ID you'll use to identify objects throughout your code base. '/ type ObjectID as string /' The abstract interface for an inve...
by paul doe
Dec 08, 2018 13:40
Forum: General
Topic: How to fix error 177 ???
Replies: 40
Views: 820

Re: How to fix error 177 ???

Why would Null be part of the object? Because not every object can be nullable, and the null pointer has to be of the same type as the object to avoid casting. The right way (depending on circumstances) would be to implement the Null Pattern for each object that needs it. I would define the Null po...
by paul doe
Dec 08, 2018 13:36
Forum: General
Topic: How to fix error 177 ???
Replies: 40
Views: 820

Re: How to fix error 177 ???

In FreeBASIC, anything that can be done with pointers can be done with references (because a reference is the dereferencing of an internal pointer, but accessible by user). Not true, because there's no orthogonality between references and pointers : type ISomething extends Object declare virtual de...
by paul doe
Dec 08, 2018 10:34
Forum: General
Topic: How to fix error 177 ???
Replies: 40
Views: 820

Re: How to fix error 177 ???

In addition to what sancho3 and Munair propose, here's a simple scheme that I use often: /' The ID you'll use to identify objects throughout your code base. '/ type ObjectID as string /' The abstract interface for an inventory item '/ type IInventory extends Object public: declare virtual destructor...
by paul doe
Dec 03, 2018 16:15
Forum: General
Topic: issue with single precision
Replies: 9
Views: 263

Re: issue with single precision

Just tag the end of the literal to what it represents (not always double) That only works with literals: const as double EPSILON = 1e-5 #define fcomp( value1, value2 ) _ iif( abs( value1 - value2 ) < EPSILON, true, false ) dim as double _ a = 5.1 dim as single _ b = 5.1 ? a, b ? cbool( a = 5.1# ), ...
by paul doe
Dec 03, 2018 10:23
Forum: General
Topic: Too restrictive compilation control on dynamic arrays in the main code?
Replies: 30
Views: 904

Re: Too restrictive compilation control on dynamic arrays in the main code?

I proposed to write an article around this subject: ... But as only one person echoed (paul doe, favorably, but probably already knew the subject), I did not write it. ... Indeed, but that's not the point. The point would be to document the technique and, if at all possible, in a place that's easy ...
by paul doe
Dec 03, 2018 10:06
Forum: General
Topic: issue with single precision
Replies: 9
Views: 263

Re: issue with single precision

Can someone please explain what's going on here? I see "a = 5.1" printed but not "b = 5.1" when I run the following code. As Munair told you above, it's the precision of the representation what's preventing to compare them for equality. In general, you don't want to do a direct ...
by paul doe
Nov 30, 2018 11:26
Forum: General
Topic: Import files
Replies: 15
Views: 526

Re: Import files

Gablea wrote:@Paul Doe

So all I need to do now is crate the function that saves the csv file into a fix length data file (think that would be the simplist part of the project)

Yes, indeed. You can use types, directly write the data as strings, bytestreams, whatever. That's entirely up to you now.
by paul doe
Nov 30, 2018 0:39
Forum: General
Topic: Import files
Replies: 15
Views: 526

Re: Import files

@Paul Doe THANK YOU that was just what I was looking for and thank you for the comments explaining what they do it makes sense now And yes I think it was show how to do that but I was struggling to understand what the code did now You have done your example that shows and explains what each section...
by paul doe
Nov 29, 2018 22:03
Forum: General
Topic: Import files
Replies: 15
Views: 526

Re: Import files

...Paul Doe You are splitting on each character in the deliminator, perhaps gablea needs to find and replace blocks... Perhaps it's just me, but Gablea clearly stated he wanted to read each field delimited with a '|' from a CSV-like file: ... But how would I read in files that use | as field sepera...
by paul doe
Nov 29, 2018 20:14
Forum: General
Topic: Import files
Replies: 15
Views: 526

Re: Import files

... Is there any simple examples on here that shows how to do that? Weren't you answered how to do it in another one of your threads ? How hard can it be to rewrite the code to accept any delimiter? Anyway: '' Include needed dependencies #include once "file.bi" /' Splits a string into sub...
by paul doe
Nov 28, 2018 22:34
Forum: Community Discussion
Topic: Nominations for Forum Moderators
Replies: 70
Views: 4258

Re: Nominations for Forum Moderators

Indeed, I think Imortis will do a very good gob as moderator. Fxm too, if he's also willing to accept (Imortis already volunteered).
by paul doe
Nov 16, 2018 15:44
Forum: General
Topic: raytrace try
Replies: 24
Views: 1412

Re: raytrace try

Nice. Another simple optimization that helps shaving a few cycles: instead of dividing by the determinant, you can multiply by its reciprocal, like this: '' ... function m33.inverse() as m33 dim as double d = e11 * e22 * e33 _ - e11 * e32 * e23 _ + e21 * e32 * e13 _ - e21 * e12 * e33 _ + e31 * e12 *...
by paul doe
Nov 14, 2018 14:16
Forum: Tips and Tricks
Topic: Multikey key release
Replies: 12
Views: 437

Re: Multikey key release

Here's a revised version of the above class (the other one is old =D). This one allows for finer control of keys, specifying times for both repeating and releasing of the key. Check the code to see how it works. Might be useful for the folks that are competing in Lachie's compo: '' This file contain...
by paul doe
Nov 12, 2018 23:14
Forum: Tips and Tricks
Topic: Multikey key release
Replies: 12
Views: 437

Re: Multikey key release

Assimilation complete: Nice. You can use a keyboard snooper to look for specific scancodes on your keyboard, too: /' Keyboard snooper This little utility will show you the scancode returned by multiKey(), so you can see which SC corresponds to which one. Useful if you don't want to include fbgfx.bi...

Go to advanced search