actually i got quite a weird but useful method for optimisation…whereby, u can just get your desired output without even performing ANY "if" tests
what you can do is to organize all your element names into a ordered list in order of atomic number from 1 to the last (whatever yours might be)…the length of each element should thus be the maximum length of the longest elemtn name…you can then DIRECTLY use the substring function to call out the elemtn name using the Atomic number alone…without ANY "if" tests
let me illustrate this using an example
Mandy gave birth to 3 children…1st Peter, then Mary and finally Isabel (isabel thus have the longest name of 6 char)
FIRST BUILD THE STRING USING A SEPERATE PROGRAM
:Input "length of longest name",A
:""->Str3
:" "-> Str2
\\make sure that the length of str2 containing only spaces is AT LEAST the difference in length between the longest and shortest name (6 for isabel n 4 for mary so diff=2 in this case…but it can exceed the difference, but nvr smaller)
:Lbl A
:Input "Name of child starting from 1st to last:",Str1
\\Peter (5 char) is first
Str1+sub(Str2, 1,A-length(Str1))->Str1
\\the string now is thus "Peter " (6char)
Str1+Str3->Str3
\\Str3 is the final template string containing all names
Goto A
After inputting isabel's name, the final template you should have is thus "Peter Mary Isabel" (Str3)
NOW BUILD THE PROGRAM TO CALL THE NAMES OUT
:Input "Rank of child in order of birth time",A
:Disp sub(Str3,6(A-1)+1,6)
DONE!!!! =)=)=)=)=)=)=)
let's say i input A to be 1, i am thus looking for Peter…the sub function will thus look and display witin template string, Str 3 starting from the 6(A-1)+1=1 position for a total length of 6 char (the 6 is fixed by you- in your case should be the length of the longest element)
Whoa LA! Saves you about 400 over lines of programming and you can just Use the 1st program to build your string by inputting the elements in order with a much lower room for error…
IN FACT…I WUD BE GLAD TO WRITE THE PROGRAM FOR YOU AND SEND IT TO YOU SHOULD YOU REQUIRE IT