Determining success of <<if condition>>stuff<<end>>

Is there any way to determine if tadsSay(’<>something<>’) failed to do anything useful?

I’d like to have a function that will iterate back using inherited() attempting to “say” a particular property, halting when something succeeds.

The idea is that the base class will define a very generic response, and the child class(es) will offer more specific responses to certain conditions. But, I want to allow for the dynamic nature to work, without requiring the child class to handle every case itself.

Is there a way to do that?

tadsSay() doesn’t return anything, regardless of it’s success and I don’t see gTranscript changing when the if statement succeeds and something is written out to the terminal.

I’d have to see more of your code to be certain – I could be way off-base here – but my tendency would be not to use ‘<> blah blah<>’ at all. In the situation you’re describing, I’d tend to write out actual blocks of code, something like this:

if (someCondition) "Blah blah blah. "; else inherited();
If you work it right, the call to inherited() will take you back to the functionality defined in the base class. But to know exactly how to set it up, or how it might go astray, I’d need to see more of what you’re doing. (And even then, I’d need to do some testing.)

well, I’d like it to be more invisible than that. If the writer forgets to use else inherited(), then things won’t work. Thus, I’d like to use property strings, if possible.

You may be able to do what you want with propDefined (see sysman page). There is a parameter, PropDefGetClass, to return the (super)class that defines a property, or nil.

	local definingClass = obj.propDefined(prop,PropDefGetClass);
	if (definingClass)
	{
		tadsSay(definingClass.(prop));
		return true;
	}
	return nil;

You can use the ternary conditional operator:

someCondition ? "Blah. " : inherited();

It does not allow you to omit the “:” part (the equivalent of “else”.)