In class programming, is there a way to access an instance's, class's or member function's own identifier programmatically from within a class or function definition? The current use case is to display a generalized error message within a member function, as in
.import below, but getting an identifier seems like a general problem that may have other applications
.
dataSource.class:
Code:
class dataSource {
repositoryURL = ""
version = ""
filelist = ""
localDir = ""
}
...
program .download
//Default provided here
...
end
program .unpack
//Default is do nothing; override if necessary
end
program .import
di as err "Classes that inherit from .dataSource MUST override .import"
exit 4050
end
but I would like the text ".dataSource" and ".import" added to the error message automatically based on the fact that the currently executing (or compiling?) function is
.dataSource.import. Is that possible in Stata?
0 Response to Access instance, class, or function "own" identifiers within the .class file
Post a Comment