from Custom import CustomBase import API class execCustom (CustomBase): stack = None def __init__(self, stack): self.stack = stack # __init__ def help(self): msg = "execCustom\n" msg += "----------\n\n" msg += "This custom function demonstrates how to call other custom functions. " msg += "Data is passed through the stack." API.showPopup('Custom function', msg, font=('Courier',API.helpFontSize)) # help def calculate(self): if self.stack.inputMode != 'DEC': API.toast('This operation is only supported in DEC mode') return if self.stack.finishEntry() == -1: return # abort here because data in input line is invalid if self.stack.size() < 1: API.toast('This operation needs 1 argument') return _ok = API.execCustom('logarithm/ln') if _ok is not True: # There was an exception when calling the custom function return x = self.stack.getRegister(0) self.stack.pop(1) self.stack.push(x + 3) # calculate # execCustom