Jump to content



Photo
- - - - -

How To Overcome Limits In Assigning Variables?


  • Please log in to reply
5 replies to this topic

#1 josephlo

josephlo

    Newbie

  • Members
  • Pip
  • 13 posts

Posted 15 April 2008 - 03:06 AM

Hi

I have now programmed quite a few short programs on my FX-9860G and I must say that the 9860 is cool!

I am right now doing a rather complex program and I ran into the limitation of assigning variables as all alphabets A-Z are now used. I know I can use Lists (e.g. List 11) as variables but this kinda make the programs hard to read/debug IMHO.

I am inclined to split the programs up into chunks and pieces of codes by using the PROG keyword so that I can recall programs by using the command PROG "CALCULATE" for instance. Ideally, I would like to reuse variables in these different chunk of codes as follows:

For example, is it possible to, in program "input", do a "Input power"?->A
and in program "calculate", do a P/415->A ? The actual formula is quite long, so I am doing a short form here.

Will I be able to link the programs together somehow?

Appreciate if anyone can give some insights how to write long/complex programs.

Thanks

#2 Somelauw

Somelauw

    Newbie

  • Members
  • Pip
  • 14 posts

  • Calculators:
    Casio CFX-9850GC PLUS

Posted 19 June 2008 - 03:30 PM

Hi

I have now programmed quite a few short programs on my FX-9860G and I must say that the 9860 is cool!

I'm using an older calculator, but I think that what applies for mine will apply for yours too.

I am right now doing a rather complex program and I ran into the limitation of assigning variables as all alphabets A-Z are now used. I know I can use Lists (e.g. List 11) as variables but this kinda make the programs hard to read/debug IMHO.

You could use theta, besides only lists and matrices could be used.
You could merge parts of two variables in one. Like 5 and 3 --> 503, but than I would rather use lists.

I am inclined to split the programs up into chunks and pieces of codes by using the PROG keyword so that I can recall programs by using the command PROG "CALCULATE" for instance.

I would rather use goto and lbl, although I prefer while, for etc... even more.

Will I be able to link the programs together somehow?

By using goto, lbl and all the loops.

#3 Somelauw

Somelauw

    Newbie

  • Members
  • Pip
  • 14 posts

  • Calculators:
    Casio CFX-9850GC PLUS

Posted 09 September 2008 - 01:15 PM

What does your program do? I doubt your program really needs more than the 28 variables you could use.

#4 verena

verena

    Casio Fan

  • Members
  • PipPip
  • 41 posts
  • Gender:Female
  • Location:Tashkent

  • Calculators:
    Casio ƒx-10 ~ ƒx-991ES

Posted 11 September 2008 - 05:34 AM

Yes you can use the same variables for different programs. The variables will just have the value that they were given by the most recent program. You can make ten programs, and if none of the programs would use more than five variables, you could always use variables A through E.

Unless there is a value you really need the calculator to "remember" - you should use that one only in the program that works with it, not in any other program.

#5 dschlic1

dschlic1

    Newbie

  • Members
  • Pip
  • 4 posts

  • Calculators:
    CFX-9850+

Posted 16 September 2008 - 03:13 PM

You might try storing the alpha variables into and out of a list or lists when jumping from one program to another.

#6 Kapytanhook

Kapytanhook

    Newbie

  • Members
  • Pip
  • 25 posts

  • Calculators:
    fx-9860G

Posted 14 October 2008 - 12:49 PM

Yup if you need to store data Arrays are your friend, if you don't know how those work check this:
Advanced Variables. Those REALLY helped me.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users