473,472 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using env variables in tcl script

Hi,

If I do following in tclsh prompt, it works;

%set i [array names env PATH]
%echo $env($i)

But if I wrap it in a.tcl, source it in tclsh prompt and call test, it
gives me following error:

can't read "env": no such variable

----------- a.tcl -----------------
proc test {} {
set i [array names env PATH]
echo $env($i)
}
--------------------------------------

%source a.tcl
%test
can't read "env": no such variable
%

Please let me know how to resolve this.

Regards,
~ Soumen
Mar 12 '08 #1
3 3136
Soumen wrote:

<snip>

Please post to a TCL group or forum like comp.lang.tcl. This group is
for standard C. You might also try comp.programming.

Mar 12 '08 #2
Soumen wrote:
Hi,

If I do following in tclsh prompt, it works;

%set i [array names env PATH]
%echo $env($i)

But if I wrap it in a.tcl, source it in tclsh prompt and call test, it
gives me following error:

can't read "env": no such variable

----------- a.tcl -----------------
proc test {} {
set i [array names env PATH]
echo $env($i)
}
--------------------------------------

%source a.tcl
%test
can't read "env": no such variable
%

Please let me know how to resolve this.
Would you like us to diagnose your car's timing problem as well?

This has nothing to do with C - why should we be expected to know
anything about it?

There appears to be a comp.lang.tcl group - why not ask there?
Mar 12 '08 #3
In article <fr**********@aioe.org>,
Mark Bluemel <ma**********@pobox.comwrote:
....
>Please let me know how to resolve this.

Would you like us to diagnose your car's timing problem as well?

This has nothing to do with C - why should we be expected to know
anything about it?
No, sorry, you are wrong. See, tcl is written in C, therefore this is
on topic in a C group.

See, ultimately, we all know that "tcl" is just a wrapper around the
underlying C runtime. For example, the error message that the OP
mentions - that actually comes from C.
>There appears to be a comp.lang.tcl group - why not ask there?
Interesting. That might work, as well.

Mar 12 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Craig L | last post by:
I use ASP to obtain data from a database and I have a piece of javascript code I use on my website. I want to use the database variables in my javascript. I'm not very familiar with javascript, but...
2
by: Craig L | last post by:
This is a solution followup to a request for help posted on 11/04/03 at 12:51pm titled "Using ASP Variables". Here is how you can make ASP variables available for use in Javascript code. I hope you...
13
by: Jake Barnes | last post by:
I saw this sentence: "The last stage of variable instantiation is to create named properties of the Variable object that correspond with all the local variables declared within the function." ...
10
by: Paul | last post by:
Hi I am using the HtmlInputFile control to upload a file from a client to a server. I have a browse to find the file on the server but need to create the path dynamically as to were it will go...
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.