I would recommend using Self for this, AIML is not a programming language. You can use the "self" tag in AIML.