Simple Drive Display - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Utilities (https://staging.qb64phoenix.com/forumdisplay.php?fid=8) +---- Thread: Simple Drive Display (/showthread.php?tid=1256) |
Simple Drive Display - eoredson - 12-10-2022 Hi, I wrote this simple drive display function which is not that large. It works in QB64 and uses library function GetDrivetype. My question was: Id there a equivalent QB45/71 function to return drive type such as [cdrom] or [removable]?? Thanks, Erik. RE: Simple Drive Display - Pete - 12-10-2022 A QBasic way... Code: (Select All) ON ERROR GOTO er1 The "not ready" is going to be the optical drive if it does not contain media. Error 68 is drive not ready. We can't use CHDIR as it will not differentiate a drive not ready, therefore it would not show the optical drive at all. ~.~ simply denotes a file name no one should have. It triggers the error 53, file not found, which we ignore. Error 76 is drive not found. Pete RE: Simple Drive Display - eoredson - 12-10-2022 This drive function works well in QB64 2.0.2 but in QB64 PE 3.4.1 throws an error which I cannot figure out: C++ Compilation failed (Check .\internal\temp\compilelog.txt) Nevermind: I had checked "Strip C++ symbols from executables." in Compiler settings in Alt-Options.. :? (i get worried when a Print "Hello world!" doesn't work...) RE: Simple Drive Display - mnrvovrfc - 12-10-2022 This is an issue that has been discussed somewhat: https://staging.qb64phoenix.com/showthread.php?tid=1183 Something was changed in MinGW which is preventing some programs from being created successfully. You could try to separately install v3.4.0 for now and try Pete's example again. RE: Simple Drive Display - Pete - 12-10-2022 Change the ~.~ to something less cryptic like "NoSuchFile.abc" Pete RE: Simple Drive Display - Pete - 12-10-2022 Just downloaded 3.4.1 and the original code I posted compiled and worked just fine. Pete RE: Simple Drive Display - eoredson - 12-10-2022 (12-10-2022, 08:28 AM)Pete Wrote: Just downloaded 3.4.1 and the original code I posted compiled and worked just fine. Thanks Pete.. It was a problem with a compiler setting! Erik. RE: Simple Drive Display - Pete - 12-10-2022 No problem. And now, thanks to your post, I've got V 3.4.1. Win-Win. Pete RE: Simple Drive Display - eoredson - 12-10-2022 Actually I was thinking more upon this: Code: (Select All) Declare Library RE: Simple Drive Display - mnrvovrfc - 12-10-2022 (12-10-2022, 09:06 AM)eoredson Wrote: Actually I was thinking more upon this:Why not have the function return a string instead? Needing a global string variable for the drive type is clunky. Could make it so it returns two values for the "not found" cases such as "[NONE][BADROOT]" or something else. |