Discussion:
Using variables in msgbox - v.3?
JHegener
2003-12-28 22:21:27 UTC
Permalink
Hi guys, I'm trying to get some info about a file to be copied (the
filesize for now but eventually time and date stamps too) and then to
display that info in a msgbox which prompts the user to continue or
not. (Initially, I wanted to do this in version 2.64 but it did not
seem to like UNC paths, nor did it seem to have a function that would
return file information).

At any rate, I always get an error message when I try to embed the
variable into the msgbox prompt string. I'm sure it's something
stupid but I could not find anything in the help for variables or
msgbox that seemed to address the correct syntax. Here is a bit of
sample code... can anyone help?


$filesize = FileGetSize("\\shambala\test1\test.txt")

; Bring up a message box with file details
$answer = MsgBox(4, "Auto It", "File size is: $filesize. Proceed?)

If $answer = 7 Then
Exit
EndIf

FileCopy ("\\shambala\test1\test.txt", "\\shambala\test2\test.txt", 1)





Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/AutoItList/

To unsubscribe from this group, send an email to:
AutoItList-***@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Gene Sears
2003-12-28 22:38:44 UTC
Permalink
Try...


$answer = MsgBox(4, "Auto It", "File size is: " & $filesize & ". Proceed?")

The two ampersands (&) concatenate (join) the two text strings and the
variable.

Gene

PS. If the file size comes back as Zero even though you know it has data,
then it is most likely open. FileGetTime() will also fail if it's target is
open.



) -----Original Message-----
) From: JHegener [mailto:***@earthlink.net]
) Sent: Sunday, December 28, 2003 5:21 PM
) To: ***@yahoogroups.com
) Subject: [AutoIt] Using variables in msgbox - v.3?
)
)
) Hi guys, I'm trying to get some info about a file to be copied (the
) filesize for now but eventually time and date stamps too) and then to
) display that info in a msgbox which prompts the user to continue or
) not. (Initially, I wanted to do this in version 2.64 but it did not
) seem to like UNC paths, nor did it seem to have a function that would
) return file information).
)
) At any rate, I always get an error message when I try to embed the
) variable into the msgbox prompt string. I'm sure it's something
) stupid but I could not find anything in the help for variables or
) msgbox that seemed to address the correct syntax. Here is a bit of
) sample code... can anyone help?
)
)
) $filesize = FileGetSize("\\shambala\test1\test.txt")
)
) ; Bring up a message box with file details
) $answer = MsgBox(4, "Auto It", "File size is: $filesize. Proceed?)
)
) If $answer = 7 Then
) Exit
) EndIf
)
) FileCopy ("\\shambala\test1\test.txt", "\\shambala\test2\test.txt", 1)
)
)
)
)
)
) Yahoo! Groups Links
)
) To visit your group on the web, go to:
) http://groups.yahoo.com/group/AutoItList/
)
) To unsubscribe from this group, send an email to:
) AutoItList-***@yahoogroups.com
)
) Your use of Yahoo! Groups is subject to:
) http://docs.yahoo.com/info/terms/
)
)




Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/AutoItList/

To unsubscribe from this group, send an email to:
AutoItList-***@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
JHegener
2003-12-28 23:10:21 UTC
Permalink
Post by Gene Sears
Try...
$answer = MsgBox(4, "Auto It", "File size is: " & $filesize & ".
Proceed?")
Post by Gene Sears
The two ampersands (&) concatenate (join) the two text strings and the
variable.
Works like a charm... thanks!

Now how do I embed a carriage return? You used to be able to put a
\n in version 2 message boxes.





Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/AutoItList/

To unsubscribe from this group, send an email to:
AutoItList-***@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Jeremy Landes
2003-12-28 23:55:18 UTC
Permalink
Use the @CR macro. Example:

$answer = MsgBox(4, "Auto It", "File size is: " & @CR & $filesize & ".
Proceed?")

Sincerely yours,
Jeremy Landes
***@landeserve.com

----- Original Message -----
From: "JHegener" <***@earthlink.net>
To: <***@yahoogroups.com>
Sent: Sunday, December 28, 2003 6:10 PM
Subject: Re: [AutoIt] Using variables in msgbox - v.3?
Post by Gene Sears
Try...
$answer = MsgBox(4, "Auto It", "File size is: " & $filesize & ".
Proceed?")
Post by Gene Sears
The two ampersands (&) concatenate (join) the two text strings and the
variable.
Works like a charm... thanks!

Now how do I embed a carriage return? You used to be able to put a
\n in version 2 message boxes.





Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/AutoItList/

To unsubscribe from this group, send an email to:
AutoItList-***@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/






Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/AutoItList/

To unsubscribe from this group, send an email to:
AutoItList-***@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Tutor2000
2003-12-30 08:37:24 UTC
Permalink
Gene!

I understood what you wrote. Using autoit 3 scriptlets as part of
autoit2 main scripts and making new scripts autoit3 work!

i gote smater

Rik
Post by Gene Sears
Post by Gene Sears
$answer = MsgBox(4, "Auto It", "File size is: " & $filesize & ".
Proceed?")
Post by Gene Sears
The two ampersands (&) concatenate (join) the two text strings
and
Post by Gene Sears
the
Post by Gene Sears
variable.
Works like a charm... thanks!
Now how do I embed a carriage return? You used to be able to put a
\n in version 2 message boxes.
Yahoo! Groups Links
http://groups.yahoo.com/group/AutoItList/
http://docs.yahoo.com/info/terms/
Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/AutoItList/

To unsubscribe from this group, send an email to:
AutoItList-***@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
JHegener
2004-01-05 22:36:42 UTC
Permalink
Post by Gene Sears
Proceed?")
Thanks... I'll try it!




Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/AutoItList/

To unsubscribe from this group, send an email to:
AutoItList-***@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Chris Stoneham
2004-01-07 08:51:08 UTC
Permalink
Wishing for ExpandVariables and ExpandMacros options like the
ExpandEnvStrings.....

Chris

-----Original Message-----
From: JHegener [mailto:***@earthlink.net]
Sent: 05 January 2004 22:37
To: ***@yahoogroups.com
Subject: Re: [AutoIt] Using variables in msgbox - v.3?
& ".
Post by Gene Sears
Proceed?")
Thanks... I'll try it!




Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/AutoItList/

To unsubscribe from this group, send an email to:
AutoItList-***@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



**DISCLAIMER: The contents and any attachments of this e-mail message are
confidential and intended only for the named addressees. If you have
received it in error, please advise the sender immediately by return e-mail
and then delete it from your system.
Any unauthorised distribution, or copying of this transmission, or misuse or
wrongful disclosure of information contained in it, is strictly prohibited.
Havant Borough Council cannot accept liability for any statements made which
are clearly the sender's own and not expressly made on behalf of the
Council.



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Upgrade to 128-bit SSL Security!
http://us.click.yahoo.com/qZ0LdD/yjVHAA/TtwFAA/EGnolB/TM
---------------------------------------------------------------------~->

Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/AutoItList/

To unsubscribe from this group, send an email to:
AutoItList-***@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Loading...