Rocket jBASE

 View Only
  • 1.  Within a trigger, solution to get File Name, not File Var

    Posted 03-30-2023 15:16
    Edited by Kathy Larson 03-30-2023 15:46

    Trying to create a generic write/delete trigger subroutine and would like to be able to determine the File name. Is there a way to get back to it from within a Trigger?

    I'm trying to write to a specific history file, based on the file name.


    I know I have a File Variable, but I'm not familiar how to parse that or cast it to a normal variable that I could parse. I've looked through the SYSTEM() values at the time and don't see anything obvious set there for the file.

    I'm really trying to avoid a separate subroutine for each file if possible.

    Jbase Version 5.6.6.

    Thanks,

    EDIT: After posting, I did find out that IOCTL works.

    IF IOCTL(FILEVAR,JBC_COMMAND_GETFILENAME,FILENAME) THEN
        FILENAME = FIELD(FILENAME,'/',DCOUNT(FILENAME,'/'))

    Is there a simpler way?

    ------------------------------
    Greg Motter
    Rocket Forum Shared Account
    ------------------------------



  • 2.  RE: Within a trigger, solution to get File Name, not File Var

    ROCKETEER
    Posted 03-31-2023 09:39

    Greg,
    In a jBASE trigger, the IOCTL function would appear to be the best solution.

    Mike



    ------------------------------
    Mike Street
    Technical Support Engineer
    Rocket Internal - All Brands
    ------------------------------