topical media & game development

talk show tell print

#mobile-ar-8-4.txt / txt



  // Prepare radiolist value which will be used in SQL statement.
  // In this function, we convert the returned value into the ones that are
  // stored in the database.
  //
  // Arguments:
  // radiolist ; the integer value of radiolist parameter in the
  // GetPOI request.
  //
  // Returns:
  // radio_value ; the value that can be used to construct the right SQL
  // statement.
  
  function GetRadioValue (radiolist) {
          // if radiolist exists, prepare radio_value.
          if( isset( radiolist ) ) {
          radio_value;
                  // if radiolist == 1, return radio_value =”sale”;
                  // if radiolist == 2, return radio_value =”rent”;
          switch (radiolist) {
                  case ‘1’:
                          radio_value = “sale” ;
                          break;
                  case ‘2’:
                          radio_value = “rent” ;
                          break;
                  default:
                  throw new Exception( “invalid radiolist value:”.radiolist );
          } //switch
          return radio_value;
          }//if
          else {
                  throw new Exception(“radiolist parameter is not passed in GetPOI request.”);
  }//else


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.