Recently I was looking at some code by KermMartian and other advanced programs and I noticed that "real(" followed by a long string of numbers was in almost every line. Can someone please explain to me what "real(" does and how to use it? I am kind of curios.
Real( is a command that has a use in regular Basic that I don't know. With hybrid basic, real( enables the use of xlib functions for graphics.
Well, I'd only ever use real( for using DCS Basic libraries. What the TI-OS uses it for I have no idea. Now, in DCS libs, it's for xLibs, as if it was, say, Library(. But there is no such token, so afaik they chose to repurpose real( because it wasn't as useful as other tokens like disp( or something. Example: "real(5, 0, 39)" changes the contrast to the darkest setting.
Another thing that I noticed is text right after the "real("
Example:
real(6,0,40,30,74,47,0
"WWW. .NET
real(6,0,16,109,255,1,0
"CEMETECH
real(6,0,48,109,168,0,0
"By Kerm Martian

How does that work?
Depends on what program that is.

Regardless, it's a function of xLIB that prints text to a screen.
Would the LIBHELP program contain information that would help me?
To an extent, if you're talking about CSE programs.

The functions aren't displayed by real(#, though you can kind of get close, as the functions are listed in terms of real(1, real(2, just by their designated function name.
You appear to be using (or at least referring to) DCSE. It's documented.
Alright more questions!
So I was testing a few "real(" commands in my program and none seem to be working. They don't return errors but rather don't appear at all. Is there something else I am missing? The real( commands work in the graph screen right?
Check out the DCS Libraries. Real( is used in Xlib and Omnicalc at the bottom there.

In normal usage, read here.
APotato wrote:
The real( commands work in the graph screen right?
No. xLIBC uses an internal buffer that you need to explicitly display.

This should work as a minimal example[1]:

Code:
:real(0,1,1
:"Hello world
:real(6,0,0,0,1,1
:Repeat Ans=21
:GetKey
:End
:real(0,1,0,1
This should display "Hello world" then exit when you press 2nd.

See also: the xLIBC tutorial.

[1] "should" because I've never written any program using xLIB of any type, much less xLIBC.
Importantly, real( returns the real coefficient of a complex number.
I see
Another question, I have drawn a "circle" that came out as an ellipse. I intend for it to be an ellipse however it is vertical rather than horizontal. Right now I am using a combo of xLib and basic functions.
My code is:
real(7,12,95,55,15,130,11
The function is only for circles, im not sure that an ellipse is possible.

The only way would be if you have not turned on Half-Res mode, in which case it would be taller than it is wide, and confined to 1 side of the screen only.

xLIBC's graphics functions are designed to be drawn in Half-Res mode, which would be to invoke: real(0,1,1,0 before drawing.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement