I'm having a bit of a problem though.
I'm trying to combine Mixing Components with Music/TV Components v2
S2 Compiler Output at Sun Aug 8 16:38:50 2004
Error compiling layer:
Compile error: Can't mask local variable 'k1Mheader':
S2::NodeVarDecl, S2/NodeVarDecl.pm, 41
S2::NodeVarDeclStmt, S2/NodeVarDeclStmt.pm, 42
S2::NodeStmtBlock, S2/NodeStmtBlock.pm, 101
S2::NodeFunction, S2/NodeFunction.pm, 230
S2::Checker, S2/Checker.pm, 339
S2::Compiler, S2/Compiler.pm, 34
----------------------------------------
layerinfo "type" = "theme";
layerinfo "name" = "mixed components()";
layerinfo "source_viewable" = "1";
set first_position = "profile";
set second_position = "free_text_order";
set third_position = "links";
set fourth_position = "summary";
set fifth_position = "calendar";
set show_free_text = true;
# you can use these 5 lines as often as you want to make more component boxes
# just take the comments to the right off and take the #'s off of the front of each line
# print_comp_header("TEXT HERE"); # prints component header with text "TEXT HERE" (w/out quotes)
# """ # starts html code block
# HTML HERE # put html here
# """; # ends html code block
# print_comp_footer(); # prints component closing code
function print_free_text(Page p){
print_profile($p); # profile
print_comp_header("Free text 1");
var string k1Mheader = "Obsessions"; # title of component
var string k1Mheight = "175px"; # height of component
var Color k1Mborder = "#000000"; # bordercolor for images
# dont mess with these
var Color k1Mbg;
var string[] k1Msrc;
var string[] k1Malt;
var string[] k1Mtitle;
var string[] k1Murl;
# set one
$k1Msrc[0] = "src 1";
$k1Malt[0] = "alt 1";
$k1Mtitle[0] = "title 1";
$k1Murl[0] = "optional linking url 1";
# set two
$k1Msrc[1] = "src 2";
$k1Malt[1] = "alt 2";
$k1Mtitle[1] = "title 2";
$k1Murl[1] = "optional linking url 2";
# copy sets as necessary
# make sure that the index numbers (bolded numbers) are the same in each group
# this program will step thru them in numerical order
print_comp_header($k1Mheader);
"""
<div id="Layer1" style="position:relative; width:100%; height:$k1Mheight; z-index:1; overflow: auto; overflow-x: hidden;">
<table width="100%" cellpadding="3" cellspacing="0">
""";
foreach var int i (0 .. (size($k1Msrc) - 1)){
$k1Mbg = ($i % 2 == 0) ? $*main_bgcolor : $*comp_bgcolor;
"""
<tr style="background-color:$k1Mbg;">
<td style="text-align:left;">""";
if($k1Murl[$i] != "") { """<a href="$k1Murl[$i]">"""; }
"""<img src="$k1Msrc[$i]" border="0" style="border: 1px solid $k1Mborder" alt="$k1Malt[$i]" title="$k1Malt[$i]" />""";
if($k1Murl[$i] != "") { """</a>"""; }
"""</td>
<td style="font-weight:bold; text-align:left;">$k1Mtitle[$i]</td>
</tr>
""";
}
"""
</table>
</div>
""";
print_comp_footer();
print_comp_header("Free text 2");
var string k1Mheader = "Music"; # title of component
var string k1Mheight = "175px"; # height of component
var Color k1Mborder = "#000000"; # bordercolor for images
# dont mess with these
var Color k1Mbg;
var string[] k1Msrc;
var string[] k1Malt;
var string[] k1Mtitle;
var string[] k1Murl;
# set one
$k1Msrc[0] = "src 1";
$k1Malt[0] = "alt 1";
$k1Mtitle[0] = "title 1";
$k1Murl[0] = "optional linking url 1";
# set two
$k1Msrc[1] = "src 2";
$k1Malt[1] = "alt 2";
$k1Mtitle[1] = "title 2";
$k1Murl[1] = "optional linking url 2";
# copy sets as necessary
# make sure that the index numbers (bolded numbers) are the same in each group
# this program will step thru them in numerical order
print_comp_header($k1Mheader);
"""
<div id="Layer1" style="position:relative; width:100%; height:$k1Mheight; z-index:1; overflow: auto; overflow-x: hidden;">
<table width="100%" cellpadding="3" cellspacing="0">
""";
foreach var int i (0 .. (size($k1Msrc) - 1)){
$k1Mbg = ($i % 2 == 0) ? $*main_bgcolor : $*comp_bgcolor;
"""
<tr style="background-color:$k1Mbg;">
<td style="text-align:left;">""";
if($k1Murl[$i] != "") { """<a href="$k1Murl[$i]">"""; }
"""<img src="$k1Msrc[$i]" border="0" style="border: 1px solid $k1Mborder" alt="$k1Malt[$i]" title="$k1Malt[$i]" />""";
if($k1Murl[$i] != "") { """</a>"""; }
"""</td>
<td style="font-weight:bold; text-align:left;">$k1Mtitle[$i]</td>
</tr>
""";
}
"""
</table>
</div>
""";
print_comp_footer();
print_comp_header("Free text 3");
var string k1Mheader = "Movies"; # title of component
var string k1Mheight = "175px"; # height of component
var Color k1Mborder = "#000000"; # bordercolor for images
# dont mess with these
var Color k1Mbg;
var string[] k1Msrc;
var string[] k1Malt;
var string[] k1Mtitle;
var string[] k1Murl;
# set one
$k1Msrc[0] = "src 1";
$k1Malt[0] = "alt 1";
$k1Mtitle[0] = "title 1";
$k1Murl[0] = "optional linking url 1";
# set two
$k1Msrc[1] = "src 2";
$k1Malt[1] = "alt 2";
$k1Mtitle[1] = "title 2";
$k1Murl[1] = "optional linking url 2";
# copy sets as necessary
# make sure that the index numbers (bolded numbers) are the same in each group
# this program will step thru them in numerical order
print_comp_header($k1Mheader);
"""
<div id="Layer1" style="position:relative; width:100%; height:$k1Mheight; z-index:1; overflow: auto; overflow-x: hidden;">
<table width="100%" cellpadding="3" cellspacing="0">
""";
foreach var int i (0 .. (size($k1Msrc) - 1)){
$k1Mbg = ($i % 2 == 0) ? $*main_bgcolor : $*comp_bgcolor;
"""
<tr style="background-color:$k1Mbg;">
<td style="text-align:left;">""";
if($k1Murl[$i] != "") { """<a href="$k1Murl[$i]">"""; }
"""<img src="$k1Msrc[$i]" border="0" style="border: 1px solid $k1Mborder" alt="$k1Malt[$i]" title="$k1Malt[$i]" />""";
if($k1Murl[$i] != "") { """</a>"""; }
"""</td>
<td style="font-weight:bold; text-align:left;">$k1Mtitle[$i]</td>
</tr>
""";
}
"""
</table>
</div>
""";
print_comp_footer();
print_links($p); # links
$p->lay_print_summary(); # summary component
print_calendar($p); # calendar
}
thanks for your help
*hands