Post by kerry on Feb 22, 2020 14:11:10 GMT
I am new here. A little history first I guess. I have not done any programming since working on a degree back in 1989. At the time I used mostly Turbo Pascal and C for my classes. Anyway back then I wrote some programs that I am currently trying to convert to Just Basic, which I am just really starting to learn also. Can not remember much of my knowledge from back then. Starting new you could say. Anyway, I am retired and wanted to get back to some kind of programming as a hobby to keep busy.
Ok, here is some code that is part of a program I am converting from Turbo Pascal and when I try to run it, I am getting "DO and LOOP cannot both have boolean expression" The line (loop until finished
) is highlighted
I would appreciate any help
[displayinfo] 'displays input info and calculates results
finished = FALSE
do
cls
print " The following is the information you provided:"
print
print " Gender : " , genderword
print " Type of drink : " , drink
print " Number of drinks : " , number
print " Hours you drink : " , hours 'using ' :2.2
print " Your body weight : " , weight
print " Hours before driving: " , delay ':2:2
print
Avolume = (drinktype * number)
Wvolume = (weight * 0.453)
Wvolume = Wvolume * gender
bac = (Avolume / Wvolume)
bac = bac / 10
bac = bac * 0.8065
bac = bac - (hours * 0.015)
bac = bac - (time * 0.015)
if bac <= 0.0001 then
bac = 0.000
print " Your Approximate Blood-Alcohol Concentration (BAC) is: "; bac ':3:3)
if bac < 0.001 then
print "EXCELLENT!"
end
if bac < 0.030 then
print "NOT BAD!"
end
if bac < 0.050 then
print "USE CAUTION!"
end
if bac < 0.079 then
print "DO NOT GET BEHIND THE WHEEL!"
end
if bac > 0.079 then
print "WALKING MIGHT BE DANGEROUS!"
end
print
print " ** 0.080 and higher is presumed intoxication "
print " ** 0.050 to 0.079 is considered impaired "
print " ** below 0.050 is not categorized but could "
print " in some circumstances cause legal problems"
do
print "<C>hange data <P>rint <R>un again <Q>uit? "
input ch$
ch$ = UPPER$ (ch$)
loop until ch$="C" or ch$="P" or ch$="R" or ch$="Q"
select case ch$
case "C"
[changeinfo]
case "Q"
done = TRUE
finished = TRUE
case "R"
finished = TRUE
case "P"
cls
print "Printing..........."
' [printinfo]
end
loop until finished
return
also have a formatting problem with these lines (the :2:2 part) The :2:2 was from the TP version
print " Hours you drink : " , hours 'using ' :2.2
print " Your body weight : " , weight
print " Hours before driving: " , delay ':2:2
Ok, here is some code that is part of a program I am converting from Turbo Pascal and when I try to run it, I am getting "DO and LOOP cannot both have boolean expression" The line (loop until finished
) is highlighted
I would appreciate any help
[displayinfo] 'displays input info and calculates results
finished = FALSE
do
cls
print " The following is the information you provided:"
print " Gender : " , genderword
print " Type of drink : " , drink
print " Number of drinks : " , number
print " Hours you drink : " , hours 'using ' :2.2
print " Your body weight : " , weight
print " Hours before driving: " , delay ':2:2
Avolume = (drinktype * number)
Wvolume = (weight * 0.453)
Wvolume = Wvolume * gender
bac = (Avolume / Wvolume)
bac = bac / 10
bac = bac * 0.8065
bac = bac - (hours * 0.015)
bac = bac - (time * 0.015)
if bac <= 0.0001 then
bac = 0.000
print " Your Approximate Blood-Alcohol Concentration (BAC) is: "; bac ':3:3)
if bac < 0.001 then
print "EXCELLENT!"
end
if bac < 0.030 then
print "NOT BAD!"
end
if bac < 0.050 then
print "USE CAUTION!"
end
if bac < 0.079 then
print "DO NOT GET BEHIND THE WHEEL!"
end
if bac > 0.079 then
print "WALKING MIGHT BE DANGEROUS!"
end
print " ** 0.080 and higher is presumed intoxication "
print " ** 0.050 to 0.079 is considered impaired "
print " ** below 0.050 is not categorized but could "
print " in some circumstances cause legal problems"
do
print "<C>hange data <P>rint <R>un again <Q>uit? "
input ch$
ch$ = UPPER$ (ch$)
loop until ch$="C" or ch$="P" or ch$="R" or ch$="Q"
select case ch$
case "C"
[changeinfo]
case "Q"
done = TRUE
finished = TRUE
case "R"
finished = TRUE
case "P"
cls
print "Printing..........."
' [printinfo]
end
loop until finished
return
also have a formatting problem with these lines (the :2:2 part) The :2:2 was from the TP version
print " Hours you drink : " , hours 'using ' :2.2
print " Your body weight : " , weight
print " Hours before driving: " , delay ':2:2