From: Alin Pilkington (AlinP@AOL.COM)
Date: 20 Feb 98, 03:56 EST
From: Alin Pilkington <AlinP@AOL.COM>
Subject: Re: C++ Prefs file has an error?
Thanks again Vince!
I now realize my mistake since I actually had what you wrote during one
of my attempts at getting things to work. My mistake was to duplicate
the offending line, comment out one of them to preserve the original and
then modify the second one as in the following:
#if {[catch {uplevel \#0 [list source [file join "$PREFS
${mode}Prefs.tcl"]]}]} {
if {[catch {uplevel \#0 [list source [file join $PREFS
${mode}Prefs.tcl]]}]} {
I re-read the Welch book in the area on comments and it did say that
comments can only occur where the tcl interpreter expects a command so I
think I screwed things up by putting the comment at the beginning of an
if statement. If I take out the commented line, everything works fine!
Am I right?
Thanks!
Alin Pilkington
P.S. I hope that someday I can be a contributor to the discussions
instead of a leach always asking for help. Sorry...
Received from darley@fas.harvard.edu
>You're right the quotes are optional. I have:
>
>if {![info exists seenMode($mode)]} {
>set seenMode($mode) 1
>if {($mode != "") && [file exists [file join $PREFS ${mode}Prefs.tcl]]} {
>if {[catch {uplevel \#0 [list source [file join $PREFS
>${mode}Prefs.tcl]]}]} {
> alertnote "Your preferences file '${mode}Prefs.tcl has an error."
> }
> }
> }
>
>which works (I'vve removed indentation so it doesn't wrap in my
>emailer). That should work.
>
>-- Vince.
>
>On Thu, 19 Feb 1998 AlinP@aol.com wrote:
>
>> Hi Vince!
>>
>> Thanks for your quick response. I downloaded your latest 7.0p4 from your
>> site and installed it but it seemed to give me the same problem as
>> before. I found the message from Johan that you refered to in your
>> response and made the change he suggested but then it seemed like the
>> file alphaHooks.tcl did not load. I think this because I saw the message
>> in the lower left hand corner of the screen saying "loading
>> alphHooks.tcl" but it never advanced beyond that point. Here is the exact
>> change I made to alphaHooks.tcl and then saved and restarted.:
>>
>> from
>>
>> if {[catch {uplevel \#0 [list source [file join "$PREFS
>> ${mode}Prefs.tcl"]]}]} {
>>
>> to
>>
>> if {[catch {uplevel \#0 [list source [file join "$PREFS"
>> "${mode}Prefs.tcl"]]}]} {
>>
>> the only change was adding the quotes where Johan said to. I don't
>> really understand why this line needs to have the quotes at all when the
>> line above it which is:
>>
>> if {($mode != "") && [file exists [file join $PREFS
>> ${mode}Prefs.tcl]]} {
>>
>> doesn't have any quotes at all and it seems to work OK. I did try to
>> debug this one myself by trying out the various commands in each line on
>> a standalone basis in the Alpha shell and it all seemed to work there
>> (whereas the previous code clearly did not work) but, as I said, when I
>> saved the file alphaHooks.tcl with the changes and restarted, it hung.
>>
>> Any ideas?
>>
>> Thanks!
>>
>> Alin Pilkington
>>
>>
>> Received from darley@fas.harvard.edu
>>
>> >I uploaded p4 briefly, then removed it since I'd left that bug in (and
>> >another). You must've grabbed it in the short time it was there.
>> >
>> >Either download again, or look at Johan's previous message on the list for
>> >a fix of your bug,
>> >
>> >sorry,
>> >
>> >-- Vince.
>>