Advertisement
wldk

p3

Aug 9th, 2016
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tArgs = { ... }
  2. tArgs[1] = plik
  3.  
  4. function loadFile( fileName )
  5.  
  6.     -- Open an existing file in read ("r") mode.
  7.     local fileToLoad, errorMsg = io.open( fileName, "r" )
  8.  
  9.     if errorMsg ~= nil then
  10.         print( "\nError calling loadFile() - io.open() failed with: " .. errorMsg .. "\n" )
  11.         return
  12.     end
  13.  
  14.     for line in fileToLoad:lines() do
  15.  
  16.         print( line )
  17.  
  18.     end
  19.  
  20.     fileToLoad:close()
  21.  
  22. end
  23.  
  24. print( "Loading file!" )
  25.  
  26. loadFile( plik )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement