#1 2013-04-28 12:37

narayan
Senior Member
Registered: 2009-02-08
Posts: 471

Bug with Analyze window (extra window pops up)

I tried the PascalScript on sample text (SHFT+A) in the Analyze window, and discovered a bug:
Now ReNamer pops up a small extra window with the result, instead of showing it line-by-line in the bottom portion of the Analyze window itself.
The bottom portion of the Analyze window itself remains empty.

I have to press OK button to close that extra window, to return to the Analyze window.

Worse, if my "Automatically apply rules" option is already selected, then ReNamer pops up the extra window for each new character I add.
Thus it becomes virtually impossible to add a new line in the Analyze window to see how the stack of rules behaves.

And worst of all, this extra window shows only one line (the result for the first line).
I cannot see the results for the other lines.

Last edited by narayan (2013-04-28 12:39)

Offline

#2 2013-04-28 17:46

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Bug with Analyze window (extra window pops up)

Hi narayan,

could it be you have tested my POC script from there >>> http://www.den4b.com/forum/viewtopic.php?pid=7691#p7691

and the use of ShowMessage() had caused that issue you have described?

Other then that I can't guess what you may had seen. And Analyze works for me always, the lower pane also.


.


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#3 2013-04-28 19:04

narayan
Senior Member
Registered: 2009-02-08
Posts: 471

Re: Bug with Analyze window (extra window pops up)

Yes, I did check that script, and faced the issue. smile

Like you, I have never faced the problem otherwise.

BTW why does the script need a message window? It will anyway appear in the preview column (or we can try it out on sample text as I did.)
Another point to clean up?

Offline

#4 2013-04-28 19:59

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Bug with Analyze window (extra window pops up)

ShowMessage() is used for debugging to see what happen.
Sure, just using 'FileName := xxx' had worked here too but that is kind of 'enabling real renaming'
and could led to messed-up file names (especially as long as we do not know the pattern of the real  filename of the user)

Back to your bug report....
Do you still get this misbehaviour after you remove that ShowMessage() line?


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#5 2013-04-29 03:18

narayan
Senior Member
Registered: 2009-02-08
Posts: 471

Re: Bug with Analyze window (extra window pops up)

Hi Stefan,

I copied the latest version of the script (post#6 of the thread).

I wanted to comment out the ShowMessage() statement, but it seems you have already done that. (?)

So I simply compiled it without doing anything further.
This version compiles with an error message about only three variables (compared to four variables earlier):

---------------------------
Information
---------------------------
Compiled successfully!

[Line 0] Hint: Variable 'FILEPATH' never used
[Line 2] Hint: Variable 'SPARTBEFORE' never used
[Line 2] Hint: Variable 'SPARTAFTER' never used
---------------------------
OK   
---------------------------


But now if I press SHFT+A, ReNamer issues the following error:
---------------------------
ReNamer
---------------------------
Pascal Script Execute:
[Line 24] Exception: Invalid argument to date encode.
---------------------------
OK   
---------------------------

This error did not come before.

The same error pops up for each character I enter in the Analyze window.

So finally I created the YYYYMMDD string in a text editor, copied it into clipboard and pasted it in ReNamer.
This worked without a problem.
****
I did an extended test case: I entered abc20120104def as the test string.
The script is NOT able to strip the substrings "abc" and "def": It shows the old result without raising an alarm.

I haven't done more rigorous tests, like using numbers in "before" and "after" strings, to check if ReNamer is able to spot the matching pattern inside the input string.

Last edited by narayan (2013-04-29 03:40)

Offline

#6 2013-04-29 08:47

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Bug with Analyze window (extra window pops up)

Hi narayan,


>>This version compiles with an error message about only
>>three variables (compared to four variables earlier):
Again, this is NO error but an hint only about vars not used smile
The var FileName was now used that is why you get three hints only.
Since mostly 'FILEPATH' is never used you will almost always get that hint.



>>I did an extended test case: I entered abc20120104def as the test string.
>>The script is NOT able to strip the substrings "abc" and "def":
>>It shows the old result without raising an alarm.
Please note that the regex used in that script works only for
the examples the user had provided (20120104.ext).

To let that script work with examples like yours
you have to match/catch/extract the leading and trailing chars also,
store them for reuse at the new FileName creating.
That's why I had reserved 'sPARTBEFORE' and 'sPARTAFTER'.
Only the code to use this was not added yet.
It would have to be something like this:

  sBaseName   := WideExtractBaseName(FileName);
  sPartBefore := ReplaceRegEx(sBaseName, '([^\d]+?)(\d+)(\w+)','$1',false,true);
  sDateOrg    := ReplaceRegEx(sBaseName, '([^\d]+?)(\d+)(\w+)','$2',false,true);
  sPartAfter  := ReplaceRegEx(sBaseName, '([^\d]+?)(\d+)(\w+)','$3',false,true);

   FileName := sPartBefore + dddd + ' - ' + rest + sPartAfter + WideExtractFileExt(FileName);

I go to add this to that script over there too so it will be more flexible.
http://www.den4b.com/forum/viewtopic.php?pid=7696#p7696



>>But now if I press SHFT+A, ReNamer issues the following error:
>>Pascal Script Execute:
>>[Line 24] Exception: Invalid argument to date encode.
I guess you have used non-integer values or wrong syntax for  "EncodeDate();" ?


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

Board footer

Powered by FluxBB