RosettaCodeData/Task/Animation/Maple/animation-3.maple

19 lines
541 B
Plaintext

macro(SP=DocumentTools:-SetProperty, GP=DocumentTools:-GetProperty);
SP("Text",value,"Hello World! ");
ScrollText := proc( msg, direction::identical("Forward","Reverse"),n::posint:=20 )
local word, count;
word:=msg;
count:=0;
while count<n do
if direction = "Reverse" then
word:=cat(word[2..-1],word[1]):
else
word:=cat(word[-1],word[1..-2]):
end if;
SP("Text",value,word,refresh);
Threads:-Sleep(0.1);
count:=count+1:
end do:
end proc: