[Gambas-user] Question about how to address more than 1 checkbox or picturebox item in for-next loop
ron
ronstk at ...239...
Fri Jul 27 13:42:34 CEST 2007
On Friday 27 July 2007 12:57, Ron Klinkien wrote:
> ron wrote:
> > On Thursday 26 July 2007 16:20, Ron Klinkien wrote:
> >
Good to hear.
Just a tip I use in real programming where the Object is required.
1) if the DIM is inside the sub/function I do
'DIM myPic as Object 'doRun
DIM myPic as Picturebox 'doEdit
or more I did this as
DIM myPic as Object 'Picturebox ' 'doEdit
in the time gambas did support, with the old editor, drag and drop
on code I did drag the correct "keyword ' " in place :(
Before the compile/run I place the remarks sign to the line below
by find the lines with i.e. 'doRun'
2) if the declaration in global part of the file.
PUBLIC myPic as Object 'doRun
SUB showpic()
DIM myPic as Picturebox 'doEdit
....
END
Before the compile and/or run I put a remark at the DIM line
Now the auto completion works with correct object properties/methods
during edit time.
When gambas support the C form of #IF x=y #end (conditional compile)
this will be a peace of cake.
Ron
> >> DIM i AS Integer
> >> DIM SensorByte1 as Byte
> >> DIM PBoxI AS PictureBox = [PictureBoxI0, PictureBoxI1, PictureBoxI2,
> >> PictureBoxI3, PictureBoxI4, PictureBoxI5, PictureBoxI6, PictureBoxI7]
> >>
> >>
> >>
> > Hi Ron from Ron
> >
> > change :
> > DIM PBoxI AS PictureBox = [PictureBoxI0, PictureBoxI1, PictureBoxI2,
> > PictureBoxI3, PictureBoxI4, PictureBoxI5, PictureBoxI6, PictureBoxI7]
> > to
> > DIM PBoxI AS Object[] = [PictureBoxI0, PictureBoxI1, PictureBoxI2,
> > PictureBoxI3, PictureBoxI4, PictureBoxI5, PictureBoxI6, PictureBoxI7]
> >
> > Why Object? Well that is what it expects regarding the error :)
> > Not nice but should work
> > Why Object[]? Because you asign a array of PictureBoxI# to it
> >
> > Secondly you can't do DIM PBoxI AS PictureBox[]
> >
> > Hoop dat dit helpt. :)
> >
> > Groeten:
> > Ron
More information about the User
mailing list