custom string compare?

Apr 2, 2011
1,607
15
55
North Carolina, USA
I have a MoveAll.btm - which moves all files in a folder tree to C:\Z_UserFiles\Multiedit\DEL_000\ for instance; However in debugging the moves some files ended up in the wrong folder, for instance YahooMessenger and not Multiedit. Therefore I'd like to compare the files location to where the routine "thinks" it should be. How would I compare

C:\Z_UserFiles\MultiEdit\
with

%@path[%tFile] ?

I looked at @similar but not sure what value would be the breakpoint as to if I need to actually move the file? Any thoughts?

I have attached the BTM ........
 

Attachments

  • Move_All.btm
    11.1 KB · Views: 147
Apr 13, 2010
318
7
62
The Hague
I have a hard time understanding your question, even after taking a look at your code.

I understand that you are sorting files into classes based on their extension and some additional rules. The tests should yield a target path for each file.

In order to help you, I need to understand where the custom string compare fits into you question.
 
Apr 2, 2011
1,607
15
55
North Carolina, USA
Hello djsplits

I have added some rem'ed comments to the moveall.btm - just look for "iff defined pTGT then" and the lines thereafter
 

Attachments

  • Move_All.btm
    11.7 KB · Views: 154
Apr 13, 2010
318
7
62
The Hague
1) I noticed a line "goto here" and two labels: "here" and "heere". Are these as intended?

2) For readability and disambiguity replace %pTGT% with %[pTGT]

3) This numbering scheme you are using: could you use @version[] ? If not, what is it for?

4) Now where and how does the string compare come in?
 
Apr 2, 2011
1,607
15
55
North Carolina, USA
1) I changed the outer to use :Cleanup and the inner one to use :Here

2) Should I do the same for all my % vars?

3) I don't want to replace files that already exist - that is why I use %[nNum]

4) See my two examples - search for "e.g." - around line 288
 

Attachments

  • Move_All.btm
    11.8 KB · Views: 144
Apr 13, 2010
318
7
62
The Hague
ad 3) I thought so. Could you use @version?

ad 4) You are making separate subdirs. Could you group versioned files instead? (keep files together in 1 subdir but with a number in the filename?)

And, would you be so kind to point me to the line in your code that fails? The string compare?

I also add an alternative implementation, just for fun and to keep you on your toes ;-)

DJ
 

Attachments

  • MoveAll.BTM
    1.5 KB · Views: 144
Apr 2, 2011
1,607
15
55
North Carolina, USA
re 3: since I am working with various types of files, BAT, BTM, JPG, GIF, MPG, I do not think @version would be of much use here.

re 4: I don't want to mess with the filename - just with adding subdirs

q5: And, would you be so kind to point me to the line in your code that fails? The string compare?
I am just not sure how to handle coding the compare %[TGT] and %@path[%[fn]] -

q6: I also add an alternative implementation, just for fun and to keep you on your toes ;-)
I will look at your new BTM and reply later....
 
Apr 13, 2010
318
7
62
The Hague
How about

Code:
iff %@index[%@path[%fn],%pTGT] eq -1 then
    :: The existing path is not on the target path
endiff
 
Apr 2, 2011
1,607
15
55
North Carolina, USA
@djspits sorry about the delay in responding, life has a bad habit of getting in the way sometimes. Anyway I did some additions to the MoveAll.btm - as you can see, and made one change as to where one of the file extension matches goes. I'd very much appreciate seeing what you had in mind for the rest of the code.
 

Attachments

  • Move_All.btm
    12.6 KB · Views: 159
  • MoveAll.BTM
    2.3 KB · Views: 147

Similar threads