IsMethodClass Function |
Namespace: XSharp.RT
FUNCTION IsMethodClass( symClass AS STRING, symMethod AS STRING ) AS LOGIC
public static bool IsMethodClass( string symClass, string symMethod )
1CLASS Animal 2 EXPORT sound, weight 3CONSTRUCTOR(s, w) 4 sound := s 5 weight := w 6METHOD Speaks 7 QOut(sound) 8END CLASS 9CLASS Programmer 10 EXPORT language 11CONSTRUCTOR(lang) 12 language := lang 13METHOD Speaks 14 QOut(language) 15 QOut("Hello World") 16 QOut(Chr(7)) 17END CLASS 18 19Function Start() 20 LOCAL dog AS Animal 21 LOCAL hacker AS Programmer 22 dog := Animal{"Bark Bark!", 50} 23 hacker := Programmer{"VO"} 24 IF IsMethodClass(#Animal, #Speaks) 25 dog:Speaks() // Says Bark Bark 26 ENDIF 27 IF IsMethodClass(#Programmer, #Speaks) 28 hacker:Speaks() // Says VO 29 // Says Hello World 30 // Rings a bell 31 ENDIF