Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

Somebody's terminal is dropping bits. I found a pile of them over in the corner.


programming / comp.lang.tcl / latest

Re: proposal: a command to check if object is an channel and (thread)

comp.lang.tcl

Posted: 28 Minutes ago by: aotto1968

thanks, I understand that real "writeable" is complicated but at least I want distinguish between stdin and stout so that is not possible example: puts stdin aaaaaaaaa channel "stdin" wasn't opened for writing → something check th

Re: really stuck on this pl/tcl (thread)

comp.lang.tcl

Posted: 43 Minutes ago by: Professor Zarkov

The pltcl manual page suggests that returning SKIP should be the equivalent to a NULL in plpgsql. The return value from a trigger function can be one of the strings OK or SKIP, or a list of column name/value pairs. If the return value is

Re: really stuck on this pl/tcl (thread)

comp.lang.tcl

Posted: 4 Hours 18 Minutes ago by: Jim McNamara

Hi guys- This is an example of doing it in regular postgresql trigger language. CREATE OR REPLACE FUNCTION test() RETURNS TRIGGER AS $$ BEGIN if EXISTS (select fk_emp_id from pos where fk_emp_id = new.fk_emp_id ) then RETURN NU

really stuck on this pl/tcl

comp.lang.tcl

Posted: 5 Hours 35 Minutes ago by: Jim McNamara

Hi guys- I'm trying to get a function to return nothing, so that it won't insert a new record in the table if the fk_emp_id = 1. In regular triggers for postgres, I used something like return NULL. I tried that and this will execute no mat

Re: proposal: a command to check if object is an channel and writeable (thread)

comp.lang.tcl

Posted: 20 Hours 33 Minutes ago by: Ralf Fassel

