Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Correlations among VFP and OOP languages
Message
De
10/06/2006 05:27:29
Thomas Ganss (En ligne)
Main Trend
Frankfurt, Allemagne
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
01128092
Message ID:
01128260
Vues:
22
>You can define abstract classes but there is no language enforcement that the methods remain empty.
True, but you can fake it (sort of...<g>)
function AbstractWarn()
  local lcSetAssert
  lcSetAssert = set("Assert")
  set Assert on
  assert .f. Message Program() + " should be overwritten !"
  set Assert &lcSetAssert

define class GraphicAbstractObject as custom
   x = 0
   y = 0

function moveTo( newX, newY )
  = AbstractWarn()
endfunc

function draw()
  = AbstractWarn()
endfunc

enddefine
regards

thomas
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform