PDA

View Full Version : TyTool5r2 crashes extract Hong Kong Phooey


Agrabren
11-13-2002, 08:04 PM
I downloaded TyTool5, then theTyTool5r2 client only, and have installed (and used) both successfully. Well, mostly..

It doesn't like Hong Kong Phooey!

After I select Hong Kong Phooey, it does some communication, then TyTool Client crashes on my machine (No user dump because I have VC6 installed, so it catches the exception instead of Dr Watson).

It appears to be a problem with the name of the show...

Hong Kong Phooey The Claw/Hong Kong Phooey

Do I need a new NowShowing.tcl, a new client, a new mfs_server thingy, or all or what?

Kevin

keith721
11-13-2002, 09:39 PM
Windoze :mad: doesn't like you to use any of several special characters within file or directory names. I'm not certain if jdiner ever posted a fix for this, but it essentially consists of adding some TCL code to the NowShowing.tcl file, that removes or replaces all of the illegal characters that Windoze rejects.

I did something like this a while back, let me see if I can find the file... yup, here's an example of what needs to happen:

#
# remove invalid filename characters
#
regsub -all {[\\/:\*\?\&\"\'\<\>\}\{\|]} $namelist "" epBasename

Let me pull up my NowShowing.tcl file, and see if I can provide a fix for you...

keith721

keith721
11-13-2002, 09:53 PM
you can copy these lines of TCL code starting with regsub, and insert them into the script just after the two lines where it obtains the title and episode texts from the MFS database. Those are the first lines of each pair shown below, using the set title and set episode statements:

set title [strim [dbobj $program get Title]]
regsub -all {[\\/:\*\?\&\"'\<\>\}\{\|]} $title " " title
and

set episode [strim [dbobj $program get EpisodeTitle]]$partstr
regsub -all {[\\/:\*\?\&\"'\<\>\}\{\|]} $episode " " episode


hope this helps . . . :D

keith721

Agrabren
11-13-2002, 10:24 PM
You're the man. Thanks!

If I knew TCL, I'd have a small shot at figuring that out... But I don't.

If I had the source to TyTool Client, I coulda fixed it there, and prevented crashing. But I don't, so I can't.

Kinda caught between a rock and a hard place. Thank for bailing me out

Hong Kong Phooey thanks you. ;)

Now if only Boomerang would rerun G-Force, I'd be set. :)

Kevin

keith721
11-14-2002, 10:12 AM
but, I really like Hong Kong Phooey cartoons, almost as much as I like Ren and Stimpey.

I'm glad you were able to patch your script. I wasn't certain if mine at home was exactly the same as yours, and didn't really want to post a new copy for just a two-line fix.

The TCL regsub statement uses regular expressions to perform substitution on a string, loading the result into the same or another string. The trickiest part was finding out what characters have to be preceded by a backslash character, to insure that they're not interpreted as meta-characters. I got the list of invalid characters for filenames from a Windoze :mad: error message generated by attempting to rename a file using some of the characters.

I've passed this patch along to jdiner, if he thinks it's worthwhile.

For some strings and some purposes, it's better to replace special characters with their XML/HTML equivalents, but that's a bit more involved. The most obvious case that comes to mind is 'Will & Grace' which uses the ampersand character. Also, if you're not naming a file, but including the title or episode name in a database, you'd generally want to include almost all of the special characters, since they wouldn't necessarily create a problem.

Glad I could help you,

keith721 :D