Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Your depth of comprehension may tend to make you lax in worldly ways.


comp / comp.lang.tcl / Re: tablelist itemtodict

SubjectAuthor
* tablelist itemtodictManfred Stelzhammer
`* Re: tablelist itemtodictRalf Fassel
 `* Re: tablelist itemtodictManfred Stelzhammer
  +- Re: tablelist itemtodictRalf Fassel
  `* Re: tablelist itemtodictnemethi
   `* Re: tablelist itemtodictnemethi
    `* Re: tablelist itemtodictRalf Fassel
     `- Re: tablelist itemtodictManfred Stelzhammer

1
Subject: tablelist itemtodict
From: Manfred Stelzhammer
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Tue, 8 Oct 2024 16:21 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: manfred@antispam.at (Manfred Stelzhammer)
Newsgroups: comp.lang.tcl
Subject: tablelist itemtodict
Date: Tue, 8 Oct 2024 18:21:19 +0200
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <ve3m5v$2865q$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 08 Oct 2024 18:21:20 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e3ec796bf59b581aba32465715767c90";
logging-data="2365626"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18MPyrOpcV4lSzQzjSNNx5wclf6ozu0IXI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:vV2FFGeiDaOdUQMKKJTt4Bsx5xE=
Content-Language: en-US
View all headers

Hi

I have a small script.

##

set ::nix {{nix0 5 p-4 o0} {nix11 6 p-3 o2}}

::tablelist::tablelist .tbl -listvariable ::nix\
-columns "0 col1 left 0 col2 right 0 col3 center 0 col4 center"
..tbl columnconfigure 0 -name col0
..tbl columnconfigure 1 -name col1
..tbl columnconfigure 2 -name col2
..tbl columnconfigure 3 -name col3
pack .tbl

puts "itemtodict : [.tbl itemtodict 0]"

##

the puts command show me: % itemtodict : col0 0 col1 {} col2 {} col3 {}

I expected that I get "col0 nix0 col1 5 col2 p-4 col3 o0".

I'll get all values from a row with columnname like a dict.

What do I wrong or I don't understand?

regards

Manfred

Subject: Re: tablelist itemtodict
From: Ralf Fassel
Newsgroups: comp.lang.tcl
Date: Tue, 8 Oct 2024 16:50 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralfixx@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: Re: tablelist itemtodict
Date: Tue, 08 Oct 2024 18:50:06 +0200
Lines: 25
Message-ID: <ygar08qfsjl.fsf@akutech.de>
References: <ve3m5v$2865q$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net MGWFqzA3vgrICVLs1MoRMQzudUk5k32g4zWG4DRFPOXrumITo=
Cancel-Lock: sha1:5YhKDGy/zc23K7/MXIXZdbQjHc8= sha1:8wLI8LwcV/9KJcg7mwpDUTS5fqo= sha256:mJUuaUoVdB4AxHshOr90HXOF0coW8w3/DfI8AlfKlko=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
View all headers

* Manfred Stelzhammer <manfred@antispam.at>
| puts "itemtodict : [.tbl itemtodict 0]"
>
| the puts command show me: % itemtodict : col0 0 col1 {} col2 {} col3 {}
>
| I expected that I get "col0 nix0 col1 5 col2 p-4 col3 o0".
>
| I'll get all values from a row with columnname like a dict.
>
| What do I wrong or I don't understand?

If I understand the 'itemtodict' command correctly, it will not return
the values of the *table*, but from the *item* you passed to it.

https://www.nemethi.de/tablelist/tablelistWidget.html#itemtodict
[...]
The dictionary's keys will be column numbers or names, and the values
will be the corresponding elements of the given item.
[...]

Since the only value in the item is '0', you get empty strings for the
rest.

HTH
R'

Subject: Re: tablelist itemtodict
From: Manfred Stelzhammer
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Tue, 8 Oct 2024 19:12 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: manfred@antispam.at (Manfred Stelzhammer)
Newsgroups: comp.lang.tcl
Subject: Re: tablelist itemtodict
Date: Tue, 8 Oct 2024 21:12:52 +0200
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <ve407k$2865q$2@dont-email.me>
References: <ve3m5v$2865q$1@dont-email.me> <ygar08qfsjl.fsf@akutech.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 08 Oct 2024 21:12:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e3ec796bf59b581aba32465715767c90";
logging-data="2365626"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WMSWbM4aw4Zmhy+BLs5QXaXcTCLqrhTw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:E8GWPDqfLgQhZX+ksoP87zl5RBU=
Content-Language: en-US
In-Reply-To: <ygar08qfsjl.fsf@akutech.de>
View all headers

Hi

Thank's for your answer.

I know, that I don't get the values from the table,
but I thought the first row is the first item.
The first row has the values "nix0 5 p-4 o0".

I set the variable ::nix with {{nix0 5 p-4 o0} {nix11 6 p-3 o2}}
which is the listvariable of the table an which is shown in the first
row in the table.

I'll ask another question.
Who can I get all values of a row from the table with the columnnames?

with: ".tbl rowcget 0 -text" I only get the value, but I'll get the
columnname and the values like a dict.

regards

Manfred

Am 08.10.24 um 18:50 schrieb Ralf Fassel:
> * Manfred Stelzhammer <manfred@antispam.at>
> | puts "itemtodict : [.tbl itemtodict 0]"
>>
> | the puts command show me: % itemtodict : col0 0 col1 {} col2 {} col3 {}
>>
> | I expected that I get "col0 nix0 col1 5 col2 p-4 col3 o0".
>>
> | I'll get all values from a row with columnname like a dict.
>>
> | What do I wrong or I don't understand?
>
> If I understand the 'itemtodict' command correctly, it will not return
> the values of the *table*, but from the *item* you passed to it.
>
> https://www.nemethi.de/tablelist/tablelistWidget.html#itemtodict
> [...]
> The dictionary's keys will be column numbers or names, and the values
> will be the corresponding elements of the given item.
> [...]
>
> Since the only value in the item is '0', you get empty strings for the
> rest.
>
> HTH
> R'

Subject: Re: tablelist itemtodict
From: Ralf Fassel
Newsgroups: comp.lang.tcl
Date: Wed, 9 Oct 2024 09:08 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralfixx@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: Re: tablelist itemtodict
Date: Wed, 09 Oct 2024 11:08:52 +0200
Lines: 22
Message-ID: <ygajzehfxsr.fsf@akutech.de>
References: <ve3m5v$2865q$1@dont-email.me> <ygar08qfsjl.fsf@akutech.de>
<ve407k$2865q$2@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net m7pPJcgonwda9BYhXZlxLA086/8K7u53ybuptNq9P/wwPRKAA=
Cancel-Lock: sha1:rjK8cxqjpocncYTUzNtuBA7ZGcs= sha1:00iVqVNYNDCYWhux9iAS8cpTXT4= sha256:GgJ7Rsxg0uZq4/S8ZsrpQP7L73DUV2aYIX0n34cAlHc=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
View all headers

* Manfred Stelzhammer <manfred@antispam.at>
| I know, that I don't get the values from the table,
| but I thought the first row is the first item.
| The first row has the values "nix0 5 p-4 o0".

That's true, but 'item' in this context does not mean "item in the
tablelist", it literally means the 'item' argument to the 'itemtodict'
command, which is not some kind of index into the tablelist, but the
literal values:

puts "itemtodict : [.tbl itemtodict {nix0 5 p-4 o0}]"
itemtodict : col0 nix0 col1 5 col2 p-4 col3 o0

| I'll ask another question.
| Who can I get all values of a row from the table with the columnnames?

That would probably be

.tbl itemtodict [.tbl rowcget 0 -text]

HTH
R'

Subject: Re: tablelist itemtodict
From: nemethi
Newsgroups: comp.lang.tcl
Date: Wed, 9 Oct 2024 09:29 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.tota-refugium.de!.POSTED!not-for-mail
From: csaba.nemethi@t-online.de (nemethi)
Newsgroups: comp.lang.tcl
Subject: Re: tablelist itemtodict
Date: Wed, 9 Oct 2024 11:29:24 +0200
Message-ID: <ve5idk$5uus$1@tota-refugium.de>
References: <ve3m5v$2865q$1@dont-email.me> <ygar08qfsjl.fsf@akutech.de>
<ve407k$2865q$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 9 Oct 2024 09:29:24 -0000 (UTC)
Injection-Info: tota-refugium.de;
logging-data="195548"; mail-complaints-to="abuse@news.tota-refugium.de"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:jUOrUaD5NuSYNxn725k0IJWjWBg=
Content-Language: en-US
In-Reply-To: <ve407k$2865q$2@dont-email.me>
X-User-ID: eJwFwYEBwDAEBMCVIvxjnCL2H6F3UArbjaBhsTfdmcSOaMwZ3Mrz8Za9aFmdRLZYTNczq/oBC04REA==
View all headers

