Rabbit Web throws an error on some Select operations

"ourcoolhouse" <[email protected]>
Newsgroups gmane.comp.hardware.rabbit-semiconductor
Message-ID <[email protected]>
Hi

I don't expect digi to fix this problem, I'm really just looking to document it, and make the work-around public.

I spent several days trying to figure out why one of my ZHTML web pages would not display without errors.  I've been using Dynamic C and rabbit-web for about 9 years, so I'm no novice.

My current project uses DC 10.70, but I'm sure I've seen this on earlier versions.

The symptom is that sometimes (in very specific situations) the "select" option expansion does not generate code, instead it generates an error indicating that there is a misplaced parenthesis.

After triple checking the code, zhtml, and trying the same ZHTM in several configurations with differing results, I have completely eliminated the problem by doing something non-intuitive.

The problems were only occurring around a variable structure called "SelectedSlot".  

In desperation I surmised that there was some bad code in the ZHTML preprocessor that was interpreting my variable name as part of the "Select" statement.  I could imagine where the code was looking for the word "Select" and doing a code substitution, while forgetting that this same text string may also appear as part of the variable name.

The upshot was that when I did a complete text search and replace of SelectedSlot with SelSlot, the problem completely vanished.

So: 
 	   <Select NAME="SelectedSlot.Op" >
	    <?z print_select( $SelectedSlot.Op ) ?></select>

Would fail in some circumstances (not all), where

 	   <Select NAME="SelSlot.Op" >
	    <?z print_select( $SelSlot.Op ) ?></select>

would not.

So...   if this happens to you.....  look to see if your variable name possibly includes a ZHTML preprocessor keyword.  If so, change it.

Phil.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.