how to make it so that hitting run always works?

Monkey Forums/Monkey Beginners/how to make it so that hitting run always works?

Impmaster(Posted 2014) [#1]
Hey all.

I've got my project in different classes, each in it's own files. I like doing this for cleanliness. However, there's a problem with this. Whenever I hit build/run, I have to go to the file with my Main() method, or else it says No Main found. How can i make it so that it automatically builds/runs that file, so i don't have to navigate to it each time?


Goodlookinguy(Posted 2014) [#2]
If you're using Ted (the default editor) there isn't an option like that. If you use JungleIDE, though, it has a solution and project manager that allows you to deal with this problem quite easily by setting the compilation target.

Edit: Lies! Look below.


Impmaster(Posted 2014) [#3]
Should I switch to some other editor? Ted seems to be quite annoying. Will JungleIDE be really hard to learn?


Goodlookinguy(Posted 2014) [#4]
It depends on how familiar you are with IDEs. If you've used Visual Studio, Jungle is a breeze. Even without having used VS though, it's not like it's really any harder than Ted. The only downside is that it costs some money, but I think it's more than worth it. You can see a list of IDEs and text editors here: http://www.monkey-x.com/Community/posts.php?topic=7873&page=1


Impmaster(Posted 2014) [#5]
Oh I've used Eclipse, and I was looking for something a little more basic, because I never used 99% of it's features. I'll check out that list of editors you sent me thanks.


AdamRedwoods(Posted 2014) [#6]
Hi, do you have the Main() file in another tab in the Ted Editor?
if so, you can go to BUILD->LOCK BUILD FILE or press Control-L.


Goodlookinguy(Posted 2014) [#7]
Ted has that? Well, I guess I'm wrong.

Edit: Was that in the old Monkey editor as well? Because I used the old editor and I don't remember it having that.


ImmutableOctet(SKNG)(Posted 2014) [#8]
Monkey X's default editor/IDE "Ted" already has this functionality. Just go to: Build -> Lock Build File (AKA, CTRL+L), and make sure to have that checked on your desired file. JungleIDE is pretty great, but you don't need it for this.

EDIT: Never mind, Adam posted the same answer.


dawlane(Posted 2014) [#9]
Ted is very basic. The only option that it has for you to run your main project file is Lock File in the build menu. This file has to remain open at all times for it to work, if you close it, then you have to relock it.

EDIT:
Was that in the old Monkey editor as well? Because I used the old editor and I don't remember it having that.
This has been a feature since BlitzMax was released.


Midimaster(Posted 2014) [#10]
That's wrong Goodlookingguy!

TED has the option of "Lock Build File": You only have to go once to the TAB, where your Main() function is. Then activate "Menu - Build - Lock Build File" here. After this you can change the TABs and press F5 or F6 or F7 anywhere. The building will always start in the "locked file":


Goodlookinguy(Posted 2014) [#11]
@Midimaster Yeah, I know -> http://www.monkey-x.com/Community/posts.php?topic=8292&post=83980 | You should really refresh the thread before posting.

This has been a feature since BlitzMax was released.


Well...hmm. Learn something every day I guess. I think I used BLide free version so I never dealt with Blitz's editor. And I only used the old Ted during my first Ludum Dare with one file, so the lock build problem wasn't a problem.


dawlane(Posted 2014) [#12]
This has been a feature since BlitzMax was released.
Actually, come to think of it. It was in the Blitz3D editor as well.
Just checked. It's not a feature of Blitz3D.


Impmaster(Posted 2014) [#13]
Thank you all. That was exactly what I was looking for.

In terms of other regrets that I have with the editor, is there a way to:

1. Have line numbers
2. Have it so that whenever I do "something.blank", when I type in the period, it autoshows me any possibilities? I had that in Eclipse, where I could just type "Math." and it would automatically show me any possible variables for Math. It was really useful for remembering names of variables.
3. Have it show me syntax errors before I build?


Goodlookinguy(Posted 2014) [#14]
No to all questions above. That much I do know even if I was wrong on the other because those are the reasons most people don't use Ted. That new JentosIDE seems to have a lot of what you're looking for and it's just an extension of Ted. As for syntax errors before you build, the only IDE that can do that right now JungleIDE. It will background compile your sources and give you squiggly lines underneath the error location. It also has very advanced syntax highlighting which will usually help you catch an error even without the background compiler.

Note: Number 2 is called intelligent code completion or intellisense.


Impmaster(Posted 2014) [#15]
I'm gonna try out that Jentos thing, because I don't want to spend money and I code on a mac.