Code:
global key$ , value$ , cut$ , lenght
lenght = 20
cut$ = "|"
call store "i" , "mi"
call store "you" , "vi"
call store "he" , "li"
call store "she" , "si"
call store "greating" , "saluton"
call store "it" , "gi"
print dict$( "i" )
print dict$( "you" )
print dict$( "he" )
print dict$( "q" )
print dict$( "she" )
print dict$( "greating" )
print dict$( "it" )
end
sub store k$ , v$
if instr( key$ , pad$( k$ ) ) then exit sub
key$ = key$ + pad$( k$ )
value$ = value$ + v$ + cut$
end sub
function dict$( k$ )
p = instr( key$ , pad$( k$ ) )
if p = 0 then
uit$ = "NOT THERE"
else
p = ( p - 1 ) / lenght + 1
uit$ = word$( value$ , p , cut$ )
end if
dict$ = uit$
end function
function pad$( a$ )
pad$ = left$( a$ + space$( lenght ) , lenght )
end function