Type 'App' not found

Monkey Forums/Monkey Programming/Type 'App' not found

pyongpyong(Posted 2013) [#1]
Hello~
Sorry~ little english

my code is

----------------------------------------------

Import mojo

Class MyApp Extends App


End

Function Main()
New MyApp
End
----------------------------------------------

very simple code

but...

click click 'Biuld/Run' icon

'Type 'App' not found'!!

modules directory incorrect path was not

include monkey sample code has good running

why not Import mojo?

help me~~~~ T.T

monkey version 70g

os = windows7


Midimaster(Posted 2013) [#2]
I think the minimum for an app is this:

Strict
Import mojo

Class Game Extends App

	Method OnCreate%()
		SetUpdateRate 15
		Return 0
	End	

	Method OnUpdate%()
		If KeyHit(KEY_ESCAPE) Then Error ""
		Return 0
	End	

	Method OnRender%()
		Cls
		Return 0
	End	
	
End

Function Main%()
	New Game
	Return 0
End


And keep in mind, that functions need to return a value!


Xaron(Posted 2013) [#3]
Functions only need return values in Strict mode.

And no, his example works for me, even though I had the same thought that some methods have to be added... Hmm...


pyongpyong(Posted 2013) [#4]
MIDIMASTER-
And keep in mind, that functions need to return a value!

Xaron-
Functions only need return values in Strict mode.

---------------
Advice, thank you


Issue has been resolved

It was a problem with the file name was 'mojo.monkey'....

I am ashamed~~~~~~~


And I am studying the smalltime outlaws's video.


Nobuyuki(Posted 2013) [#5]
No need to feel ashamed. Good luck!


pyongpyong(Posted 2013) [#6]
Nobuyuki-
Thank you a ri ga to u!~


Paul - Taiphoz(Posted 2013) [#7]
Mistakes are not bad it's how we learn :)