Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: variable subtitution
I've tried %%DRV%Z%%%, %%DRV%%Z%%, and several other combinations.
temp=drv%z% for xx = 1 to temp nextor maybe:
for temp = 1 to 10 drv%z% = temp nextDepends on what you plan to do.
The rule is that you do not generally need (or want) to use %substitution% EXCEPT as a quick and dirty shortcut inside quoted strings.
DON'T using %substitution% to put the variable list data into your line. Where you have, for ex:
"%listvariablename%"just use:
listvariablenameWhen you use the %'s around the variable name, it substitutes it right then and there, then looks at your new line and decides, oops, it is over 256 characters. So no go.
I believe it has to do with the fact that the files I'm dropping are way down deep in a sub-sub-sub-directory, and it's making each passed param(1-n) a very long string, and thus reaching the 256 char limit.
Does anyone know of a way to truncate params to just pass the filename? (so as to shortent the passed string).
Here's the script:
;here's the dest info host="foo.bar.com" userid="xxxx" pswd="xxxx" acct="" destdirectory="/blah/blah/blah/" ;Here's the call of my ftp enging script g = "c:\winnt\profiles\admin\desktop\scripts\ftp_engine.wbc" p1 = "%param1%" p2 = "%param2%" p3 = "%param3%" p4 = "%param4%" p5 = "%param5%" p6 = "%param6%" p7 = "%param7%" p8 = "%param8%" p9 = "%param9%" Call(g, "%p1% %p2% %p3% %p4% %p5% %p6% %p7% %p8% %p9%")
;here's the dest info host="foo.bar.com" userid="xxxx" pswd="xxxx" acct="" destdirectory="/blah/blah/blah/" ;here's the call of my ftp enging script g = "c:\winnt\profiles\admin\desktop\scripts\ftp_engine.wbc" p1 = "%param1%" p2 = "%param2%" p3 = "%param3%" p4 = "%param4%" p5 = "%param5%" p6 = "%param6%" p7 = "%param7%" p8 = "%param8%" p9 = "%param9%" Call(g, strcat(p1," ",p2," ",p3," ",p4," ",p5," ",p6," ",p7," ",p8," ",p9))
p1="%param1%" if p1!="" then p1=strcat(FileRoot(p1),".",FileExtension(p1))
=========================== n = 1 nMax = 9 for nThisURL%n% = 1 to nMax next ===========================When the For stmt is executed (for the 2nd time around I think) you get a WIL error: "3074 Expression continues past expected end" "1 to nMax"
If the iterator is nThisURL instead of nThisURL%n%, it works fine.
Substitution not allowed in FOR statements.
Article ID: W13924
Filename: Variable Substitution Tips.txt
File Created: 2001:01:08:12:39:56
Last Updated: 2001:01:08:12:39:56