prjbrook

fileee.bas

Sep 10th, 2017
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. '' Write out text file:
  2. open "test.txt" for output as #1
  3.  
  4. print #1, "Hello,"
  5. print #1, ""
  6. print #1, "this is an example text file,"
  7. print #1, "generated with the help of FreeBASIC."
  8.  
  9. close #1
  10. print "done that"
  11.  
  12. ScreenRes 320, 240, 8
  13.  
  14. ' Plot a pixel at the coordinates 100, 100, Color 15. (white)
  15. PSet (100, 100), 15
  16. ' Confirm the operation.
  17. Locate 1: Print "Pixel plotted at 100, 100"
  18. ' Wait for a keypress.
  19. Sleep
  20. '' ---
  21. '' Display text file line by line:
  22.  
  23. open "list.text" for input as #1
  24.  
  25. dim as string ln
  26.  
  27. do until( eof(1) )
  28. line input #1, ln
  29. print ln,right(ln,1),lobyte(valUInt(ln)) 'lowByte(ln)
  30. loop
  31.  
  32. close #1
  33. sleep
Advertisement
Add Comment
Please, Sign In to add comment