> Hi, > > Is there any trick in Maple to convert a symbol/string/expression into an > integer? > So suppose that we have: > `345`, or "345", or 3,4,5. How can it be changed into integer 345? > > Thanx > > > a := `345`;whattype(%); a := 345 symbol > convert(a,decimal,10);whattype(%); 345 integer > b := "345";whattype(%); b := "345" string > convert(b,decimal,10);whattype(%); 345 integer > c := 3,4,5;whattype(%); c := 3, 4, 5 exprseq > convert(c,decimal,10); Error, wrong number (or type) of parameters in function convert > convert([c],decimal,10); Error, (in convert/decimal) unable to convert [3, 4, 5] to a decimal number > cat(c);whattype(%); 345 symbol > convert(%%,decimal,10);whattype(%); 345 integer >