Advertisement
AFRLme

Print Msg to Log [VS] (various examples)

Nov 6th, 2012
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1. -- syntax print(msg)
  2. -- prints the included message to the log file (messages.txt in visionaire studios case)
  3. -- can be wrapped with 'msg' or "msg"!
  4.  
  5. ------------------------------------------------------------------------------------- break
  6.  
  7. -- basic print example - displays "hello world!" on a line in the messages.txt log file.
  8.  
  9. print('hello world!')
  10.  
  11. ------------------------------------------------------------------------------------- break
  12.  
  13. -- including print in an if else statement: example one
  14.  
  15. if print('hello world!') then
  16.  print('message printed - hello world!')
  17. else
  18.  print('message not printed - hello world!')
  19. end
  20.  
  21. ------------------------------------------------------------------------------------- break
  22.  
  23. -- including print in an if else statement: example two (including the local variable)
  24. -- is so you can include extra things in the printed message
  25. -- example 01: print_msg .. print_msg2 .. ' - printed to log'
  26. -- example 02: print_msg .. ' printed to log ' .. print_msg2
  27.  
  28. local print_msg = 'hello world!'
  29. if print(print_msg) then
  30.  print('message printed - ' .. print_msg)
  31. else
  32.  print(print_msg .. ' - message not printed')
  33. end
  34.  
  35. ------------------------------------------------------------------------------------- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement