Maybe there's something wrong with your keycode_write( ... ) function.
The rest of it looks OK to me.
Scott Shepard wrote:
> Hello ,
>
> So here is the code that works in uncompiled but not when it is
> compiled. Here's my intention, If g.ids_entry is Null, which it is
> first time through, I check to see if it's in the key code file. If
> yes, set the flag to 1. If not, use an "input" prompt. Second time
> thru, If the
> keycode didn't exist in the file but g.ids_entry had a value, then
> write the key code to the file. (other functions check the validity
> later on).
>
> The second time through (automatic when "update" button is clicked), the file should get written because the
> g.ids_entry should have a value (it entered into the input box) when
> it didn't exist before.
>
> The MvEval statement are there only for debugging, and encodeentities
> hasn't made a difference (with or without).
>
> So why might it be that in second time thru, g.ids_entry is empty in
> the compiled, but not uncompiled?
>
> <MvEVAL EXPR = "{ g.ids_entry $ '
' }">
> <MvIF EXPR="{ NOT g.ids_entry }">
> <MvASSIGN NAME = "g.ids_entry" VALUE = "{ read_keycodefile() }">
> <MvEVAL EXPR = "{ g.ids_entry $ '
' }">
> <MvIF EXPR="{ g.ids_entry }">
> <MvASSIGN NAME = "g.ids_keycode_exist" VALUE = "{ 1 }">
> <MvEVAL EXPR = "{ g.ids_entry $ '
' }">
> </MvIf>
> </MvIf>
> <MvIF EXPR="{ NOT g.ids_entry }">
> Enter your keycode:
> <input type="text" name="g.ids_entry" size="50">
> <INPUT TYPE = "hidden" NAME = "g.ids_entry" VALUE = "{ encodeentities(g.ids_entry) }">
> <MvElse>
> <MvIF EXPR="{ NOT g.ids_keycode_exist }">
> <MvASSIGN NAME = "g.ids_keycode_exist" VALUE = "{ keycode_write( g.ids_entry ) }">
> </MvIf>
> </MvIf>
>
>
> <MvASSIGN NAME = "g.ids_keycode_exist" VALUE = "{ read_keycodefile() }">
> <MvEVAL EXPR = "{ g.ids_keycode_exist $ '
' }">
>
> <MvIF EXPR = "{ (g.ids_keycode_exist) }">
> **** Run the code that configs the operation of module *****
>
> TIA
Comment