rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: Warp on January 06, 2009, 02:31:43 PM

Title: Comment File Editor - coded for fun
Post by: Warp on January 06, 2009, 02:31:43 PM
Hi all,
i wrote a small tool which may be useful to create comment files (Freeware with source code in Win32 assembler).

I like to ask you:
Do you find it useful to display an icon beside all displayed files ?
In that case the drawback is that loading a folder with a lot of files needs some time (seconds).
Also the RAM usage increases up to 8 MByte or more.
I like to say that for me the small icon option seems not to be very helpful.
I attach a screenshot of my program.
The program itself should be available in the next 10 days (current status: testing).

Just finished coding i noticed a simular program written by ledufe:
rejetto.com/forum/index.php?topic=3761.0

Running his program i realized that it is possible to include symbols inside a comment file.
So i add this option.


Now, my questions are:
Are there any other options available inside a comment file ?

@rejetto:
What do you think about a "Tools page" ?
For me it seems to be a good idea to place all available tools on one page (mp3ToIon, exiftool etc.).

@ledufe:
viva o Win32asm ...  ;)



Warp



http:
//warp2001.dyndns.org:44792
Title: Re: Comment File Editor - coded for fun
Post by: Ranger on January 06, 2009, 06:32:23 PM
I think this could be a nice little tool. I personally use comment file's and I just do em one line at a time in one txt file.

Also a tools page is a great idea as well.
Title: Re: Comment File Editor - coded for fun
Post by: Warp_ on January 06, 2009, 07:33:25 PM
Hi DNic41,

you wrote:
I personally use comment file's and I just do em one line at a time in one txt file.

Yes, i saw it in the wiki ...
Solved and included.


Warp
Title: Re: Comment File Editor - coded for fun
Post by: ge2001 on January 07, 2009, 07:35:33 PM
Hi all,
here comes the first beta release of my HFS Comment Editor coded in Windows 32Bit assembler.
Imagine that this program is a beta, always backup your important files.
The program is freeware and tested under WinXP SP3, which is my OS.

I like to know if it works under Vista, 98 etc..
Feel free to report all Bugs.
Also your suggestions are welcome.


Short description:
------------------------------------------------
Select Folder   : Select the folder for which you like to create comments.
Symbols      : Select a symbol.
Insert Symbol   : Inserts the selected symbol into the text window at the cursor position.
Single Comment   : Create and save single comment files for every file in the selected folder.
Multiple Comment: Create and save comments in one textfile for all files in the selected folder.
Save Comment(s)   : Saves the comment(s). Depends on the selected mode ( Single / Multiple ).

If you toogle from Single Comment to Multiple Comment or vice versa the content of the
text window will be cleared and a comment file will be loaded if available.
For your pleasure you can paste the old content using the context menu (Right-Click inside the text window).

Selecting a file inside the file window in Single Comment mode loads the comment file.
In Multiple Comment mode a Right-Click inside the file window opens a popup menu with useful functions.
The target for all options is the text window at the cursor position.
In Single Comment mode you must save the comment before selecting another file.
For your pleasure you can paste the old content using the context menu (Right-Click inside the text window).

Before saving the new comment(s) the program creates a backup (.BAK).
After closing the program you should delete this *.BAK files.


Known limitations:
------------------------------------------------
Maximal comment size: ~63000 Bytes.
Clicking in a free area inside the file window hides the selection, which is still available but not visible.
I don't see a solution for this strange behavior.
There is another limitation, which i can't remember ...



@Rejetto:
What do you think about a "Tools page" ?
For me it seems to be a good idea to place all available tools on one page (mp3ToIon, exiftool etc.).
OK, i am a little bit bothersome.  ;)




Warp
Title: Re: Comment File Editor - coded for fun
Post by: r][m on January 08, 2009, 06:01:34 AM
Warp
Thanks for sharing your work.
I tested on Win 98se.
The symbols list never appeared?
Title: Re: Comment File Editor - coded for fun
Post by: Mark on January 08, 2009, 06:37:25 AM
A Comment Editor is a nice touch.  However, IMHO, what good are all of those symbols?  The majority, if any, aren't used or needed in a file's comments.  ???
Title: Re: Comment File Editor - coded for fun
Post by: ge2001 on January 08, 2009, 10:04:05 AM
Hi all,
thanks all for the response and for the bug report(s).

The Microsoft documentation says that the dropdown box should work on Win98.
So, i forgot to init the control. My fault.
The new version 0.21 beta should work on Win98.
Hey r][m, can you test it ?


Mark, take a look at my first post.
I'm not an expert using HFS, but starting a simular program from ledufe i realized
that it is possible to insert symbols inside a comment file.
So i include it.
I am not sure if there is any good reason for that ...
 




Warp
Title: Re: Comment File Editor - coded for fun
Post by: r][m on January 08, 2009, 06:36:38 PM
Warp
Tested your new ver 0.21 on win98se.
It worked fine. Symbols list was there. I can see how this will be
useful, and a time saver.

Could there be any way to select whether the .bak is generated or not?
I have to delete those, but they might be useful to someone else.

Would it be possible to make it so that we could
add our own things to the symbols list? Sort of
customize it to our own needs?
Title: Re: Comment File Editor - coded for fun
Post by: ge2001 on January 08, 2009, 07:18:09 PM
Hi again,
i will add a checkbox to enable/disable the *.BAK option in the next release.
In this world everything is possible, any idea ?  ;)
Maybe loading a (text-)file with individual options ...
 

