Hi Everyone,
I'm trying to create a bit of general purpose "code" that I can paste into the "Advanced Section" of the Command Editor. I'd like to be able to "turn on" and "turn off" portions of the code based on what I need for the button. So here are the details ...
I'm executing Locate32 from a button and using its several command line switches to make it work for each type of button. For instance, I have a button that will excute Locate32 and populate the path switch with the current path of the active lister. I then pop-up a few dialog boxes asking for the name I want to find another one that asks if I want to find a file, folder, or either, etc. Here's the code I used for the 1st button I created:
cd "C:\Program Files (Portable)\locate32_x64"
C:\Program Files (Portable)\locate32_x64\locate32.exe -lfd -P0 -lcnm -lwn -lrn -r {dlgstring|Enter text to find in NAMED:}
After I realized all the different variations of the Locate32 app I could run, I whittled the variations to a handful of options I know I would use with some regularity. I know I want to find files by their name, sometimes by extension, sometimes by modified date, sometimes by size, and I always try to narrow the location(s) of my searches. I also want to use any combination of these parmeters for a search. But I want to predefine some buttons that focus on particular searches.
Rather than rewrite code for each button, I want write enough code once to cover all of the scenarios and simply turn on or off the parts of the code as I need them. To do this (and keep it simple), I thought I would use remarks and copy variables when and where I needed them. So here's my first attempt ...
[i][b]cd C:\Program Files (Portable)\locate32_x64
@set vFileFolder=-lfd
'@set vFileFolder={dlgchoose|Select what to LOOK FOR:|Files and Folders=-lfd+Files only=-lf+Folders only=-ld}
@set vMinSize=0
'@set vMinSize={dlgchoose|Select the minimum file size:|1KB+10KB+20KB+30KB+40KB+50KB+75KB+100KB+1MB+10MB+100MB+1000MB+2000MB+3000MB+4000MB+5000MB}
'-lm {$vMinSize}
@set vMaxSize=0
'@set vMaxSize={dlgchoose|Select the maximum file size:|10KB+20KB+30KB+40KB+50KB+75KB+100KB+1MB+10MB+100MB+1000MB+2000MB+3000MB+4000MB+5000MB+6000MB+7000MB+8000MB+9000MB+10000MB}
'-LM {$vMaxSize}
@set vPath=0
'@set vPath={dlgfolder|Select where to LOOK IN:|H:}
@set vNamed=
@set vNamed={dlgstring|Enter text to find in NAMED:}
@set vExt=
'@set vExt={dlgstring|Enter FILE Extension(s) to find (separate by spaces):}
'-t {$vExt}
@set vStartDate=
@set vStartDate={dlgstring|Enter the START DATE for a date range (YYMMDD):}
@set vEndDate=
@set vEndDate={dlgstring|Enter the END DATE for a date range (YYMMDD):}
@set vDaysOld=
'@set vDaysOld={dlgstring|Enter how many DAYS AGO the file was modified:}
'-lDmDAY {$vDaysOld}
@set vText=
'@set vText={dlgstring|Enter the TEXT found in the file:}
'-lc {$vText}
C:\Program Files (Portable)\locate32_x64\locate32.exe {$vFileFolder} -p{$vPath} -lDmDAY {$vStartDate} -lDMDAY {$vEndDate} -An -r {$vNamed}
[/b][/i]
You can see in the code above that I'm first initializing my variables with a @set varname=. I'm not even sure if this is right because I could not find this in the documentation anywhere. I want to initialize the variables and make sure they start out vallueless (null). Next I was hoping to use an apostophre (') to remark out statements. But that seems to work only to an extent. By this I mean that the statements that are remarked out don't appear to execute - at least I'm not prompted by those. But after I ran this code (Windows 7 Ultimate x64), I rec'd a "@set error":
[Window Title]
'@set
[Content]
Windows cannot find ''@set'. Make sure you typed the name correctly, and then try again.
[OK]
I really don't know what's causing this error. I thought I would start by making sure I'm on the right track for syntax and how I'm trying to do this.
Any help with this would be greatly appreciated. Thank you,
RiteGuy
By the way, I attached a copy of Locate32's help page with all the command line switches.