-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jtcl cant handle this command #26
Comments
Your syntax is not quite right:
packetGroupStats get {
*}$portString 0 57344; (et.al <http://et.al>.)*
There needs to be a space after {} and before $portString, or remove the {}
all together.
Probably should be one of these, depends on what your 'packetGroupStats'
command
expects:
packetGroupStats get {} $portString 0 57344;
packetGroupStats get $portString 0 57344;
…-Tom
On Tue, Oct 8, 2019, 06:03 Emil Gustafsson ***@***.***> wrote:
I have been using a different library called tcljava/tclblend but i wanted
to upgrade to a more supported library and found this, problem i have now
is that i have one command that doesnt work. The error i get is "extra
characters after close-brace" and i cant see why, it is working on the old
library, here is the command i send:
"set list {}; foreach portString {{1 12 14} {1 12 13} } { packetGroupStats
get {*}$portString 0 57344; after 500;packetGroupStats get {*}$portString
0 57344; lappend list [regsub -all { } $portString {_}]; foreach
{streamCounterName counterName} { STREAM_PACKETS_RX totalFrames
STREAM_PACKETS_RX totalFrames } { lappend list $streamCounterName; set
numGroups [ packetGroupStats cget -numGroups]; for {set groupId 0}
{$groupId < $numGroups} {incr groupId} { packetGroupStats getGroup
$groupId; set counter [packetGroupStats cget -$counterName]; lappend list
$counter;};};}; return $list;"
it fails on method eval2 in Parser.class row 1176 when the parseCommand
have been run
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#26?email_source=notifications&email_token=ABL4KGUYD4A4OBP44A46HB3QNRZIVA5CNFSM4I6QZ2D2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HQKOXFQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABL4KGSKASJEGJPLZFXVS2DQNRZIVANCNFSM4I6QZ2DQ>
.
|
sorry, github seem to remove "*", i will edit the command |
With the change you suggested i get a new error, invalid command name "packetGroupStats". |
I think I see what you are trying to do, argument list expansion via the
"{*}$listvar" syntax that C/Tcl 8.5 and later provides.
For reference: https://wiki.tcl-lang.org/page/%7B%2A%7D
Does your variable $portString contain a list?
Unfortunately, JTcl does not yet support this syntax. The ways to do
argument expansion without the {*} syntax is to build up your command as a
list, then eval it. The lappend and linsert commands are useful for this.
Also, the Sugar macro package can be used to expand arguments, see:
https://wiki.tcl-lang.org/page/Sugar
https://wiki.tcl-lang.org/page/Using+sugar+for+forward%2Dcompatible+%7B%2A%7D
…On Tue, Oct 8, 2019 at 11:10 PM Emil Gustafsson ***@***.***> wrote:
With the change you suggested i get a new error, invalid command name
"packetGroupStats".
The new command:
set list {}; foreach portString {{1 12 14} {1 12 13}} { packetGroupStats
get {*} $portString 0 57344; after 500; packetGroupStats get {*}
$portString 0 57344; lappend list [ regsub -all { } $portString {_} ];
foreach {streamCounterName counterName} { STREAM_PACKETS_RX totalFrames
STREAM_PACKETS_RX totalFrames } { lappend list $streamCounterName; set
numGroups [ packetGroupStats cget -numGroups]; for {set groupId 0}
{$groupId < $numGroups} {incr groupId} { packetGroupStats getGroup
$groupId; set counter [packetGroupStats cget -$counterName]; lappend list
$counter;};};}; return $list;
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#26?email_source=notifications&email_token=ABL4KGTZUKEFQWJLN6LJ6RLQNVRT3A5CNFSM4I6QZ2D2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAWTHIQ#issuecomment-539833250>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABL4KGSK4X6DOYHSFRKH5S3QNVRT3ANCNFSM4I6QZ2DQ>
.
|
Thanks for your answer, i will look into the alternative way you suggested. |
I have tried to remove the usage of |
I have been using a different library called tcljava/tclblend but i wanted to upgrade to a more supported library and found this, problem i have now is that i have one command that doesnt work. The error i get is "extra characters after close-brace" and i cant see why, it is working on the old library. Here is the command i send:
set list {}; foreach portString {{1 12 14} {1 12 13} } { packetGroupStats get {*}$portString 0 57344; after 500;packetGroupStats get {*}$portString 0 57344; lappend list [regsub -all { } $portString {_}]; foreach {streamCounterName counterName} { STREAM_PACKETS_RX totalFrames STREAM_PACKETS_RX totalFrames } { lappend list $streamCounterName; set numGroups [ packetGroupStats cget -numGroups]; for {set groupId 0} {$groupId < $numGroups} {incr groupId} { packetGroupStats getGroup $groupId; set counter [packetGroupStats cget -$counterName]; lappend list $counter;};};}; return $list;
it fails on method eval2 in Parser.class row 1176 when the parseCommand have been run
The text was updated successfully, but these errors were encountered: