Code Comments
Programming Forum and web based access to our favorite programming groups.Help. An existing app that uses Directory() to get the file name(s) form a floopy disk has stopped working since it was moved to an Xp computer. I looked using the debugger and the function returns an empty array. John
Post Follow-up to this messageOn Thu, 9 Dec 2004 10:50:44 -0500, "John Scott" <jscott@kw.igs.net> wrote: >Help. An existing app that uses Directory() to get the file name(s) >form a floopy disk has stopped working since it was moved to an Xp >computer. I looked using the debugger and the function returns an >empty array. > Go & grab IsFloppy() from: http://www.witzendcs.co.uk/html/links.html Here's what it does: IsFloppy() The purpose of this protected-mode safe function is to allow the reading of floppy disks from Clipper while operating under Windows 2000 or XP. To use the function, add the enclosed isfloppy.obj to your link script & call the function like this: if IsFloppy("A") // or "B" or any letter // execute code to access floppy else Alert("No or unformatted floppy") endif
Post Follow-up to this messageI need the function to return an array containing the file names that are on the diskette. I already have some functions for verifying the diskett is loaded. John "Nick Ramsay" <news@nospam.demon.co.uk> wrote in message news:1vvgr0969a49reu6revh5bitbj6vk98881@ 4ax.com... > On Thu, 9 Dec 2004 10:50:44 -0500, "John Scott" <jscott@kw.igs.net> > wrote: > > > Go & grab IsFloppy() from: > > http://www.witzendcs.co.uk/html/links.html > > Here's what it does: > > IsFloppy() > > The purpose of this protected-mode safe function is to allow the > reading of floppy disks from Clipper while operating under Windows > 2000 or XP. > > To use the function, add the enclosed isfloppy.obj to your link > script > & call the function like this: > > if IsFloppy("A") // or "B" or any letter > // execute code to access floppy > else > Alert("No or unformatted floppy") > endif >
Post Follow-up to this messageOn Thu, 9 Dec 2004 14:31:12 -0500, "John Scott" <jscott@kw.igs.net>
wrote:
>I need the function to return an array containing the file names that
>are on the diskette. I already have some functions for verifying the
>diskett is loaded.
But I guess they do not work correctly. Nick's does. See below.
>
>John
>
>"Nick Ramsay" <news@nospam.demon.co.uk> wrote in message
> news:1vvgr0969a49reu6revh5bitbj6vk98881@
4ax.com...
>
John,
With respect...read Nick's message again...and then do this..
if IsFloppy("A") // or "B" or any letter
// execute code to access floppy
aFiles := Directory("*.DBF" ) // or whatever
else
Alert("No or unformatted floppy")
endif
Regards,
Ross McKenzie
ValuSoft
Melbourne Australia
valusoft AT optushome DOT com DOT au
When there's a will, I want to be in it
Post Follow-up to this messageMy problem is not recognizing when a diskett is ready, it is when
executing the line
aFiles=Directory("a:*.*")
After this line executes the array aFiles is empty. It worked fine in
Win98 but not on an XP machine. I need a replacement for the
Directory() or ADir() functions. Niether one works in XP Pro with SP2
applied.
John
"Ross McKenzie" <NoJunk_valusoft@optushome.com.au> wrote in message
news:41b8c685.1622062@news...
> On Thu, 9 Dec 2004 14:31:12 -0500, "John Scott" <jscott@kw.igs.net>
> wrote:
>
>
> But I guess they do not work correctly. Nick's does. See below.
>
>
> John,
>
> With respect...read Nick's message again...and then do this..
>
> if IsFloppy("A") // or "B" or any letter
> // execute code to access floppy
> aFiles := Directory("*.DBF" ) // or whatever
> else
> Alert("No or unformatted floppy")
> endif
>
>
> Regards,
>
> Ross McKenzie
> ValuSoft
> Melbourne Australia
>
> valusoft AT optushome DOT com DOT au
>
> When there's a will, I want to be in it
Post Follow-up to this messageOn Fri, 10 Dec 2004 10:46:06 -0500, "John Scott"
<jscottwithoutspam@kw.igs.net> wrote:
>My problem is not recognizing when a diskett is ready, it is when
>executing the line
>
>aFiles=Directory("a:*.*")
>
>After this line executes the array aFiles is empty. It worked fine in
>Win98 but not on an XP machine. I need a replacement for the
>Directory() or ADir() functions. Niether one works in XP Pro with SP2
>applied.
>
Sigh - yes, we know. My function will force XP to read the contents
of the floppy instead of assuming it is empty. You don't need to
replace anything, you just need to persuade XP to give Clipper the
contents of the directory on the floppy. That's what IsFloppy() does.
Post Follow-up to this messageIn article <dKKdnU-3bIAiWSTcRVn-rg@igs.net>
jscottwithoutspam@kw.igs.net "John Scott" writes:
[Please don't top post...]
> My problem is not recognizing when a diskett is ready, it is when
> executing the line
>
> aFiles=Directory("a:*.*")
Perhaps the diskette is not "ready"?
> After this line executes the array aFiles is empty. It worked fine in
> Win98 but not on an XP machine. I need a replacement for the
> Directory() or ADir() functions. Niether one works in XP Pro with SP2
> applied.
I beg to differ; ADIR() works fine on the XP machines I use it on
(admittedly under S87, but I doubt that this is significant).
What I have found though is that certain diskettes that have been
written under LFN-aware versions of Windows will not be read by
DOS apps (or rather the underlying DOS service calls) as these
calls get
between LFNs and volume labels. The diskette
gives all the signs of being "not ready".
Try a diskette that has been formatted under plain DOS and which
has only upper case, 8.3 filenames on it.
Pete
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Post Follow-up to this messageOn Fri, 10 Dec 2004 17:57:28 +0000 (UTC), pete@nospam.demon.co.uk wrote: >In article <dKKdnU-3bIAiWSTcRVn-rg@igs.net> > jscottwithoutspam@kw.igs.net "John Scott" writes: > >[Please don't top post...] > > >Perhaps the diskette is not "ready"? > > >I beg to differ; ADIR() works fine on the XP machines I use it on >(admittedly under S87, but I doubt that this is significant). >What I have found though is that certain diskettes that have been >written under LFN-aware versions of Windows will not be read by >DOS apps (or rather the underlying DOS service calls) as these >calls getbetween LFNs and volume labels. The diskette >gives all the signs of being "not ready". > It's not quite that simple, Pete. For some reason, Clipper 5.2x (and maybe others) has a problem accessing the floppy in protected mode under NT & friends. Do you remember the old CP/M trick where you had to do ctrl-c on a floppy to get CP/M to re-read the directory when you changed floppies? (Remember, hell you're probably still doing it ;-) It's quite similar to that, only XP always insists that there's nothing on the floppy. What my little function does is a low-level verify of track 1, side 1 which tests if the floppy is readable without invoking the DOS error handler if it isn't & also has the side benefit of making the floppy contents visible to the Clipper app. I suspect that directly invoking DOS int 13h does "something" to the VDM, but I have no real evidence other than empirical.
Post Follow-up to this messageIn article <3v7lr0dkbqitk8iscg6r0dtrkq35s863hk@4ax.com> delete-all-spam2@witzendcs.co.uk "Nick Ramsay" writes: > On Fri, 10 Dec 2004 17:57:28 +0000 (UTC), pete@nospam.demon.co.uk > wrote: [..] > > It's not quite that simple, Pete. It rarely is :-( > For some reason, Clipper 5.2x (and > maybe others) has a problem accessing the floppy in protected mode > under NT & friends. Ah, so it's a pmode thing -- outside my S87 territory. Apologies to the OP for the bum steer. > Do you remember the old CP/M trick where you had > to do ctrl-c on a floppy to get CP/M to re-read the directory when you > changed floppies? (Remember, hell you're probably still doing it ;-) Indeed so -- outed at last <bg> > It's quite similar to that, only XP always insists that there's > nothing on the floppy. What my little function does is a low-level > verify of track 1, side 1 which tests if the floppy is readable > without invoking the DOS error handler if it isn't & also has the side > benefit of making the floppy contents visible to the Clipper app. I > suspect that directly invoking DOS int 13h does "something" to the > VDM, but I have no real evidence other than empirical. Hmm -- interesting. Don't you just hate black magic? ;-) Pete -- "We have not inherited the earth from our ancestors, we have borrowed it from our descendants."
Post Follow-up to this messageOn Sat, 11 Dec 2004 15:05:27 +0000 (UTC), pete@nospam.demon.co.uk wrote: ..snipped with a dead chook... > >Hmm -- interesting. Don't you just hate black magic? ;-) > >Pete Not if it works for you <g>. Regards, Ross McKenzie ValuSoft Melbourne Australia valusoft AT optushome DOT com DOT au When there's a will, I want to be in it
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.