Jump to content



Photo
- - - - -

How To Display A Variable In The Middle Of A String?


  • Please log in to reply
2 replies to this topic

#1 ThemePark

ThemePark

    Newbie

  • Members
  • Pip
  • 1 posts

  • Calculators:
    CFX9850 GB Plus

Posted 08 July 2013 - 12:17 PM

Say I want to output a string that has a variable in the middle, for instance "Today it is ", a, " degrees Celsius.". How can I do that on a CFX9850 GB Plus? I know one way is to use locate, but as my variable will contain numbers with different number of digits, I can't use that as I would have to calculate that number and I don't think there's a function for that in the library, though I suppose one could be coded. So is there another way of outputting a string and a variable like above?

#2 3298

3298

    Casio Addict

  • Members
  • PipPipPip
  • 79 posts
  • Gender:Male
  • Location:Germany

  • Calculators:
    fx-9750G Plus
    Algebra FX 2.0 (ROM 1.03,broken)
    HP 50G

Posted 08 July 2013 - 08:37 PM

Not possible on the 9850, sorry. You need at least a 9860 with OS 2.00 so you can use string variables. Your only options are to calculate the number length (the "log" function can be helpful here, but remember to handle these special cases yourself: negative, 0 and non-integer) or to simply place the number behind the text on one line. Oh, and watch out for the interaction between Locate and the screen-scrolling "text", ? and Disp (small triangle) commands, otherwise your Locate-placed text may end up in the wrong place or get overwritten.

#3 bennyboy8888

bennyboy8888

    Newbie

  • Members
  • Pip
  • 4 posts

  • Calculators:
    fx-9860 AU Plus

Posted 15 June 2014 - 01:01 PM

You need at least a 9860 with OS 2.00 so you can use string variables.

I know this thread is just about a year old but I've been struggling with this ever since I started playing with the programming section of my calculator. How is this possible on the Casio fx-9860 Au Plus? Could you please give an example? Thanks




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users