Jump to content



Photo
- - - - -

Casio BASIC Tutorial


  • Please log in to reply
6 replies to this topic

#1 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 26 April 2003 - 03:09 PM

Part 8: Text Display



I have already done some stuff with text display as you saw above, putting anything in ?quotes? causes it to be displayed to the screen.  However there are other ways to display text, and each has its good points and bad points.



The ??s:

Quotes displays what ever is inside it on the left hand side of the screen, and automatically adds a return to the end, this means that the start of each new " begins on a new line, there is no way to prevent this.  If the screen is full and you are trying to display more text then " will cause the screen to scroll, giving you a new line to put text on.



The Locate command:



Locate is used in text based games, it allows you to place text anywhere on the screen using x,y coordinates.  Locate does not cause the screen to scroll since you cannot place anything below the 7th line, if you do you get an error.  Also locate does not wrap onto the next line so if your text goes off the screen it wont show up on the next line.  With locate you must be careful not to exceed the boundaries of the screen:



1,1

______________________

|000000000000000000000|

|000000000000000000000|

|000000000000000000000|

|000000000000000000000|

|000000000000000000000|

|000000000000000000000|

|000000000000000000000|

--------------------------------- 21,7



Syntax for locate:

Locate x,y,?YOUR TEXT IN QUOTES HERE?



Placing anything outside these boundaries will result in an error.



The Text command:



Its important not to get text and locate mixed up, text does the exact same thing as locate except that it places the text on the graph screen (right next to that nice parabola you made in math).



An important note about the text and graph screen, they are totally independent of each other, so you can switch back and forth between the two without messing up the other one, this can come in handy in games.



Syntax for Text:

Text y,x,?YOUR TEXT IN QUOTES HERE?



Please note the juxtaposition of the X and Y values, when using Text the Y value comes first and the X value second.  Also, you cannot exceed the boundaries of the screen with Text either, though they are different than those of locate since Text goes by pixels (the little dots that make up your screen).  Here are the Text boundaries:



1,1

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??.

???.???.???.???.???.???.???.???.???.???.???.???.??. 63,127

Remember, x and y are reversed.



If you took the time to count that you would get 8128 pixels, meaning you could place your text in any one of those places, as opposed to locate?s 147 places.  As you can see, text gives us a lot more control than locate, but each has their uses.



Some other useful text functions:

ClrText: clears all the text on the text screen.

Cls:  clears the entire graph screen.

ClrGraph: clears the graph and sets the view window (covered later) to its default.


#2 Atomic

Atomic

    Newbie

  • Members
  • Pip
  • 14 posts

Posted 27 April 2003 - 03:41 AM

would have been nice to see it done in a code box. i'll repeat it in a code box.

#3 Pixter

Pixter

    Casio Fan

  • Members
  • PipPip
  • 43 posts
  • Location:The Netherlands
  • Interests:casio, visual basic, lego mindstorms and formula 1.

  • Calculators:
    cfx9850gb plus

Posted 27 April 2003 - 06:18 AM

another nice chapter :D but I don't see the use of these 8001 characters :o
lol

and I think the screen width is 127*63 pixels and not 127*64. But I have a cfx9850gb+ and I don't know how large the screen of your calc is.

#4 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 27 April 2003 - 07:17 AM

In fact the screen is 64x128 pixel. (i think it is stated in the manual)
and I think it is annoying (:profanity:) if you post this silly thing 3 times in a threat! I've to scroll for miley before I find sth. interresting. I think the graphic is useless as everyone can imaging what "a screen with a resolution of 128x64 means WITHOUT your example)

:angry: ;)

#5 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 27 April 2003 - 10:24 AM

yea, it's kinda pointless to draw the screen like that..
and the screen size is 128x64, from which you can access 127x63 in Basic
  • Test1234 likes this

#6 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 27 April 2003 - 12:11 PM

I drew it just to give people the idea(some people have no imagination :lol: ), atomic thatnks for putting it in a code box, I forgot but I would have prefered you just remind me so I could edit it...

I wrote in 64,127 because it is not the bottom row but the top you cant normally access... except on the CFX 9850, that calc can using vertcal. so technically it starts at zero and goes to 63, but I forgot when I was writing this and will fix it in a moment.

plz no one quote it any more, its getting abit redundant. :lol:

#7 Guest_Bytefish Productions_*

Guest_Bytefish Productions_*
  • Guests

Posted 27 April 2003 - 01:08 PM

hehe back in the days i drawed me a screen on a paper just like this. :)
reminds me of old times. :greengrin:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users