Jump to content

quotes n variables for filename


gcue
 Share

Recommended Posts

trying to use variablename for filename. i tried running it through scite and didnt find any syntax errors. output i get is just ".zip"

$filename = twelvehour(@HOUR) & "." & @MIN & "." & @SEC & "_" & @MON & "-" & @MDAY & "-" & @YEAR

Func twelvehour($hour)
    If $hour > 12 Then $hour -= 12
    Return StringFormat("%02i", $hour)
EndFunc

MsgBox(0, "filename", "c:\" & $filename & ".zip")
RunWait("wzzip " & $toolsdir & '"\Log Grabber\" & $filename & ".zip" "\\d0056849\c$\program files\etp\rolling.log"')
Edited by gcue
Link to comment
Share on other sites

$filename = StringFormat("%s.%s.%s_%s-%s-%s.zip", twelvehour(@HOUR), @MIN, @SEC, @MON, @MDAY, @YEAR)

MsgBox(0, "filename", "c:\" & $filename)

$runString = StringFormat('wzzip "%s\Log Grabber\%s" "\\d0056849\c$\program files\etp\rolling.log"', $toolsdir, $filename)

Func twelvehour($hour)
    If $hour > 12 Then $hour -= 12
    Return StringFormat("%02i", $hour)
EndFunc

Link to comment
Share on other sites

Did you add a RunWait command? Should be:

$filename = StringFormat("%s.%s.%s_%s-%s-%s.zip", twelvehour(@HOUR), @MIN, @SEC, @MON, @MDAY, @YEAR)

MsgBox(0, "filename", "c:\" & $filename)

$runString = StringFormat('wzzip "%s\Log Grabber\%s" "\\d0056849\c$\program files\etp\rolling.log"', $toolsdir, $filename)

RunWait($runString)

Func twelvehour($hour)
    If $hour > 12 Then $hour -= 12
    Return StringFormat("%02i", $hour)
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...