Onkelma erillisen toiminnon tekemisessä
Posted: Wed Jun 20, 2012 8:55 pm
Tein ohjelman joka printtaa tekstiä näytölle ja lopulta kysyy haluatko lopettaa ohjelman vai avata musiiki playerin.
*F5*
...
Compile Error
Code 38
Invalid name at line 71
You can't define "{" as identifier.
...
Eli siis miten saada tuo "player" sisältämään tuon koodin pätkän?
[/code]
Code: Select all
[OHJELMA]
64 CenterText 250,250,"Press 'Q' to quit, or 'K' to open music player!"
65
66 DrawScreen
67
68 If KeyDown(16) Then End
69 If KeyDown(37) Then player
70
71 player={
72
73 CenterText 250,250,"Press '1' to play 'Music.mp3 or press '2' to play 'Music2.mp3"
74
75 M1=LoadSound ("Media\Music.mp3")
76 M2=LoadSound ("Media\Music2.mp3")
77
78 If KeyDown(2) Then PlaySound M1 Wait 141000
79 If KeyDown(3) Then PlaySound M2 Wait 117000
}
...
Compile Error
Code 38
Invalid name at line 71
You can't define "{" as identifier.
...
Eli siis miten saada tuo "player" sisältämään tuon koodin pätkän?
[/code]