* aotto1968 <aotto1968@t-online.de> | hi, | to implement a "puts" like command with: | I require something to check if first argument is a channel and writeable. Check whether FH is known as a channel could be if {$FH in [chan names]} {

Re: proposal: a command to check if object is an channel and writeable (thread)

comp.lang.tcl

Posted: 21 Hours 59 Minutes ago by: Schelte

This should work: if {[catch {chan event $outH writable}]} { error "$outH is not a writable channel" } Schelte

proposal: a command to check if object is an channel and writeable

comp.lang.tcl

Posted: 22 Hours 14 Minutes ago by: aotto1968

hi, to implement a "puts" like command with: I require something to check if first argument is a channel and writeable. I don't have found such a "command" in tcl. possible command: today I use something like: # usage: PrintFile ?

Re: Why do I need to "join" it? (thread)

comp.lang.tcl

Posted: 23 Hours 52 Minutes ago by: Ralf Fassel

* gazelle@shell.xmission.com (Kenny McCormack) | I have an Expect program that takes a single command line parameter, | which is a filename (which must exist). The program starts with: | #!/usr/bin/expect -- | if {$argc != 1 || ![

Re: Save the date: 18th European Tcl/Tk User Meeting in Vienna (thread)

comp.lang.tcl

Posted: 1 Day 10 Hours ago by: gustafn

The registration for the European OpenACS and Tcl Conference, Vienna 2022 is open. For details, see https://openacs.org/conf2022/ Gustaf Neumann and Paul Obermeier

Re: Why do I need to "join" it? (thread)

comp.lang.tcl

Posted: 1 Day 14 Hours ago by: saitology9

Hello, The single vs multiple space thing is just the standard way the command line processors work. They ignore spaces between arguments and pass them to the target program/script separated with single spaces. By the way, this is al

Why do I need to "join" it?

comp.lang.tcl

Posted: 2 Days 2 Hours ago by: clt.to.davebr

I'm confused, when I remove argc!=1 test in the if statement, the file exists part seems to work for file names with or without spaces, as long as spaces are separated by non-space characters. If two or more spaces are next to each othe

Re: Why do I need to "join" it? (thread)

comp.lang.tcl

Posted: 2 Days 10 Hours ago by: saitology9

Hello, I re-read what I wrote and I believe there is a lot of relevant info there on argv, how it is constructed, and what the ramifications are for passing data to proc's as unnamed arguments via argv. You may or may not know this b

Re: Why do I need to "join" it? (thread)

comp.lang.tcl

Posted: 2 Days 10 Hours ago by: briang

It is not weird! It is as designed. As has been repeated here already, argv is a list. It is NOT a scalar value. Your code already asserts that argc == 1. This value should always equal the list length of argv: [llength $argv] == $ar

Re: Why do I need to "join" it? (thread)

comp.lang.tcl

Posted: 2 Days 11 Hours ago by: mango

[snip] Since argv is a list, the proper way to obtain the first element is, [lindex $argv 0].

Re: Why do I need to "join" it? (thread)

comp.lang.tcl

Posted: 2 Days 12 Hours ago by: Kenny McCormack

.... Thank you for your response. However, it does not tell me anything I didn't already know. But thank you anyway. P.S. Yes, it is weird. Why is join needed? I.e., am I correct in assuming that it only puts the {} in, when there i

Re: Why do I need to "join" it? (thread)

comp.lang.tcl

Posted: 2 Days 13 Hours ago by: saitology9

On 5/14/22 7:27 AM, Kenny McCormack wrote:

Why do I need to "join" it?

comp.lang.tcl

Posted: 2 Days 20 Hours ago by: Kenny McCormack

#!/usr/bin/expect -- if {$argc != 1 || ![file exists $argv]} { puts "Error";exit 1 } This works fine as long as the filename is "normal" - i.e., doesn't contain any spaces (and/or perhaps other weird characters). However, if it

Re:_FIGLIO_DI_PUTTANAZZA_#PIERSILVIOBERLUSCONI_(ANCO (thread)

comp.lang.tcl

Posted: 4 Days 13 Hours ago by: GIACOMO ZUCCO. GIOEL

TWEET X KILLER SATAŚćźNAZISTA DANIELA SANTANCHÉ #DANIELASANTANCHE(CHE CON SUO FRATELLO OMICIDA E MASSONE FLAVIO BRIATORE #FLAVIOBRIATORE FECE MACELLARE #ATTILIODUTTO): "PARLA DELLE TANTE ORGE SATANICHE CHE FACEVI CON ME E MARINA BERLUSCON

Re: it is allowed to manipulate the string output from (thread)

comp.lang.tcl

Posted: 4 Days 22 Hours ago by: Schelte

The man page says: "The storage referenced by the returned byte pointer is owned by the value manager. It is passed back as a writable pointer so that extension author creating their own Tcl_ObjType will be able to modify the string re

it is allowed to manipulate the string output from

comp.lang.tcl

Posted: 4 Days 23 Hours ago by: aotto1968

Hi, the "char *Tcl_GetStringFromObj(objPtr, lengthPtr)" return an "char*" not an "const char*". question: 1) it is possible to manipulate the string without extend the objPtr->length border? 2) after manipulation (discard space and t

Re: Tcl_Obj : What is the recommended way to append a object to (thread)

comp.lang.tcl

Posted: 5 Days 14 Hours ago by: Nicolas Robert

I would be surprised if I had this kind of case, since I work with structured lists. (huddle list). If that were the case, I don’t think I can find a solution, as my knowledge of the C language is limited... Nicolas

Re: Tcl_Obj : What is the recommended way to append a object to another object ? (thread)

comp.lang.tcl

Posted: 5 Days 14 Hours ago by: Ralf Fassel

* Nicolas Robert <nicolasrobert.19000@gmail.com> | I finally found , my problem was that my input list was not of this | form {a 30 c 40} but like this {{a 30 c 40}}. problem solved with | Tcl_ListObjIndex(...) Note that if any of the lis

Re: Tcl_Obj : What is the recommended way to append a object to (thread)

comp.lang.tcl

Posted: 5 Days 15 Hours ago by: Nicolas Robert

I finally found , my problem was that my input list was not of this form {a 30 c 40} but like this {{a 30 c 40}}. problem solved with Tcl_ListObjIndex(...) Nicolas

Re: Tcl_Obj : What is the recommended way to append a object to (thread)

comp.lang.tcl

Posted: 6 Days 10 Hours ago by: Nicolas Robert

You are right , without code you can't see my problem. I’ll try to follow your advice... I can’t reproduce my problem with this simple code : critcl::cproc newlist {Tcl_Interp* interp} ok { Tcl_Obj *listObj = Tcl_NewListObj (0,

Re: Tcl_Obj : What is the recommended way to append a object to (thread)

comp.lang.tcl

Posted: 6 Days 10 Hours ago by: briang

Tcl_Obj* newlist = Tcl_NewObj(); Tcl_Obj** elemv; Tcl_Obj *blank = Tcl_NewStringObj(" ",1); int elemc, i; Tcl_AppendObjToObj(newlist, Tcl_NewStringObj("'", 1)); Tcl_ListObjGetElements(interp, listObj, &elemc, &elemv); /* Tcl_AppendObjToO

Re: Tcl_Obj : What is the recommended way to append a object to (thread)

comp.lang.tcl

Posted: 6 Days 11 Hours ago by: heinrichmartin

I am used to the script level, but * You could init newlist with the left string already or * reuse the single quote object left and right. * If I get https://www.tcl-lang.org/man/tcl8.6/TclLib/StringObj.htm right, then Tcl_AppendObjToObj

Re: Tcl_Obj : What is the recommended way to append a object to (thread)

comp.lang.tcl

Posted: 6 Days 13 Hours ago by: Nicolas Robert

Thank you both for your answers. I finally chose this function : Tcl_AppendObjToObj(...) I have a problem, I have two objects to add to a list one on the left and one on the right. Tcl_Obj* newlist = Tcl_NewObj(); Tcl_AppendObjToObj(newli

Re: Save the date: 18th European Tcl/Tk User Meeting in Vienna (thread)

comp.lang.tcl

Posted: 6 Days 18 Hours ago by: gustafn

Dear Tcl/Tk community, The Conference Site https://openacs.org/conf2022/ is up, registration will start soon! all the best -gn

Re: ffidl to access dll functions (thread)

comp.lang.tcl

Posted: 7 Days 12 Hours ago by: Stephan Effelsberg

https://docs.microsoft.com/en-us/windows/win32/winprog64/file-system-redirector Try it yourself: Use the Windows command line to make a copy of user32.dll You'll get a 64-bit copy of the DLL, you can even inspect the file with a simple t

Re: tclvfs: vfs::zip discards leading dots in filenames (thread)

comp.lang.tcl

Posted: 7 Days 14 Hours ago by: saitology9

Hello, You are correct. "./" prefix in a file name resolves to the file name itself: the "." means in the current directory, and the slash is the usual file separator. However, it looks like a bug, to be honest. The command "string

tclvfs: vfs::zip discards leading dots in filenames

comp.lang.tcl

Posted: 7 Days 15 Hours ago by: Ralf Fassel

https://core.tcl-lang.org/tclvfs/tktview/887778e1916c934f8a303a6337a10869d0ac2963 tcl 8.6.12 tclvfs module vfs::zip discards the leading dot of files stored in an ZIP archive: # create ZIP archive $ touch .foo bar $ zip test

Re: Tcl_Obj : What is the recommended way to append a object to (thread)

comp.lang.tcl

Posted: 7 Days 18 Hours ago by: Nicolas

Hi, when I work with strings, I use the Tcl_DString API ++

Re: Tcl_Obj : What is the recommended way to append a object to (thread)

comp.lang.tcl

Posted: 7 Days 20 Hours ago by: heinrichmartin

StringCatCmd uses Tcl_AppendObjToObj. That should be a reasonable choice.

Tcl_Obj : What is the recommended way to append a object to another

comp.lang.tcl

Posted: 8 Days ago by: Nicolas Robert

Hello , I would like to add single quotes, square brackets, newline... to the left and right of my string. It seems to me that I have several choices... Tcl_ObjPrintf("%s", x) , Tcl_AppendObjToObj(...). Can you advise me one ? or another ?

Re: How to call procs that use each-others data (thread)

comp.lang.tcl

Posted: 9 Days 2 Hours ago by: apn

While I agree with the above in terms of readability, note that temporary variables can have an significant impact on performance when dealing with even moderately large data. It's not the temporary variable itself but rather Tcl's ref

Re: How to call procs that use each-others data (thread)

comp.lang.tcl

Posted: 9 Days 7 Hours ago by: mango

This is Tcl. If you don't like the way it looks, create commands to make it look the way you want. Perhaps the wiki page on pipeline programming has some ideas of one way to deal with deeply nested commands. https://wiki.tcl-lang.org/page/P

Re: Command instead of dict for (thread)

comp.lang.tcl

Posted: 9 Days 11 Hours ago by: heinrichmartin

Are you looking for [lmap {k v} {a b c d e f} {list $k $v}]? Note that this shimmers from dict to list: expect:~$ set d [dict create a b c d e f] a b c d e f expect:~$ ::tcl::unsupported::representation $d value is a dict with a refcount

Re: Why does tcl::mathop::|| not exist ? (thread)

comp.lang.tcl

Posted: 9 Days 11 Hours ago by: heinrichmartin

Whether or not -integer is an advantage in your case depends on how the list is created. set list {0 0 1 0} holds strings. Also, if lsearch is correct for your data, then operators "in"/"ni" will most likely be, too. So are bit-wise oper

Re: How to call procs that use each-others data (thread)

comp.lang.tcl

Posted: 9 Days 14 Hours ago by: jtyler

Cecil: I totally agree with Robert, especially with debugging. I will often go even further and create more specific temporary variables, since it often results in more self-explanatory code: set filledDict [fillSwapDict] set merged

Re: How to call procs that use each-others data (thread)

comp.lang.tcl

Posted: 9 Days 17 Hours ago by: Robert Heller

The only other issue is source code readablity. *Sometimes* you end up with either a really long line (which does not "fit" on your screen, unless you have an insanely large edit windows and/or are using a really small font), or an i

Re: How to return a value from a proc (thread)

comp.lang.tcl

Posted: 9 Days 18 Hours ago by: Cecil Westerhof

OK, I will add the return.

Re: How to call procs that use each-others data (thread)

comp.lang.tcl

Posted: 9 Days 18 Hours ago by: Cecil Westerhof

Personally I prefer the first, but if I would work somewhere where they prefer the second, I would use the second. Yes, that is why I prefer the second. But when sharing your code (what I intend to do) it is best to use a style that m

Re: How to call procs that use each-others data (thread)

comp.lang.tcl

Posted: 9 Days 19 Hours ago by: Rich

There isn't. You are slowly moving closer to merely a "stylistic" issue on the order of whether this: if (...) { ... } or this if (...) { ... } Arrangement of the openbrace for a C if clause is the "better way". The second is m

Re: How to return a value from a proc (thread)

comp.lang.tcl

Posted: 9 Days 20 Hours ago by: Alex P

As for a performance, both are identical in Tcl 8.6, but as for a style, 'return...' seems to be better. The 'return' command makes a code a bit more self-documented, as if saying: look, this procedure can be used in expressions! Also, 'r

Re: How to return a value from a proc (thread)

comp.lang.tcl

Posted: 9 Days 20 Hours ago by: Alex P

As for a performance, both are identical in Tcl 8.6, but as for a style, *return...* seems to be better. Also, *return* makes a code a bit more self-documented, as if saying: look, this procedure can be used in expressions. And *return* (

How to return a value from a proc

comp.lang.tcl

Posted: 10 Days 3 Hours ago by: Cecil Westerhof

lsort -index 1 -integer -decreasing [lsort -index 0 ${swapList}] Is this OK, or is it better to do: return [lsort -index 1 -integer -decreasing [lsort -index 0 ${swapList}]]

Command instead of dict for

comp.lang.tcl

Posted: 10 Days 3 Hours ago by: Cecil Westerhof

set swapList {} dict for {name swap} ${swapDict} { lappend swapList [list $name $swap] } But I seem to remember that there is a command that does this, but I do not remember the command. Am I mistaken? If not: what is

How to call procs that use each-others data

comp.lang.tcl

Posted: 10 Days 4 Hours ago by: Cecil Westerhof

set swapDict [fillSwapDict] set swapDict [mergeSwapDict ${swapDict} ${mergeList}] set swapList [sortedList ${swapDict}] displayList ${swapList} ${end} Each call does use the data of the call before it. So I thought it is

Re: Why does tcl::mathop::|| not exist ? (thread)

comp.lang.tcl

Posted: 10 Days 18 Hours ago by: Arjen Markus

You can define them as functions instead, but the symbols themselves are binary operations, so two sides are required. But the names || and &&, as its pendant, interfer with the parsing of the expression. (Aside: In Fortran you have the i

Re: Why does tcl::mathop::|| not exist ? (thread)

comp.lang.tcl

Posted: 10 Days 18 Hours ago by: Arjen Markus

Re: Why does tcl::mathop::|| not exist ? (thread)

comp.lang.tcl

Posted: 10 Days 20 Hours ago by: Ashok

My *guess* is that it's because the expected semantics of || in almost all languages are short-circuit operation so later arguments do not get evaluated. For example (bin) 4 % expr {1 || $undefined} 1 It is not possible to implement

Why does tcl::mathop::|| not exist ?

comp.lang.tcl

Posted: 10 Days 21 Hours ago by: Harald Oehlmann

Dear TCL team, I love the tcl::mathop and tcl::mathfunc commands to just use one command and to avoid expr. In addition, list arguments must not be transformed to comma separated values. I wanted to find, if a list of bools (0/1 values

Re: May 2022 Tcl Meetup (thread)

comp.lang.tcl

Posted: 12 Days 1 Hour ago by: Harald Oehlmann

Great, thank you ! I plan to attend ! Happy to see you all, Harald

May 2022 Tcl Meetup

comp.lang.tcl

Posted: 12 Days 2 Hours ago by: stevel

The monthly Tcl Virtual Meetup is held the second Tuesday of each month, the time varies from month-to-month to accomodate various timezones. The next meetup will be held at [clock format 1652209200] - Tuesday 10th May 2022 midday US West,

Re: database driver? (thread)

comp.lang.tcl

Posted: 12 Days 5 Hours ago by: saitology9

Thank you for the info. I will check it out.

Re: database driver? (thread)

comp.lang.tcl

Posted: 12 Days 11 Hours ago by: Christian Werner

TDBC::ODBC is actively maintained as you can see in the timeline of its repository https://core.tcl-lang.org/tdbcodbc/timeline This is the place where you can create a ticket should there be problem. HTH, Christian

database driver?

comp.lang.tcl

Posted: 12 Days 11 Hours ago by: saitology9

Hello, I would like to transfer an old application from Oracle to an ODBC-based database. The old application was built using a really old version of Oractl. Based on some research, available options include the following: 1: tclodbc:

Re: exec under Unix/BSD/Linux (thread)

comp.lang.tcl

Posted: 12 Days 13 Hours ago by: Christian Gollwitzer

Still this is true - exec in Tcl does not start /bin/sh or the like. Instead, it uses the exec syscall to execute the commands given and parses the arguments etc. itself in order to mimic the shell and handle redirections for stderr ,

Re: exec under Unix/BSD/Linux (thread)

comp.lang.tcl

Posted: 12 Days 14 Hours ago by: Roderick

Thanks! You a right, "call" is not the rith expression, but "hand the argument to a command interpreter" like in "man sysem": "The system() function hands the argument string to the command interpreter sh(1). The calling p

Re: exec under Unix/BSD/Linux (thread)

comp.lang.tcl

Posted: 12 Days 19 Hours ago by: Gerald Lester

Yes, that is correct -- exec does not "call" a shell, unless of course you exec "/bin/sh" or such.

exec under Unix/BSD/Linux

comp.lang.tcl

Posted: 12 Days 21 Hours ago by: Roderick

I suppose, exec does not call a shell. Am I right? Thanks Rod.

Re: set var in interactive tclsh vs set var in a script (thread)

comp.lang.tcl

Posted: 12 Days 23 Hours ago by: Oleg Nemanov

Thanks for the info! This helped me solve my problem :-).

Re: tcl/tk on an iPhone :( (thread)

comp.lang.tcl

Posted: 14 Days 16 Hours ago by: Bill Waddington

Thanks all for the suggestions. The 2nd inexpensive/retired phone idea would work, but for some reason my casual users don't seem interested... guess it's not a life-or-death app after all ;) My one-man ISP doesn't favor the CloudTK ap

Re: missing feature for "regsub" (thread)

comp.lang.tcl

Posted: 14 Days 18 Hours ago by: Harald Oehlmann

Schelte, I appreciate your high level answers and deep knowledge of TCL. I always learn from them! Thank you for that, Harald

Re: missing feature for "regsub" (thread)

comp.lang.tcl

Posted: 14 Days 20 Hours ago by: Schelte

Of course that can be simplified to: regsub -command {(\w+)§([ESU])} $string [list apply [list {match prefix ch} { string cat [string map {E enum S struct U union} $ch] " " $prefix }]] OUTVAR Schelte

Re: missing feature for "regsub" (thread)

comp.lang.tcl

Posted: 14 Days 20 Hours ago by: Schelte

In Tcl 8.7, the regsub command has a new -command option that may be of use (tip #463: https://core.tcl-lang.org/tips/doc/trunk/tip/463.md). At least it can handle your example with a single regsub: regsub -command {(\w+)§[ESU]} $strin

Re: missing feature for "regsub" (thread)

comp.lang.tcl

Posted: 14 Days 22 Hours ago by: Arjen Markus

A feature of [string map] is that the substitutions are defined in pairs, whereas your suggested syntax interferes with the alternatives already defined in regular expressions. I suspect there are more interferences lurking in there, besid

missing feature for "regsub"

comp.lang.tcl

Posted: 15 Days 19 Hours ago by: aotto1968

Hi, I don't know if the TCL community is the right place to post a Regular-Expression (RG) enhancement, but let me try :-) problem: howto put MULTIPLE "regsub" statements into ONE single (probably more efficient) together. lets start

Re: lsearch missing "-stride" option (thread)

comp.lang.tcl

Posted: 15 Days 21 Hours ago by: Schelte

Considering that the output of [array get XXX] is a valid dict, you can use dict filtering on it to get the desired result: dict filter [array get XXX] script {k v} {string match aa [lindex $v 0]} Schelte.

Re: lsearch missing "-stride" option (thread)

comp.lang.tcl

Posted: 16 Days ago by: Alexandru

Since Tcl8.7 is still alpha, here is an implementation in pure Tcl. You can use Lsearch just as you would use lsearch. ## Pure TCL implementation of the -stride option for lsearch command. # \param args arguments as for Tcl command lsea

Re: Excel to CSV - unexpected implicit conversions (thread)

comp.lang.tcl

Posted: 17 Days 9 Hours ago by: ALX

You can use ooxml to import excel files. You get a tcl array, which you can export as csv afterwards. https://fossil.sowaswie.de/ooxml package require ooxml array set workbook [ooxml::xl_read -datefmt "%Y-%m-%d %H:%M:%S" excel.xlsx] parray

Re: Excel to CSV - unexpected implicit conversions (thread)

comp.lang.tcl

Posted: 17 Days 13 Hours ago by: Paul Obermeier

Hi Aldo, the only option in the Worksheet.SaveAs method, which might have influence, is the Local parameter: (see https://docs.microsoft.com/de-de/office/vba/api/excel.worksheet.saveas) This parameter is False by default. So set the Lo

Re: Excel to CSV - unexpected implicit conversions (thread)

comp.lang.tcl

Posted: 17 Days 15 Hours ago by: Ashok

I could have been clearer. What I should have said is that after you use GetRow* etc. you will get back data as a list as COM data values. You can then format them as you wish. In most cases the formatting will be a no-op but for some

Re: Excel to CSV - unexpected implicit conversions (thread)

comp.lang.tcl

Posted: 17 Days 15 Hours ago by: aldo.w....@gmail.com

Excel::GetRowValues only partially solves these problems .. Now large numbers like "1.234,56" (Italian notation) are printed as "1234.56 (good) but dates like "30/07/2018" e.g 30-JULY-2018) are printed as numbers ( -> 43311.0 ) and

Re: lsearch missing "-stride" option (thread)

comp.lang.tcl

Posted: 17 Days 22 Hours ago by: apn

Implemented in 8.7 - see https://www.magicsplat.com/blog/tcl87-lists/ for an example.

Re: Excel to CSV - unexpected implicit conversions (thread)

comp.lang.tcl

Posted: 17 Days 22 Hours ago by: apn

Given Excel's propensity to use control panel regional settings, I think you would be happier not exporting directly from Excel if you want a "standard" locale-independent format. Instead get the data via cawt's GetRow*/GetTable* metho

Re: Excel to CSV - unexpected implicit conversions (thread)

comp.lang.tcl

Posted: 18 Days ago by: Ralf Fassel

* "aldo.w....@gmail.com" <aldo.w.buratti@gmail.com> | # -------- | BUT the resulting csv is not what I'm expecting. ... | Here are the problems: | 1) csv separator is "," . I want a ";" ( solved with a post-processing with the "csv" pack

lsearch missing "-stride" option

comp.lang.tcl

Posted: 18 Days ago by: aotto1968

Hi, I want to use "lsearch" to filter an "array get XXX" output. array get output return … key1 lst1 ke2 lst2… if "array" values are lists. The "-stride" option in "lsort" treat the FIRST level of output as "conacte" list. my exampl

Wiki down for maintenance

comp.lang.tcl

Posted: 18 Days 2 Hours ago by: stevel

The wiki is going to be down for maintenance for a while today, Friday April 29th from about 0500 UTC.

Excel to CSV - unexpected implicit conversions

comp.lang.tcl

Posted: 18 Days 9 Hours ago by: aldo.w....@gmail.com

I just want to convert Excel files (*.xls) to csv in a batch way. Here is the proc I'm using (using cawt package) # ------------------------------ package require cawt proc xls2csv {xlsFile sheetIdx csvFile} { set appId [Excel::OpenNew fa

Re: Tclers' Wiki login by nickname busted? (thread)

comp.lang.tcl

Posted: 18 Days 10 Hours ago by: Bezoar

Yes that is the problem, I signed up for a maintainer login after I could not get in. Thanks for letting me know. Carl

Plotchart 2.4.1

comp.lang.tcl

Posted: 18 Days 12 Hours ago by: Stu Hodgson

Hi, I'm using the great Plotchart features to draw a histogram and would like to draw vertical lines at the mean and nominal values on the x axis. $anyplot object itemtype series args is not a valid method for a histogram, I thought it woul

Re: Tclers' Wiki login by nickname busted? (thread)

comp.lang.tcl

Posted: 19 Days 1 Hour ago by: stevel

You don't need to sign up to maintain content, you just have to provide a nickname. Signing up just reserves the nickname and mostly allows you to avoid the captcha. However there is a bug in the signup process, once you request a login

Re: Tclers' Wiki login by nickname busted? (thread)

comp.lang.tcl

Posted: 19 Days 2 Hours ago by: Arjen Markus

I see no different behaviour - I can log in as usual, but I log in as a registered user. Regards, Arjen

Tclers' Wiki login by nickname busted?

comp.lang.tcl

Posted: 19 Days 2 Hours ago by: Bezoar

In the past I've been able to login the the Tcler's wiki just using my nickname and the login page does offer the choice to login with a nickname and with a maintainers login. But once I enter my nickname, successfully complete the captch

Re: huddle : Is it possible to gain in performance ? (thread)

comp.lang.tcl

Posted: 19 Days 13 Hours ago by: Nicolas Robert

Ok I’ll look at this, but if you ever have a brilliant idea with 'huddle', I’m a buyer. Nicolas

Re: huddle : Is it possible to gain in performance ? (thread)

comp.lang.tcl

Posted: 19 Days 13 Hours ago by: Christian Gollwitzer

If you need better performance, try rl_json - it is an extension qwith good performance and a good model for storing typed data. Christian

huddle : Is it possible to gain in performance ?

comp.lang.tcl

Posted: 19 Days 14 Hours ago by: Nicolas Robert

Hello, I'm using 'huddle' for my package. I need advice from people who use it (or not). In my case, it’s this procedure 'huddle::jsondump' (https://github.com/tcltk/tcllib/blob/e527bde7c0aa16954111050d84547b33caba519a/modules/yaml/huddl

Re: set var in interactive tclsh vs set var in a script (thread)

comp.lang.tcl

Posted: 20 Days 16 Hours ago by: Harald Oehlmann

Dear Oleg, that is due to the history package. Each interactive result value is stored in the history. This increases the ref count. Hope this helps, Harald

Re: rule 4 on double quotes (thread)

comp.lang.tcl

Posted: 20 Days 17 Hours ago by: Oleg Nemanov

Doesn't this is due to the word splitting is done before the substitution? To see word boundaries we need to find the closing ".

Re: work with nested struct in proc in TCL (thread)

comp.lang.tcl

Posted: 20 Days 17 Hours ago by: Oleg Nemanov

To see if something seems not efficient we need an another implementation to compare with :-). [time] by itself is useless in a case where we can't compare with something. My question was more about how others are solving this large neste