Am 08.10.24 um 21:12 schrieb Manfred Stelzhammer:
> Hi
>
> Thank's for your answer.
>
> I know, that I don't get the values from the table,
> but I thought the first row is the first item.
> The first row has the values "nix0 5 p-4 o0".
>
> I set the variable ::nix with {{nix0 5 p-4 o0} {nix11 6 p-3 o2}}
> which is the listvariable of the table an which is shown in the first
> row in the table.
>
> I'll ask another question.
> Who can I get all values of a row from the table with the columnnames?
>
> with: ".tbl rowcget 0 -text" I only get the value, but I'll get the
> columnname and the values like a dict.
>
>
> regards
>
> Manfred
>
>
> Am 08.10.24 um 18:50 schrieb Ralf Fassel:
>> * Manfred Stelzhammer <manfred@antispam.at>
>> | puts "itemtodict : [.tbl itemtodict 0]"
>>>
>> | the puts command show me: % itemtodict : col0 0 col1 {} col2 {} col3 {}
>>>
>> | I expected that I get "col0 nix0 col1 5 col2 p-4 col3 o0".
>>>
>> | I'll get all values from a row with columnname like a dict.
>>>
>> | What do I wrong or I don't understand?
>>
>> If I understand the 'itemtodict' command correctly, it will not return
>> the values of the *table*, but from the *item* you passed to it.
>>
>>    https://www.nemethi.de/tablelist/tablelistWidget.html#itemtodict
>>    [...]
>>    The dictionary's keys will be column numbers or names, and the values
>>    will be the corresponding elements of the given item.
>>    [...]
>>
>> Since the only value in the item is '0', you get empty strings for the
>> rest.
>>
>> HTH
>> R'
>

The itemtodict subcommand expects as its first argument an item (i.e., a
list of elements), not an item index. To get and print the desired
dict, use

puts "itemtodict : [.tbl itemtodict [.tbl rowcget 0 -text]]"

or

puts "itemtodict : [.tbl itemtodict [.tbl get 0]]"

--
Csaba Nemethi https://www.nemethi.de mailto:csaba.nemethi@t-online.de

Subject: Re: tablelist itemtodict
From: nemethi
Newsgroups: comp.lang.tcl
Date: Wed, 9 Oct 2024 09:38 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.tota-refugium.de!.POSTED!not-for-mail
From: csaba.nemethi@t-online.de (nemethi)
Newsgroups: comp.lang.tcl
Subject: Re: tablelist itemtodict
Date: Wed, 9 Oct 2024 11:38:02 +0200
Message-ID: <ve5itq$5uus$2@tota-refugium.de>
References: <ve3m5v$2865q$1@dont-email.me> <ygar08qfsjl.fsf@akutech.de>
<ve407k$2865q$2@dont-email.me> <ve5idk$5uus$1@tota-refugium.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 9 Oct 2024 09:38:02 -0000 (UTC)
Injection-Info: tota-refugium.de;
logging-data="195548"; mail-complaints-to="abuse@news.tota-refugium.de"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:KqItpuWdBl/t4vRKBoNiCXj2qKE=
X-User-ID: eJwFwQERADEIAzBLcNDC5PT54V/CEgSdU0kwsdhyUX1M3EvmLCa7m3NBK3fEf9hudb+QZA8R9hCp
Content-Language: en-US
In-Reply-To: <ve5idk$5uus$1@tota-refugium.de>
View all headers

Am 09.10.24 um 11:29 schrieb nemethi:
> Am 08.10.24 um 21:12 schrieb Manfred Stelzhammer:
>> Hi
>>
>> Thank's for your answer.
>>
>> I know, that I don't get the values from the table,
>> but I thought the first row is the first item.
>> The first row has the values "nix0 5 p-4 o0".
>>
>> I set the variable ::nix with {{nix0 5 p-4 o0} {nix11 6 p-3 o2}}
>> which is the listvariable of the table an which is shown in the first
>> row in the table.
>>
>> I'll ask another question.
>> Who can I get all values of a row from the table with the columnnames?
>>
>> with: ".tbl rowcget 0 -text" I only get the value, but I'll get the
>> columnname and the values like a dict.
>>
>>
>> regards
>>
>> Manfred
>>
>>
>> Am 08.10.24 um 18:50 schrieb Ralf Fassel:
>>> * Manfred Stelzhammer <manfred@antispam.at>
>>> | puts "itemtodict : [.tbl itemtodict 0]"
>>>>
>>> | the puts command show me: % itemtodict : col0 0 col1 {} col2 {}
>>> col3 {}
>>>>
>>> | I expected that I get "col0 nix0 col1 5 col2 p-4 col3 o0".
>>>>
>>> | I'll get all values from a row with columnname like a dict.
>>>>
>>> | What do I wrong or I don't understand?
>>>
>>> If I understand the 'itemtodict' command correctly, it will not return
>>> the values of the *table*, but from the *item* you passed to it.
>>>
>>>    https://www.nemethi.de/tablelist/tablelistWidget.html#itemtodict
>>>    [...]
>>>    The dictionary's keys will be column numbers or names, and the values
>>>    will be the corresponding elements of the given item.
>>>    [...]
>>>
>>> Since the only value in the item is '0', you get empty strings for the
>>> rest.
>>>
>>> HTH
>>> R'
>>
>
> The itemtodict subcommand expects as its first argument an item (i.e., a
> list of elements), not an item index.  To get and print the desired
> dict, use
>
>     puts "itemtodict : [.tbl itemtodict [.tbl rowcget 0 -text]]"
>
> or
>
>     puts "itemtodict : [.tbl itemtodict [.tbl get 0]]"
>

Oops, I have basically written the same as Ralf. It was not before
posting my answer that I saw Ralf's one.

--
Csaba Nemethi https://www.nemethi.de mailto:csaba.nemethi@t-online.de

Subject: Re: tablelist itemtodict
From: Ralf Fassel
Newsgroups: comp.lang.tcl
Date: Wed, 9 Oct 2024 10:57 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralfixx@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: Re: tablelist itemtodict
Date: Wed, 09 Oct 2024 12:57:26 +0200
Lines: 16
Message-ID: <ygafrp5fsrt.fsf@akutech.de>
References: <ve3m5v$2865q$1@dont-email.me> <ygar08qfsjl.fsf@akutech.de>
<ve407k$2865q$2@dont-email.me> <ve5idk$5uus$1@tota-refugium.de>
<ve5itq$5uus$2@tota-refugium.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net zvYy3H/F1Md475ILWVTFAw0mZhyGXaLfKlST9Oj0vw92UOXeI=
Cancel-Lock: sha1:qBZwhcNR8OefheKEfz5vGrx4CMU= sha1:c9PK91JQMNf38nTFJo+cKs1dK8c= sha256:0zyyQjOE170VsqkIt3sm0ypUEvxAuWPZVEgNUdYBzPA=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
View all headers

* nemethi <csaba.nemethi@t-online.de>
| > The itemtodict subcommand expects as its first argument an item
| > (i.e., a
| > list of elements), not an item index.  To get and print the desired
| > dict, use
| >     puts "itemtodict : [.tbl itemtodict [.tbl rowcget 0 -text]]"
| > or
| >     puts "itemtodict : [.tbl itemtodict [.tbl get 0]]"
| >
>
| Oops, I have basically written the same as Ralf. It was not before
| posting my answer that I saw Ralf's one.

Always good to get confirmation from *the* boss himself ;-)

R'

Subject: Re: tablelist itemtodict
From: Manfred Stelzhammer
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Thu, 10 Oct 2024 15:32 UTC
References: 1 2 3 4 5 6
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: manfred@antispam.at (Manfred Stelzhammer)
Newsgroups: comp.lang.tcl
Subject: Re: tablelist itemtodict
Date: Thu, 10 Oct 2024 17:32:59 +0200
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <ve8s3c$37160$1@dont-email.me>
References: <ve3m5v$2865q$1@dont-email.me> <ygar08qfsjl.fsf@akutech.de>
<ve407k$2865q$2@dont-email.me> <ve5idk$5uus$1@tota-refugium.de>
<ve5itq$5uus$2@tota-refugium.de> <ygafrp5fsrt.fsf@akutech.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 10 Oct 2024 17:33:00 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="9a32bad9fdf47458866af6cf58f9d077";
logging-data="3376320"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/3LSgzOy4Ijt0ht8aC2RsbkayJ92FbvYw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:qfnNtpUJwNHEmw6CGh2EXLGwL78=
Content-Language: en-US
In-Reply-To: <ygafrp5fsrt.fsf@akutech.de>
View all headers

Thank's for the answers

Manfred

Am 09.10.24 um 12:57 schrieb Ralf Fassel:
> * nemethi <csaba.nemethi@t-online.de>
> | > The itemtodict subcommand expects as its first argument an item
> | > (i.e., a
> | > list of elements), not an item index.  To get and print the desired
> | > dict, use
> | >     puts "itemtodict : [.tbl itemtodict [.tbl rowcget 0 -text]]"
> | > or
> | >     puts "itemtodict : [.tbl itemtodict [.tbl get 0]]"
> | >
>>
> | Oops, I have basically written the same as Ralf. It was not before
> | posting my answer that I saw Ralf's one.
>
> Always good to get confirmation from *the* boss himself ;-)
>
> R'

1

rocksolid light 0.9.8
clearnet tor