12-09-2022, 05:28 AM
Requires the file "quotes.json". If it's in the same format it doesn't matter who the speaker was, does it?
Code: (Select All)
$CONSOLE:ONLY
dim as long ff, ll, l, ts
ts = (val(mid$(time$, 4, 2)) mod 2) * 60 + val(right$(time$, 2))
afile$ = "quotes.json"
ff = freefile
open afile$ for input as ff
do until eof(ff)
line input #ff, aline$
if aline$ = "[" then
ll = 0
elseif aline$ = "]" then
exit do
else
ll = ll + 1
end if
loop
close ff
redim sf$(1 to ll)
ff = freefile
open afile$ for input as ff
do until eof(ff)
line input #ff, aline$
if aline$ = "[" then
l = 0
elseif aline$ = "]" then
exit do
else
l = l + 1
aline$ = _trim$(aline$)
if l = ll then
sf$(l) = mid$(aline$, 2, len(aline$) - 2)
else
sf$(l) = mid$(aline$, 2, len(aline$) - 3)
end if
end if
loop
close ff
print sf$(ts)
print "- Kanye West"
system