Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 21:50 28 Mar 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 : MICROMITE PLUS SD PROBLEM

Author Message
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 875
Posted: 06:41am 24 Dec 2019
Copy link to clipboard 
Print this post

I have been playing with a project on the mm plus E64 where I came to a problem accessing a small database on the SD card. The problem was that within the program I could access the file (32K) and count the records then when I close the file and re-open it later in the program I got an error of file not open. Looked at the MM build and it showed ver 5.03.02 so I decided to update to version 5.05.02. This all went Ok but now I cannot load the program as when I type LOAD "PROGRAM.BAS" I get Error: Invalid in a program. And this occurs no matter which file I try to load.

Any guidance would be much appreciated.
OA47
 
SWA-Guy
Newbie

Joined: 01/02/2019
Location: Germany
Posts: 24
Posted: 01:48pm 24 Dec 2019
Copy link to clipboard 
Print this post

Hi,

I have the same problem with my Explore 100 and ver 5.05.02.
If I go back to ver 5.05.01 the "LOAD" command works correcly.
I use the sd-card slot from the SSD1963 5" lcdpanel.
Here my configuration:

OPTION BAUDRATE 230400
OPTION COLOURCODE ON
OPTION DISPLAY 24, 66
OPTION LCDPANEL SSD1963_5, LANDSCAPE, 48, 6
OPTION TOUCH 1, 40, 39
GUI CALIBRATE 1, 113, 3826, 2086, -1310
OPTION SDCARD 47
OPTION LCDPANEL CONSOLE

Merry chrismas from Germany.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5867
Posted: 08:48pm 24 Dec 2019
Copy link to clipboard 
Print this post

You have found a bug.

Geoff will probably be thinking "bah humbug!"

The LOAD command was changed in V5.05.02 to create an error when trying to LOAD from within a program but it appears that things went astray a bit.

From the change log:
"Trying to use LOAD "file" in a program will now generate an error. LOAD "file", R is
unchanged can be used both in a program and at the command prompt."

I can confirm that LOAD "myprog.bas" from the command prompt does raise an error.
LOAD "myprog.bas" ,R does load and run as expected.

So, LOAD "myprog.bas" ,R followed by ctrl-C will get you there for now.

Jim
VK7JH
MMedit   MMBasic Help
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 875
Posted: 09:04pm 24 Dec 2019
Copy link to clipboard 
Print this post

Tassy Jim, thank you for the xmas present, I can now continue with the project over the next couple of days I have off.

Merry Xmas Shedders  
OA47
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 875
Posted: 10:23pm 24 Dec 2019
Copy link to clipboard 
Print this post

This one may slow me down a bit. When reading the data base with LINE INPUT, CC$ if the string has leading zeros then they are ommitted.
Database entry 0000GOSH
LINE INPUT READS CC$="GOSH"



Curses, foiled again.
OA47
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3163
Posted: 11:18pm 24 Dec 2019
Copy link to clipboard 
Print this post

Bummer, and there I was thinking that V5.05.02 was near perfect.  OK, after Christmas I will look into these reports.

Thanks,
Geoff
Geoff Graham - http://geoffg.net
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 875
Posted: 11:31pm 24 Dec 2019
Copy link to clipboard 
Print this post

Thanks Geoff, sorry to interrupt your Christmas. I can wait until the new year. I might be able to modify the database to change the leading zeros. By the way the leading zeros in the string from the file is apparent in 5.03.

OA47
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5867
Posted: 01:31am 25 Dec 2019
Copy link to clipboard 
Print this post

Are the leading zeros chr$(0) or chr$(48)- "0"

Jim
VK7JH
MMedit   MMBasic Help
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 875
Posted: 02:38am 25 Dec 2019
Copy link to clipboard 
Print this post

Jim, the string is saved as "00000HG1LH000V" but reads back in as "HG1LH000V".

I have just been thru the database and changed each "0" to "O" and I will see if I can use it.

OA47
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5867
Posted: 04:21am 25 Dec 2019
Copy link to clipboard 
Print this post

This works for me:
  Quote    OPEN "my.db" FOR output AS #2
 
FOR n = 1 TO 10
   
PRINT #2, "00000HG1LH000V"
 
NEXT n
 
CLOSE #2
 
'
 OPEN "my.db" FOR INPUT AS #3
 
FOR n = 1 TO 10
   
LINE INPUT #3, txt$
   
PRINT txt$
 
NEXT n
 
CLOSE #3


I'm supposed to be having my after dinner nap about now...

Jim
VK7JH
MMedit   MMBasic Help
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 875
Posted: 06:40am 30 Dec 2019
Copy link to clipboard 
Print this post

Any thoughts on this one?

[247] MID$(RP$,J,1)="1"
Error: MID is not declared
> ? J
5
> ? mm.ver
5.0502
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3163
Posted: 07:01am 30 Dec 2019
Copy link to clipboard 
Print this post

MID$() cannot be used as a command (ie, be assigned a value like PIN()).
Some BASICs (I cannot remember which) did allow this but not MMBasic.
Geoff Graham - http://geoffg.net
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 875
Posted: 07:13am 30 Dec 2019
Copy link to clipboard 
Print this post

Thanks Geoff I shall soldier on.
OA47
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5867
Posted: 07:46am 30 Dec 2019
Copy link to clipboard 
Print this post

Someting like this:
  Quote    a$ = "fred,wilma"
 j =
5
 n$ =
" and "

 b$ = replaceStr$(a$,J,
1,n$)
 
 
PRINT a$
 
PRINT b$
 
FUNCTION replaceStr$(src$,st,n,newStr$)
 replaceStr$=
LEFT$(src$,st-1)+newStr$+MID$(src$,st+n)
END FUNCTION


Jim
VK7JH
MMedit   MMBasic Help
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 875
Posted: 08:46am 30 Dec 2019
Copy link to clipboard 
Print this post

Thanks again Jim. I replaced the string with a number that held the appropriate values.
OA47
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1983
Posted: 08:51am 30 Dec 2019
Copy link to clipboard 
Print this post

  Geoffg said  MID$() ... as a command...
Some BASICs (I cannot remember which) did allow this...


Just off the top of me 'ead:

I think all the MS basics from GW onward supported MID$ as a statement (QB and VB defo) as well as Mallard Basic; which was used on the CPCs and the various CPM offerings from Amstrad (i.e. for Speccy+3, PCW etc). There was also a version of this for MSDOS.

It is a rare enough requirement and easy to work round.

all the best
Edited 2019-12-30 20:20 by CaptainBoing
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024