![]() |
Forum Index : Microcontroller and PC projects : Old hang-over from Maximite?
Author | Message | ||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
I have a console based application that needs a bit more than simple line based output, so tonight I was just writing some screen control code that allows me to position the cursor etc just as you would on an old 80s micro using VT100 ANSI escape codes. Strange thing is, CLS seems to be a reserved word but MMBasic doesn't complain about it. It allows me to define a SUB called CLS but it never works and with nothing in memory, typing CLS doesn't invoke an error. If I define a sub for another reserved word (in this case FOR) I do get moaned at. See below > ?mm.ver 5.0408 > new > AUTOSAVE For n=1 To 25 Print At(n,n);str$(n) Next Function At(v As Integer,h As Integer) As String At=Chr$(27)+"["+Str$(v)+";"+Str$(h)+"H" End Function Sub Cls Print Chr$(27)+"[2J"; End Sub Sub For Print Chr$(27)+"[2J"; End Sub Saved 218 bytes > > RUN [14] Sub For Error: Invalid identifier > > cls > odd. Edited 2019-09-28 06:47 by CaptainBoing |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Do you have any display defined in OPTIONs? I expect that if you did, MMBasic would complain. Jim VK7JH MMedit |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
genius! Well done Jim. I hadn't used this mite for a while and it completely went out of my head that I had it driving a panel before. ![]() Cheers |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |