Hola Amigos!
My first attempt at a weird script thing:
Im trying to get this script to work correctly, but I can't seem to make it work.
If I do this, everything is just fine--->
DateTime *dt = DateTime.Now;
Display ("The time is: %02d:%02d:%02d", dt.Hour, dt.Minute, dt.Second);
But what are the "script rules" if I want to display the exact same thing, but with DisplayAt? What I mean by rules is...the "grammatical priority" of brackets, /", {}...etc.
Im getting mixed-up with where to put the parenthesises...Ive tried many many varations without any luck and I think my brain is gonna blow! LOL
For example, this doesn't work--->
DisplayAt (700, 400, 370, "The time is: %02d:%02d:%02d", dt.Hour, dt.Minute, dt.Second");
???
I've never used DisplayAt, but you can best solve your problem with this:
DateTime *dt = DateTime.Now;
String time=String.Format("The time is: %02d:%02d:%02d", dt.Hour, dt.Minute, dt.Second)
DisplayAt (700, 400, 370, time);
As for your other questions, I don't have time right now to answer, but someone else will, or you can check out the Scripting tutorial in the manual.
~Trent
Actually, I think it's simpler than that. You have an extra " at the end of the line, before the final ) - dt.Second"); - which will cause a compilation error ('end of input reached in middle of expression'). You can use Ctrl-B on all braces and quotation marks to make sure they match up - the usual cause of that error. Otherwise it works fine as-is, provided you've still got the DateTime *dt = DateTime.Now; line in as well. (I'm assuming your resolution is high enough that 700,400 is on screen :))
In the future, it's helpful if you say WHY/HOW something isn't working as best you can (error messages, crashing, just not doing as expected...), but beyond that the manual examples and scripting tutorial are good places to start to pick up the rules. And always check braces, quotation marks, capitalisation, semi-colons at line ends, etc. It's the simple things that cause the most hair-tearing frustration, in my experience.
I wasnt aware of the String.Format function...thats exacly what I needed. All is ok now.