ID:134251
 
An extra directive like #note/#comment/#warning etc would be nice.

It would be like the #error directive, but it won't stop compiling - just leave a message in the error area window (maybe as a warning, adding to the warning count).
It would be nice to have, some personal example, I code a proc, but before finishing I need to leave the computer/go to sleep, I put in the end of the proc code something like bogus("finish this"), so Dream Maker will remind me and point me to that proc the next time I compile. It works good, except that frequently I'd open my source just to add in some quick testing verbs etc to test something (and not to continue my code), and I have to comment out the bogus() line so it compiles, and later after I finished testing I have to remember to re-uncomment it, which is pretty annoying.
Kaioken wrote:
An extra directive like #note/#comment/#warning etc would be nice.

I agree. Something to the effect of displaying what people often put in "TODO" messages would be great. That way, at the end of the output, you might have something like
TODO: Add creepy clown voice to Lol() proc, file.dm, line 2

...Which might come from something such as:
proc/Lol()
#TODO: Add creepy clown voice to Lol() proc
return 0


Hiead
In response to Hiead
Hiead wrote:
I agree. Something to the effect of displaying what people often put in "TODO" messages would be great. That way, at the end of the output, you might have something like
TODO: Add creepy clown voice to Lol() proc, file.dm, line 2


That would be terrible. :(
The compiler's output from my code would be megabytes in size! :P
Kaioken wrote:
An extra directive like #note/#comment/#warning etc would be nice.

Well, if I understand what you're asking for here, I believe something like this may work:
(In _defines.dm)
#define TODO(x)  var/todo = "[(x)]"

(In the proc that needs work)
mob/Gacy/proc/lol(var/outList)
outList << "[name] laughs in a way that makes you think of small, innocent things being tortured"
TODO("add clown laugh wav file")

This should giv a compiler "var/todo no used" warning, but allow you to compile.
If you wanted to compile without the warning, go back into '_defines.dm' and comment out macro part of the define:
#define TODO(x) //var/todo = "[(x)]"


Alternately, you could use this macro as a search for things left to do as well as rewriting the macro to output to a file.

[EDIT] Note! This way does have it's limitations: [link]
In response to TheMonkeyDidIt
I like your suggestion of creating a simple macro for that. Myself, I usually create a file called todo.dm in my projects (in Incursion and SotS II it's huge) with a list of what needs working on.

Lummox JR
In response to Hiead
Hiead wrote:
TODO: Add creepy clown voice to Lol() proc, file.dm, line 2

...Which might come from something such as:
proc/Lol()
> #TODO: Add creepy clown voice to Lol() proc
> return 0


Along these lines, some development environments now will even create lists and stuff based on #TODO items found in the code.
In response to Deadron
I was totally talking about this with Jp the other day. I would REALLY like this- the ability to tag areas in code files to be indexed somewhere else (along with a comment/explanation) in the IDE- maybe in some central hub page.
In response to TheMonkeyDidIt
That's quite a smart and nice solution. Not QUITE like a new directive, though close enough.
In response to Lummox JR
Lummox JR wrote:
Myself, I usually create a file called todo.dm in my projects (in Incursion and SotS II it's huge) with a list of what needs working on.

Me, too. They can get pretty overwhelming as well. But at least we'll never run out of things to do, I suppose.

I should point out, tho, that, in it's current form, that macro will have problems since it relies on declaring an unused variable. If used twice inside a code block (like a while() block, a proc, and even on a global level), it'll produce a duplicate var error.
However, I think most people spotted that, but I'll edit the post above.

If anyone can think of a way around that shortcoming, I'd love to see it, as it's not exactly making itself obvious to me right now.
In response to TheMonkeyDidIt
Well, um, the basic idea wasn't creating an unused var, more like creating a #define that will generate a warning. >_> There should be many approaches from here, for one:
#define TODO(x) :some_random_label


It will generate an unused label warning.

I can think up one that would always work:
#define TODO(xyz) if(1)


That makes a useless if statement warning, though it doesn't input 'xyz' to the error window. :\ I'll see if I can think up a better one up. >_>
In response to Kaioken
#define TODO(x) var/x


x has to be a valid variable name, but TODO(finish_this_function) would give you:

game.dme:15:finish_this_function :warning: variable defined but not used

its not perfect, but it does output it to the console.

or you could just do something like this:

var/TODO_wrgreswg = "finish this function"


no #define needed, and you can put whatever text you want in the quotes as a note to yourself. it will give you a "variable defined but not used" warning and output the name of the variable. if you use these a lot, it could really clutter your console window in DM.
[link]

And I'm fairly certain I've brought it up other times as well. >_>
(edit: HAPPY NEW YEAR!!!}

a large project (or even a thoroughly planned small project) can have a lot of things to be done. cluttering your DM console with TODO messages makes finding the errors in there even harder.

ahkftw!

(auto hot key for the win!)

this script opens the .dme file that you currently have open (provided that you do have dream maker open) and checks for the included .dm files. it checks each of the .dm files for a certain substring ("//todo:" by default) and outputs a list of all of the text from your todo notes. the output looks something like this:

<code>6 things to do: building.dm - Line 71 change mouse interface cycle.dm - Line 14 make power usage ordered logically cycle.dm - Line 40 change how population growth works cycle.dm - Line 60 make labor shifting only shift labor to more vital and more convenient buildings hud.dm - Line 87 add HUD button to access trading screen player.dm - Line 92 create HTML page for trade interface</code>

the text following each file name and line number comes from your comment in the code. for example, the note "change how population growth works" came from the text "//todo:change how population growth works".

by default it lists 10 notes per page.

the only snag is that the script cannot tell the directory of the .dme file that you have open. in the version of the script linked at the beginning of this post, the folder is hard-coded in the script and you'd have to edit it to match the folder that you store your BYOND projects in.

there is another version of the script that prompts you for the folder where you store your BYOND projects and saves the path in the windows registry. in this script there is also a hotkey to change this path.

autohotkey is awesome, free, and available at http://www.autohotkey.com/. you will need it to execute these scripts. once you've installed autohotkey, you can run the script file (which will create a tray icon). there's no need to run both of the script files, they're just slightly different versions of the same thing.

the script displays the todo notes in message boxes, but you could do whatever you want with the notes that it finds. you could have it create an HTML file containing the notes and run your web browser of choice to display that file. you could create your own format for these notes and have the script parse them further to get more information out of them.
In response to OneFishDown
Wow, this is quite nice. I think I might have this startup with Windows. It'd make life much easier.

[EDIT]

Spreading the fun. I've uploaded a modified version of OneFishDown's script (The second one, with the registry stuff). It outputs to a file called TODO.txt in the environment's directory, and it changes the format of the file so that an example file might look like:

2 things to do:

File: D:\BYOND Projects\Domini\Code\Items\Weapons.dm
Line: 16
Note: Make this look better.

File: D:\BYOND Projects\Domini\Code\NPC\Team Leader.dm
Line: 8
Note: Make this look cleaner.


As opposed to:

2 things to do:

Code\Items\Weapons.dm - Line 16
Make this look better.

Code\NPC\Team Leader.dm - Line 8
Make this look cleaner.



I will take this file down only upon request by OneFishDown. Otherwise, live on freedom fighters.

[EDIT]

All of my changes are now clearly marked.

[EDIT]

I fixed some of the formatting in the script itself that resulted in an error of my chosen method of uploading. The updated format is above.
In response to Audeuro
http://www.pages.drexel.edu/~rrm322/byond_todo3.ahk

now it runs notepad to open the todo.txt file that it creates. i also cut out some unnecessary parts at the end (took out the stuff for paging because its not being displayed with message boxes).

(note: i also changed TodoMarker back to "//todo:")

it would be neat to have a way to track which tasks are completed, but i guess the easiest way is to have the user manually add "DONE!" to the end of their task descriptions as they complete them.


i hadn't tested my script on an environment with code files in subfolders (because i don't think i've ever put code files in subfolders), but from your sample output i guess it works :-P


Audeuro wrote:
I will take this file down only upon request by OneFishDown.

i don't mind at all. in fact, i was typing up a blog post to encourage people to use AHK as you were writing this post =)
In response to OneFishDown
OneFishDown wrote:
http://www.pages.drexel.edu/~rrm322/byond_todo3.ahk

now it runs notepad to open the todo.txt file that it creates. i also cut out some unnecessary parts at the end (took out the stuff for paging because its not being displayed with message boxes).

Wow.
Nice job, guys! Thanks!
In response to OneFishDown
Auto Hot Key? Sounds like AutoIt. I might redo it in autoIt for a .exe, plus I need an excuse to try the file commands.

Seems simple enough though.
In response to Danial.Beta
you can convert autohotkey scripts to exes.
In response to OneFishDown
Oh ok, than there really isn't a reason for me to do it.
In response to Deadron
Deadron wrote:
Along these lines, some development environments now will even create lists and stuff based on #TODO items found in the code.

Yeah, SPE(Stani's Python Editor) does this, and I really liked it.