Function to get number of minutes between 2 dates.

HI Forum,

I am trying to write a UDS to calculate the number of minutes between 2 dates.

I created a function in a vbscript and works fine, but when i try to use (save) the script in Sage i get an invalid Syntax error.

Is it possible to create functions in a UDS ?

Regards,

Manuel Roman

  • Button script, yes; BOI script no.  When "compiled" each BOI script gets wrapped inside a sub, and you can't have a function inside a sub.

  • in reply to Kevin M

    That makes sense, i want to create and event based on a UDF column (end date).

    I cannot even save the script because i get a syntax error....

    Thanks Kevin, I appreciate your prompt response 

  • in reply to mroman

    There is a way around this. Structure the script like this:

    End Sub ' this will cause the end of the sub started in the wrapper Kevin refers to 

    Function myFunction

    ...

    End Function

    Sub myFix  ' this will be ended by the End Sub created by the wrapper.