Page 1 of 1

* vs OSCLI

Posted: Wed 24 Apr 2019, 19:01
by MattC
Hi.

The 'star' commands can be implemented using the OSCLI command, e.g.

Code: Select all

*FONT Arial,16
[=]
OSCLI "Arial,16"
OSCLI also has the ability to use variables in the call, so can be adapted during runtime, e.g.

Code: Select all

font$ = "Arial,16"
OSCLI font$
However, my question is, are there any other advantages of one over the other, such as speed or error handling?

Matt

Re: * vs OSCLI

Posted: Fri 14 Jun 2019, 12:37
by KenDown
TIME=0
FORi%=0TO20000
*FONT Ariel,48
NEXT
PRINTTIME

TIME=0
FORI%=0TO20000
OSCLI("FONT Ariel,48")
NEXT
PRINTTIME

a$="Ariel,48"
TIME=0
FORI%=0TO20000
OSCLI("FONT "+a$)
NEXT
PRINTTIME

Play around, perhaps substituting other variable for the font name or the font size. As it stands, using the star command is just slightly slower than using OSCLI but using a variable is very slightly faster than using the full string.

Re: * vs OSCLI

Posted: Fri 14 Jun 2019, 17:46
by Leo
I don't have a font called Ariel. Did you mean Arial?
Interestingly, for a non-existent font they all take the same (very short) time.
With Arial, OSCLI cases are marginally faster (Results: 96,94,94).