You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by "Hicks, Bob" <BH...@osc.uscg.mil> on 2005/05/02 14:02:43 UTC

RE: Question on scope (not the mouthwash) and another

I am sure:

Here is my index.tcl:

set titleMain "Ellipse Information / Main"
parse main.rvt

Here is my main.rvt:

<? include tpl/header.tpl ?>
<? include tpl/main.tpl ?>
<? include tpl/footer.tpl ?>

Here is my main.tpl (relevent portion):

<div id="pageHeader"><? puts [$titleMain] ?></div>

I have tried:
 puts [$titleMain]
 puts $titleMain
 puts stdout $titleMain

The main.rvt *is* being parsed because the page shows up the way it should.
It just doesn't have $titleMain.

Bob


> -----Original Message-----
> From: Karl Lehenbauer [mailto:karl@sc.com] 
> Sent: Saturday, April 30, 2005 10:15 AM
> To: Hicks, Bob
> Cc: rivet-dev@tcl.apache.org
> Subject: Re: Question on scope (not the mouthwash) and another
> 
> 
> Hi Bob,
> 
> This should totally work.  You've confirmed from looking at the page 
> source that what you're emitting simply isn't there?  Can you 
> try just 
> emitting some straight piece of text, puts stdout "Hi, Mom" 
> or for sure 
> setting titleMain to a known value?
> 
> We'll get this figured out, and thanks for using Rivet.
> 
> Karl
> 
> On Apr 29, 2005, at 11:10 AM, Hicks, Bob wrote:
> 
> > puts stdout $titleMain
> > puts $titleMain
> > puts [$titleMain]
> >
> > None of those work...so I am guessing it doesn't cascade?
> >
> > Bob
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
> > For additional commands, e-mail: rivet-dev-help@tcl.apache.org
> >
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: Question on scope (not the mouthwash) and another

Posted by "David N. Welton" <da...@dedasys.com>.
"Hicks, Bob" <BH...@osc.uscg.mil> writes:

> Here is my main.rvt:
> 
> <? include tpl/header.tpl ?>

includee does a raw include, without doing any parsing.  I think you
want to try the 'parse' command - let us know if that fixes the
problem.

> <div id="pageHeader"><? puts [$titleMain] ?></div>
> 
> I have tried:
>  puts [$titleMain]

This is wrong, unless $titleMain contains the name of a procedure that
can be evaluated, which it doesn't seem to be in your example.

>  puts $titleMain

This second one is correct.

-- 
David N. Welton
 - http://www.dedasys.com/davidw/

Apache, Linux, Tcl Consulting
 - http://www.dedasys.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: Question on scope (not the mouthwash) and another

Posted by Karl Lehenbauer <ka...@sc.com>.
OK, what does the titleMain variable contain?  If you want to be sure 
it has what you think it has, you might try just adding a quick

     set tempfp [open /tmp/titleMain w]; puts $tempfp $titleMain; close 
$tempfp

just to get it into an external file and make sure it's sensible.

If it contains what it should contain, well, I'm not up to speed on 
that <div> tag, but are you sure it's getting emitted in the proper 
section of the webpage, like does it belong in <head> or <body> or 
what?

Karl

On May 2, 2005, at 6:02 AM, Hicks, Bob wrote:

> I am sure:
>
> Here is my index.tcl:
>
> set titleMain "Ellipse Information / Main"
> parse main.rvt
>
> Here is my main.rvt:
>
> <? include tpl/header.tpl ?>
> <? include tpl/main.tpl ?>
> <? include tpl/footer.tpl ?>
>
> Here is my main.tpl (relevent portion):
>
> <div id="pageHeader"><? puts [$titleMain] ?></div>
>
> I have tried:
>  puts [$titleMain]
>  puts $titleMain
>  puts stdout $titleMain
>
> The main.rvt *is* being parsed because the page shows up the way it 
> should.
> It just doesn't have $titleMain.
>
> Bob
>
>
>> -----Original Message-----
>> From: Karl Lehenbauer [mailto:karl@sc.com]
>> Sent: Saturday, April 30, 2005 10:15 AM
>> To: Hicks, Bob
>> Cc: rivet-dev@tcl.apache.org
>> Subject: Re: Question on scope (not the mouthwash) and another
>>
>>
>> Hi Bob,
>>
>> This should totally work.  You've confirmed from looking at the page
>> source that what you're emitting simply isn't there?  Can you
>> try just
>> emitting some straight piece of text, puts stdout "Hi, Mom"
>> or for sure
>> setting titleMain to a known value?
>>
>> We'll get this figured out, and thanks for using Rivet.
>>
>> Karl
>>
>> On Apr 29, 2005, at 11:10 AM, Hicks, Bob wrote:
>>
>>> puts stdout $titleMain
>>> puts $titleMain
>>> puts [$titleMain]
>>>
>>> None of those work...so I am guessing it doesn't cascade?
>>>
>>> Bob
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
>>> For additional commands, e-mail: rivet-dev-help@tcl.apache.org
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
> For additional commands, e-mail: rivet-dev-help@tcl.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: Question on scope (not the mouthwash) and another

Posted by Ronnie Brunner <ro...@netcetera.ch>.
To debug, I'd do the following:

Note that the <div> tag is usually shown, but you should still check
your style sheet to make sure that it isn' hidden or anything. The
easiestz way to rally check the code is "view source" in your favorite
browser to make sure you're looking at the correct <div> tag ...

Does <div id="pageHeader"><? puts FOOBAR ?></div>
result in <div id="pageHeader">FOOBAR</div>

No: your puts does not work
Yes: your $titleMain is empty

> I have tried:
>  puts [$titleMain]

Tcl problem: will not work unless you have a proc that has the name of 
what's in titleMain that returns the title, such as

set titleMain foo
proc foo {} {return "My actual title"}

>  puts $titleMain

works unless titleMain is unset: you can check with

<div id="pageHeader"><? puts [info exists titleMain] ?></div>

if your result is "1" then titleMain is empty (i.e. set titleMain "") 
if your result is "0" then titleMain does not exist

>  puts stdout $titleMain

Does proably not work, as Apache has its own output channel (well,
that's way it's in Websh, I don't really know about Rivet ...)

hth
Ronnie
-----------------------------------------------------------------------
Ronnie Brunner                              ronnie.brunner@netcetera.ch
Netcetera AG, 8040 Zuerich, phone +41 44 247 79 79 fax +41 44 247 70 75

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org