Brace Style Affects Variable Expansion by ECHO - Protocols
This is a discussion on Brace Style Affects Variable Expansion by ECHO - Protocols ; While experimenting with different brace styles, I ran across a
situation in which variables used within an ECHO string were not being
expanded.
The following test script,
..\%j = 3
for \%i 0 5 1 {
IF
ELSE { ECHO ...
-
Brace Style Affects Variable Expansion by ECHO
While experimenting with different brace styles, I ran across a
situation in which variables used within an ECHO string were not being
expanded.
The following test script,
..\%j = 3
for \%i 0 5 1 {
IF < \%i \%j { ECHO \%i is less than \%j on \v(ndate)}
ELSE { ECHO \%i is not less than \%j on \v(ndate)}
}
produces this output:
[C:\temp\] K-95> take test1.ksc
0 is less than 3 on 20050809
1 is less than 3 on 20050809
2 is less than 3 on 20050809
\%i is not less than \%j on \v(ndate)
\%i is not less than \%j on \v(ndate)
\%i is not less than \%j on \v(ndate)
However if I just remove the braces in the ELSE statement,
..\%j = 3
for \%i 0 5 1 {
IF < \%i \%j { ECHO \%i is less than \%j on \v(ndate)}
ELSE ECHO \%i is not less than \%j on \v(ndate)
}
the script behaves as one would expect:
[C:\temp\] K-95> take test2.ksc
0 is less than 3 on 20050809
1 is less than 3 on 20050809
2 is less than 3 on 20050809
3 is not less than 3 on 20050809
4 is not less than 3 on 20050809
5 is not less than 3 on 20050809
I'm running Kermit 95 2.1.3, 1 Jan 2003 under Windows XP SP 2.
-
Re: Brace Style Affects Variable Expansion by ECHO
Allen wrote:
> While experimenting with different brace styles, I ran across a
> situation in which variables used within an ECHO string were not being
> expanded.
>
> The following test script,
> .\%j = 3
> for \%i 0 5 1 {
> IF < \%i \%j { ECHO \%i is less than \%j on \v(ndate)}
> ELSE { ECHO \%i is not less than \%j on \v(ndate)}
> }
>
> produces this output:
> [C:\temp\] K-95> take test1.ksc
> 0 is less than 3 on 20050809
> 1 is less than 3 on 20050809
> 2 is less than 3 on 20050809
> \%i is not less than \%j on \v(ndate)
> \%i is not less than \%j on \v(ndate)
> \%i is not less than \%j on \v(ndate)
>
> However if I just remove the braces in the ELSE statement,
> .\%j = 3
> for \%i 0 5 1 {
> IF < \%i \%j { ECHO \%i is less than \%j on \v(ndate)}
> ELSE ECHO \%i is not less than \%j on \v(ndate)
> }
>
> the script behaves as one would expect:
> [C:\temp\] K-95> take test2.ksc
> 0 is less than 3 on 20050809
> 1 is less than 3 on 20050809
> 2 is less than 3 on 20050809
> 3 is not less than 3 on 20050809
> 4 is not less than 3 on 20050809
> 5 is not less than 3 on 20050809
This is one manifestation of a larger problem that has existed for
quite some time. The problem was concidentally just fixed (on Aug 11)
in the C-Kermit source as part of another fix. See
http://www.columbia.edu/kermit/ckdaily.html
> I'm running Kermit 95 2.1.3, 1 Jan 2003 under Windows XP SP 2.
The fix has not yet made it into a Kermit 95 release. When a K-95
update is released, the fix will be there too.
--
Mark Sapiro msapiro at value net The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
-
Re: Brace Style Affects Variable Expansion by ECHO
Mark Sapiro wrote:
>>I'm running Kermit 95 2.1.3, 1 Jan 2003 under Windows XP SP 2.
>
>
> The fix has not yet made it into a Kermit 95 release. When a K-95
> update is released, the fix will be there too.
This fix is available today as part of the custom Kermit 95 builds
that are available to Kermit 95 registered users from Secure
Endpoints Inc.
http://www.columbia.edu/kermit/support.html#k95
Jeffrey Altman