Post Reply 
Terminal Usage
09-02-2015, 05:57 PM
Post: #3
RE: Terminal Usage
(09-01-2015 06:35 PM)eried Wrote:  Since the font in the terminal for any number has the same width per number, and each number is 2 spaces wide, why don't you pass the first number to that function?

Example:
Code:
spaces (var,len)
BEGIN
local ss:="";
for X from 0 to (len-length(var+""))*2 do ss:=ss+" "; end;
return ss;
END;

EXPORT test1()
BEGIN
local a:=1234, b:=5555;
print(a+spaces(a,20)+b);
END;

You could optimize that but is an idea.

Thanks a lot! I still have the problem of minus signs and decimal points (one space instead of two) messing up the columns but it's a lot better than it was.

I still wish for a real TAB function, though, where TAB(10) would always start printing in column 10 no matter what had been printed before.
LOCATE(X,Y) to start printing at a given column and row would also be handy. Especially if you had a way to determine what row and column you were on to begin with.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Terminal Usage - toml_12953 - 09-01-2015, 04:52 PM
RE: Terminal Usage - eried - 09-01-2015, 06:35 PM
RE: Terminal Usage - toml_12953 - 09-02-2015 05:57 PM
RE: Terminal Usage - eried - 09-02-2015, 06:47 PM
RE: Terminal Usage - toml_12953 - 09-03-2015, 12:29 PM
RE: Terminal Usage - eried - 09-03-2015, 12:55 PM



User(s) browsing this thread: 1 Guest(s)