using eval block to do logic - missing ) after condition

Posted by gonzales.pgon@gmail.com on 14-May-2014 11:09

Hi 

Im using the eval[] block to design my codes and return the values to the html. I am able to query the database and return values normally but im stuck at a problem. The problem was i have a missing ')' character in my code.  I've checked all my code and i don't undestand why this error shows up. 

Here is my code :

var arr = rbv_api.selectQuery("SELECT email FROM collector",20000); // query to get list of all user emails
var user = null; // variable where to put confirmed mail

for (var i = 0; i < arr.length; i++)
{

if ( {!#CURR_USER.email} == arr[i][0]) // check if current mail is one of those
  {
   user = arr[i][0];
   }
}

return user;


Here is the parsed formula


And here is the error i keep getting

I don't get my error. I checked the number of ( and ) i have and i think they are correct

Posted by bakar on 14-May-2014 17:17

Try to add quotes around {!#CURR_USER.email}

if ( '{!#CURR_USER.email}' == arr[i][0]) // check if current mail is one of those

 {

  user = arr[i][0];

  }

All Replies

Posted by bakar on 14-May-2014 17:17

Try to add quotes around {!#CURR_USER.email}

if ( '{!#CURR_USER.email}' == arr[i][0]) // check if current mail is one of those

 {

  user = arr[i][0];

  }

Posted by gonzales.pgon@gmail.com on 14-May-2014 19:32

Thanks bakar , it worked!

Posted by Santosh Patel on 14-May-2014 20:15

You can check following section for further reference documentation.progress.com/.../index.html

This thread is closed