I am encountering unexpected errors: see attached WMV.
My code is:
- Code: Select all
⎕cself←'c' ⎕cse 'Init' 'System'
⍝ Issue 1:
⎕cse 'Exec' (⍉,[⍬]"public static int myAge {{} get; set; {}};")
⎕cse 'GetLastError' ⍝ NOTE/QUERY Why is the terminating semi-colun an error?
⎕cse 'Exec' (⍉,[⍬]"public static int myAge {{} get; set {}}") ⍝ It works without te semi-colun
⎕cse 'SetValue' 'myAge' '42'
1.25 × ⎕cse 'GetValue' myAge'
⍝ Issue 2:
⎕cse 'Exec' (⍉,[⍬]"public static int myAge2 {{} get; set; {}} = 42") ⍝ NOTE: No ; BUT default Value specified
⎕cse 'GetLastError' ⍝ Why is this an error? [NOTE error - property is of type int]
⍝ Issue 3:
⎕cse 'Exec' (⍉,[⍬]"public static string myName {{} get; set; {}}") ⍝ Omitting the semi-colum to avoid a repeat error
⎕cse 'SetValue' 'myName' 'Ajay'
⎕cse 'GetLastError' ⍝ ⍝ Why is this an error? [NOTE error - property is of type string]
⍝ Works for variables
⎕cse 'ExecStmt' 'public string thisName;'
⎕cse 'SetValue' 'thisName' 'Ajay'
⎕cse 'GetValue' 'thisName'
⍝ Summary:
⍝ 1. Why is the ternminating semi-colon an error? Note - the statement is valid in VS2015.
⍝ 2. Why can't I set a default value for a public property?
⍝ 3. Why can't I assign to a property of stype string?