Hi,
I am trying to "Define" an expression to check whether a long char string contains another small char string. For this, I am using strstr() library function in C++.
Expression is like this:
THaVarList * gHaVars = new THaVarList(); THaCutList * gHaCuts = new THaCutList(gHaVars); const char* listClients="ABCD,EFGH,HIJK,NEWONE,JUNK,DONE"; const char* ordClient = "DONE";
gHaVars->Define("listClients",listClients); gHaVars->Define("ordClient",ordClient); gHaCuts->Define("Expr","((size < 1000) && (vol < (0.001 * ADV)) && (prod == value) && strstr(listClients,ordClient) )");
Program compiles fine, but when I run this program, the Define() function call fails with an error message: Error in <THaCut::Compile>: strstr requires 2 string arguments Error in <THaCutList::Define>: expression error, cut not created: Expr ((size < 1000) && (vol < (0.001 * ADV)) && (prod == value) && strstr((listClients),(ordClient)) ) block: Default
I have given the correct number & type of input parameters to strstr, but then why is the "::Compile" still failing? How can we achieve this type of checks?
Please help.
Thanks and Regards,
Ganesh
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
This archive was generated by hypermail 2.2.0 : Thu Nov 29 2007 - 11:50:02 CET