Re: Proper way to split a string?

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Proper way to split a string?
De : luc (at) *nospam* sep.invalid (Luc)
Groupes : comp.lang.tcl
Date : 21. Dec 2024, 20:54:27
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20241221165427.54f656fd@lud1.home>
References : 1 2
On Fri, 20 Dec 2024 23:13:44 -0600, Gerald Lester wrote:

Rich suggested making it a list. You can do that or make ::PINPUT an array:
>
set ::PINPUT(state) waiting
bind $::SRw  <Return>  {
    set ::PINPUT(pname) $pname
    set ::PINPUT(pname) $pfile
    set ::PINPUT(state) done
}
>
then:
>
vwait ::PINPUT(state)
catch {destroy $::SRw}
return [array get ::PINPUT]
>
Where you go to use it, do:
>
array set resultArray $returnValue
>
Or use the dict command to access the pieces.
>
**************************

It's good to know that I was even wronger than I thought.

I have been using a list as Rich suggested, but the use of an array
is very interesting, rather Tcl-ish.

Thank you all for the education.


--
Luc
>


Date Sujet#  Auteur
17 Dec 24 * Proper way to split a string?5Luc
17 Dec 24 +- Re: Proper way to split a string?1Rich
21 Dec 24 +- Re: Proper way to split a string?1Emiliano
21 Dec 24 `* Re: Proper way to split a string?2Luc
21 Dec 24  `- Re: Proper way to split a string?1Rich

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal