[Gambas-user] did I miss something, or is that a bug

Charlie Reinl Karl.Reinl at ...2345...
Sun Feb 14 20:42:13 CET 2010


Am Sonntag, den 14.02.2010, 20:30 +0200 schrieb Jussi Lahtinen:
> It works perfectly without eval.
> Print "/tmp/testArchivCopy_" & Format(Date(), "yyyymmdd") &
> Replace(CStr(Time()), ":", "") & ".pdf"
> Result: /tmp/testArchivCopy_20100214202540.428.pdf
> 
> Eval is only for math! Like Eval("1+2") or Eval("1/sqr(eo*uo)", cExpr).
> 
> Jussi
> 
> 
> On Sun, Feb 14, 2010 at 20:20, Charlie Reinl <Karl.Reinl at ...9...> wrote:
> > Am Sonntag, den 14.02.2010, 20:00 +0200 schrieb Jussi Lahtinen:
> >> > I try to work with a string in that case a Path and eval tries to
> >> > divide.
> >>
> >>  Sorry, I still don't understand what you are trying to do.
> >>  Eval tries to divide, that is very much expected.
> >>
> >>  "? eval("/tmp/testArchivCopy.pdf")"
> >>  Doesn't make any sense, "/tmp/testArchivCopy.pdf" is not mathematical
> >> expression.
> >>  What is the result you are expecting?
> >>
> >>
> >> http://gambasdoc.org/help/lang/eval
> >> "Evaluates an expression and returns its value."
> >>
> >>
> >> Jussi
> >
> > Salut Jussi,
> >
> > the original is:
> > ? eval("/tmp/testArchivCopy_" & Format(Date(), "yyyymmdd") &
> > Replace(CStr(Time()), ":", "") & ".pdf")
> >
> > that was the last in the first mail. And I expect something like :
> > "/tmp/testArchivCopy_20100214130107.408.pdf"
> >
> >
> > --
> > Amicalement
> > Charlie
> >
Salut Jussi,

no, not only for math, even at http://gambasdoc.org/help/lang/eval 
it is shown.

And that works :
  gbx2 -e "Format(Date(), \"yyyymmdd\")" 
  
  gbx2 -e "iif(1=2,True,False)" 
  
  gbx2 -e "\"/tmp/testArchivCopy_\" & Format(Date(), \"yyyymmdd\")"

I have to pass it as a String, if not the / is seen as the math /.

Thanks anyway.
Charlie





More information about the User mailing list