Warp
Title: Re: Comment File Editor - coded for fun
Post by: Ranger on January 08, 2009, 07:36:49 PM
Ok finally figured out how to use it. Still have to manually enter the "=" sign after you insert the file and before you enter the comment.

I'm not sure how to use the symbol section however, how do I use those?
Title: Re: Comment File Editor - coded for fun
Post by: r][m on January 08, 2009, 08:35:58 PM
Quote
Maybe loading a (text-)file with individual options ...
That could work, maybe have it so we could edit out the symbols
we'd never use and add things like =80's Music, or some such, that
we might use repeatedly.

Quote
I'm not sure how to use the symbol section however, how do I use those?
Maybe like =Added to Server on %timestamp%. Experiment !  ;D
Title: Re: Comment File Editor - coded for fun
Post by: ge2001 on January 08, 2009, 09:40:51 PM
Hi,
as i wrote before i'm not an expert using HFS ...

Using a symbol seems to be easy:
Place the cursor in the text window where you like to insert the symbol.
Select a symbol for example %timestamp% and press the "Insert Symbol" button.
Then you will see time and date inside HFS.
No "=" char needed.
As discussed before, i am not sure if there is any good reason for symbols inside a comment file ...
Maybe a power user could tell us any good reason.

If everybody agree I can add the "=" char while inserting the filename, ok ?

Yes, it is also possible to enable "in Place editing" the items in the drop down box,
but i prefer the option to insert new items.
The advantage is that the list can grow and the symbols remain untouched.
In that case the list must be loaded/saved on program start/program exit.
For me, as the programmer, it is much more easy to load all dropdown items from an extra text file.
I will think about a user friendly solution.
Anyway that option needs some time to code.
 

Warp

Yust got an idea.
Displaying a second dropdown box with custom items ...
Title: Re: Comment File Editor - coded for fun
Post by: Ranger on January 08, 2009, 10:41:08 PM
Quote
I'm not sure how to use the symbol section however, how do I use those?
Maybe like =Added to Server on %timestamp%. Experiment !  ;D


Ok I see how it used now, thanks.
Title: Re: Comment File Editor - coded for fun
Post by: ge2001 on January 09, 2009, 10:37:08 AM
Hi,
here comes HFS Comment Editor 0.22 beta.

What's new:
Added the "=" char behind the filename while inserting the filename.
Checkbox to enable/disable the backup old comment file option.

The beta release messagebox at program start will be removed in the final version.



Warp
Title: Re: Comment File Editor - coded for fun
Post by: r][m on January 09, 2009, 04:03:56 PM
Checkbox to enable/disable .bak works here.
Didn't test them all, but I find that many symbols don't work in comments.
Many only work in specific [sections] of the template.

Still think a list that the user could edit to build their own
frequently used comments, with or without symbols would be
more useful.




Title: Re: Comment File Editor - coded for fun
Post by: ge2001 on January 09, 2009, 04:11:00 PM
Hi,
thanks for the reply.
I only test %timestamp%.
That symbol works as described above.
But i remember that another one do not work.
I will test them all and remove those which don't work.
Useful or not useful, that is another question ...  ;)

Frequently used comments will be available, maybe in the next release.


Warp
Title: Re: Comment File Editor - coded for fun
Post by: ge2001 on January 10, 2009, 06:04:49 PM
Hi,
here comes the HFS Comment Editor 0.23 beta.

What's new:
--------------
Some symbols added, some symbols removed.
The "=" char behind the filename will be not appended in Single Comment mode, because it is not necessary.
Customer frequently used comments dropdown box added.
The list grows after loading or saving a comment file.
In this version 0.23 the customer comments are lost if the program is terminated.

The beta release messagebox at program start will be removed in the final version.



Warp
Title: Re: Comment File Editor - coded for fun
Post by: ge2001 on January 12, 2009, 06:46:39 PM
Hi folks,
HFS Comment Editor 0.24 beta.

What's new:
--------------
Several bugfixes, one of them is very important ...
So, please don't use the old versions !
The frequently used comments are loaded on startup and saved while terminating the program.
Items in the dropdown box are sorted now.

