Re: [Gambas-user] =?iso-8859-1?q?Question_about_how_to_address_more_t?= =?iso-8859-1?q?han_1=09che
Brought to you by:
gambas
From: ron <ro...@ti...> - 2007-07-27 11:42:26
|
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 |