DEF ENCODE INPUTSTRING$ ARRAYPOINTERINDEX
for t=0 to len(INPUTSTRING$)
currentchar$ = mid$(INPUTSTRING$, T, 1)
TRANSLATETOVALUE CURRENTCHAR$ OUT VALUE
arr[ARRAYPOINTERINDEX+t] = VALUE
next
END
This is the first function you will need.
Explanation: You would call ENCODE, and give it the input string, and it would automatically put the values (related to each character in the string) into an array.
The function TRANSLATETOVAL is still needed.
here' s a pre-requisite.
ALPHNUMERIC$[37]
for t=0 to 9
ALPHANUMERIC$[t] = str$(t)
next t
DIM ALPHABET$[27]
for t=0 to 26
read letter$
ALPHABET$[t]=letter$
next t
FOR T=0 TO 27
LETTER$ = ALPHABET$[T]
ALPHANUMERIC$[T+10]=LETTER$
NEXT T
DATA "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"
So now that this is all set up you will want the getvalue function
DEF TRANSLATETOVALUE CURRENTCHAR$ OUT VALUE
FOR T=0 TO LEN(ALPHANUMERIC)
LETTER$ = ALPHANUMERIC$[T]
IF CURRENTCHAR$==LETTER$ THEN
VALUE = T
BREAK
ENDIF
NEXT T
END
putting all of this together along with
this at the start of your code
DIM ARR[250]
ARRAYPOINTERINDEX=0
and those are the basic concepts.. you would just write the opposite thing to get the values back.. i'll show how later
and lastly you would just save the array Arr[] as a dat file.