Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Only God can make random selections.


devel / comp.lang.tcl / Error in capturing selection

SubjectAuthor
* Error in capturing selectionLuc
`- Error in capturing selectionMartyn Smith

1
Error in capturing selection

<20230202034350.70888f10@lud1.home>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10646&group=comp.lang.tcl#10646

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: luc...@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Error in capturing selection
Date: Thu, 2 Feb 2023 03:43:50 -0300
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <20230202034350.70888f10@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="35ad5e70702b0ab4345bfa8dc65dade8";
logging-data="811893"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19TLKUnj9SB3TVQaWgODIzCPabo73irvsQ="
Cancel-Lock: sha1:SaPZ3PqwclWDuykPd80PXI7wvA4=
 by: Luc - Thu, 2 Feb 2023 06:43 UTC

$::bottomtextbox insert end "\n[$::HASFOCUS tag ranges sel]"

Type abcdef

Highlight. It prints:

1.0 1.6

So it doesn't give me the text. It gives me the indices of the
selection. OK then:

$::bottomtextbox insert end "\n[$::HASFOCUS get [$::HASFOCUS tag ranges sel]]"

Can't even type. It throws an error:

bad text index ""
while executing
"$::HASFOCUS get [$::HASFOCUS tag ranges sel]"

What am I doing wrong this time?

--
Luc
>>

Re: Error in capturing selection

<2fc64723-8fda-4cfe-b0da-d5e2765f7a6cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10647&group=comp.lang.tcl#10647

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a0c:c492:0:b0:53b:8e88:b2d7 with SMTP id u18-20020a0cc492000000b0053b8e88b2d7mr314711qvi.80.1675328477558;
Thu, 02 Feb 2023 01:01:17 -0800 (PST)
X-Received: by 2002:a05:690c:c0a:b0:506:3cd3:7e42 with SMTP id
cl10-20020a05690c0c0a00b005063cd37e42mr745950ywb.454.1675328477261; Thu, 02
Feb 2023 01:01:17 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Thu, 2 Feb 2023 01:01:17 -0800 (PST)
In-Reply-To: <20230202034350.70888f10@lud1.home>
Injection-Info: google-groups.googlegroups.com; posting-host=88.125.159.138; posting-account=mLIBBgoAAAB4JewF9c77L9_3jmlBPOq9
NNTP-Posting-Host: 88.125.159.138
References: <20230202034350.70888f10@lud1.home>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2fc64723-8fda-4cfe-b0da-d5e2765f7a6cn@googlegroups.com>
Subject: Re: Error in capturing selection
From: martyn.a...@gmail.com (Martyn Smith)
Injection-Date: Thu, 02 Feb 2023 09:01:17 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1992
 by: Martyn Smith - Thu, 2 Feb 2023 09:01 UTC

Le jeudi 2 février 2023 à 07:43:55 UTC+1, Luc a écrit :
> $::bottomtextbox insert end "\n[$::HASFOCUS tag ranges sel]"
>
> Type abcdef
>
> Highlight. It prints:
>
> 1.0 1.6
>
> So it doesn't give me the text. It gives me the indices of the
> selection. OK then:
>
> $::bottomtextbox insert end "\n[$::HASFOCUS get [$::HASFOCUS tag ranges sel]]"
>
> Can't even type. It throws an error:
>
> bad text index ""
> while executing
> "$::HASFOCUS get [$::HASFOCUS tag ranges sel]"
>
>
> What am I doing wrong this time?
>
> --
> Luc
> >>
The get requires 2 arguments and the 'tag ranges sel' returns a list of 2 items so you need the {*} operator to expand the list into 2 arguments
[$::HASFOCUS get {*}[$::HASFOCUS tag ranges sel]]

Martyn

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor