Skip to content
Tcl Source Code Artifact [0e584d19ea]
Login

Artifact [0e584d19ea]

Artifact 0e584d19ea33851d19c79f94d3ca2cc3158c70dc:

Ticket change [0e584d19ea] - New ticket [218721ffffffffff|218721ffff] <i>Updated string command</i>. by nobody on 2000-10-26 01:04:33.
D 2000-10-26T01:04:33
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s1845\sRFE\nVersion:\s8.1b3\nSubmitDate:\s'1999-04-16'\nLastModified:\s'1999-08-06'\nSeverity:\sLOW\nStatus:\sReleased\nSubmitter:\spat\nChangedBy:\shobbs\nOS:\sOther\nMachine:\sNA\nFixedDate:\s'1999-08-06'\nFixedInVersion:\s8.1.1\nClosedDate:\s'2000-10-25'\n\n\nName:\nJeffrey\sHobbs\n\nCustomShell:\nThis\sis\sthe\score\smod,\sbaby!\n\nComments:\nI\sthink\sthis\sfully\stested\spatch\swould\smake\sa\sgreat\saddition\sto\s8.1,\n\s\s\s\sbut\srealizing\sthat\sthat\sis\sclose\sto\sfinal,\sthey\sshould\sdefinitely\sbe\n\s\s\s\sfolded\sinto\s8.2.\s\sIf\syou\sneed\sgood\sexamples\sof\swhere\sthis\ssaves\stimes\n\s\s\s\sor\simproves\slogic\sfor\scommon\stasks.\syou're\snot\scoding\senough\sTcl\s:^).\n\s\s\s\s\n\s\s\s\sThe\simplementations\swere\sdone\sto\smaintain\s100%\sbackwards\scompatibility\n\s\s\s\swith\sworking\scode\s(changing\sthe\soptions\sto\san\sarg\scan\sobviously\schange\n\s\s\s\swhat\serror\sstrings\sarise),\sand\sreduce\sany\sloss\sof\sspeed\s(the\sonly\smethod\n\s\s\s\sthat\sactually\sattained\sa\sspeed\sloss\swas\sstring\sindex,\sas\sI\sthrow\sa\n\s\s\s\sTcl_NumUtfChars\scall\sin\sto\ssupport\send-1\slike\sindices,\sand\sthat\sis\snot\n\s\s\s\smajor).\n\nDesiredBehavior:\nThere\sis\ssome\sbasic\sfunctionality\smissing\sin\sTcl\sthat\scauses\scommonly\n\s\s\s\srequired\sfunctions\sto\sneed\smultiple\sTcl\scalls.\s\sI\shave\supgraded\sthe\n\s\s\s\score\sstring\scommand\s(with\ssome\sminor\slist\sindexing\sbenefits)\sto\sgive\n\s\s\s\sbetter\score\sfunctionality\sfor\sstring\smanipulation\sin\sTcl.\s\sThese\n\s\s\s\sfunctions\sare\sfully\stested\s(test\ssuite\sincluded\sin\spatch,\swith\sall\n\s\s\s\smods\snecessary\sto\sother\stests)\sand\sdocumented.\n\s\s\s\s\n\s\s\s\sI\smade\sthe\sfollowing\smodifications:\n\s\s\s\s\n\s\s\s\s*\sstring\scompare\snow\stakes\soptional\slength\sarg\n\s\s\s\s(for\sstrncmp\sbehavior)\n\s\s\s\s\n\s\s\s\s*\sadded\sstring\sequal\s(just\sa\sfew\slines\sof\scode\sblended\n\s\s\s\sin\swith\sstring\scompare)\n\s\s\s\s\n\s\s\s\s*\sadded\sstring\sicompare/iequal\sfor\scase-insensitive\scomparisons\n\s\s\s\s\n\s\s\s\s*\sstring\sindex's\sindex\scan\snow\sbe\s?end[+-]?expression\n\s\s\s\sI\smade\sthis\schange\sin\sthe\sprivate\sTclGetIntForIndex,\n\s\s\s\swhich\smeans\sthat\sthe\slist\scommands\salso\sbenefit,\sas\n\s\s\s\swell\sas\sstring\srange,\set\sal.\n\s\s\s\s\n\s\s\s\s*\sadded\s[string\srepeat\sstring\scount]\n\s\s\s\sRepeats\sgiven\sstring\s<count>\snumber\sof\stimes\n\s\s\s\s\n\s\s\s\s*\sadded\sstring\sreplace,\sstring\sequiv\sto\slreplace\n\s\s\s\s\s\s(quasi\sopposite\sof\sstring\srange):\n\s\s\s\sstring\sreplace\sfirst\slast\s?string?\n\s\s\s\sExample\sof\suse,\sreplacing\send\sof\sstring\swith\s...\n\s\s\s\sshould\sthe\sstring\sbe\smore\sthan\s16\schars\slong:\n\s\s\s\sstring\sreplace\s$string\s16\send\s"..."\n\s\s\s\sThis\sjust\sreturns\sthe\sstring\slen\s<\s16,\sso\sit\n\s\s\s\swill\sonly\saffect\sthe\slong\sstrings.\n\s\s\s\s\n\s\s\s\s*\sadded\soptional\sfirst\sand\slast\sargs\sto\sstring\sto*\n\s\s\s\sThis\sallows\syou\sto\sjust\saffect\scertain\sregions\sof\n\s\s\s\sa\sstring\swith\sthe\scommand\s(like\sjust\scapping\sthe\n\s\s\s\sfirst\sletter).\s\sI\sfound\sthe\soriginal\stotitle\sto\n\s\s\s\sbe\stoo\sdraconian\sto\sbe\suseful.\n\s\s\s\s\n\s\s\s\s*\sadded\s[string\smap\scharMap\sstring]\n\s\s\s\swhere\scharMap\sis\sa\s{from\sto\sfrom\sto}\slist\sthat\sequates\sto\n\s\s\s\swhat\sone\smight\sget\sfrom\s[array\sget].\s\sEach\s<from>\sand\s<to>\n\s\s\s\scan\sbe\smultiple\schars\s(or\snone\sat\sall).\s\sFor\sTcl/CGI\susers,\n\s\s\s\sthis\sis\sa\sMAJOR\sspeed\sbooster.\n\nPatch:\nThe\spatch\scomes\sto\s64KB\swith\sfull\sdoc\sand\stest\ssuite\schanges\nagainst\sthe\stcl8.1b3\ssources.\nhttp://www.hobbs.wservice.com/tcl/capp/newstring.txt\n\nPatchFiles:\nC:\stclUtil.c\s&&\stclCmdMZ.c\n\s\s\s\sdoc:\sstring.n\n\s\s\s\stests:\sstring.test\scmd*.test\sl*.test\serror.test\n\n\n\nAdded\sto\s8.1.1.\s\n--\s08/06/1999\shobbs
J foundin obsolete:\s8.1b3
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 69.\sOther
J title Updated\sstring\scommand
J type RFE
K 218721ffffffffffffffffffffffffffffffffff
U nobody
Z 751ce8378647109d0f0ca6404013cee7