Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 07:31 27 Apr 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 : Minor issue with MMEdit

     Page 1 of 2    
Author Message
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 07:38am 06 Apr 2021
Copy link to clipboard 
Print this post

I have been doing a bit of work lately and found that some keywords are not recognised for MMBasic for DOS. See below:
  Quote  
' DOS Basic 5.05.01

ON ERROR skip 1
ON ERROR abort
ON ERROR ignore
ON ERROR CLEAR
DIM a$(5) length 10
OPEN f$ FOR output AS #1
OPEN f$ FOR INPUT AS #1


If I change to CMM2 they are recognised

  Quote  ' CMM2

ON ERROR SKIP 1
ON ERROR ABORT
ON ERROR IGNORE
ON ERROR CLEAR
DIM a$(5) LENGTH 10
OPEN f$ FOR OUTPUT AS #1
OPEN f$ FOR INPUT AS #1


Not a big deal but it is comforting to see the keywords change to uppercase blue as you type them. Al least I know that I have spelled them correctly.

I would correct them if I knew how. Sorry if it's been explained before. Jim?

Bill
Keep safe. Live long and prosper.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5904
Posted: 08:20am 06 Apr 2021
Copy link to clipboard 
Print this post

Syntax words are in the *.tkn files in the data folder.
I will add them for the next update.
You can ad then yourself save waiting. The preferred place is to the second group of words, lowercase and separated by a single space.

Jim
VK7JH
MMedit   MMBasic Help
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 08:55pm 06 Apr 2021
Copy link to clipboard 
Print this post

Thanks Jim,

