The following code represents a trivial example of ganging some radio buttons.
WINAPP
PROGRAM p
USE clrwin, ONLY: winio@
INTEGER, PARAMETER :: n=3
INTEGER, DIMENSION(n) :: irbs
CHARACTER(LEN=1), DIMENSION(n) :: crbs= (/'A','B','C'/)
INTEGER :: iw
irbs(1)=1
irbs(2:)=0
iw=winio@('%3`ga&',irbs(1),irbs(2),irbs(3))
DO i=1,n
iw=winio@('%nl%rb@&',crbs(i),irbs(i))
END DO
iw=winio@('%ff')
END PROGRAM p
Although everything works, the format of line 11 is proving to be very restrictive. If line 11 could be changed so that the argument to %ga is an array I think it would become much more flexible. For example, it would be very helpful if line 11 could be written as:
iw=winio@('%3`ga&',irbs(1:n))
In this format it would be easier to convert the code above to a subroutine that would gang a set of n buttons where n is passed as an argument. (The '3' after the % sign could easily be coded to the correct number, of course.) Right now my subroutine has to look something like the following:
SELECT CASE (n)
CASE (2)
iw=winio@('%2`ga&',irbs(1),irbs(2))
CASE (3)
iw=winio@('%3`ga&',irbs(1),irbs(2),irbs(3))
CASE (4)
iw=winio@('%4`ga&',irbs(1),irbs(2),irbs(3),irbs(4))
...
Would it be possible to get %ga to accept an array argument instead of individual scalars? Or am I missing a more obvious way to do this?