Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / CodeCuts

Author
Message
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 24th Mar 2009 20:18 Edited at: 29th Mar 2009 10:37
I really like coding. I hate typing lines of code I have typed hundreds of times before. This is why I find libraries useful: They are large sections of code that I do not have to retype.

CodeCuts is a snippets library. Instead of a huge section of code, CodeCuts are small (should be less than 20 lines). The CodeCuts utility is designed to run while one is coding. Switch from the IDE to the CodeCuts utility and click on the code snippet needed. The code snippet is copied to the clipboard. Switch back to the IDE and paste the snippet right into the IDE code.

CodeCuts can also help standardize coding in a large project, as well as reduce errors.

CodeCuts is OpenSource, so feel free to add to it. Additions to the code snippets are welcome. If you post your snippet to this thread, I will add it (within reason) to the CodeCuts utility. The more community input, the more useful CodeCuts can be. See the example text files to see the format for code snippets. The List.txt file is the master list and is used to create the buttons within the CodeCuts program. There are two parameters when adding a new snippet to the List.txt file.

Button name;File name

1) Button name: This is what the user will see in the utility.
2) File name: The name of the file the snippet is stored in. Files should be .txt format.
Note: The semicolon is the delimiter. Do not include a space after the semicolon. Do not use quotation marks.

The CodeCuts project requires IanM's Matrix Utilties to compile. There is an executable included, and code snippet additions are via scripting, so compilation is not required.

Included are a few example snippets. Feel free to edit your copy of the utility to include your own snippets and edit or delete the existing snippets.


Open MMORPG: It's your game!

Attachments

Login to view attachments
tiresius
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 24th Mar 2009 21:10
I think BlueIDE already has something like this? Maybe it's different.

Pretty neat though, nice work.

I'm not a real programmer but I play one with DBPro!
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 24th Mar 2009 23:43
Cool. Sounds useful. I have bookmarked this so I won't forget.

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 25th Mar 2009 00:08
Quote: "Cool. Sounds useful. I have bookmarked this so I won't forget."


I concur . I'll have to have a look at the code and see how you did that clipboard thing.

<---Spell casting battle game!
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 25th Mar 2009 00:17
Quote: "I'll have to have a look at the code and see how you did that clipboard thing."


Maybe using Write To Clipboard? Anyways looks really cool, this will come in handy.

Thank you.
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 25th Mar 2009 01:08
I will have to look at the code to because write to clipboard wouldn't work. for this you would need more then one line and the clipboard can only hold one string(well dbc can only right one string)

New Site! Check it out \/
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 25th Mar 2009 01:40
Quote: "Maybe using Write To Clipboard? "


LOL you're right that's exactly what he uses. I think I may have gotten this confused with reading pictures from the clipboard .

<---Spell casting battle game!
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 25th Mar 2009 02:09
Quote: "I will have to look at the code to because write to clipboard wouldn't work. for this you would need more then one line and the clipboard can only hold one string(well dbc can only right one string)"


Ya, but you can have multiple lines in one string by inserting carriage returns using chr$(13) at the end of each line.

Thank you.
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 27th Mar 2009 05:41 Edited at: 27th Mar 2009 05:44
i rialized that i was like huh? then i remembered thats the ascii version of the return key hahaha gotcha! oh and get some nice gui into this and this will be great.

oh and a amazing feature would be to edit the code in the program or just be able to open it in dark edit from the program or something


sixty squares:

is that possible?

New Site! Check it out \/
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 27th Mar 2009 17:35 Edited at: 27th Mar 2009 17:46
Thanks for all the comments.

@Caleb1994: The GUI is simple so that folks can easily add ttheir own snippets. I could spice it up a bit with a few sprites or something. I'll play with that.

Anyone have code snippets that they would like to add to this utility?


Open MMORPG: It's your game!
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 27th Mar 2009 20:00
Quote: "sixty squares:

is that possible?"


I don't know how but it may be possible with some windows DLL.

<---Spell casting battle game!
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 27th Mar 2009 20:06
any particular reason for the suggested < 20 lines of code?

Profit
18
Years of Service
User Offline
Joined: 19th Feb 2006
Location: United States
Posted: 27th Mar 2009 20:43
Quote: "any particular reason for the suggested < 20 lines of code?"
Was wondering the same thing.


Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 27th Mar 2009 21:11
Mouse inside function is always useful

New Site! Check it out \/
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 27th Mar 2009 23:22
Quote: "any particular reason for the suggested < 20 lines of code?"

<20 lines of code in a useful function is a rarity for me. Good luck with this.


Come see the WIP!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 28th Mar 2009 00:55
Quote: "any particular reason for the suggested < 20 lines of code?"


Quote: "<20 lines of code in a useful function is a rarity for me."


Quote: "Was wondering the same thing."


I'm wondering why so many guys are concerned about the size of their functions.

Don't get hung up on "20 lines", that's more of an arbitrary line-in-the-sand. Where each coder decides to draw their line is a personal preference. Oops... mine is showing.


Open MMORPG: It's your game!
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 28th Mar 2009 05:37
nah, it's foreseeing a desire to utilize this for more than a simple snippet/function/whathaveyou copy/paste tool and my wondering if there was a limit on clipboard usage or string length, their reliabilities beyond 20 lines, etc, that i hadn't heard of before. ie, "why did he specify ~20 lines?"; figured there was a reason

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 28th Mar 2009 07:05
I just did a test of 500 lines of code. That's probably more than enough. I think there is some limit to the clipboard, but it is probably something like a DWord block of memory or something huge like that.


Open MMORPG: It's your game!
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 29th Mar 2009 03:32
Quote: "I just did a test of 500 lines of code. That's probably more than enough. I think there is some limit to the clipboard, but it is probably something like a DWord block of memory or something huge like that."


Ya, I've copied several thousand lines of code to the clipboard with no problem, so you probably shouldn't encounter one.

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 29th Mar 2009 10:39
Updated version posted in the first post. Added a little pizazz to the utility as requested.

Buttons are now organized into columns.
Preview screen shows the first few lines of code.
Improved pointer sprite.
Button under mouse is highlighted.
A few more snippets and a library or two added.


Open MMORPG: It's your game!
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 30th Mar 2009 01:12
What about string over load error? i have tried to do something like this before but it didn't work because when i tried to copy a 10 or 15 like code it gave me a "String overload error" error how did you make it work!? i forgot about this till now

New Site! Check it out \/
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 30th Mar 2009 05:19
I didn't get that error so I technically didn't make it work. Just look at the code and see what I did.


Open MMORPG: It's your game!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 31st Mar 2009 19:00
This project has evolved into the Integrated Coding Utility.


Open MMORPG: It's your game!

Login to post a reply

Server time is: 2024-11-24 09:33:05
Your offset time is: 2024-11-24 09:33:05