Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sending variables in text string

0 views
Skip to first unread message

JB

unread,
Oct 2, 2008, 11:41:21 AM10/2/08
to
Defined Variables

set tdate [clock format [clock seconds] -format %Y%m%d%H]
set tdate2 [clock format [clock seconds] -format %Y-%m-%d]
set starttime [clock format [clock seconds] -format %H]
set endtime [clock format [expr {(60*60) + [clock seconds]}] -format
%H]


I am currently using this code in Expect:

send "GENERATE PMREPORT PCHLOADSEC STARTDATE=" & $tdate2 & "ENDDATE="
& $tdate2 "STARTTIME=" $starttime ":00 ENDTIME=" $endtime ":00\r"


This beleive this would work in Perl or VBA but it is not recognized
in Expect.

How should I change the send command to make this work?

TIA

JB

unread,
Oct 2, 2008, 12:27:17 PM10/2/08
to

Got it. I just had to break it up into separate lines.

Cameron Laird

unread,
Oct 2, 2008, 12:45:29 PM10/2/08
to
In article <97cc2945-434b-4c1b...@v28g2000hsv.googlegroups.com>,
.
.
.
While I suspect our notions of "work" diverge somewhat, I believe

send "GENERATE PMREPORT PHLOADSEC STARTDATE=$tdate2&ENDDATE=$tdate2&STARTTIME=$starttime:00&ENDTIME=$endtime:00\r"

will get you closer to where you want to be.

Larry W. Virden

unread,
Oct 2, 2008, 1:16:40 PM10/2/08
to
On Oct 2, 11:41 am, JB <jbju...@gmail.com> wrote:

> I am currently using this code in Expect:
>
> send  "GENERATE PMREPORT PCHLOADSEC STARTDATE=" & $tdate2 & "ENDDATE="
> & $tdate2 "STARTTIME=" $starttime ":00 ENDTIME=" $endtime ":00\r"
>

> How should I change the send command to make this work?

What would the output from this statement look like if it worked?

For instance, do you want literal & in the output? That is

GENERATE PMREPORT PCHLOADSEC STARTDATE= & 2008-10-02 & ENDDATE= &
2008-10-02 STARTTIME= 13 :00 ENDTIME= 14 :00

I am guessing not. I am guessing that the output you want would rather
be:
GENERATE PMREPORT PCHLOADSEC STARTDATE=2008-10-02 ENDDATE=2008-10-02
STARTTIME=13:00 ENDTIME=14:00

If I am guessing correctly, then in Tcl, you want

send "GENERATE PMREPORT PCHLOADSEC STARTDATE=$tdate2 ENDDATE=$tdate2
STARTTIME=${starttime}:00 ENDTIME=${endtime}:00\r"

0 new messages