Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:55 02 Aug 2025 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 : Old hang-over from Maximite?

Author Message
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 08:45pm 27 Sep 2019
Copy link to clipboard 
Print this post

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: Australia
Posts: 6283
Posted: 09:54pm 27 Sep 2019
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 2170
Posted: 12:04pm 28 Sep 2019
Copy link to clipboard 
Print this post

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
 
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025