Author Topic: Hello World for Pusar2d  (Read 2533 times)

Rick3137

  • Guest
Hello World for Pusar2d
« on: March 12, 2014, 03:52:03 PM »
  my example of  "HELLO WORLD" is also a simple test of FileIO.
Code: [Select]
      -- By Rick3137  http://rb23.yolasite.com/


  -- Starts Program
   b = 0    c = "a"
   win=openwindow ("Files",-1,-1,800,600)
      setactivewindow (win)
      color (25,25,20,255)
      backcolor (240,240,255,255)
      cls()

         fh1 = open("test.txt", "w")
         fprint(fh1, "HELLO WORLD")
         close(fh1)



     filehandle = open("test.txt", "r")
     x = 0 a = 0
     color (0,0,0,255)
     fillcircle (x,y,w)
     textsize (2)
     drawtext ("This will create a file on your DiskDrive",10,30)
     drawtext ("It will then read it and print it to your screen.",10,60)
     drawtext ("Press any key to exit ..",10,90)
     sync()
     

     while (eof(filehandle) == false) do
x = x + 20
        a = finput(filehandle)

        drawtext ( a,200+x,200)
     end
     close(filehandle)

     sync()
     key=inkey()
     closewindow(win)
     closeapplication()