 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Gary Jensen
Joined: 22 Mar 2000 Posts: 28
|
|
Expanding variables within quote strings |
|
We send emails using MailSend. The problem is getting the name of the file we are processing in the subject line. Could you send me a working example of this? (We would also like to do this with other commands also.) i.e. Dim processfile, string, 05052000.txt mailsend "profile", "password", "address@site", "File processfile actions completed.", "" When the message arrives, it says File processfile ... not File 05052000.txt ...
|
|
Tue May 09, 2000 12:04 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
Re: Expanding variables within quote strings |
|
Dim processfile, string, "05052000.txt" Dim subject, string Concat "File ", processfile, subject Concat subject, " actions completed.", subject mailsend "profile", "password", "address@site", subject, "" When the message arrives, it says File processfile ... not File 05052000.txt ... : We send emails using MailSend. The problem is getting the name of the file we : are processing in the subject line. Could you send me a working example of : this? : (We would also like to do this with other commands also.) : i.e. : Dim processfile, string, 05052000.txt : mailsend "profile", "password", "address@site", : "File processfile actions completed.", "" : When the message arrives, it says File processfile ... : not File 05052000.txt ...
|
|
Tue May 09, 2000 12:50 pm |
|
 |
Gary Jensen
Joined: 22 Mar 2000 Posts: 28
|
|
Re: Expanding variables within quote strings |
|
I understand Concat. I have scripts filling with Concat statements. It seems ridiculous that I would have to Concat and Concat and Concat to get a string with variables in it. Take the following exampe and yes this is a real example: Dim strFileLocation, string, "c:\temp\" Dim strFileName, string, "myfile" Dim strKey, string, "XYZ@site.com" Dim strRunThis, string Dim nbrProcessNumber, number, "1" Concat "c:\pgp262\pgp.exe -e ", strFileLocation, strMessage Concat strRunThis, strFileName, strRunThis Concat strRunThis, strKey, strRunThis Concat strRunThis, " > ", strRunThis Concat strRunThis, strFileLocation, strRunThis Concat strRunThis, "archive\", strRunThis Concat strRunThis, strFileName, strRunThis Concat strRunThis, "log.txt", strRunThis RunAndWait strRunThis, "", 30, nbrProcessNumber Does this seem a little lengthy to you just to generate a command line using values stored in global variables, or created dynamically within the script? : Dim processfile, string, "05052000.txt" : Dim subject, string : Concat "File ", processfile, subject : Concat subject, " actions completed.", subject : mailsend "profile", "password", "address@site", : subject, "" : When the message arrives, it says File processfile ... : not File 05052000.txt ...
|
|
Wed May 10, 2000 5:03 pm |
|
 |
Gary Jensen
Joined: 22 Mar 2000 Posts: 28
|
|
Re: Expanding variables within quote strings |
|
Sorry, strMessage should have been strRunThis in the first Concat statement. : I understand Concat. I have scripts filling with Concat statements. It seems : ridiculous that I would have to Concat and Concat and Concat to get a : string with variables in it. Take the following exampe and yes this is a : real example: Dim strFileLocation, string, "c:\temp\" : Dim strFileName, string, "myfile" : Dim strKey, string, "XYZ@site.com" : Dim strRunThis, string : Dim nbrProcessNumber, number, "1" : Concat "c:\pgp262\pgp.exe -e ", strFileLocation, strMessage : Concat strRunThis, strFileName, strRunThis : Concat strRunThis, strKey, strRunThis : Concat strRunThis, " > ", strRunThis : Concat strRunThis, strFileLocation, strRunThis : Concat strRunThis, "archive\", strRunThis : Concat strRunThis, strFileName, strRunThis : Concat strRunThis, "log.txt", strRunThis : RunAndWait strRunThis, "", 30, nbrProcessNumber : Does this seem a little lengthy to you just to generate a command line using : values stored in global variables, or created dynamically within the : script?
|
|
Wed May 10, 2000 5:05 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
Re: Expanding variables within quote strings |
|
This is the way it works. If you need to do this in many placess consider creating generic user-defined statement with as many arguments as many components you want to concatenate then a call to your statement may take just one line: MyConcat "c:\pgp262\pgp.exe -e ", strFileLocation, strKey, " > ", strFileLocation, "archive\", strFileName, "log.txt", strRunThis : I understand Concat. I have scripts filling with Concat statements. It seems : ridiculous that I would have to Concat and Concat and Concat to get a : string with variables in it. Take the following exampe and yes this is a : real example: Dim strFileLocation, string, "c:\temp\" : Dim strFileName, string, "myfile" : Dim strKey, string, "XYZ@site.com" : Dim strRunThis, string : Dim nbrProcessNumber, number, "1" : Concat "c:\pgp262\pgp.exe -e ", strFileLocation, strMessage : Concat strRunThis, strFileName, strRunThis : Concat strRunThis, strKey, strRunThis : Concat strRunThis, " > ", strRunThis : Concat strRunThis, strFileLocation, strRunThis : Concat strRunThis, "archive\", strRunThis : Concat strRunThis, strFileName, strRunThis : Concat strRunThis, "log.txt", strRunThis : RunAndWait strRunThis, "", 30, nbrProcessNumber : Does this seem a little lengthy to you just to generate a command line using : values stored in global variables, or created dynamically within the : script?
|
|
Wed May 10, 2000 5:19 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|