Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

issue in opening a file through pipeline

Status
Not open for further replies.

jitsubh07

Programmer
Feb 10, 2009
3
DE
HI!! I'm trying to write some interactive macro in RobCAD with the help of tcl/tk. I'm using RobCAD7.5.1, tcl/tk8.4 & os WinXP.

In RobCAD interactive macROSE console when I write the following command,
% set pipetk [open | c:/Conversion/example1.tk r+]
it gives the error :-- expected integer but got "r+"

Any help will be highly appreciated..
Regards,
jitsubh07
 
It looks like you have a pipe ("|") between "open" and your Tk file. To me, that means "open" (with no arguments), then run this script with "r+" as the argument.

_________________
Bob Rashkin
 
Thanks Bob......

You are absolutely right....I need to open the Tk file with pipeline....because I need interaction between the TK interface and the Base application i.e. RobCAD.

since I'm new in this field....can u please give an example... so that I can understand the way to achieve an interactive interface....

Thanks Again!!!

Regards,.
jitsubh07
 
OK. I've never done this but I think you've got it basically right. From the Help File:
COMMAND PIPELINES
If the first character of fileName is ``|'' then the remaining characters of fileName are treated as a list of arguments that describe a command pipeline to invoke, in the same style as the arguments for exec. In this case, the channel identifier returned by open may be used to write to the command's input pipe or read from its output pipe, depending on the value of access. If write-only access is used (e.g. access is w), then standard output for the pipeline is directed to the current standard output unless overridden by the command. If read-only access is used (e.g. access is r), standard input for the pipeline is taken from the current standard input unless overridden by the command. The id of the spawned process is accessible through the pid command, using the channel id returned by open as argument.

So I think the problem is that you have a blank space between "|" and "c:/....".

If it doesn't work when you remove the space, you may need to execute the shell (wish) with the script as its argument:
Code:
set pipetk [open |"wish c:/Conversion/example1.tk" r+]

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top