Search found 3863 matches

by MrSwiss
Apr 06, 2016 17:28
Forum: General
Topic: How can I close this file (and only this one)?
Replies: 18
Views: 2630

Re: How can I close this file (and only this one)?

It appears to me, that you're trying to be difficult, because it can also be done without a Variable.

Code: Select all

close( (FreeFile()-1) )
This closes the "last" opened File.
by MrSwiss
Apr 06, 2016 17:13
Forum: General
Topic: How can I close this file (and only this one)?
Replies: 18
Views: 2630

Re: How can I close this file (and only this one)?

A hack:

Code: Select all

open "xfile" for output as #(freefile())
dim as long ff = FreeFile
close( #(ff-1) )
No more "later changing Rules", please!
by MrSwiss
Apr 06, 2016 16:39
Forum: Documentation
Topic: Open syntax -> what is the function result type?
Replies: 28
Views: 3810

Re: Open syntax -> what is the function result type?

Tourist Trap wrote:You can post it in tips and tricks.
Done, see Link below ...

File "open" UDT
by MrSwiss
Apr 06, 2016 16:17
Forum: General
Topic: How can I close this file (and only this one)?
Replies: 18
Views: 2630

Re: How can I close this file?

Code: Select all

'close #(freefile())  ----> crash
close    ' closes all open Files (no comment, crash etc.)
The problem is:
you are assigning #2 (while attempting to "close"), to a File opened as #1 ...
by MrSwiss
Apr 06, 2016 16:11
Forum: Sources, Examples, Tips and Tricks
Topic: File "open" UDT
Replies: 5
Views: 1364

File "open" UDT

Hi all, just some "proof of Concept" - Code on: tracking of Files "opened"/"closed" in a simple Type and a few Functions (by no means finished!). I call it "FILEEXT.bas" : ' ==================================================================== ' FILEEXT.bas - A...
by MrSwiss
Apr 06, 2016 15:27
Forum: Documentation
Topic: Open syntax -> what is the function result type?
Replies: 28
Views: 3810

Re: Open syntax -> what is the function result type?

Unless testing with trying a kill, which is rather radical. There are at least workaround's possible. Remember my Idea of using a Type to keep track of Files "open" ... Just for "proof of Concept" I've coded a short hack on that. But I think that Code in this Section is not a ve...
by MrSwiss
Apr 06, 2016 15:05
Forum: Documentation
Topic: Open syntax -> what is the function result type?
Replies: 28
Views: 3810

Re: Open syntax -> what is the function result type?

Tourist Trap wrote:the crash triggered by name()'s call is more a bug
Well, not really ... if you check first, if the File is "closed".
by MrSwiss
Apr 06, 2016 14:55
Forum: Documentation
Topic: Open syntax -> what is the function result type?
Replies: 28
Views: 3810

Re: Open syntax -> what is the function result type?

But they can conflict: open "aaaaaa.aaaaaaa" for output as #1 name "aaaaaa.aaaaaaa", "bbbb.bbbb" '-----> crash ... via Shell command maybe. I think I'll test a rename with a Shell call to see if the crash remains. You don't have to test that: it won't work! Not a Crash...
by MrSwiss
Apr 06, 2016 14:24
Forum: Documentation
Topic: Open syntax -> what is the function result type?
Replies: 28
Views: 3810

Re: Open syntax -> what is the function result type?

There is more on File Handles: e.g. we have an open File with #1 (for append), but now we also want to copy the #1 content to another location ... we can, "via OS" force a second Handle to the same File (that has already #1), however I'm not certain that FB can manage this (OS Commands lik...
by MrSwiss
Apr 06, 2016 14:01
Forum: Beginners
Topic: How to erase a file, retrieve filename bound to filenum, rename a file
Replies: 22
Views: 908

Re: How to erase a file, retrieve filename bound to filenum, rename a file

Tourist Trap wrote:Shouldn't a file opened via Open(), be closed as fast as possible after the FILES' functions usage that motivates the opening?
Yes, but more due to the Restriction to, the max. "Files Open" = 255. OS could handle more "open" Files, I think (a FB limitation, probably).
by MrSwiss
Apr 06, 2016 13:38
Forum: Beginners
Topic: How to erase a file, retrieve filename bound to filenum, rename a file
Replies: 22
Views: 908

Re: How to erase a file, retrieve filename bound to filenum, rename a file

... an association with a file handle number (for instance provided via Freefile() and comprised within 1..255). Where is this knowledge coming from? DOC says: FreeFile() as Long ... On 32-bit signed whole-number data type. Can hold values from -2147483648 to 2147483647. Corresponds to a signed DWO...
by MrSwiss
Apr 06, 2016 11:33
Forum: Sources, Examples, Tips and Tricks
Topic: image info udt
Replies: 18
Views: 2001

Re: image info udt

If I changed it to what you say it should read, ImageDestroy(im) would always crash trying to destroy a non valid image. You are right (I've missed the ImageInfo part in code), Pointer Non-ZERO check: If (im <> 0) Then ... EndIf If you want to check for Pointer "recycling/reuse" then: If ...
by MrSwiss
Apr 06, 2016 10:44
Forum: Sources, Examples, Tips and Tricks
Topic: image info udt
Replies: 18
Views: 2001

Re: image info udt

[duplicate]deleted ...[/duplicate]
by MrSwiss
Apr 06, 2016 10:30
Forum: Linux
Topic: Win to Linux conversion
Replies: 4
Views: 1490

Re: Win to Linux conversion

b3333734 wrote:If linux doesn't use dll's, what are the equivalents?
The equivalent of a .dll in LIN, is a .so (dynamically loaded LIB, at run-time).
by MrSwiss
Apr 06, 2016 2:35
Forum: Sources, Examples, Tips and Tricks
Topic: image info udt
Replies: 18
Views: 2001

Re: image info udt

Mr.Swiss, I'm reasonably sure I got it right. ImageInfo returns 0 when there is a valid image at the pointer. I'm NOT talking about any Function Return, but about the Number the Pointer holds (the Start Memory Address, of the Block allocated by ImageCreate()). There is a Difference between Print Po...