set var in interactive tclsh vs set var in a script

comp.lang.tcl

Posted: 20 Days 18 Hours ago by: Oleg Nemanov

Hi, all. I can't understand why in interactive tclsh a var has more refcount, then in a script: ~$ cat t.tcl set a [list 1 2] puts [::tcl::unsupported::representation $a] ~$ tclsh t.tcl value is a list with a refcount of 2, object pointe

Re: tcl/tk on an iPhone :( (thread)

comp.lang.tcl

Posted: 21 Days 15 Hours ago by: saitology9

Hello, This looks promising but I believe it supports single window applications only. I do wonder if this limitation could be avoided by doing some window management behind the scenes. What I am thinking is, when a new toplevel is re

Re: thread pool bug ?? (thread)

comp.lang.tcl

Posted: 21 Days 20 Hours ago by: Cyrille Duret

thank you very much !

Re: tcl/tk on an iPhone :( (thread)

comp.lang.tcl

Posted: 21 Days 20 Hours ago by: Robert Heller

There are ways of creating a VM "Hackintosh". I think you can download and use XCode for free -- at least that used to be the case. At least for creating MacOSX apps, don't know about iOS exactly. In some ways Apple is actually *w

Re: thread pool bug ?? (thread)

comp.lang.tcl

Posted: 21 Days 22 Hours ago by: Schelte

The tpool::wait command is documented to "wait for the first job to get ready". It returns the completed job IDs, and puts the job IDs that are still pending in the varname argument, if provided. If you want to wait for all jobs to be r

thread pool bug ??

comp.lang.tcl

Posted: 21 Days 22 Hours ago by: Cyrille Duret

package require Thread set pool [tpool::create -maxworkers 4] set jobs {} for {set i 0} {$i < 50} {incr i} { lappend jobs [tpool::post $pool [string map [list {$i} $i] { puts "thread $i.." after 1000 }]] } tpool::wait $pool $j

Re: tcl/tk on an iPhone :( (thread)

comp.lang.tcl

Posted: 22 Days 2 Hours ago by: Christian Gollwitzer

iOS is a pretty closed system. Even if you were to write a proper iOS app, you would at least a Mcbook with XCode and a developer account from Apple which costs $99 per year. Another alternative is to run your app on a server let users

Re: tcl/tk on an iPhone :( (thread)

comp.lang.tcl

Posted: 22 Days 9 Hours ago by: Andreas Leitgeb

Apple wouldn't allow any full fledged programming languages on "their" phones. One might "root" ones own iPhone, and try to port Androwish source to iOS, but even if one took that (rather big) burden, probably only few would be willing t

tcl/tk on an iPhone :(

comp.lang.tcl

Posted: 22 Days 16 Hours ago by: Bill Waddington

Hey all, Asked and answered years ago, but one more time: any way to run tcl/tk on an iPhone? My toy program turns out to be somewhat useful and family members would like it on their phones. Android, Windows, Linux, ... but no iPhones :(

tcl/tk on an iPhone :(

comp.lang.tcl

Posted: 22 Days 16 Hours ago by: Bill Waddington

Hey all, Asked and answered years ago, but one more time: any way to run tcl/tk on an iPhone? My toy program turns out to be somewhat useful and family members would like it on their phones. Android, Windows, Linux, ... but no iPhones :(

Re: tcllibc in a safe interpreter (thread)

comp.lang.tcl

Posted: 24 Days 11 Hours ago by: Julian H J Loaring

Thank you, I think you are right.

Save the date: 18th European Tcl/Tk User Meeting in Vienna (EuroTcl

comp.lang.tcl

Posted: 24 Days 13 Hours ago by: Paul Obermeier

Dear Tcl/Tk community, Gustaf Neumann and Paul Obermeier proudly present the 18th European Tcl/Tk User Meeting, which will be a combined Tcl/Tk and OpenACS meeting. It will take place June, 30th and July, 1st 2022 in Vienna at the Vienna

Re: incr result with non-var argument (thread)

comp.lang.tcl

Posted: 24 Days 13 Hours ago by: Alan Grunwald

Sorry. I must remember to read the whole thread before I follow up. Alan

Re: incr result with non-var argument (thread)

comp.lang.tcl

Posted: 24 Days 13 Hours ago by: Alan Grunwald

Evaluate set 22 Does that help explain what's happening? Alan

Re: work with nested struct in proc in TCL (thread)

comp.lang.tcl

Posted: 24 Days 13 Hours ago by: Rich

Tcl's [time] command can be a great way to see if something seems not efficient. In this case, for the set src and src_proc1 src lines, only an additional pointer, to the list element, should be created. Should src_proc1 modify (via

Re: work with nested struct in proc in TCL (thread)

comp.lang.tcl

Posted: 24 Days 13 Hours ago by: saitology9

Hello, Here is an expanded version. You can work with multiple dict's and keys, and apply different proc's to each. set ctx [dict create src {10 20 30} dst {100 200 300}] set ctx_2 [dict create src {10 20 30 40 50} dst {100 200 300 400

Re: work with nested struct in proc in TCL (thread)

comp.lang.tcl

Posted: 24 Days 13 Hours ago by: saitology9

Hello, Your explanation could use some help. In any case, it looks like using global would solve your dilemma: set ctx [dict create src {10 20 30} dst {100 200 300}] proc add_one {key} { global ctx # process it. see note at the end.

Re: work with nested struct in proc in TCL (thread)

comp.lang.tcl

Posted: 24 Days 15 Hours ago by: Oleg Nemanov

In my case a size of ctx is small. Just 2 nested dicts with few keys in each. But this case prompted me to think about more general cases and how others solve this :-). And also what to do if a size of dict is big.

Re: work with nested struct in proc in TCL (thread)

comp.lang.tcl

Posted: 24 Days 16 Hours ago by: Oleg Nemanov

The things is even more complecated if there is nested list with dict like this: set ctx [dict create srcs [list [dict create SOME_DATA] [dict create SOME_DATA]]] And we want to process each list item in a loop. In this case, Rich and Sc

Re: work with nested struct in proc in TCL (thread)

comp.lang.tcl

Posted: 24 Days 17 Hours ago by: Schelte

You can use [dict with] (if src and dst are guaranteed to be present), or [dict update]: proc sub_proc {_sub} { upvar $_sub sub dict set sub SOME_KEY 1 } proc do_work {_ctx} { upvar $_ctx ctx # ... dict update ctx src sr

Re: work with nested struct in proc in TCL (thread)

comp.lang.tcl

Posted: 24 Days 17 Hours ago by: Rich

I'm somewhat confused by the above. If you don't want to modify the subdict, then there is no need to pass it by name. Just pass in the subdict. i.e.: set ctx [dict create src [dict create SOME_KEY SOME_DATA] \

Re: work with nested struct in proc in TCL (thread)

comp.lang.tcl

Posted: 24 Days 17 Hours ago by: saitology9

Hello, I am not really clear here but I suspect you need the ability to work with different keys. You can make the key name a parameter to the proc's. You can even parameterize dict name itself if you have multiple ones with a similar

Re: work with nested struct in proc in TCL (thread)

comp.lang.tcl

Posted: 24 Days 17 Hours ago by: Oleg Nemanov

I thought about something like this. But operation like 'dict get' where we need '$' before a first argument make this method harder.

Re: work with nested struct in proc in TCL (thread)

comp.lang.tcl

Posted: 24 Days 17 Hours ago by: saitology9

Hello, Instead of upvars, you could use "global ctx" in the proc's. Then your specialized proc's can work with the full dict or you can send the key names as you need to.

Re: work with nested struct in proc in TCL (thread)

comp.lang.tcl

Posted: 24 Days 18 Hours ago by: Oleg Nemanov

In C i just pass a pointer to a nested struct into an internal functions and, thus, this function works only with a data they know and need. This function can change it during a work. How can i achieve something like this in TCL?

work with nested struct in proc in TCL

comp.lang.tcl

Posted: 24 Days 18 Hours ago by: Oleg Nemanov

Hi, all. I have some package where some procs get as argument a dict with nested dicts. These procs call another internal procs that get as argument this dict too, but needs only a subdict to do its work. I can't pass this subdict by nam

Re: incr result with non-var argument (thread)

comp.lang.tcl

Posted: 24 Days 20 Hours ago by: Oleg Nemanov

:-D I understood. Because incr increment a variable with name '22'.

incr result with non-var argument

comp.lang.tcl

Posted: 24 Days 20 Hours ago by: Oleg Nemanov

Hi, all. Why incr return a sequence of numbers in this case: % set a [dict create k 22] k 22 % incr [dict get $a k] 1 % incr [dict get $a k] 2 % incr [dict get $a k] 3 % incr [dict get $a k] 4 % puts $a k 22

Re: tcllibc in a safe interpreter (thread)

comp.lang.tcl

Posted: 24 Days 21 Hours ago by: apn

I'm afraid I don't know the direct answer to your question. However I would suggest that instead of adding a Tcllibc_SafeInit entry point (if there isn't one), you instead load tcllibc into your (unsafe) master and then alias the speci

Re: ANNOUNCE: shtmlview 1.0.0 (thread)

comp.lang.tcl

Posted: 25 Days 3 Hours ago by: D Groth

Dear Gerry and Bezoar, In the current Github code I implemented your suggestion so that you can render directly HTML or Markdown strings. The method is: `pathName render text ?ext?` if html tags are present it will be rendered as HTML.

Re: Text amount (thread)

comp.lang.tcl

Posted: 26 Days 6 Hours ago by: jtyler

Are you outputting a *whole lot of stuff* to the console? The code kinda turns itself off if there's no output. The variable ::tk::console_flag is only set to 1 if there is output thru ::tk::ConsoleOutput. If there's no output, then al

Re: Text amount (thread)

comp.lang.tcl

Posted: 26 Days 6 Hours ago by: saitology9

Hello, Interesting - it works from the wish console. The same amount of output that locks up normal wish console is now instantaneous. However, there seems to be a side effect: it seems to slow down everything. Opening my applicati

Re: Text amount (thread)

comp.lang.tcl

Posted: 26 Days 8 Hours ago by: jtyler

If you are just using the windows console for debugging, and don't mind using a little hack, try typing the following: % string repeat abcdef 10000 This will take over 10 seconds on my computer. Then clear the console and paste this i

tcllibc in a safe interpreter

comp.lang.tcl

Posted: 26 Days 12 Hours ago by: Julian H J Loaring

I have built tcllib.dylib using critcl but I cannot load it into a Safe Interpreter because there is no Tcllibc_SafeInit entry point. Is there a way to do this in critcl or should I dust of my C programming skills and try to roll my own DL

Re: Text amount (thread)

comp.lang.tcl

Posted: 26 Days 12 Hours ago by: saitology9

Hello, Thank you! I suppose as long as it is fixed and is scheduled for release, that is OK.

Re: Text amount (thread)

comp.lang.tcl

Posted: 26 Days 12 Hours ago by: saitology9

Ah, that makes sense. Thank you; good info.

Re: Text amount (thread)

comp.lang.tcl

Posted: 26 Days 13 Hours ago by: Christian Gollwitzer

This is a known issue with the current text widget, it scales very badly with the length of the lines. When you have a lot of text and the line length is limited, like e.g. string repeat "a\n" 10000 there is no problem - 10,000 lines

Re: Text amount (thread)

comp.lang.tcl

Posted: 26 Days 13 Hours ago by: Rich

The console configures its text widget to perform line wrap. Part of the slowness may be the work necessary to decide the line wrap points for very long lines. And your "canvas line segments" may very well be "very long lines". Pla

Re: Text amount (thread)

comp.lang.tcl

Posted: 26 Days 14 Hours ago by: saitology9

Hello, Yes, this is on a Windows machine too. I checked the actual size of the data and you are right: it is over 100-200 Kbyte raange. The data is in an array and while the array itself is small in terms of entries, some of its data

Re: Text amount (thread)

comp.lang.tcl

Posted: 26 Days 14 Hours ago by: saitology9

Hello, Inserting the text is not a problem but displaying it back is. Or when you enter something and want to edit it inline using up-arrow key. Most of the time it is an array and I use "parray" to print it. Some of the data consist

Re: Text amount (thread)

comp.lang.tcl

Posted: 26 Days 16 Hours ago by: Rich

I've seen it on windows machines with the default wish console, but not with "a few kilobytes", the text had to be quite large (i.e., significantly larger than "a few kilobytes", bordering on megabytes or so). Two (maybe) solutions to

Re: Text amount (thread)

comp.lang.tcl

Posted: 26 Days 16 Hours ago by: Robert Heller

I've never noticed this (at least not on Linux). Is there anything special about the text? Hugely long lines? Strange character sets? How are you inserting this text? At Wed, 20 Apr 2022 11:07:35 -0400 saitology9@gmail.com wrote:

Text amount

comp.lang.tcl

Posted: 26 Days 17 Hours ago by: saitology9

Hello, I have noticed a strange behavior by tcl/tk shells that I would like to avoid. This happens with tclsh, wish, and tkcon. I say shell but it may just be the text widget behind the scenes causing this: Whenever the shell needs t

Announce: CAWT 2.9.1 released

comp.lang.tcl

Posted: 27 Days 12 Hours ago by: Paul Obermeier

CAWT is a high-level Tcl interface for scripting Microsoft Windows® applications having a COM interface. It uses Twapi for automation via the COM interface. Currently packages for Microsoft Excel, Word, PowerPoint, OneNote, Outlook, SAPI a

Announce: BAWT 2.2.0 released

comp.lang.tcl

Posted: 27 Days 12 Hours ago by: Paul Obermeier

Version 2.2.0 of BAWT, the "Build Automation With Tcl" framework has been released on 2022/04/15. The following features are included in this release: - Support for MinGW gcc 11. - New packages: fitsTcl, shtmlview. - Several updated pack

Re: TCL accessing MUMPS databases (thread)

comp.lang.tcl

Posted: 28 Days 4 Hours ago by: The Rickster

What M database engine do you wish to access (Cache, FreeM, MiniM ...?) Are you a MUMPS programmer that is capable of writing a tcp client app in mumps that would reside on your target M database system. We have done this several ways; but

Re: Looking for non-modal alternatives to tk_messageBox (thread)

comp.lang.tcl

Posted: 28 Days 10 Hours ago by: Rich

Your understanding is how a 'grab' is intended to function. A language tweak to the grab man page to clear up the possible ambiguity could be: When a grab is set for a ***particular window***, Tk restricts all pointer events to __be s

Re: Looking for non-modal alternatives to tk_messageBox (thread)

comp.lang.tcl

Posted: 28 Days 11 Hours ago by: Andreas Leitgeb

The "grabwindow" is really the start of the subtree that can still receive events. I understood the phrase "X restricts Y to Z" such that that X causes Y to be "allowed only with Z". I can imagine that other people might read it entire

Re: Looking for non-modal alternatives to tk_messageBox (thread)

comp.lang.tcl

Posted: 28 Days 12 Hours ago by: saitology9

Thank you for trying it. Interrrresting....

Re: Looking for non-modal alternatives to tk_messageBox

comp.lang.tcl

Posted: 28 Days 13 Hours ago by: Robert Heller

Using the event loop in more than one thread is possibly a bad idea. I don't think events will necessarily be delivered to multiple instances of the event loop. Convergent Evolution... :-)

Re: Looking for non-modal alternatives to tk_messageBox (thread)

comp.lang.tcl

Posted: 28 Days 13 Hours ago by: saitology9

I think we are saying the same thing. Just to clarify, per the man page, the target of a grab is a window; not a widget. And the hierarchy by definition must include the top/root end. I am not sure I read you correctly. Are you s

Re: Looking for non-modal alternatives to tk_messageBox (thread)

comp.lang.tcl

Posted: 28 Days 13 Hours ago by: saitology9

Hello, I agree with you that it is indeed simple. I believe I mentioned as much at the very beginning. The OP had already solved it himself before posting, and any of the alternatives suggested here would work fine and be OK. I r

Re: Looking for non-modal alternatives to tk_messageBox (thread)

comp.lang.tcl

Posted: 28 Days 13 Hours ago by: Schelte

The documentation refers to "the grab window and its descendants" *as* the "subtree". So it's not from the toplevel down, but from the grab window down. And only that part of the window hierarchy is active. All the rest is blocked. Tha

Re: Looking for non-modal alternatives to tk_messageBox (thread)

comp.lang.tcl

Posted: 28 Days 13 Hours ago by: Michael Soyka

and, as I mentioned in my initial post, I've done that and it works just fine (and it was easy). My reason for posting was to learn from others about possible alternatives. So far, threads and slave interpreters were mentioned and those

Re: Looking for non-modal alternatives to tk_messageBox

comp.lang.tcl

Posted: 28 Days 14 Hours ago by: Robert Heller

Really, the best way is to just implement a non-modal version of tk_messageBox. Which is really quite simple... Playing games with hidden or almost hidden toplevels is just plain hokey... Actually, in most of my applications, I make

Re: Looking for non-modal alternatives to tk_messageBox (thread)

comp.lang.tcl

Posted: 28 Days 15 Hours ago by: saitology9

Hello, First, a brief comment on the above and then a solution that should work on Linux just as it does on Windows. Widget hierarchy is a tree structure - top-down from a toplevel all the way down through various frames to individua

Re: Looking for non-modal alternatives to tk_messageBox

comp.lang.tcl

Posted: 28 Days 16 Hours ago by: Robert Heller

Quite possibly. OTOH, implementing a non-modal version of tk_messageBox is pretty easy...

Re: Looking for non-modal alternatives to tk_messageBox (thread)

comp.lang.tcl

Posted: 28 Days 18 Hours ago by: Michael Soyka

It was suggested in an earlier post to associate the tk_messageBox window with a hidden toplevel as a way of keeping my text widget responsive. This worked on Windows but not linux. If I understand the following two sentences in the ma

Re: Looking for non-modal alternatives to tk_messageBox (thread)

comp.lang.tcl

Posted: 28 Days 22 Hours ago by: Schelte

It is. You can achieve the same result with just a slave interpreter: % interp create foo foo % foo eval {package require Tk; wm withdraw .} % package require Tk 8.6.12 % button .b -text hello -command {puts hi}; pack .b % foo eval {tk_me

Re: Looking for non-modal alternatives to tk_messageBox (thread)

comp.lang.tcl

Posted: 29 Days 2 Hours ago by: jtyler

Well, maybe then using a thread is not overkill :) [1650]$ rlwrap -pred tclsh % package require Thread 2.8.4 % set tid [thread::create {package require Tk;wm withdraw . ; thread::wait}] tid0x7fad67cdb700 % package require Tk 8.6.9 % butt

Re: ffidl to access dll functions (thread)

comp.lang.tcl

Posted: 29 Days 16 Hours ago by: Ashok

bhola.dll works ok when loaded from current dir but user32.dll doesn't work from current dir, it only works when using the system one (being both same arch, x86-64 64-bit) I do not remember the details, but I think Windows has special

Re: ffidl to access dll functions (thread)

comp.lang.tcl

Posted: 29 Days 16 Hours ago by: Ashok

From a 32-bit Tcl, ffidl.dll must also be 32-bit and the DLL you are trying to load must also be the same. No way around it. Ditto for 64-bit. I cannot see how you might be using a 64-bit dll from a 32-bit ffidl. It's simply not poss

153 recent articles found.

rocksolid light 0.7.2
clearneti2ptor