• New Module ExtdVars

    From Thomas Milius@21:1/5 to All on Sat Mar 20 15:16:22 2021
    I have just released a new small module called ExtdVars.

    ExtdVars simply provides a couple of variables which all are starting
    with "ExtdVars$". You can read this variables as usual eg. in
    programs written in C (getenv, SWI OS_ReadVarVal), BBC Basic (SWI OS_ReadVarVal) or in Command scripts (<>). But you can't set the
    content of this variables.

    Inbuild variables:

    1. UUID - Everytime when it is called it will return an unique value
    according to RFC 4122 version 1. The actual version allows
    the generation of up to 65536 unique values within 1/100 second.
    Eg. such UUIDs are required inside iCalender formats to identify
    an event in a unique way. But you can also use it to write
    Command scripts of which you can run several instances in
    parallel by passing the UUID as parameter and use it to
    create unique variable names (Example Instances_main).
    1. ActualDir - Contains the current selected directory. In theory
    you should be able to obtain this from
    FileSwitch$CurrentFilingSystem and FileSwitch$*CSD
    variables but practice shows that these are often
    not updated in the way you are expecting.

    Additionally you can create and delete a nearly arbitrary number of
    variables by commands which can be of one of two types.

    The command ExtdVars_UnsetVar followed by variable name without
    "ExtdVars$" will delete such variables. A regular Unset isn't
    enough as ExtdVars module won't note the deletion.

    The command ExtdVars_CreateCommandVar followed by variable name without "ExtdVars$" and command will create a so called command variable.
    When you are reading the content of such a variable the assigned command will be executed (it must be a real command and not a program as this will lead to internal problems!). The first line of the ouput generated by execution of
    the command will be returned as value of the variable. Eg. this can be the first line of a certain file by using Type as command or the result of an evaluation defined as an Alias as the Prompt example is showing which will change the CLI prompt into a UNIX/LINUX like variant showing a part of
    the path of the current selected directory.

    The command ExtdVars_CreateQuestionVar followed by variable name without "ExtdVars$", decimal flag value, title and question text (including
    optionally a list of buttons at the end separated from the question by
    "|") creates a so called question variable. If you are reading the
    content of such a variable ExtdVars will call Wimp_ReportError (see PRMs for
    a description of the flags and return value). After you did your choice its value will be returned as the value of the variable. Be careful. Eg. a Show ExtdVars$* will end up in showing you a message for all such defined
    variables. So it may be wise to create the variable immediately before
    reading it and deleting it directly afterwards. The example Question gives
    a primitive demonstration of the possibilities.

    ExtdVars can be downloaded from my homepage

    http://thomas-milius-stade.dnshome.de/indexE.htm

    Section Computer activities

    or directly

    http://thomas-milius-stade.dnshome.de/Download/Freeware/ExtdVars.zip

    I hope anyone is finding the tool useful. Any feedback is welcome.

    Best Regards

    Thomas Milius


    _______________________________________________________________ a.m.conroy@argonet.co.uk, Moderator of comp.sys.acorn.announce.
    Submissions to csaa@owlart.net
    Related mail to csaa-request@owlart.net

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)