SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Expanding variables within quote strings

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Expanding variables within quote strings
Author Message
Gary Jensen



Joined: 22 Mar 2000
Posts: 28

Post Expanding variables within quote strings Reply with quote

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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6499

Post Re: Expanding variables within quote strings Reply with quote

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 View user's profile Send private message
Gary Jensen



Joined: 22 Mar 2000
Posts: 28

Post Re: Expanding variables within quote strings Reply with quote

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 View user's profile Send private message
Gary Jensen



Joined: 22 Mar 2000
Posts: 28

Post Re: Expanding variables within quote strings Reply with quote

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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6499

Post Re: Expanding variables within quote strings Reply with quote

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 View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.