Date: Thu, 13 Dec 2007 13:41:36 -0500
Reply-To: Dave Scocca <dave@SCOCCA.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dave Scocca <dave@SCOCCA.ORG>
Subject: Re: Create SAS/AF Push Button at Run Time
In-Reply-To: <200712131651.lBDBksBL027053@mailgw.cc.uga.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed
--On 12/13/2007 11:51 AM -0500 Paul Walker wrote:
> How could I do this using array logic? Here
> is what I tried based on above example:
>
> init:
>
> /* Try to declare an array of push buttons */
> declare sashelp.classes.PushButton_c.class
> buttons[2] pushbutton1 pushbutton2;
I found the SAS doc that explains what the problem was here:
http://support.sas.com/onlinedoc/913/getDoc/en/sclref.hlp/a000147897.htm
SCL Reference: SCL Arrays: Declaring Arrays in SCL Programs
> The ARRAY statement (but not the DECLARE statement) enables you to assign
> names to individual array elements. For example, the following statement
> assigns the names JAN, FEB, MAR, APR, and MAY to the five elements in the
> MONTH array.:
>
> array month[5] $ jan feb mar apr may;
>
> You can use these names to refer to the array elements in your SCL
> program.
>
> In contrast to the ARRAY statement, you cannot use the DECLARE statement
> to assign names to individual array elements. The following DECLARE
> statement declares an array named MONTH plus five more character
> variables named JAN, FEB, MAR, APR, and MAY:
>
> declare char month[5] jan feb mar apr may;
So when your code said:
> declare sashelp.classes.PushButton_c.class
> buttons[2] pushbutton1 pushbutton2;
it was declaring a one-dimensional array of pushbuttons, "buttons", with
two elements, plus two pushbutton objects, "pushbutton1" and "pushbutton2",
which were completely unrelated to the array.
Dave Scocca
|