margin.t = 5
margin.l = 4
dwidth = 72
page.h = 6
row = 1
noe = 13
x$
(1) = " 01 We the People of the United States, in Order to form a more perfect " + CHR$(10)x$
(2) = " 02 Union, establish Justice, insure domestic Tranquility, provide for " + CHR$(10)x$
(3) = " 03 the common defence, promote the general Welfare, and secure the " + CHR$(10)x$
(4) = " 04 Blessings of Liberty to ourselves and our Posterity, do ordain and " + CHR$(10)x$
(5) = " 05 establish this Constitution for the United States of America." + CHR$(10)x$
(7) = " 07 Article I" + CHR$(10)x$
(9) = " 09 Section 1: Congress" + CHR$(10)x$
(11) = " 11 All legislative Powers herein granted shall be vested in a Congress " + CHR$(10)x$
(12) = " 12 of the United States, which shall consist of a Senate and House of " + CHR$(10)x$
(13) = " 13 Representatives." + CHR$(10) INPUT "Input the line number where a word you want found appears 1-13: "; first_find%
LOCATE 1, 1:
PRINT "scr ="; scr
, "first_find% ="; first_find%
, "first_find_row% ="; first_find_row%
displaydoc:
' Calculate page find.
' first_find% is the entry number with the first find.
' Put the first find in the second row, but only if the page can be filled.
' If the page cannot be filled. Put the first find in the upper-most row possible.
IF noe
- first_find%
>= page.h
THEN ' Plenty of page space remaining. first_find_row% = 1
first_find_row% = 2 ' Place first find on second row.
scr = first_find% - 2
ELSE ' Manipulate text to bottom of page. scr = noe - page.h ' Page will display to bottom.
scr = 0 ' Less than a page of text.
first_find_row% = first_find% - scr
LOCATE margin.t
+ i%
, margin.l
+ 1