Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:46 26 Nov 2024 Privacy Policy
Jump to

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: Australia
Posts: 512
Posted: 10:40am 28 Jul 2012
Copy link to clipboard 
Print this post

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
Edited by Nick 2012-07-29
 
Raros

Regular Member

Joined: 06/02/2012
Location: Italy
Posts: 55
Posted: 01:02am 29 Jul 2012
Copy link to clipboard 
Print this post

Hi all.

Thanks Nick, is the program I was trying to do .

Raros.
Edited by Raros 2012-07-30
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 03:40am 29 Jul 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 231
Posted: 08:17am 29 Jul 2012
Copy link to clipboard 
Print this post

@Nick
Whats with all the "optional" spamware programs on the install program?
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 09:55am 29 Jul 2012
Copy link to clipboard 
Print this post

  DuinoMiteMegaAn said  
Whats with all the "optional" spamware programs on the install program?


Yes. The program and only the program. The way all programs should be.
 
darthmite

Senior Member

Joined: 20/11/2011
Location: France
Posts: 240
Posted: 01:07pm 29 Jul 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 266
Posted: 02:55pm 29 Jul 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 266
Posted: 03:35pm 29 Jul 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 266
Posted: 03:43pm 29 Jul 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 935
Posted: 03:50pm 29 Jul 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 512
Posted: 08:33pm 29 Jul 2012
Copy link to clipboard 
Print this post

  BobDevries said   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,


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: Australia
Posts: 266
Posted: 10:01pm 29 Jul 2012
Copy link to clipboard 
Print this post

  Nick said  
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


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: Australia
Posts: 290
Posted: 10:37pm 29 Jul 2012
Copy link to clipboard 
Print this post

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,
Edited by ajkw 2012-07-31
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 10:50pm 29 Jul 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 290
Posted: 11:45pm 29 Jul 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 290
Posted: 11:54pm 29 Jul 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 512
Posted: 11:59pm 29 Jul 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 290
Posted: 12:11am 30 Jul 2012
Copy link to clipboard 
Print this post

standby. a familiar task.
 
ajkw
Senior Member

Joined: 29/06/2011
Location: Australia
Posts: 290
Posted: 12:28am 30 Jul 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 3194
Posted: 12:54am 30 Jul 2012
Copy link to clipboard 
Print this post

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
© JAQ Software 2024