I am trying to use the syntaxes, READONLY, HIDDEN, and PROTECTED in classes but none of them are working. I seem to remember that in the past at least some of them were working. The test code below compiles and runs without any errors--and there should be errors. Either the compiler shouldn't allow it, or the running app should report errors. Any ideas?
James
- Code: Select all Expand view
- /*
Purpose : Test OOP syntax: hidden, readonly, protected
Program :
Author : James Bott, jbott@compuserve.com
Date : 06/30/2017 12:58:01 PM
Company : Intellitech
Language : Fivewin 16.02/xHarbour
Updated :
Notes : It seems none of these syntaxes have any affect.
*/
#include "fivewin.ch"
Function Main()
Local oSyntax
oSyntax:= TSyntax():new()
oSyntax:fname := "Mary"
oSyntax:Lname := "Jones"
oSyntax:cAlias := "MyAlias"
MsgInfo( oSyntax:fname )
msgInfo( oSyntax:lname)
msgInfo( oSyntax:cAlias)
Return nil
Class TSyntax
Data fname HIDDEN
Data lname PROTECTED
DATA cAlias READONLY INIT "cAlias"
Method New()
endclass
Method New() class TSyntax
::fName:="James"
::lname:= "Bott"
Return self