I thought this is what you meant but it didn't change. Added them in alphabetical order. Is there something else I need to do?

  Quote  then time time$ timer to trace troff tron ucase ucase$ ucase$( until val val( wedit wend while xor  

abort base default explicit float ignore integer length lower none output skip title upper  


Bill
Keep safe. Live long and prosper.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5904
Posted: 09:12pm 06 Apr 2021
Copy link to clipboard 
Print this post

You did change the correct file?

Mine is at:
"C:\Users\Jim\AppData\Local\CCom\MMedit\DOS_5.05.01.tkn"

There is also a DOS4.5 but I doubt you are still on that version.

You also need to re-select the syntax after saving the changes to force a re-read.

Jim
VK7JH
MMedit   MMBasic Help
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 09:26pm 06 Apr 2021
Copy link to clipboard 
Print this post

  Quote  You did change the correct file?


Aha! No I changed the one in 'program files (x86)'.

When I changed the one in the Users folder it worked! Thanks Jim.

Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 05:54am 25 May 2021
Copy link to clipboard 
Print this post

Hi Jim,

The recent MMEdit update undid my changes to DOS_5.05.01.tkn. I've re-entered the words and the bottom line now is:
  Quote   abort base default explicit float ignore integer lower none output skip title upper  


Bill
Keep safe. Live long and prosper.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5904
Posted: 06:12am 25 May 2021
Copy link to clipboard 
Print this post

Sorry about that.
I have definitely added then to the next update.

I blame it on being too preoccupied with b...dy windows.

The double glazed type, not Microsoft.
Replacing windows in the middle of winter is a silly thing to do.

Jim
VK7JH
MMedit   MMBasic Help
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 04:53am 08 Jan 2022
Copy link to clipboard 
Print this post

Hi Jim,

I've broken MMEdit again. Trying the SYSTEM command in MMBasic DOS and found that windows command lines don't like spaces. So I edited the path to MMBasic DOS so that there are no spaces and now MMEdit can't find it. I seem to recall that you told someone else how and where to change it but I can't find the post.

Can you please tell how?

Thanks
Bill
Keep safe. Live long and prosper.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5904
Posted: 06:04am 08 Jan 2022
Copy link to clipboard 
Print this post

hold the shift key down while selecting "run in dos"
VK7JH
MMedit   MMBasic Help
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 06:14am 08 Jan 2022
Copy link to clipboard 
Print this post

Brilliant!

Thanks Jim  

Bill
Keep safe. Live long and prosper.
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 1781
Posted: 06:24am 08 Jan 2022
Copy link to clipboard 
Print this post

"windows command lines don't like spaces"
Path names with spaces work if enclosed in " " on my box.
eg
C:\Windows\System32>cd "C:\Program Files (x86)"
C:\Program Files (x86)>

Perhaps it applies to other commands as well.
Edited 2022-01-08 16:25 by phil99
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5904
Posted: 06:38am 08 Jan 2022
Copy link to clipboard 
Print this post

There is no problem with spaces in path names.
MMEdit is (usually) happy.
I have spaces in the path to mmbasic.exe and my usual bas file folder.

Bill still needed to do the shift thing to re-select the exe.
VK7JH
MMedit   MMBasic Help
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 06:53am 08 Jan 2022
Copy link to clipboard 
Print this post

  Quote  There is no problem with spaces in path names

I usually have no problem but the SYSTEM command in MMBasic Dos/Windows stopped looking at the first space and errored out. Not sure if it's MMBasic or the command line that is the problem. No matter, I'll put a copy of MMBasic.exe in the same folder as the BASIC programs. I shouldn't need a pathname for either MMBasic or the program I want to run from the first then.

Bill
Keep safe. Live long and prosper.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5904
Posted: 08:46am 08 Jan 2022
Copy link to clipboard 
Print this post

With the SYSTEM command you have to include the quotes as required.
MMEdit does that for you.
VK7JH
MMedit   MMBasic Help
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3659
Posted: 09:52am 08 Jan 2022
Copy link to clipboard 
Print this post

  TassyJim said  With the SYSTEM command you have to include the quotes as required


+1

Embed quotes as required & it'll work.

John
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 10:13am 08 Jan 2022
Copy link to clipboard 
Print this post

This was the SYSTEM command I used:

  Quote          SYSTEM "C:\Users\mckiw\Documents\Micros\DOS Basic\mmbasic.exe asssa.bas"
       
QUIT


It stopped at the space after 'dos' with an error (don't remember it exactly). I replaced it with and underscore in the command and in the folder name. That's when MMEdit couldn't find MMBasic.exe. After fixing the problem with MMEdit that I caused it still wouldn't work anyway because I needed to include the full path to AASSA.BAS. I think the command format is correct but the space was not accepted in the path to MMBasic.exe.

I'll look at it again tomorrow.

Bill
Keep safe. Live long and prosper.
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 01:27pm 08 Jan 2022
Copy link to clipboard 
Print this post

Perhaps something like

a$=chr$(34)+C:\Users\mckiw\Documents\Micros\DOS Basic\mmbasic.exe"+chr$(34)+" asssa.bas"
SYSTEM a$
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 01:37am 09 Jan 2022
Copy link to clipboard 
Print this post

Thanks lizby, but Windows is still presented with a 'space' in the command line. I'll just have MMBasic.exe in the same folder and avoid the long and complicated path(s). By the time I add the path to asssa.bas the string may be too long anyway.

Bill
Keep safe. Live long and prosper.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5904
Posted: 06:39am 09 Jan 2022
Copy link to clipboard 
Print this post

I reckon it's a BUG
Even with quotes around the path, it stops at the first space character. The quotes seem to be stripped out.
'system test
exe$=chr$(34)+"C:\Users\Jim\Documents\apps\maximite\DOS MMBasic\MMBasic.exe"+chr$(34)
para$ = chr$(34)+"C:\Users\Jim\Documents\apps\maximite\apps - Copy\atest.bas"+chr$(34)
cmdln$ = exe$+" "+para$
print exe$
print para$
print cmdln$
system cmdln$
end


gave:
Windows MMBasic Ver 5.05.04
Copyright 2011-2021 Geoff Graham

"C:\Users\Jim\Documents\apps\maximite\DOS MMBasic\MMBasic.exe"
"C:\Users\Jim\Documents\apps\maximite\apps - Copy\atest.bas"
"C:\Users\Jim\Documents\apps\maximite\DOS MMBasic\MMBasic.exe" "C:\Users\Jim\Documents\apps\maximite\apps - Copy\atest.bas"
'C:\Users\Jim\Documents\apps\maximite\DOS' is not recognized as an internal or external command,
operable program or batch file.
[8] System cmdln$
Error : Command could not be run
>


Workaround is to create a batch file on the fly and run it.
'system test
exe$=chr$(34)+"C:\Users\Jim\Documents\apps\maximite\DOS MMBasic\MMBasic.exe"+chr$(34)
para$ = chr$(34)+"C:\Users\Jim\Documents\apps\maximite\apps - Copy\atest.bas"+chr$(34)
cmdln$ = exe$+" "+para$
open "go.bat" for output as #1
'print exe$
'print para$
print #1, cmdln$
close #1
pause 500
system "go.bat"
end


and it works!
the atest.bas file did run
THe batch file is
"C:\Users\Jim\Documents\apps\maximite\DOS MMBasic\MMBasic.exe" "C:\Users\Jim\Documents\apps\maximite\apps - Copy\atest.bas"

spaces in both exe path and bas path correctly honoured.

Jim
VK7JH
MMedit   MMBasic Help
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 08:20am 09 Jan 2022
Copy link to clipboard 
Print this post

Thanks Jim, I guess I should have realized that if the error came from MMBasic and not Windows. Logically if Windows allows spaces in filenames and folder names then it should be able to cope with them.

Logic and Window don't always coexist though. I have a laptop in which update finds a missing or corrupted file and stops with an error number. If it's found a problem file, why can't it tell me what it is?

Bill
Keep safe. Live long and prosper.
 
     Page 1 of 2    
Print this page
© JAQ Software 2024