If the users do not report a bug or suggestions this will be the last beta release before the final version.



Warp
Title: Re: Comment File Editor - coded for fun
Post by: Ranger on January 12, 2009, 09:36:24 PM
I'll give it a go a bit later.
Thanks!
Title: Re: Comment File Editor - coded for fun
Post by: Fysack on January 13, 2009, 11:17:54 PM
Great Wrap, GREAT! Keep up the good work.
Title: Re: Comment File Editor - coded for fun
Post by: Ranger on January 14, 2009, 02:43:34 AM
Works just great for me.
Title: Re: Comment File Editor - coded for fun
Post by: ge2001 on January 15, 2009, 02:31:36 PM
Hi,
HFS Comment Editor 0.25 Final.

What is new:
---------------
Code cosmetic, nothing important.
No popup menu before selecting a folder.
Error message improvement.
A PDF help file is included.

Thanks to all for the response and the suggestions.


So long

Warp
Title: Re: Comment File Editor - coded for fun
Post by: ge2001 on January 15, 2009, 09:44:15 PM
Hi,

it's me again ...

Just noticed that it could be a fine option to scan for new files and add those to the comment window.
So, popup option added, here is version 0.26 final.


So long


Warp
Title: Re: Comment File Editor - coded for fun
Post by: ge2001 on January 16, 2009, 04:16:01 PM
Hi,

another brave step in the international comment editor programming contest.  ;)

What's new in this version 0.27 final: ::)
---------------------------------------
Frequently used directorys added.
Program screen size enlarged.
PDF help file updated.

Cheerio

Warp
Title: Re: Comment File Editor - coded for fun
Post by: Fysack on January 18, 2009, 09:17:39 PM
Damn Wrap, im em impressed, I`M impressed. Thx
Title: Re: Comment File Editor - coded for fun
Post by: ge2001 on January 19, 2009, 11:22:06 AM
Hi,

thanks for the compliment Fysack.

Maybe it was not a good idea to choose the equal (=) charachter as the seperator, because in windows it is a legal character in a filename.
Anyway, to change that now by rejetto would cause complications ...

I'm often searching for a new area of programming activity, except in spring and summer where i like to travel or stay in my garden.  ;D


ciao


Warp
Title: Re: Comment File Editor - coded for fun
Post by: Mars on January 19, 2009, 09:35:50 PM
Maybe it was not a good idea to choose the equal (=) charachter as the seperator, because in windows it is a legal character in a filename.
Anyway, to change that now by rejetto would cause complications ...

The use of the sign = is in compliance with the INI files, the choice of rejetto seems the most just. Even if signs = are used in names of file, those this must be used after the separator = and do not thus enter conflict. 

You should not forget that the section [ special:string ] is on the base used to replace texts of announcements with macro by example {.!current folder|%folder%.} and not this way {.!%folder%|another text.}

There are many other formulations to avoid the problem posed.
Title: Re: Comment File Editor - coded for fun
Post by: ge2001 on January 19, 2009, 10:44:14 PM
Hmmm,

if the filename is, for example, "te=st.zip" and the comment line is "te=st.zip=helpme" HFS do not display the comment.
I think that HFS assumes that the comment follows directly after the equal char, correct ?
In the case described above HFS do not display a comment because he do not find the filename "te".

To avoid that problem HFS and also a comment editor must search in "hfs.comments.txt":
1. for the filename
   and if true
2. for a equal char behind the filename and everything behind until the end is part of the comment.


Since i start coding i am at war with macros and script languages, so i don't understand much of your friendly explanation.
Anyway, i understand the macro you supplied.
But i don't see how a macro can solve the filename with equal char behaviour inside "hfs.comments.txt".


mars, please be so kind and give me a hint ...
Don't hesitate to correct me if i'm completly wrong.



Warp
Title: Re: Comment File Editor - coded for fun
Post by: rejetto on January 23, 2009, 01:51:11 AM
you are right warp, hfs is not supporting the = for filenames inside hfs.comments.txt
(it works with other systems anyway).

a solution, inspired by descript.ion files, is to "quote" filenames with the equal sign.
Title: Re: Comment File Editor - coded for fun
Post by: rejetto on January 23, 2009, 02:11:23 AM
hey mars, i thought this would have solved the problem by applying the idea reported in my previous post

Code: [Select]
    procedure fixQuotedStringList(sl:Tstrings);
    var
      i: integer;
      s: string;
    begin
    for i:=0 to sl.count-1 do
      begin
      s:=sl.names[i];
      if (s = '') or (s[1] <> '"') then continue;
      s:=s+'='+sl.ValueFromIndex[i]; // reconstruct the line
      sl.names[i]:=chop(nonQuotedPos('=', s), s);
      sl.ValueFromIndex[i]:=s;
      end;
    end;

but names[] cannot be assigned.
have you any idea on how to get the = inside the name?