Repeat Through Actions

version 2 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Book - the Repeat Through Actions extension

    Chapter - Small technical needs

    Section - typecasting between number and action-name

    To decide what number is (acn - an action-name) as the/an/a/-- number:
    (- GetNumForActionname({acn}) -).

    To decide what action-name is (n - a number) as the/an/a/-- action-name:
    (- GetActionnameForNum({n}) -).

    Include (-
    [ GetActionnameForNum n;
        if (n < 1) return ##Wait;
        n--; ! Inform 7 counts from 1; Inform 6 counts from 0
        n = (n * AD_RECORD_SIZE) + 1 + AD_ACTION;
        if (n > ActionData-->0) return ##Wait;
        return ActionData-->n;
    ];

    [ GetNumForActionname acn;
        return 1 + (FindAction(acn) / AD_RECORD_SIZE);
    ];

    -).