Reply to Re: How do you convert a TCL list into a string that PHP can read?

Your name:

Reply:


Posted by comp.lang.tcl on 04/21/06 20:45

Bryan Oakley wrote:
> Bryan Oakley wrote:
>
> > Maybe you should file a bug with whomever wrote PROPER_CASE instead of
> > trying to work around its limitations.
> >
>
> FWIW, the culprit is this infinite loop:
>
> while {![regexp -nocase {[a-z]} [string index $wordlet $beginIndx]]} {
> append nonWord [string index $wordlet $beginIndx]
> incr beginIndx
> }

WOW! I would never have found that one, you are truly one of the TCL
gurus out there (you came highly recommended by those I know)

this seemed to have fixed the problem (probably overkill but it was the
best I could think up at the moment:

while {[info exists wordlet] && [string length $wordlet] > 0 &&
![regexp -nocase {[a-z]} [string index $wordlet $beginIndx]]} {
append nonWord [string index $wordlet $beginIndx]
incr beginIndx
}

Phil

>
> Under the right conditions (such as a word beginning or ending with "-"
> or "_"), $wordlet will be null. When wordlet is null, [string index
> $wordlet $beginIndx] will be null for all values of $beginIndx, the
> regexp will never match, and the loop will never terminate.
>
> --
> Bryan Oakley
> http://www.tclscripting.com

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация