Description
These two are pretty straight forward. Just a few lines of javascript to convert:
this.jclass = function(name) {
if (typeof(name) == "string") {
var clazz = sapkg.utilities.SystemDictionaryHelper.findInstanceKlass(name);
if (clazz) {
writeln(clazz.getName().asString() + " @" + clazz.getAddress().toString());
} else {
writeln("class not found: " + name);
}
} else {
writeln("Usage: class name");
}
}
registerCommand("class", "class name", "jclass");
this.jclasses = function() {
forEachKlass(function (clazz) {
writeln(clazz.getName().asString() + " @" + clazz.getAddress().toString());
});
}
registerCommand("classes", "classes", "jclasses");
Logic for forEachKlass() already exists in SA and there are plenty of examples to leverage.
this.jclass = function(name) {
if (typeof(name) == "string") {
var clazz = sapkg.utilities.SystemDictionaryHelper.findInstanceKlass(name);
if (clazz) {
writeln(clazz.getName().asString() + " @" + clazz.getAddress().toString());
} else {
writeln("class not found: " + name);
}
} else {
writeln("Usage: class name");
}
}
registerCommand("class", "class name", "jclass");
this.jclasses = function() {
forEachKlass(function (clazz) {
writeln(clazz.getName().asString() + " @" + clazz.getAddress().toString());
});
}
registerCommand("classes", "classes", "jclasses");
Logic for forEachKlass() already exists in SA and there are plenty of examples to leverage.