[APBeta] Parameter defaults

Paul Rodman paul at ilanga.com
Fri Jan 9 16:43:36 PST 2009


OK, bummer.

Paul R.

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

> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.astroplanner.net/pipermail/apbeta-astroplanner.net/attachments/20090109/44ff4084/attachment-0003.htm>


More information about the APBeta mailing list