The M2000 Interpreter and Environment has finished as a VB 6 open source project.
Here is a paper for the language M2000. https://github.com/M2000Interpreter/...M2000paper.pdf
Aim of M2000 is the educational branch, as a tool for pupils and for teacher to make some applications to support their course.
The M2000 Interpreter and Environment has finished as a VB 6 open source project.
Here is a paper for the language M2000. https://github.com/M2000Interpreter/...M2000paper.pdf
Aim of M2000 is the educational branch, as a tool for pupils and for teacher to make some applications to support their course.
vb6 projects belong in the Visual Basic 6 and Earlier Forum.
EDIT:
After looking at the code samples at Rosetta and in the manual I tried to create and load file but there appears to be no obvious way to load code saved in a file. Can your program load code from external files? And if so, how?
Last edited by Peter Swinkels; Jul 5th, 2020 at 06:37 AM.
... I tried to create and load file but there appears to be no obvious way to load code saved in a file. Can your program load code from external files? And if so, how?
Alright, when I enter "Load "Stack.gsb" or another *.gsb file the environment crashes. I am getting no errors other than just being thrown straight back into Windows.
But since is it open source, you could try running the program in the IDE and see where it is crashing.
Or, if you really don't have the time and/or interest, I guess wait to see if George will respond. Since he was on earlier today with the update to this thread, perhaps he'll be back soon.
I've see the topic various times over the last several years, but haven't tried any version of it myself. From what I've seen of it on the forum, I'm not sure that I agree with the proposition that this interpreter is better suited for teaching students a programming language compared to VB6.
"... Then he found that Visual Basic is a fantastic environment but not for pupils."
The M2000 interpreter, just from what I've see of it, didn't seem to be easier to comprehend compared to VB6, or other BASICs.
And if you have problems getting it to run, then that doesn't bode well either.
But, since I haven't actually tried it, my minimal observations shouldn't be given much merit.
"Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930
But since is it open source, you could try running the program in the IDE and see where it is crashing.
Or, if you really don't have the time and/or interest, I guess wait to see if George will respond. Since he was on earlier today with the update to this thread, perhaps he'll be back soon.
I've see the topic various times over the last several years, but haven't tried any version of it myself. From what I've seen of it on the forum, I'm not sure that I agree with the proposition that this interpreter is better suited for teaching students a programming language compared to VB6.
The M2000 interpreter, just from what I've see of it, didn't seem to be easier to comprehend compared to VB6, or other BASICs.
And if you have problems getting it to run, then that doesn't bode well either.
But, since I haven't actually tried it, my minimal observations shouldn't be given much merit.
In the ide it appears to compile and run but the interface doesn’t appear. It does appear when I run it compiled as an exe.
I guess what you do now depends on how interested you are in exploring someone's project.
You can hit the || pause button, then click on the debug "step over" button to see where in the code you are, or what the next periodic event that occurs.
You can step through the code to see if you understand what it is doing at that point, and why it might not be showing the M2000 console.
I presume the M2000 console is just a VB6 Form, but have no idea.
Sometimes, if a program is truly new to me, I may just hit the "Step Into" button at the start, rather than the "Run" button, or F5 key so that I can see what the program is doing from the very start.
Perhaps there is some error that is hidden by an OnError statement, so you are just stuck in a loop, repeating the error without handling it, so there is no indication of a fault and you can't progress.
"Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930
I guess what you do now depends on how interested you are in exploring someone's project.
You can hit the || pause button, then click on the debug "step over" button to see where in the code you are, or what the next periodic event that occurs.
You can step through the code to see if you understand what it is doing at that point, and why it might not be showing the M2000 console.
I presume the M2000 console is just a VB6 Form, but have no idea.
Sometimes, if a program is truly new to me, I may just hit the "Step Into" button at the start, rather than the "Run" button, or F5 key so that I can see what the program is doing from the very start.
Perhaps there is some error that is hidden by an OnError statement, so you are just stuck in a loop, repeating the error without handling it, so there is no indication of a fault and you can't progress.
1. Well, I am interested in taking a look; I will see where it goes from there.
2. Does not appear to be working, no code is highlighted when I pause the program.
3. Stepping doesn't appear to be enabled for this particular project.
4. I can't prove or disprove your presumption, there are several forms but none look like the interface displayed while the compiled program was running.
5. Clicking "Step into" or pressing "F5" don't work. The program appears to compile and run; but visible is happening.
6. Disabling 897 error traps worked. Now we're getting somewhere. It now says "Sub or function not defined.". Presumably an external component.
Thank you for replying. I will get back to this thread when I have found out more.
Some investigation told me the following:
1. There is a project group file called "testme.vbg" which can't be loaded from Explorer because Microsoft Visual Basic 6.0 Enterprise will not load it properly. It gets mistaken for a module.
2. When I load the "testme.vbg" file via the "Open Project" menu option Visual Basic throws an error about an invalid key called "StartUpProject", after that an error claiming "VBGROUP 5.0" appears.
3. While I appear unable to reproduce the situation, a dialog stating the project ("m2000.vbg") was made in an earlier version of Visual Basic appeared once or twice.
EDIT:
4. There are several batch files referring to Micosoft Macro Assembler, as near as I can tell the executable needs to be modified after having been compiled with Visual Basic.
EDIT 2:
5. I now noticed the manual has been downloaded as well. Going to have a closer look.
EDIT 3:
6. The manual explains how to use the software, not how to properly compile it or how to set it up...
EDIT 4:
7. There is a readme file with links to a few binaries, some code and the manual. The other text files are a log (only reads: "Line 17: Cannot load control gList2."), the other mentions a *.cab file which I don't appear to have has been built. The other file appears to be a numbered list in both greek and english. BTW: The readme mentions a certificate (ca.crt) that I could install... BTW 2: These binaries turned out to be an M2000 installer and a copy of ca.crt.
Last edited by Peter Swinkels; Jul 6th, 2020 at 01:20 PM.
I'm not really sure what I did, other than the minor pointing out of a page in the manual.
I'm pretty sure I would have stopped after step 5 in post #16 if it were me.
"Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930
I'm not really sure what I did, other than the minor pointing out of a page in the manual.
I'm pretty sure I would have stopped after step 5 in post #16 if it were me.
Your long list inspired me to put more effort into investigating the issue and writing a proper reply.
You can run from IDE if you want but you have to do some things:
First because M2000 has Greek and English identifiers, you have to choose a greek font from VB6. IDE.
The M2000.vbp make the Μ2000.dll. So you have to start it from Vb6 and then you have to start the m2000.exe, which execute it. I have edit many times code when the dll running from iDE. You can use threads and windows from ide too.
Please get the revision 46 of version 9.9
You can unistall the language as all programs and then install new again. All binaries are signed by me. The last few also have signed the uninstall exe too.
Load "alfa.gsb" just open a file to editor, not loaded as program.
Load name is the proper command
M2000 has GNU GPL 3 licence
Maybe you can make the Dutch Version, replacing Greek Identifiers and keep the English. There are more than 500 identifiers for each vocabulary.
Last edited by georgekar; Jul 17th, 2020 at 11:29 AM.
You can run from IDE if you want but you have to do some things:
First because M2000 has Greek and English identifiers, you have to choose a greek font from VB6. IDE.
The M2000.vbp make the Μ2000.dll. So you have to start it from Vb6 and then you have to start the m2000.exe, which execute it. I have edit many times code when the dll running from iDE. You can use threads and windows from ide too.
Please get the revision 46 of version 9.9
You can unistall the language as all programs and then install new again. All binaries are signed by me. The last few also have signed the uninstall exe too.
Load "alfa.gsb" just open a file to editor, not loaded as program.
Load name is the proper command
Thank you GeorgeKar, But I got M2000 to work. Nice. Keep up the good work!
M2000 has GNU GPL 3 licence
Maybe you can make the Dutch Version, replacing Greek Identifiers and keep the English. There are more than 500 identifiers for each vocabulary.
Hello GeorgeKar,
I am not going to be able to proof-read an entire wiki for you, nor am I going to translate an entire project into another language. What I can do is help you with grammar and give advice regarding translations. I attached a corrected version of you Wiki's front page text with corrections in red. You need to pay more attention to how you use the definite article and verb tenses.
Enjoy the M2000 language.
There are plenty of programs in info.gsb file.
if you want to export code from internal editor and you have tabs, then it is better to change automatic to spaces.
Use Switches "-nbs" in M2000 console, to enable the automatic change
Use Help Switches to see about command. Switches can be passed to command line when you open m2000 environment.
Enjoy the M2000 language.
There are plenty of programs in info.gsb file.
if you want to export code from internal editor and you have tabs, then it is better to change automatic to spaces.
Use Switches "-nbs" in M2000 console, to enable the automatic change
Use Help Switches to see about command. Switches can be passed to command line when you open m2000 environment.
Peter Swinkels,
Don't miss the last revision 48. Also I change a bit the M2000paper.pdf.
Georgekar, I was mostly just curious about your program. I am not going to be an active user. Sorry. If you have any specific questions I can help with though I will do my best to answer those.
Peter,
Do you run the programs in info.gsb? The biggest is a chess (without AI, just for two players) using FEN strings for storing previous positions. At the end you can export these strings and pick one to start from that point or in the game you can go back to some earlier point.
Revision 49 is the best one for now.
For any reader,
M2000 has not the strength of a production language. From a point of view the environment of the language recreate a micro from '80s, using user GUI, OOP, Lambda functions, massive memory, graphics, sound, speech, score playing through midi, threads as part of the language, event programming, using of external com objects with events, using of external functions in dll, by C or StdCall calling convention. Also you can use/make databases and handling printers too.
Some languages change in time, making obsolete things. M2000 ban the obsolete mechanism. You write a program, today and has to run twenty years later. For this reason and the benefits from VB6 like the compiling directive to exclude arrays bound checking (like c), M2000 use VB6. The core dll of VB6 as I know is a part of Windows 10. So if Windows 10 is the last operating system from Microsoft, then Vb6 core dll would exist decades from today.
M2000 has two sets of identifiers, from English and Greek languages. Scope of the double set is to be later change one,say the Greek, to another language. Also the help system works for both languages so for a new language we have to provide help text for each identifier. It's important for me a pupil to programming using identifiers from his or her language.
George Karras
Last edited by georgekar; Jul 20th, 2020 at 02:08 AM.
Peter,
Do you run the programs in info.gsb? The biggest is a chess (without AI, just for two players) using FEN strings for storing previous positions. At the end you can export these strings and pick one to start from that point or in the game you can go back to some earlier point.
Revision 49 is the best one for now.
For any reader,
M2000 has not the strength of a production language. From a point of view the environment of the language recreate a micro from '80s, using user GUI, OOP, Lambda functions, massive memory, graphics, sound, speech, score playing through midi, threads as part of the language, event programming, using of external com objects with events, using of external functions in dll, by C or StdCall calling convention. Also you can use/make databases and handling printers too.
Some languages change in time, making obsolete things. M2000 ban the obsolete mechanism. You write a program, today and has to run twenty years later. For this reason and the benefits from VB6 like the compiling directive to exclude arrays bound checking (like c), M2000 use VB6. The core dll of VB6 as I know is a part of Windows 10. So if Windows 10 is the last operating system from Microsoft, then Vb6 core dll would exist decades from today.
M2000 has two sets of identifiers, from English and Greek languages. Scope of the double set is to be later change one,say the Greek, to another language. Also the help system works for both languages so for a new language we have to provide help text for each identifier. It's important for me a pupil to programming using identifiers from his or her language.
George Karras
No, I don't but I had a look. Is your chess game text based? How does it work?
It's graphical, and you can move the pieces or write simple e2e4 + enter to move it.
Load Info
Then press F12 to start chess. You can pick a FEN string and start chess with that string to open chess with the pieces according to FEN https://en.wikipedia.org/wiki/Forsyt...wards_Notation
Intentionally isn't user friendly. As I remember, neither a Texas TI99/4A, from a friend, was user friendly nor the Acorn Electron I owned in the year 1984 was user friendly. Always with the manual at hand, and some magazines from I had to write on it, and then if I didn't accidentally push the break button, I had to saved on a tape drive,
So in M2000 if you press break (the pause button) you get a message to ask you if you really want to reset the environment. And that is a bit more of user friendly.
Some tips:
Win Dir$ (open the user directory on explorer)
Keyboard ! (open the virtual keyboard)
Settings (open the settings dialog)
With a new revision the info file may change, so:
Dir Appdir$
Load Info
Then press F1 to save it to user folder
Now if info is loaded then press F8 open the mEditior, a notepad for M2000, in a window, running in M2000. From that open the info file, 25k lines, and you can mark a word and press F3 to search down or F2 to search up. Its very fast editor. This editor use the EditBox a control made in M2000 environment, with programmable syntax color.
There are other editors:
CS for CSharp editor, You can compile the program from that editor and execute it. Its simple, but as all those programs included in a distro, has to be simple. Has syntax color for c sharp.
HtmlEditor Is another one for Html with syntax color too.
I have another for VB6 but not in the Info.gsb which is a collection of programs.
Fkey statement display the functions keys which info made for you.
There three statements which clear a part of internal state:
New clear programs (as modules loaded)
Edit A
write something press Esc to exit
Modules ? (or ctrl + N)
You see A as module
New
Modules ? (or ctrl + N)
You see nothing
Clear clear static variables and global made in console.
A=10
List ' show A=10
Clear
List ' show nothing
Flush empty the stack of values
Check this:
Push 1,2,3 : Stack: Flush : Stack ' now is empty
Also statement start is the software reset.
Don't forget to use END to exit from console
That's not all
George
Print "Wait..."
db.provider ""
a$="DRIVER=SQLite3 ODBC Driver;Database="+dir$+"one.db;LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;"
db.provider a$, "ODBC", "newpassword"
execute "(sqlite3db)", {
CREATE TABLE customers (
customer_id INTEGER PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
birth_date date DEFAULT NULL,
phone VARCHAR(50) DEFAULT NULL,
address VARCHAR(50) NOT NULL,
city VARCHAR(50) NOT NULL,
state char(2) NOT NULL,
points integer NOT NULL DEFAULT 0
);
INSERT INTO `customers` VALUES (1,'Babara','MacCaffrey','1986-03-28','781-932-9754','0 Sage Terrace','Waltham','MA',2273);
INSERT INTO `customers` VALUES (2,'Ines','Brushfield','1986-04-13','804-427-9456','14187 Commercial Trail','Hampton','VA',947);
INSERT INTO `customers` VALUES (3,'Freddi','Boagey','1985-02-07','719-724-7869','251 Springs Junction','Colorado Springs','CO',2967);
INSERT INTO `customers` VALUES (4,'Ambur','Roseburgh','1974-04-14','407-231-8017','30 Arapahoe Terrace','Orlando','FL',457);
INSERT INTO `customers` VALUES (5,'Clemmie','Betchley','1973-11-07',NULL,'5 Spohn Circle','Arlington','TX',3675);
INSERT INTO `customers` VALUES (6,'Elka','Twiddell','1991-09-04','312-480-8498','7 Manley Drive','Chicago','IL',3073);
INSERT INTO `customers` VALUES (7,'Ilene','Dowson','1964-08-30','615-641-4759','50 Lillian Crossing','Nashville','TN',1672);
INSERT INTO `customers` VALUES (8,'Thacher','Naseby','1993-07-17','941-527-3977','538 Mosinee Center','Sarasota','FL',205);
INSERT INTO `customers` VALUES (9,'Romola','Rumgay','1992-05-23','559-181-3744','3520 Ohio Trail','Visalia','CA',1486);
INSERT INTO `customers` VALUES (10,'Levy','Mynett','1969-10-13','','68 Lawn Avenue','Atlanta','GA',796);
}
report "customers created"
report "Selected customers where Points<1000 in descending order"
execute "(sqlite3db)",{
SELECT customer_id,
last_name,
first_name,
phone,
points
FROM `customers`
WHERE Points<1000
ORDER BY Points DESC,
last_name,
first_name
}
Def CheckNull$(a, a$)=If$(type$(a)="Null"->"NULL", a$)
GetListA() ' value is already in stack
report "Select customers id where phone is null"
execute "(sqlite3db)",{
SELECT customer_id,
phone
FROM `customers`
WHERE phone IS Null
ORDER BY customer_id
}
GetIDwithNullPhone() ' value is already in stack
wait 300
close base "(sqlite3db)"
wait 300
if exist(dir$+"one.db")then
dos "del "+dir$+"one.db";
wait 300
end if
sub GetListA(RS)
if type$(RS)="Recordset" then
with RS, "EOF" as new rs.eof, "fields" as new fields(), "fields" as new fields$(), "fields" as new rs.fields
with rs.fields, "count" as new rs.fields.count
print "Test number of fields:", rs.fields.count
while not rs.eof
print $(6),fields(0),
print $(9)," ";fields$(1);" ";fields$(2);@(32); CheckNull$(fields(3), fields$(3));@(42), fields(4)
method rs, "movenext"
end while
print $(0),,
end if
end sub
sub GetIDwithNullPhone(RS)
if type$(RS)="Recordset" then
with RS, "EOF" as new rs.eof, "fields" as new fields(), "fields" as new fields$(), "fields" as new rs.fields
with rs.fields, "count" as new rs.fields.count
print "Test number of fields:", rs.fields.count
while not rs.eof
print $(4), fields(0), $(7), CheckNull$(fields(1), fields$(1)), $(0)
method rs, "movenext"
end while
print
end if
end sub
This is a video of Version 12 revision 4 (not uploaded yet, but actual show things that Version 11 can do, except for the new Test form which has error log and the use of Functions keys, plus a run to error capability)
Version 12, rev7 is very good, and is 99% compatible with previous versions. The differences has to do with unary minus, which now work as in VB6 and the power function for integer, long, long long which not used the VB6 power, but a faster code optimized for integers (also the type preserved or raised an overflow error).
Here is the link from Wiki, at Git Hub "About M2000)":