Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why can't I set a variable?

Status
Not open for further replies.

PhillipFoster

Technical User
May 23, 2002
41
GB
Consider this code snippet:

vcmdLine = "A Load Of Rubbish"
vDate = Mid(vDate,1,4) & "-" & Mid(vDate,5,2) & "-" & Mid(vDate,7,2)
vcmdLine = "winzip32 -min -a -ex " _
& faxDone _
& "FAX-" _
& vDate _
& ".zip " _
& faxStaging _
& file

When I run the debugger, all the variables are populated as they should be except vcmdLine is still set to "A Load Of Rubbish". It's as though the second variable assignment isn't being processed, although it steps through normally in debug mode.

vDate is something like: 2003-05-22
file is a filename (it does have "_" characters in it)
faxDone & faxStaging are directories. i.e G:/FAXSYSTEM/Fax_Staging/

Is either the "-" or "/" or even "_" in the path/filename upsetting something?

Yours in bafflement - Phil.
 
If you want the underscore character in the file anme you need to enclose them in quotes, the ones you have in the snipepet is to carry an ASP command to mutiple lines for readability, but you know that. But this doesn't explain it not being set, just a curiousity question you are getting the value after you try to set vcmdLine to the "winzip32 -min -a -ex " etc ?
 

OK then, from what you say the qualified cmdline should read:
"winzip32 -min -a -ex G:/FAXSYSTEM/Fax'_'Done/FAX-2003-05-20.zip G:/FAXSYSTEM/Fax'_'Staging/1457879516'_'35033174320030522174127'_'3.tif"

With all the underscores wrapped in quotes.
Yes?
 
no just enclosed them in the quotes

"winzip32 -min -a -ex G:/FAXSYSTEM/Fax_Done/FAX-2003-05-20.zip G:/FAXSYSTEM/Fax_Staging/1457879516_35033174320030522174127_3.tif"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top