Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 23:12 20 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 : print@ in MMBasic 5

Author Message
karjo238
Regular Member

Joined: 12/10/2018
Location: New Zealand
Posts: 54
Posted: 07:48am 19 Aug 2019
Copy link to clipboard 
Print this post

I am trying to print text at a certain point on the screen in MMBasic 5.0503, and as far as I can tell, the PRINT@ command has gone.

What can I use in place of this? The only thing that suggests itself is a GUI DISPLAYBOX, which I don't exactly understand how to use.

Have I missed something, or have I got to brush up on how to use the GUI commands a bit better?

As always, any help offered would be most appreciated.

Joseph  
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1345
Posted: 08:12am 19 Aug 2019
Copy link to clipboard 
Print this post

You can use the TEXT command, it's faster than any GUI but can clash with a GUI if you don't take precautions. I use it even in my GUI intensive programs.


TEXT X, Y, STRING, ALIGNMENT, FONT, SCALE, C, BC


BTW it's in the Micromite manual, don't think it's in the Plus manual as it's already covered.

Mike.
Edited 2019-08-19 18:15 by KeepIS
It's all too hard.
Mike.
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 10:18am 19 Aug 2019
Copy link to clipboard 
Print this post

  karjo238 said  I am trying to print text at a certain point on the screen in MMBasic 5.0503, and as far as I can tell, the PRINT@ command has gone.


hey Joseph, you OK?

Are you printing to a terminal via the console port? The below only applies if you are (i.e. not to a LCD panel)

It depends on the terminal emulator you are using. Most can use the VT100 control set (or at least a sub-set of it, probably ignoring stuff like double-height etc...) so you can position the cursor, clear portions of the screen etc... These are "escape sequences" that start with the escape character CHR$(27), a square bracket and then some control values that actually tell the terminal what you want to do and some numbers to work with.

Have a play with the ones here and let us know how you get on. http://www.termsys.demon.co.uk/vtansi.htm

have fun
Edited 2019-08-19 20:48 by CaptainBoing
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2285
Posted: 12:30pm 19 Aug 2019
Copy link to clipboard 
Print this post

using a terminal, these three are useful:

Function at(x,y) As string
 at=Chr$(27)+"["+Str$(y)+";"+Str$(x)+"H"
End Function


Function ca(A, B, C, D, E) As string
 Local temp$
 temp$=Chr$(27)+"["+Str$(A)
 If B<>0 Then temp$=temp$+";"+Str$(B)
 If C<>0 Then temp$=temp$+";"+Str$(C)
 If D<>0 Then temp$=temp$+";"+Str$(D)
 If E<>0 Then temp$=temp$+";"+Str$(E)
 ca=temp$+"m"
End Function


Sub clrscr
 Print Chr$(27)+"[2J";
End Sub


for usage see the basic example:

colour test charts.zip


cheers,
rob   :-)
 
karjo238
Regular Member

Joined: 12/10/2018
Location: New Zealand
Posts: 54
Posted: 10:24pm 19 Aug 2019
Copy link to clipboard 
Print this post

  CaptainBoing said  
hey Joseph, you OK?


@CaptainBoing: I'm very well thank you   I may not have come across as such in my question, but let me explain.

As you may know, I'm in the middle of writing a version of Missile Command for a Micromite system. I had already written most of the game in MMBasic 4.5 using a Colour Maximite, but found I had hit some barriers when trying to implement all of the features I wanted to.

So, I went ahead and bought a Micromite Extreme 144 and recently upgraded to MMBasic 5.0503. I now have the resources I need to finish the game, but I need to rethink my code because Geoff and co have made some big changes to how things are written, and the problem I'm having is that I have to look through 3 PDFs in order to find the explanations for the relevant code I'm trying to write.

Such as PRINT@ now becoming TEXT.

I tried that command and it does exactly what I need, so many thanks for the guidance on that. It's actually quite nice, as it's reduced 3 lines of code into 1, and even that makes my code look a bit cleaner.

I have several more challenges to overcome, such as turning my 4.5 FNT file into something usuable in 5.0503, but we will get there!

This forum is a great way for me to get the answers I need, and avoid me tearing out what remains of my hair. A big thankyou to everyone who had helped me thus far. Hopefully I've overcome most of the obstacles now, and I don't need to ask these sorts of questions again, but knowing my luck....

I've rambled a bit here, but I hope this has clarified everything.

Many thanks as always,

Joseph  
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8570
Posted: 07:19am 20 Aug 2019
Copy link to clipboard 
Print this post

Joseph

As the author of the sprite system in the Micromite Extreme 144 I'm very interested in your experiences. AFAIK no-one before has tried to use it in anger. Have you seen the various demo videos I did of it working - put "sprite micromite extreme" into youtube.

I'm very happy to consider changes once I get real experiences of it in use so please keep us up-to-date with your progress, ask questions, and if you hit road-blocks let us know.

Peter (matherp)
Edited 2019-08-20 17:20 by matherp
 
Print this page


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

© JAQ Software 2024