DSLua Community
Welcome, Guest. Please login or register.
May 21, 2012, 09:13:19 PM
1371 Posts in 262 Topics by 33109 Members
Latest Member: Limewire Download
DSLua Community  |  General DS Programming Chats  |  Code Hashing  |  Problem with patterns and loops « previous next »
Pages: [1]
Author Topic: Problem with patterns and loops  (Read 1767 times)
Samji
New Moon
*
Posts: 6


« on: February 10, 2008, 05:18:45 PM »

I'm having problems with these programs. That is they refuse to run.

Code:
SCREEN_TOP = 1
SCREEN_BOTTOM = 0
BGTopText = Screen.LoadTextBG()
BGBotText = Screen.LoadTextBG()
Screen.Initialize(SCREEN_TOP, BGTopText)
Screen.Initialize(SCREEN_BOTTOM, BGBotText)

fruit = "apple,pear,banana,pineapple"
basket = {}
i = 1
for v in string.gmatch(fruit, "%w+") do
    basket[i] = v
    i = i + 1
end
-- I needs a nice, fruity drink...
message = "What about a nice " .. fruit[3] .. "?"
BGBotText:PrintXY(5, 12, message)
DSLua.WaitForAnyKey()
Code:
-- set up the screens to display text
SCREEN_TOP = 1
SCREEN_BOTTOM = 0
BGTopText = Screen.LoadTextBG() BGBotText = Screen.LoadTextBG()
Screen.Initialize(SCREEN_TOP, BGTopText)
Screen.Initialize(SCREEN_BOTTOM, BGBotText)

text = "%match this#"
match = string.match(text, "[%w%s]+")

BGTopText:PrintXY(10, 12, match)

-- wait for any key press
DSLua.WaitForAnyKey()

Any ideas? Thanks.
Logged
Pages: [1]
« previous next »
    Jump to: