Results 1 to 8 of 8

Thread: Move statement not working with custom function

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Move statement not working with custom function

    I'm sure I must have missed something, because I've written a function that works fine when it's in the .wo in which it's called, but as soon as I move it elsewhere it throws "Function Not Found" and won't compile. Am I missing something syntax wise?

    The (basic gist of the) function (which I've put in TimeClock.bp):

    Code:
    Function CurrentLocalDateTime Global Returns DateTime 
       DateTime dtDate   DateTime dtChangeDate
    
       Move (DateAddMinute(CurrentDateTime(), 60 * (SYSTEM.HoursAdjust))) to dtDate // Get AEST (System Time) + standard difference in SYSTEM file
       Move (SYSTEM.NewHoursAdjustDate) to dtChangeDate       
       If (dtDate > dtChangeDate) Move (DateAddMinute(CurrentDateTime(), 60 * (SYSTEM.HoursAdjustDS))) to dtDate // it's currently DST, apply that adjustment   
       Function_Return dtDate
    End_Function
    Then I put a Use "TimeClock.bp" and call "Move (CurrentLocalDateTime()) to dtVariable" but it doesn't like it.

    I've tried a few ways of sticking "of oTimeClock" in there and not having it as a global function but so far no dice.
    Any one able to tell me what I'm missing?
    Last edited by IsaacReefman; 18-Feb-2019 at 12:33 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •