Page 1 of 1

Easter egg or just beeing helpful on our behalf?

Posted: Mon Aug 01, 2005 10:59 pm
by oakvalley
Try:

CreateImage(500000,320,256)
with the debugger on, and read the error.

Yes, suppose I WANT to do that, and I AM sure?

But, Purebasic really means in other words...are you INSANE?!

hehe

Posted: Mon Aug 01, 2005 11:30 pm
by freak
By doing CreateImage(500000,320,256) you allocate space for 499999 other images too.

So yes, that is insane :P

Posted: Mon Aug 01, 2005 11:36 pm
by SoulReaper
wow :shock:

thats half a million images LOL I dont think there is any APP or Game that would even need that....

Still nice to see the limits of Pure Basic being tested :wink:

Posted: Tue Aug 02, 2005 1:08 pm
by whertz
If I use CreateImage(10,.. or LoadImage(10,...etc as the first image in my program does that mean ten other images are allocated too?

Posted: Tue Aug 02, 2005 1:20 pm
by Fred
It means than a room to handle 10 images is allocated, the images aren't really created. For example, each images need 20 bytes to be handled by PB, so 220 bytes will be used in your case.

Posted: Tue Aug 02, 2005 1:30 pm
by freak
Yes. In the case of 10 or 100 or even 1000, that is not a really a problem, as the memory that is allocated but not used is small,
but with the number of 500000, there are 9.5 Mb allocated that are not needed.

Posted: Tue Aug 02, 2005 1:36 pm
by Fred
BTW, using #PB_Any allows to have any number of images (only memory limited).

Posted: Wed Aug 03, 2005 5:05 pm
by oakvalley
Well, I did not actually have to assign so many images, but I found
the respond message kinda "out of place".

Think it's the first time purebasic has gotten personal in it's messages,
and referring to me directly with "are you sure of that ?"

No other errors I've seen did that on a personal level. Maybe purebasic
is getting "aware" and start self-improve without Fred's help. Now, that
would be nice....self learning software computerprogrammingsoftware software.

:)

Posted: Thu Aug 04, 2005 7:48 pm
by netmaestro
I find that the "are you sure of that?" message is returned in many situations where the parameters supplied by the programmer are fairly far out of the usual bounds the compiler is expecting for the given operation. I might add that in the seven or eight different cases where I've encountered the message, there wasn't a single time where I was using the language correctly and should have been "sure of that". So when I see it now I start from the assumption that I'm off base and Fred is trying to rescue me from the murky depths of my noobishness. (-the nooby murks of my depthishness?)
Huh? Are you sure of that?____________________________________________| :)

Actually, I think any compiler message which doesn't feature the word 'Moron' is polite and helpful. But that's just me.

Posted: Thu Aug 04, 2005 10:40 pm
by traumatic
netmaestro wrote:Actually, I think any compiler message which doesn't feature the word 'Moron' is polite and helpful. But that's just me.
:lol: