[APBeta] Global observations script
Paul Rodman
paul at ilanga.com
Tue Mar 24 19:49:51 PDT 2009
Unfortunately, the REALbasic language subset used in AP scripting does
not (currently) allow me to determine the type of exception, or its
location. I have been leaning on the vendor for (literally) years to
sort out the problem. At least it's better than V1 where an exception
just caused a hard crash...
Hopefully in the future this situation will improve.
Meantime, the way I go about tracking these things down is one or more
of the following:
a: Comment out chunks of code until it doesn't get an exception, and
narrow it down.
b: Put debugging comments (e.g. debug "A", debug "B", etc.) every
dozen lines and see with debug statement was the last one to report in
successfully.
c: put a "return" statement in the main() method near the start. If
the code runs to that point, move the statement down another couple of
lines, etc.
Paul R.
On Mar 24, 2009, at 07:35 PM, Christopher Todd wrote:
> Jeff,
>
> I finally got a chance to try your script tonight with 2.0b27, but
> it is
> throwing an Exception if I try to print observation details
> (doLongForm is
> true).
>
> I've not worked much with REALbasic, but I went to the realsoftware
> website
> and downloaded the REALbasic2009r1/LanguageReference.pdf, and was
> reading up
> on RuntimeExceptions and try/catch blocks. I'll be darned if I can
> figure
> out how to get more details about what exception is being thrown, or
> from
> what line of the script, or what the error message is.
>
> If I use the syntax in the docs:
> try
> // lots of other code
> catch err as OutOfBoundsException
> print "Caught a RuntimeException:
" + Str(err.ErrorNumber) + " " +
> err.Message + " " + err.Stack
> end try
>
> I get "There is no class with this name" when I check for errors.
>
> So how do I capture information about the RuntimeException being
> thrown?
>
> Chris
>
>
> On 3/17/09 5:06 PM, "Chris Todd" <christopher.todd at gmail.com> wrote:
>
>> Oooh, I can't wait to get home and try this out! Thanks for posting,
>> Jeff. May I assume, since this was sent to the Beta testing list,
>> that it works in V2?
>>
>> 2009/3/17 Jeff Young <jey at adobe.com>:
>>> I have a script I use to print out a PDF of all my observations.
>>> (It also
>>> has a mode that generates a simple list of all observed objects
>>> and the
>>> date/times for each observation.) It’s based on an old script
>>> (that I think
>>> Paul wrote), but it’s been through some major metamorphisis.
>>>
>>> I’d upload it to the general area, but it contains a couple of
>>> sections of
>>> hard-coded stuff that’s probably only useful with my plans.
>>> (These include
>>> the format of the transparency field and the location of a plan
>>> containing
>>> all the planets and comets.)
>>>
>>> However, for those of you who write script and want to customize
>>> it (or
>>> simply change the hard-coded parts to your liking), I’ve appended
>>> it to this
>>> message.
>>>
>>> Cheers,
>>>
>>> -- Jeff.
>
>
> _______________________________________________
> APBeta mailing list
> APBeta at lists.astroplanner.net
> http://lists.astroplanner.net/listinfo.cgi/apbeta-astroplanner.net
More information about the APBeta
mailing list