|
Forum Index : Microcontroller and PC projects : Crash when using %, $, ! for type.
| Author | Message | ||||
| Paul_L Guru Joined: 03/03/2016 Location: United StatesPosts: 769 |
This code crashes under MMbasic.exe. dim something% open "something.txt" for output as #2 print #2, something% The interpeter doesn't like the "%" after the variable name "something%" in the print command. When you tell it: print #2, something It works. I wonder if the same thing happens in a real chip. Paul in NY |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2461 |
i believe the copy of mmbasic.exe available is an earlier version of maximite basic, which does not support the integer variable type. micromite basic (derived from maximite basic) has evolved quite a bit since that copy of mmbasic.exe was created. it would be rather useful if some kind person out there could create a win32 compile of the current micromite basic - the job is a little above my own abilities! cheers, rob :-) |
||||
| Paul_L Guru Joined: 03/03/2016 Location: United StatesPosts: 769 |
Back in the day (1970s) I wrote a DosPlus Basic program for a NY CPA firm that ran on Radio Shack Model IIIs. I did the following: dim d$(156) dim d%(156,3) dim d#(156) f$="###,###,###.##" TR=1 FA=2 ' then I filled D$() with descriptive strings ' then I filled d%(1-n,2) and d%(1-n,3) with screen rows and columns for input ' then I went and got all the inputs for i=1 to 156 input @d%(i,2),d%(i,3) d$(i) using f$, d#(i) 'what the heck does this do! 'now test the reasonableness of each input value test(d#(i)) if testOK then d%(i,1)=TR else d%(i,1)=FA next The original interpreter permitted the simultaneous coexistance of the same name variable as type $, %, !, and #! This was extremely handy. I stored a descriptive string in d$(i), the value in d#(i), the screen row in d%(i,2), the screen column in d%(i,3) and a valid data flag in d%(i,1). I provided names keyed to the U.S. I.R.S. tax return form names substituting for example "F1040a" for "d". That program carried around over 2000 variables in a 64KB core! It also prompted commands like that very obtuse input command above so, just to help the confusion factor a little more, I used to write my comments in Polish. MMbasic seems to stumble when you stick in one of the type indentifiers $, %, or !. It likes them in DIM statements, but not in LOCAL statements, formulas or other commands. It seems a little inconsistent. Just one of its appealing traits I guess. Paul in NY |
||||
| Paul_L Guru Joined: 03/03/2016 Location: United StatesPosts: 769 |
I think you're right Rob! It also doesn't like "DIM AS INTEGER anything" or DIM anthing%. A new compilation of the current uM basic would be quite a job. All the hardware specific stuff would have to be skipped and that would be an enormous job. But it would be nice to have an interpreter which would run under Windoze which could, at least, verify the formulaic flow of a program. Does anyone have any recommendations as to which currently available interpreter would be the best to use? Paul in NY |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2461 |
yes, this was allowed in traditional BASIC because the symbol ($, %, !) was a part of the variable name back in the original specifications. a couple of years back there was much discussion about this on the forum, and a philosophical decision was made by geoff to separate out the "type designator". the up side of this is that with the right OPTION settings and the use of DIM and LOCAL statements a variable can now be of any type without need for a $, % or ! modifier at the end. the down side is that there are still some little foibles in the micromite basic interpreter that show through as what to the uninitiated appear to be inconsistencies. for example: Const A$="123" Print A End > run 123 > cheers, rob :-) |
||||
| Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3308 |
Yes, this is something that is on my todo list, along with updating the Maximite MMBasic to the current Micromite MMBasic (which is quite stable now). It is just a case of getting the higher priority jobs done first. Geoff Geoff Graham - http://geoffg.net |
||||
| Paul_L Guru Joined: 03/03/2016 Location: United StatesPosts: 769 |
Hi Geoff, How was the trip to New Zealand? Did you meet up with any fellow TBS members there? That must be quite a todo list! I wish I had been around during the discussion about separating the "type designator" from the variable name. I would have liked to contribute to that discussion. I do agree with your choice by the way. I do, however, think that a slight revision in the way this is explained in the various manuals is needed at this time. Let me know if you would like me to propose a revision. I DO HAVE ONE COMPLAINT! WHEN THE HECK ARE YOU GOING TO PUT A CONTRIBUTION LINK ON YOUR WEBSITE? You have done an enormous amount of excellent work developing this extremely useful language interpreter. I presume that you enjoy doing it. You should be compensated for this work! Please excuse me for shouting at you. That crazy Polack in NY. |
||||
| Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3308 |
I'm still in NZ (Palmerston North) but I have not found any TBS followers. OK, I will look at the wording in the manuals and have a think about adding a contribution button (if only to get some peace ).Geoff Geoff Graham - http://geoffg.net |
||||
| Paul_L Guru Joined: 03/03/2016 Location: United StatesPosts: 769 |
Geoff, I've never been to Palmerston North, just flown over it on the way from Auckland to Wellington and on to ChiChi. You should have a pretty scenic ridge to the southeast and farm land to the west and north. Is it true that the sheep outnumber the people 10 to 1? Paul in NY |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2461 |
we're all down in the south island, where earthquakes and dragons sleeping under the mountains decimate the cities every now and then. cheers, rob :-) |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |