c_tool target ..
Monkey Forums/Monkey Programming/c_tool target ..
| ||
few quick questions about this target, would I be right in assuming its for building command line tools ? Also as a test I thought I would try something like this. [monkeycode] Strict Import mojo.input Function Main:Int() Print("Testing Command Line Tool") Repeat Print "Inside " Until KeyHit(KEY_SPACE) Return 0 End Function [/monkeycode] but I get an MAV Building... Testing Command Line Tool Inside (null) STOPPED Monkey Runtime Error : Memory access violation Any ideas? I really should start reading all the change notes cos that tool target iv only just noticed it. |
| ||
I'm pretty sure the Mojo isn't supported fro the C++ Tool. The STDCPP was renamed to C++ Tool for v67+. |
| ||
mojo.input requires a already created context in order to work, so it can only be called after the OnCreate of the mojo app, so not compatible with a command line tool. I've wrote this stdio module for commandline tools: http://www.jungleide.com/free_stuff/jungle.stdio.zip It's ultra simple, but allows you to input text, and output text both to the standard output pipe, and to the standard error pipe. That said, you should know that, unless mojo is used, the c++ tool does not collect garbage. So it leaves garbage for ever untill the whole application ends. It has a built-in mem leak. XD As far as I know, c++ garbage collector was desiged to be fast on games, but it requires to be called "behind the scenes" between the "onrender", "onupdate" etc. As there is not any onrender, onupdate on the c++ tool, garbage is never collected. |
| ||
I dont think I will have much use for the target anyway, if I wanted to do something command line I would use Max, was just wondering what it was all about, and vaguely recall reading some where it might be used to plugins to ted but I might have read that wrong. |
| ||
The Monkey compiler/translator trans uses this target to compile itself. |
| ||
Ah .... did I read something about it being used for making plugins to ted ?? or am I just miss-remembering something else lol. |
| ||
I think ziggy has mentioned it in regard to making plugins for Jungle, maybe that was it? |