C0313 Compiler Error
Message text
Static member name cannot be accessed with an instance reference.
Qualify the static member with a type name.
Explanation
To access a static variable in a .NET class in a conditional
compilation clause, you must use a type name, not a reference to an
instance of the class. This example uses a simple public class Department
that is in the .NET assembly PBInterop.dll. Department has two member
variables: public string Name and public static int ID. In the following
example, the attempt to access the static variable ID using an instance of
the Department class generates C0313:
|
1 2 3 4 5 6 |
long dept_id #if defined pbwebform then PBInterOp.Department dept dept = create PBInterOp.Department dept_id = dept.ID // generates C0313 #end if |
This example deploys without error because the type name of the
class is used to access the static variable:
|
1 2 3 4 |
long dept_id #if defined pbwebform then dept_id = PBInterOp.Department.ID #end if |
See Also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest