Hey, guys.
I'm trying to make a simple script that reads in a file and prints the first line.
This is what I have:
-- set up screens to display text
SCREEN_TOP = 1
SCREEN_BOTTOM = 0
BGTopText = Screen.LoadTextBG() BGBotText = ScreenLoadTextBG()
Screen.Initialize(SCREEN_TOP, BGTopText)
Screen.Initialize(SCREEN_BOTTOM, BGBotText)
-- read file.txt
file = io.open("file.txt", "r")
output = file:read("*line")
BGTopText:PrintXY(10, 12, "File contains:")
BGBotText:PrintXY(10, 12, output)
-- wait for any key press
DSLua.WaitForAnyKey()
I just one to display the first line from a two line text file. What's wrong? When I run this script in DSLua 0.7, I just get a blank screen.
Thanks in advance. BTW I suspect file input is what is preventing my XML parser module from working with DS Lua, that is why I wrote the above example in the first place.
Also, it it possible to just do a require() at the top of the file for a file which includes the code to initialize the screen?
Thanks
