Hi, 

I have a problem with setting string parameters from command line:
I have written this small test program:

#include <ftool.h>
#include <iostream>

int main(int argc, char *argv[]) {
  ftool::md_param params;
  params.add_string_param("MSG", "Foo is not Bar");
  params.add_real_param("size", 1.0);
  params.read_command_line(argc, argv);
  std::cout << params.string_value("MSG") << "\n";
  std::cout << params.real_value("size") <<  "\n";
  return 0;
};

and this is the result of running it with different command line arguments.

jinx:~/programming/c++/getfem/examples/params>./params 
Foo is not Bar
1

jinx:~/programming/c++/getfem/examples/params>./params -d size=10.11
Foo is not Bar
10.11

jinx:~/programming/c++/getfem/examples/params>./params -d size=10.11 -d
MSG='foo'
terminate called after throwing an instance of 'dal::failure_error'
  what():  Error in ftool.cc, line 166 : 
  Error reading command line line 1 : Parameter foo not found
  Abort

So as you can see it fails when trying to set string parameter.
On the other hand when using parameter file it works all right.

I will look at the source code but maybe some of you will be 
quicker in finding this bug (if this is a bug:).


Regards

Roman

-- 
Roman Putanowicz  < [EMAIL PROTECTED]  >
Institute for Computational Civil Engng (L-5)
Dept. of Civil Engng, Cracow Univ. of Technology
www.l5.pk.edu.pl, tel. +48 12 628 2569, fax 2034

_______________________________________________
Getfem-users mailing list
[email protected]
https://mail.gna.org/listinfo/getfem-users

Reply via email to