1
0
Fork 0
mirror of https://gitlab.com/niansa/pilang2.git synced 2025-03-06 20:49:22 +01:00
pilang2/examples/gettest2.pil
2020-04-13 15:44:49 +02:00

39 lines
1.2 KiB
Text

#This file is part of pilang.
#
#pilang is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#pilang is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with pilang. If not, see <https://www.gnu.org/licenses/>.
catch True
# Check argv
set argslen,$argc
cmp equal,$~argslen,2,"print Usage: ,$argv 0, <some text>",exit 1
# Store passed arguments as concenated string
set counter,2
set userin,
marker set,concatloop
# print $~counter, ,$argv $~counter
append userin,$argv $~counter," "
inc counter
cmp smaller,$~counter,$~argslen,"marker goto,concatloop"
# Print character for character slowly
set charnum,0
marker set,printloop
sleep 0.1
printnnl $get "$~userin,$~charnum"
inc charnum
cmp bigger,$len $~userin,$~charnum,"marker goto,printloop"
print