Code: Select all
100 REMark Tests for PARUSE() FuNction from SuperToolkit II
140 :
180 PRINT '1: ';:PRINT testParuse(f,i,s)
220 PRINT '2: ';:PRINT testParuse()
260 PRINT '3: ';:PRINT testParuse(PI,1,'Hello')
300 PRINT '4: ';:PRINT testParuse(2.718282,1.414214,'')
340 f=PI:i%=8:s$='Hi!'
380 PRINT'5: ';:PRINT testParuse(f,i%,s$)
420 PRINT\'Did you expect this result?'
1000 :
1002 :
1040 DEFine FuNction testParuse(float,integer,string)
1080 :
1120 :
1160 PRINT PARTYP(float)!PARUSE(float)!float;' | ';
1200 PRINT PARTYP(integer)!PARUSE(integer)!integer;' | ';
1240 PRINT PARTYP(string)!PARUSE(string)!string;' | ';
1280 RETurn 0
1320 :
1360 END DEFine
Here the result is:
Code: Select all
1: 2 0 0 | 2 0 0 | 2 0 0 | 0
2: 2 0 0 | 2 0 0 | 2 0 0 | 0
3: 2 2 3.141593 | 2 2 1 | 1 2 Hello | 0
4: 2 2 2.718282 | 2 2 1.414214 | 1 2 | 0
5: 2 2 3.141593 | 3 2 8 | 1 2 Hi! | 0
Code: Select all
5: 2 1 3.141593 | 3 1 8 | 1 1 Hi! | 0