doprttest% = 1
datastr$(1) = "Data_p1_" + formalt$((i&), "0")
datastr$(2) = "Data_p2_" + formalt$((i&), "0")
datastr$(3) = "Data_p3_" + formalt$((i&), "0")
datastr$(4) = "Data_p4_" + formalt$((i&), "0")
datastr$(5) = "Data_p5_" + formalt$((i&), "0")
PRINT #1, datastr$
(1);
","; datastr$
(2);
","; datastr$
(3);
","; datastr$
(4);
","; datastr$
(5)
timetaken = fitimer - sttimer
PRINT "test_pri1 (time):-"; formalt$
((timetaken
), "0.00")
datastr$(1) = "Data_p1_" + formalt$((i&), "0")
datastr$(2) = "Data_p2_" + formalt$((i&), "0")
datastr$(3) = "Data_p3_" + formalt$((i&), "0")
datastr$(4) = "Data_p4_" + formalt$((i&), "0")
datastr$(5) = "Data_p5_" + formalt$((i&), "0")
WRITE #1, datastr$
(1), datastr$
(2), datastr$
(3), datastr$
(4), datastr$
(5)
timetaken = fitimer - sttimer
PRINT "test_wri1 (time):-"; formalt$
((timetaken
), "0.00")
linecount& = 0
INPUT #1, datastr$
(1), datastr$
(2), datastr$
(3), datastr$
(4), datastr$
(5) linecount& = linecount& + 1
timetaken = fitimer - sttimer
PRINT "read using input (time):-"; formalt$
((timetaken
), "0.00") PRINT "linecount&="; linecount&
linecount& = 0
linecount& = linecount& + 1
parsedata% = 0
stpos% = 0
Index% = 1
nextpos%
= INSTR(stpos%
+ 1, tdata$
, ",") datastr$
(Index%
) = MID$(tdata$
, stpos%
+ 1, nextpos%
- stpos%
) Index% = Index% + 1
stpos% = nextpos%
datastr$
(Index%
) = MID$(tdata$
, stpos%
+ 1)
'FOR dli% = 1 TO 5
' PRINT datastr$(dli%)
'NEXT
'INPUT s$
timetaken = fitimer - sttimer
PRINT "read using line input (time):-"; formalt$
((timetaken
), "0.00") PRINT "linecount&="; linecount&
testbinio% = 0
'PRINT "loffile&="; loffile&
linecount& = 0
'IF SEEK(1) < loffile& THEN
'PRINT "Length of data="; LEN(tdata$); "Current file pos="; SEEK(1)
linecount& = linecount& + 1
'PRINT "Current file pos="; SEEK(1)
timetaken = fitimer - sttimer
PRINT "read using Binary line input (time):-"; formalt$
((timetaken
), "0.00") PRINT "linecount&="; linecount&
PRINT "press any key to continue"
dotpos%
= INSTR(precstr$
, ".")
'PRINT "called ("; num; ","; precstr$; ")"
tnum = num
trailingzeros%
= LEN(precstr$
) - dotpos%
leadingzeros% = dotpos% - 1
'PRINT dotpos%, trailingzeros%
multiplyby& = 10 ^ trailingzeros%
tempnum&
= INT(tnum
* multiplyby&
)
'PRINT tnumstr$, tempnum&
newtrailingpartnumstr$
= RIGHT$(tnumstr$
, trailingzeros%
) newleadingnumstr$
= LEFT$(tnumstr$
, LEN(tnumstr$
) - trailingzeros%
)
numberoffleadingzerostoadd%
= leadingzeros%
- LEN(newleadingnumstr$
)
IF numberoffleadingzerostoadd%
> 0 THEN addleadingzero$
= STRING$(numberoffleadingzerostoadd%
, "0") addleadingzero$ = ""
newleadingnumstr$ = addleadingzero$ + newleadingnumstr$
tnumstr$ = newleadingnumstr$ + "." + newtrailingpartnumstr$
leadingzeros%
= LEN(precstr$
) trailingzeros% = 0
numberoffleadingzerostoadd%
= leadingzeros%
- LEN(tnumstr$
)
IF numberoffleadingzerostoadd%
> 0 THEN addleadingzero$
= STRING$(numberoffleadingzerostoadd%
, "0") addleadingzero$ = ""
tnumstr$ = addleadingzero$ + tnumstr$
'PRINT tnumstr$
formalt$ = tnumstr$