| Can I create a variable with a custom type (like HSC for highscores)?

Previous | TI Variables and the Variable Allocation Table (VAT) | Next

Q: | Is it possible to create a file which will have a custom type (i.e. which does not appear in VAR-LINK as a stanard type like STR, PIC, PRGM etc.). For example, I want to create a highscore file which will appear in VAR-LINK as HSC type...

A:

Christian Walther pointed to me that this is possible. Moreover, this is easy. All you need to do is to create a file of "other" type (i.e. which terminates with OTH_TAG). TIOS then expects that a real type name is stored just below OTH_TAG as a zero-started zero-terminated string of maximum 4 chars. Look the following code fragment as an example:

    FILE *fp = fopen ("example", "wb");
    // store anything you want in the file here
    fputc (0, fp);
    fputs ("HSC", fp);
    fputc (0, fp);
    fputc (OTH_TAG, fp);
    fclose (fp);

After this, you will have a file named "example" with type "HSC": you will see it in the VAR-LINK dialog.