def rungutenbergwindow rwdgutenbergwindowtwo end $tempnumber = 0 def rwdgutenbergwindowtwo tempdoc = "" @gutendisplayvariable = "" tempcount = 0 if @rwd_tab== "rwdgutenberg" @rwd_window = "gutendisplaywindowtwo" end if $gutenbergcommand == "openbook" tmpfileName = @a_viewgutenberg + ".gut" fileName = File.join($rwdgutenberg_directory,tmpfileName) fd = File.open(fileName,"r") booktitle = fd.readline.chomp $bookfile=File.new(booktitle,"r") #opens the file thats in fileName as read only $gutenbergcommand = "continue" end while tempcount < $booklocation + $booksteps $bookfile.gets if tempcount > $booklocation -1 tempdoc += $bookfile.gets #reads the file into the doc string end tempcount += 1 end $booklocation = $booklocation + $booksteps if $gutenbergcommand == "closebook" $bookfile.close end @gutendisplayvariable = tempdoc end