FreeFile(1) - what does Open 256+ really do?
The definition of file number in the Open file syntax states that a FileNumber of 256 through 511 is to be used for files accessible from other applications.
Does anybody know what this really means? What is the difference between opening a random file ... As 1 vs ... As 256?
Thanks!
Re: FreeFile(1) - what does Open 256+ really do?
Where did you get that from?
FreeFile does not take a parameter. It returns the first available file number or an error if more than 255 file handles are currently in use.
http://msdn.microsoft.com/en-us/libr...(v=vs.90).aspx
I would expect open for input as #257 to crash with an error
Re: FreeFile(1) - what does Open 256+ really do?
Pretty sure 8-bit file handles were still in use. 0-255
Re: FreeFile(1) - what does Open 256+ really do?
I remember back in the days when it was not uncommon to only be able to have 3 or 4 open files at a time. Can't remember the exact syntax but there was a line in the cfg file to set max files and was almost always set to a number < 10
Re: FreeFile(1) - what does Open 256+ really do?
Ah... the olden days. Config.Sys, files=20, buffers=40... :)
Re: FreeFile(1) - what does Open 256+ really do?
I knew it had something to do with sys and cfg but I could not remember the name. Thankfully it has been a long time since I needed to edit one of these files. Now I have almost forgotten everything about it.
Re: FreeFile(1) - what does Open 256+ really do?
Really? Are younger programmers that forgetful? ;)
I must admit that I can remember the commands of my old CP/M system better than the .NET stuf I looked at last week.
I put that to WoF.System.Memory.Learning.Programming.NETstuff.Important.Recall again. :)
Re: FreeFile(1) - what does Open 256+ really do?
Its sad just how much my memory has went downhill in recent years. Used to be someone could talk with me for 10 minutes about a project and I would still remember the details 2 years later and now 10 minutes after the conversation I may not even remember having the conversation :(
I think I need to purcahse a new stick or 2 ;)
Re: FreeFile(1) - what does Open 256+ really do?
While I do still remember the old open file limitations this does not have anything to do with that (besides the file numbers were limited to 1 to 255 back then).
This is in VB6. The help screen for the "Open" statement lists the filenumber parameter and then the link on filenumber shows: "Use file numbers in the range 1-255, inclusive, for files not accessible to other applications. Use file numbers in the range 256-511 for files accessible from other applications."
And the FreeFile function accept an optional parameter: 0 = returns 1 - 255, 1 = returns 256-511. (the optional parameter defaults to 0 so it returns 1-255 as it always did).
Somebody at Microsoft obviously did this for a reason but I cannot find any additional information on it and in testing files opened with high vs. low file number and I cannot see the difference.
Re: FreeFile(1) - what does Open 256+ really do?
After some searching I found the info in the Op but nothing to expand on it so I have no idea what a filenumber above 255 would do in VB6. It appears these filenumbers are not supported in later versions of VB and I was not aware they could be used in VB6 until now.
The only thing that makes sense from the little info that is provided would be if you are opening a file to allow shared access but I was under the impression that the shared option was the method which should be used for this so again I do not know.
My take would be to stick with normal filenumbers 1-255
Re: FreeFile(1) - what does Open 256+ really do?
I must admit, I never heared about that optional parameter on FreeFile at all.
How do you share a file with another application anyway? One is reading it, the other is writing to it?
Re: FreeFile(1) - what does Open 256+ really do?
Quote:
Originally Posted by
DataMiser
After some searching I found the info in the Op but nothing to expand on it so I have no idea what a filenumber above 255 would do in VB6.
Could you post that link... I cant seem to find anything official..
only this obscure post where he says that Freefile(1) allows you to access the next 255 file numbers...
Re: FreeFile(1) - what does Open 256+ really do?
It is actually in the msdn help that came with VB6 under the Open Statement.
Here is a link related to VBA which says pretty much the same thing.
http://msdn.microsoft.com/en-us/libr...(v=vs.60).aspx
Re: FreeFile(1) - what does Open 256+ really do?