Function Returning Itself.c 877 B

123456789101112131415161718192021222324252627
  1. // A function returning itself
  2. #define USE_TI89 // Compile for TI-89
  3. #define USE_TI92PLUS // Compile for TI-92 Plus
  4. #define USE_V200 // Compile for V200
  5. #define RETURN_VALUE // Return pushed expression
  6. #define MIN_AMS 101 // Compile for AMS 1.01 or higher
  7. #define SAVE_SCREEN // Save/Restore LCD Contents
  8. #include <tigcclib.h> // Include All Header Files
  9. // Main Function
  10. void _main(void)
  11. {
  12. ESI argptr = top_estack;
  13. if (GetArgType (argptr) <= VAR_Q_TAG) // it means that arg is a variable
  14. // see Tags to see why...
  15. push_expr_quantum (SYMSTR ("example"), USERFUNC_TAG);
  16. else
  17. {
  18. while (ESTACK (top_estack) != END_TAG)
  19. top_estack = next_expression_index (top_estack);
  20. top_estack--;
  21. push_string (SYMSTR ("blabla"));
  22. }
  23. }