News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

A place to store my snippets?

Started by Ehtyar, January 18, 2007, 10:05:53 AM

Previous topic - Next topic

Ehtyar

Hi all.
I've been at it with MASM for some time now, and thanks mostly to this forum, i have quite a lot of handy snippets floating around. Trouble is I tend to stick them in inappropriately named  text files that i will never find again at the right time. My question is does anyone have the name of a program i can use to store them. My requirements are that it is accessible offline, and does not make use of .NET. Naturally i am willing to spend some money if the program is good and reasonably priced. Any reply is helpful.

Thanks, Ehtyar.

TNick

Hello, Ehtya!
What about building such a program? I was just thinking about such app to store the code, times obtained on warious machines (if appropriate) and a brief description. A search engine would be very helpfull and, maybe a treeview to categorise the snippets I think it would be quite simple, no more than a day or two.
What do you say?
Nick

jack

do a Google search for:
snippet organize

Ehtyar

Quote from: jack on January 18, 2007, 01:23:28 PM
do a Google search for:
snippet organize
Thank you Jack. The purpose of my question was to determine if any of these were decent programs. Though i had only found two organizers with websites that are online, both of which use .NET.  :snooty:

Quote from: TNick on January 18, 2007, 11:16:43 AM
Hello, Ehtya!
What about building such a program? I was just thinking about such app to store the code, times obtained on warious machines (if appropriate) and a brief description. A search engine would be very helpfull and, maybe a treeview to categorise the snippets I think it would be quite simple, no more than a day or two.
What do you say?
Nick
Nick, before making this post, i did a little research on building my own as well. The part where i got stuck was designing a workable database format. INI will not cut it i think, sqlite has awful documentation, and i cannot find another winapi database format available as a static lib or dll.  :'(
However, if you have some ideas, and would like to discuss collaboration on such a project, i would be more than happy to supply you with my MSN details, IRC details, or simply an email address. Also please feel free to PM me at any time, thought i must warn you, this will be my first project involving a database of this kind, and i have never implemented treeview or search functionality in any of my previous projects, so i will be spending a lot of time learning.

Please keep the replies coming everyone if you have suggestion, if nothing else it might give Nick and I some ideas on how to build our own snippet storage program.  :dance:

Thanks, Ehtyar.

Ehtyar

Was sitting at work today bored out of my mind and it suddenly hit me....XML. I'm going to do some research on it now, not sure what i'll find, but i also have a dialog design in mind from your suggestions TNick, though if we build this thing, i think search will have to be your department :P
Anyway, going to do some research, might build a non-working example dialog too if i have time.

Ehtyar.

TNick

Hey, glad to see that you like the idea. Now, about that database, I know that general opinion is you should stay with the existing databases. But ... I was kind of thinking that it shouldn't be that hard. Let me think for an hour and I will post a simple format for this ...

And about that treeview, I am working on a custom one - open source - but I'm stuck with some problems. If I can finish it in some resonable time, we could use this one.

A dialog example would be great, BTW.

Nick

P1

Did you know that ...

Part of how the C language came about was that, it was a shell of Assembler routines.  AKA, a Snippet Librarain of sorts.

As always, as programmers in the greatest of all languages, it's either roll your own, or smoke someone's elses.

Regards,  P1  :8)

TNick


daydreamer

Quote from: P1 on January 19, 2007, 03:48:43 PM
Did you know that ...

Part of how the C language came about was that, it was a shell of Assembler routines.  AKA, a Snippet Librarain of sorts.

As always, as programmers in the greatest of all languages, it's either roll your own, or smoke someone's elses.

Regards,  P1  :8)
smoke someone's else that is made in Highlevel, no please I don't want to get High

TNick

Well, it was more than an hour, but here is some sample. I will try to add some controls, but there are some basic things for our database: add, remove, read. To be done: edit and search.

Nick
PS. I didn't test the code yet,and some optimization is required.


[attachment deleted by admin]

Ehtyar

Hi again TNick.
I'm not even going to pretend i know how all this works at this point, though i have to say without radasm, radasm produced code is extremely hard to follow. I am, however, very glad you have developed your own database format, as parsing xml was easy, but rewriting it was nigh on impossible without some third party addon. The format i had in mind was something like this:

<Database cdate="190107">
<Category name="cat1">
<Snippet name="snip1" date="190107">
blablabla
this is a snippet
blablabla
</Snippet>
</Category>
</Database>

but anyway, on to other things...
The dialog im thinking of (ugly demo) is here:

I know it's extremely ugly, but there we go for the moment. Was thinking it would be good idea to use HiEdit for displaying the snippet. We will have line numbers and undo built in, and writing the snippet to file will be a piece of cake. If you're interested ill start working on the dialog right away.

Thanks, Ehtyar.

TNick

Absolutely interested! :)
HiEdit is a good idea, and the dialog is looking good, already!

Let's proceed, then!

Nick

hutch--

Ehtyar,

If you are going to have a tree structure why not use the file system as it already has that logic and is close enough to infinitely extendable. It also has the advantage that you can add to it and modify things with other tools like a normal text editor. The accessory I have in masm32 "Procedure Browser" uses this basic system and all I need to do to add to it is save a section of a file that I want as a snippet into one of the directories where I have it pointed and I can routinely scan through mountains of source code to find bits and pieces.

Even if you wanted to share it around, you need do no more than put an app something like this at the head of a directory structure and zip the directory and all of its subdirectories and you have it as a single working file that can be passed around.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

ramguru

I once had an idea to make a program with 500 templates of about dialog. I were thinking to use sqlite...To say truth I've never gave up that idea  :lol
So now when I think about this: I even can embed chosen template directly to exe file (no problem) if DB stores data in res format. Damn this is a great idea for my current project RP  :bg

u

Just wanted to finally play with listboxes to learn them...

[attachment deleted by admin]
Please use a smaller graphic in your signature.