Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : FileManager Program
Page 1 of 2 | |||||
Author | Message | ||||
Nick Guru Joined: 09/06/2011 Location: AustraliaPosts: 512 |
Here is a simple File Manager program I wrote that will allow you to organize your files on the SD card from the Maximite. It's a dual window interface similar to Directory Opus on the Amiga. It allows you to view 2 directory paths and copy files easily between them. Usage: UP and Down arrows move cursor up and down to make a selection. RIGHT and LEFT move the Source window from left to right. SPACEBAR tags and untags files ENTER enters the Command Panel in the centre (Up/Down arrows to select) ENTER again within the Command Panel executes selected command. (LEFT or RIGHT exits) ESC cancels all tagged items. Entering a blank (ENTER with no text) into a text fields skips that entry. There is a display limit of 44 files and directories in each window. Simple! I assume no responsibilty for any files lost with the use of this program from any possible bugs or user error. Backup your SD (or use another) when trialing this program. I never lost anything but be careful how you use it. Once you accept to delete something, it's gone! Here is the BASIC file: 2012-07-28_204005_FILEMAN.zip |
||||
Raros Regular Member Joined: 06/02/2012 Location: ItalyPosts: 55 |
Hi all. Thanks Nick, is the program I was trying to do . Raros. |
||||
paceman Guru Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Great stuff Nick, that'll make life easier. Now if only all programs would run OK from their own directory! Greg |
||||
DuinoMiteMegaAn Senior Member Joined: 17/11/2011 Location: AustraliaPosts: 231 |
@Nick Whats with all the "optional" spamware programs on the install program? |
||||
Nick Guru Joined: 09/06/2011 Location: AustraliaPosts: 512 |
Yes. The program and only the program. The way all programs should be. |
||||
darthmite Senior Member Joined: 20/11/2011 Location: FrancePosts: 240 |
Great Nick , If we continue like this at end we will got a Amiga out of the MM Cheers. Darth. Theory is when we know everything but nothing work ... Practice is when everything work but no one know why ;) |
||||
BobDevries Senior Member Joined: 08/06/2011 Location: AustraliaPosts: 266 |
Hi Nick, I just loaded your Filemanager programme. I get an error: [79] k$=Inkey$:If k$="" Then GoTo WAIT1 Else k=Asc(k$) Error: Invalid line number. I'm using version 3.2C of MMBasic Regards, Bob Devries Dalby, QLD, Australia |
||||
BobDevries Senior Member Joined: 08/06/2011 Location: AustraliaPosts: 266 |
Nick, I did a bit of fiddling around, and I came to the conclusion that the interpreter may be expecting a GOTO after an ELSE in this line: WAIT1:k$=inkey$:if k$="" then goto WAIT1 else k=asc(k$) I was able to reproduce the error with just that line (and the label of course). If I remove the end of that line starting with "else", the code works. Can anyone comment further? Am I doing something wrong here? Regards, Bob Devries Dalby, QLD, Australia |
||||
BobDevries Senior Member Joined: 08/06/2011 Location: AustraliaPosts: 266 |
Here's a solution.... If I reverse the logic, it works: WAIT1: k$=inkey$:if k$<>"" then k=asc(k$) else goto WAIT1 Comments? Regards, Bob Devries Dalby, QLD, Australia |
||||
BobD Guru Joined: 07/12/2011 Location: AustraliaPosts: 935 |
try this Bob WAIT1: do k$=inkey$ loop until k$ <> "" k=asc(k$) the WAIT1: may now be redundant if it is not referenced elsewhere in the program. |
||||
Nick Guru Joined: 09/06/2011 Location: AustraliaPosts: 512 |
I'll have to check when I'm back home from work but... Should WAIT1: be on a line on its own? I had standardized on all labels to be on a line by themselves so I don't know why this line has it combined with the IF THEN. Maybe a last minute typo or slip of the DELETE key on my part? Nick |
||||
BobDevries Senior Member Joined: 08/06/2011 Location: AustraliaPosts: 266 |
No, Nick, you had the WAIT1 on a line by itself. I moved it, but it made no difference. It was only when I reversed the logic, that it worked for me. Regards, Bob Devries Dalby, QLD, Australia |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
Same problem on my MM. My solution is the same as BobD i.e. do k$=inkey$ loop until k$ <> "" k=asc(k$) which means you don't need the WAIT1: any more or for that matter WAIT2 and 3. Nice program otherwise, will be most useful. Cheers, Anthony, |
||||
Nick Guru Joined: 09/06/2011 Location: AustraliaPosts: 512 |
Hmm. Works fine on mine. I had 3.2 and it worked there (it was orginally developed on that version). I didn't apply the later "bug fixed" versions such as 3.2C. I am now running a pre-release version 4.0 beta 9 and it's working fine there also. Maybe a bug in certain versions? Bob Devries is running 3.2C. What are you run ajkw? Is anyone else running it ok nand what version of BASIC have you got? One weird thing I did discover is that everything worked fine with the directory deletion routine except when I put my SD into my PC and transfered some files into a folder. It all wolrked fine back on the Maximite, but although I cought empty that new folder by deleting the files within, I couldn't delete the folder. I thought it was my program but the same was happening from the MBasic prompt using the commands directly. The folder was empty but it kept reporting that it was not and wouldn't delete the folder. Back on the PC, I deleted it no problem. A bug in MBasic's Fat32 file structure? |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
Nick, Am on 3.2C. I have had a go at directory deletion problem and have found that a file sent to the recycle bin on the PC, rather than deleting in, will later cause the folder not empty error on the MM when trying to delete the folder. Also, I do get further errors in line 213 when changing directories back a level with (DIR) .. I think that this is also related to a GoTo (or GoSUB) label in a IF / THEN code line. i.e. the MM throws an error, Invalid line number. Cheers, Anthony. |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
Nick, more testing, a bug perhaps !! or are we doing something incorrect?? ---test code--- main: for i = 1 to 10 if i = 5 then gosub test else print i next i end test: print "test" return --- end test code--- This code generates the error Error: Invalid line number on my 3.2C when i = 5. Removing the else print i and all works ok. There is something with the goto/gosub label followed by else. Cheers, Anthony. |
||||
Nick Guru Joined: 09/06/2011 Location: AustraliaPosts: 512 |
I don't suppose it's easy to downgrade the firmware to a previous version and see what you get? |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
standby. a familiar task. |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
BUG in 3.2C, I think there is. I reverted to 3.0 and got the expected result from my test code from above, no errors. (however Fileman failed at the Dim in line 5 with an Out of General Memory error.) Now someone has to tell Geoff, he doesn't like bugs... Cheers, Anthony. |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
This is rather confusing but I think that a small change that I made in 4.0 also fixed this bug that existed in 3.2C. That is why Nick is not seeing it but others are. Ah, well... 4.0 will be out soon, then we can all be the same. For the meantime, the workaround will be to avoid an assignment in the ELSE portion of a single line IF statement. Geoff Geoff Graham - http://geoffg.net |
||||
Page 1 of 2 |
Print this page |