or make your function
function writetext$(currenttile)
and the function call would be
writetext$(currenttile)
so you tell the function it will get a value called currenttile and that it will be called currenttile inside the function, remeber that if you alter the value of currenttile inside the function that it will make no difference to the value of currenttile in the main program, cheers.
Mentor.
1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, 2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.