A+B: Difference between revisions

Content added Content deleted
Line 3,698: Line 3,698:
<lang qbasic>START:
<lang qbasic>START:
PRINT "Enter two integers between -1000 and +1000 separated by at least one space: "
PRINT "Enter two integers between -1000 and +1000 separated by at least one space: "
INPUT "> "; n$ ' | LINE INPUT allows entry of space and other non-numeric characters
INPUT "> "; n$ ' | Enter two numbers with at least one space between.
n$ = _TRIM$(n$) ' | TRIM any leading or trailing spaces.
n$ = _TRIM$(n$) ' | TRIM any leading or trailing spaces.
bpos = INSTR(n$, " ") ' | Find the first space between the two numbers.
bpos = INSTR(n$, " ") ' | Find the first space between the two numbers.