Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 02:47 06 May 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 : VT100 Output Help.

     Page 2 of 2    
Author Message
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 03:23pm 18 Jun 2017
Copy link to clipboard 
Print this post

Still think using STR$() is the easiest and most straightforward way of getting values to align.
This function will right align values and pad with spaces in the front basically doing the formatting for you without the need to know exactly on which line (y) and position (x) you are.
at$(x,y) requires you to keep track of the current line also which is a pain.
Imagine having more then a screen full of data. With a terminal program that is not a problem as it is basically an infinite large number of lines.
Or inserting a line will require you to adjust all then at$(x,y) or alternatively you need to keep track of it programmatically which is just unnecessary clutter.

The problem arises only when STR$() is used when you need to align left instead of right. A LEFT$() will solve that.

What is missing id the PRINT USING statement. This allows formatting. However STR$() does the job adequate enough except for left aligning a numeric value while still having a fixed width (padding spaces to the right).

Microblocks. Build with logic.
 
     Page 2 of 2    
Print this page


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

© JAQ Software 2024