It is currently Fri May 24, 2013 2:16 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Createfile with high number - irritating warning
PostPosted: Sat May 12, 2012 8:34 am 
Offline
User
User
User avatar

Joined: Sun Aug 08, 2004 6:34 pm
Posts: 42
Location: Norway
Please remove the error/debug stop or whatever it is that tells me "#File object number is very high (over 1000), are You sure of that ?" when trying to Createfile(1000,"c:\test.ini").

I find no use of such a limitation, it's plain ridiculous!

Let the user decide if he/she creates a file number of 999/1000. That's their worry, not PureBasic or did I miss something why there is a limit? Can't be a number base question either, then it should be $FF (256) or $FFFF (65536). At least then it would be understandable.

_________________
----
Regards Stone Oakvalley
PB 4.xx - always the latest one...but no betas for me!


Top
 Profile  
 
 Post subject: Re: Createfile with high number - irritating warning
PostPosted: Sat May 12, 2012 9:14 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jan 21, 2011 8:25 am
Posts: 549
It's just a warning. If you put DisableDebugger / EnableDebugger around it,
it will work without halting the program.

The only reason there is a warning is because it's a waste of memory if you use high numbers.
If you want to open a file with the number 100'000 then an array will be created with 100'000
elements, even if you only use one single file.

My recommendation is...just stop using those freaking IDs and use #PB_Any only,
it's much better and more flexible anyway.

_________________
Image
ImageImageImage
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds


Top
 Profile  
 
 Post subject: Re: Createfile with high number - irritating warning
PostPosted: Sat May 12, 2012 11:32 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 1575
Location: Berlin, Germany
No, meaningful warnings like this one should not be removed!

_________________
Math problems?
Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x].


Top
 Profile  
 
 Post subject: Re: Createfile with high number - irritating warning
PostPosted: Sat May 12, 2012 1:42 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Aug 15, 2009 6:59 pm
Posts: 1024
Go to compiler options, enable "Use Warning Mode" and set "Ignore Warnings".

However, as Shield pointed out you are wasting memory by using large numbers (and dont use all lower numbers at the same time).
Also i am not sure if high numbers can conflict with handles returned by using #PB_Any.


Top
 Profile  
 
 Post subject: Re: Createfile with high number - irritating warning
PostPosted: Sat May 12, 2012 4:36 pm 
Offline
User
User
User avatar

Joined: Sun Aug 08, 2004 6:34 pm
Posts: 42
Location: Norway
Ahh, ok. Ignore warnings can do for me. It was not for any serious release program, just a work tool I use a couple of times to produce some datafiles.

I just get confuzed when there is a question to be answered. It do say "if I'm really sure", and in my case, yes, I was 100% sure. The warning should probably spell out something else though. Sounds like an easter egg the way it's written now. Something more true to the cause should be "File numbers over 1000 will consume a lot of memory, please check your arguments." or "Due to OS limitations, please use #PB_Any or numbers below 1000." or even "File numbers above 1000 is not recommended, however, if needed, use the Ignore Warnings command to overrule it"....I can go on and on

:-)

_________________
----
Regards Stone Oakvalley
PB 4.xx - always the latest one...but no betas for me!


Top
 Profile  
 
 Post subject: Re: Createfile with high number - irritating warning
PostPosted: Sat May 12, 2012 5:31 pm 
Offline
PureBasic Bullfrog
PureBasic Bullfrog
User avatar

Joined: Wed Jul 06, 2005 5:42 am
Posts: 6465
The memory wasted by choosing high static object numbers is a good reason to question it to be sure, but it is a bit more complicated than that. The programmer may freely mix static #'s with #PB_Any and it is frequently done. Even if you don't do it you might be using a userlib that is using #PB_Any alongside your static numbers. #PB_Any will choose a high number from its pool and if you've chosen a high static number it has no way of knowing that it isn't creating an object number that is already being used. As the team has told us before, executing Is<your object here>() is relatively slow and so for the #PB_Any system to do it all the time would slow PB down unnecessarily.

That said, I agree with you that the language in the warning could be improved as it imparts no real information. This is a good request imho.

_________________
Veni, vidi, vici.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye