Here is an example that loads the file in and allows you to add more names and ages before exiting and saving.
//
// Variables
//
` Dim the arrays for Names and Ages, 100 should do to start :)
Dim name$(100)
Dim age(100)
` entry is the current record
entry=0
//
// Load the previous data
//
if file exist("variables.txt")
open to read 1,"variables.txt"
` this next bit is because the 1st line of the text file is a line that reads "Your text file"
` which we don't need
read string 1,null$
do
inc entry
` read the name as a string
read string 1,name$(entry)
` read the age as a string
read string 1,temp$
` then convert to a variable
age(entry)=val(temp$)
if name$(entry)=""
exit
endif
loop
close file 1
delete file "variables.txt"
else
` to start on entry 1
inc entry
endif
//
// lets input some varibales
//
Do
Print
Print "Greetings Human"
Print "Leave Name blank and Press [Enter] to quit and save"
print
print "Record #"+str$(entry)
input "What is your name?: ",name$(entry)
if name$(entry)=""
exit
endif
input "How old are you?: ",age(entry)
inc entry
loop
//
// Now we'll save the file to disk
//
open to write 1,"variables.txt"
write string 1,"Your Text File"
for a=1 to entry
write string 1,name$(a)
` this next line is different, I'm changing the integer to a string with the
` str$ command so as you can read it from note pad
write string 1,str$(age(a))
next a
close file 1
Its maybe a bit clumsy, but it works and hopefully will help you in the right direction.
(Sorry for the Edit, that'll teach me for not testing the code properly)
Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@