none
Design Question - Table Population RRS feed

  • Question

  • Hi Folks -

    I'm trying to create a table to list out the runs times for each of my functions.

    It's 3 columns :  Function_Name, Start_Time, End_Time

    It's easy to populate the Function_name and Start_Time as I will do that as the first step in my functions. But at the end of my function, I need to go back in and populate the End_Time.  How do I do that? Do I need to store the "ID" in a variable and reference that?

    Thanks!

    Thursday, April 30, 2020 8:58 PM

All replies

  • How do I do that? Do I need to store the "ID" in a variable and reference that?

    Hi cdtakacs,

    There are several ways to do that.

    One way could be to write Start_Time in a (global) variable. At the end of your function, you can write Start_time, End_Time and Function_Name in a new record to store in the table.

    Instead of Start_Time and End_Time you could also save only the difference of End_Time - Start_Time.

    Imb.

    Thursday, April 30, 2020 9:49 PM
  • Thats a great idea!!!! I didn't think to store the variable first and add everything once at the end.

    The only thought I have here is the reason I was trying to do it as I originally outlined is hat happens if the process terminates before it ends? Then I wouldn't capture anything. But I suppose the story can be told from the Function before the terminated one as well as the one after...

    Thursday, April 30, 2020 10:09 PM
  • The only thought I have here is the reason I was trying to do it as I originally outlined is hat happens if the process terminates before it ends?

    Hi cdtakacs,

    Why should the process terminates before it ends? In case of an error inthe code you better correct that error. And instead of an Exit Sub orExitFunction inside the code, you can directit to the end of the routine for writing the time record.

    Imb.

    Friday, May 1, 2020 7:01 AM