IS AMONG anamolies

Sannyasin Brahmanathaswami brahma at hindu.org
Sun Oct 4 00:15:06 EDT 2015


If I put this in a button:



on mouseup
   put ("ha" is among the items of "ha,ht,hhe,taka")
end mouseUp

	We get “true”

If I put this in the msg box


	"ha" is among the items of "ha,ht,hhe,taka”


Returns  “false”

If we use

	put "ha" is among the items of "ha,ht,hhe,taka”

Returns true

OK… now move over to the server

 the URL is

someDomain/index.lc?ha

And my code is

put $_SERVER[QUERY_STRING] into tEntryPoint

if (tEntryPoint is among the items of "ha,ht,hhe,taka") then
	put empty into tEntryPoint
end if


tEntryPoint is Empty

If I comment out the if statement and simple pass 

tEntryPoint to the html  I get “ha”  

So, why does (tEntryPoint is among the items of "ha,ht,hhe,taka”)  evaluate to false, both in this server script context and in the msg box without the cmd “put” ??

An attempt to emulate the msg box on the server:

Somedomain/index.lc?ha

put $_SERVER[QUERY_STRING] into tEntryPoint

put (tEntryPoint is among the items of "ha,ht,hhe,taka") into tTest

if tTest="true" then
		# do nothing
	else
		put tTest into tEntryPoint
end if



And later in some old code in the HTML:

<?rev put tEntryPoint  ?>

Outputs nothing

Change that to  <?lc put tEntryPoint  ?>

output: “false” ! But the query_string *is* among the items of "ha,ht,hhe,taka”

and “yikes”  <?rev is not always evaluating...

To make matters more interesting:

Ping url: Somedomain/index.lc?ha

put $_SERVER[QUERY_STRING] into tEntryPoint


With no attempt to validate the data

Outputs to the HTML via

<li>•  <a href=“##"><?rev put tEntryPoint  ?></a></li>
						<li>•  <a href=“##"><?lc put tEntryPoint  ?></a></li>

 “ha" appears in both cases

bottom line

Somedomain/index.lc?ha
put $_SERVER[QUERY_STRING] into tEntryPoint
put (tEntryPoint is among the items of "ha,ht,hhe,taka”) 

evaluates to false  

Why?



BR


More information about the use-livecode mailing list