Re: Multiple includes
- Posted by kbochert at copper.net Nov 11, 2003
- 440 views
On 11 Nov 2003 at 15:30, C. K. Lester wrote: > > > kbochert at copper.net wrote: > > >class Rect > >atom x1, x2, y1, y2 > >endclass > > > >method Resize(atom way, atom perc) > > if way = RECT_EXPAND_HORIZONTAL then > > .x2 *= perc > > elsif way = RECT_EXPAND_VERTICAL then > > .y2 *= perc > > else > > .x2 *= perc > > .y2 *= perc > > end if > >end method > > > >1) the class declaration only contains the data. > >2) methods are attached to the most recently- refined class > >3) class members are referenced with a leading '.' > >4) a method may or may not return a value. A returned value > >may be ignored. > > > >More refinements: > > > >class Rect > >atom x1 = 0, x2 = 0, y1, y2 > >constant HORIZONTAL = 1, > > VERTICAL = 2 > >endclass > > > >method Resize(atom perc, way = 0) > > if way = .HORIZONTAL then > > .x2 *= perc > > elsif way = .VERTICAL then > > .y2 *= perc > > else > > .x2 *= perc > > .y2 *= perc > > end if > >end method > >... > >Rect myrect -- x1 and x2 are initialized to 0 > >myrect.x2 = 3 > >myrect.y2 = 3 > >myrect.Resize(5) -- resize both x and y > >myrect.Resize(3, Rect.VERTICAL) > > > >Karl Bochert > > > > > Karl, > > Do you provide a reasonable amount of sample code with the Bach > download? I did see a screenshot of the graphics subsystem, but how > about something more complicated? Also, is Bach x-plat? > The only examples are the libraries some benchmarks, and the IUP demos (to my knowledge, not a single application has been written in Bach) Bach is currently windows only -- I have tried, and been unable to use Linux, so I may need some porting. Karl