Christian Cypert wrote:
OK, I've been staring at this code now for a day and I'm going cross-eyed. This I would think would be a simple task, but for some reason I cannot get the code to execute correctly. Below is an If statement followed by a conversion to a Case statement. This has got to be something simple, but when the code executes if the second condition in the If or Case is true the statements still fail.
If "get session("employee_name")#[Customer]ITSName))" is true in either of the statements below I always get a false reading. I've compared the strings with the "compare strings" command in Active4D and it returns a 0. I've displayed the values of both on screen and they appear identical. Does anyone see something I've glossed over?
<% if((get session("employee_name")#[Customer]OTSName)|(get session("employee_name")#[Customer]ITSName)) %>
<td align="left"><% write([Customer]Number) %></td>
<% else %>
<td align="left"> <b><a href="<% =makeLinkCustomer %>"> <% write([Customer]Number) %></a></b></td>
<% end if %>
<% case of %>
<% : (get session("employee_name")#[Customer]OTSName) %>
<td align="left"><% write([Customer]Number) %></td>
<% : (get session("employee_name")#[Customer]ITSName) %>
<td align="left"><% write([Customer]Number) %></td>
<% else %>
<td align="left"> <b><a href="<% =makeLinkCustomer %>"> <% write([Customer]Number) %></a></b></td>
<% end case %>
Christian Cypert [EMAIL PROTECTED]
Christian,
I don't immediately see anything wrong. What happens if you try something like this:
<%
$sessionEmpName := get session ("employee_name")
if ($sessionEmpName = "")
throw("Session Employee Name not set") `debug - catch error
end ifif ( ($sessionEmpName#[Customer]OTSName) | ($sessionEmpName#[Customer]ITSName) )
%>
<td align="left"><% write ([Customer]Number) %></td>
<% else %>
<td align="left"> <b><a href="<% =makeLinkCustomer %>"> <% write([Customer]Number) %></a></b></td>
<% end if %>
It shouldn't matter but maybe the multiple calls to get session on the same key are causing problems?
The same technique could be applied to the Case based approach too.
-- Brad Perkins
_______________________________________________ Active4D-dev mailing list [email protected] http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/
