Numerically Index Words


Routine Summary

Retrieves a word from an indexed string of words with an index number.


A - The word's index number
Str0 - The index of words


Str1 - The word

Variables Used

A, Str0, Str1

Calculator Compatibility







The routine converts the number into a string then searches for that in the string of words and stores the characters that follow it. Input in some 3 digit number ex: 001 would correspond to word 001. 102 would correspond to word 102. The routine itself can store up to 1000 10 letter words. I developed this for the purpose of storing and retrieving Pokemon names in the game I am developing but I am sure that there are other uses.

  • Acceptable inputs: zero, positive integers up to 999
  • Error inducing inputs: decimals, negative numbers, numbers over 1000

This example of the routine would display "helloworld",

:Disp Str1

If A were 0 instead of 1, then the output would be "worldhello".
In this modified version of the code it would output "helloworlditsme" a 15 letter code while still only displaying 10 letter words for any other input. You can see how by looking at the end of the 3rd line of programming it adds a value of 5 to the length of the outputted string under the condition of A being equal to 1

:Disp Str1

Error Conditions

  • ERR:INVALID DIM is thrown when the input number is either over 999 or under 0

Related Routines


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License