[APBeta] Parameter defaults

portuesi at jotabout.com portuesi at jotabout.com
Fri Jan 9 17:56:02 PST 2009


I also support the idea of requiring a main() for scripts.  Mostly on stylistic grounds, but I'm sure there are practical ones as well.

Michael P.

-original message-
Subject: Re: [APBeta] Parameter defaults
From: "Gary A. Ferguson" <garyfe at fergos.com>
Date: 01/09/2009 4:33 PM

Nope, no difference. But I support your idea of requiring a "main"
subroutine anyway. Tweaking v1 scripts has so far turned out to be no big
deal.

Gary

  _____  

From: apbeta-bounces at lists.astroplanner.net
[mailto:apbeta-bounces at lists.astroplanner.net] On Behalf Of Paul Rodman
Sent: Friday, January 09, 2009 4:21 PM
To: AstroPlanner Beta Testers
Subject: Re: [APBeta] Parameter defaults



On Jan 9, 2009, at 04:09 PM, Gary A. Ferguson wrote:


I keep having to change lines like:
c=new Canvas(800,1000,"Magnification")
into lines like:
c=new Canvas(800,1000,nil,"Magnification",true)
which is fine, things change, it's a new version after all. But why can't I
use:
c=new Canvas(800,1000,,"Magnification") ?

The 2 new fields in the constructor appear to be defaulted according to the
framework, so it seems like I shouldn't have to provide explicit values. Is
this just something about the particular version of BASIC that I don't
understand?


I dunno. Well, perhaps I do - it's just that I've never tried this:

I was recently told by the vendor that if you have your main program in a
script not encapsulated in a method, then a lot of the "syntactic sugar" one
would expect is not available to you. I suspect embedded default parameters
might be included in this.

For this reason (and others) I am contemplating forcing the script writer to
encapsulate their main program code in a "main" subroutine, which I would
then call. Of course, this would mean that all V1 scripts would need
tweaking, but then that's probably the case anyway.

Try putting your main program in a sub(routine) and calling it:

  sub main()
     ...
     program statements
     ...
  end sub

  main()   // Call main

and see if that resolves the issue. Let me know.

Paul R.



_______________________________________________
APBeta mailing list
APBeta at lists.astroplanner.net
http://lists.astroplanner.net/listinfo.cgi/apbeta-astroplanner.net





More information about the APBeta mailing list