2 Replies Latest reply on Jun 15, 2017 2:52 PM by esancha

    I Can't get the current cursor time

    esancha

      Hi all!

      I'm trying to obtain the CursorTime for edit a dataset and show his result on a textbox, but ThisDisplay.Trend2.CursorTime returns a empty string, after search on the help and here I can't find what Im doing bad.

      Any help vill be welcome.

       

      This is my code (EditDataSet is a UDF)

       

      Private Sub Trend2_DropCursor(bCancel As Boolean, ByVal nCursor As Integer, ByVal NewTime As String)

      Debug.Print ThisDisplay.Trend2.CursorTime

      EditDataSet "Acumulado caudal", "TagVal('FC3:Q_001','*')-TagVal('FC3:Q_001','" & ThisDisplay.Trend2.CursorTime & "') "

      ThisDisplay.Revert

      End Sub

       

      Thank you very much.

       

      Kind regards

      Emilio Sancha

       

      PS: I'm working with ProcessBook 2015 R2

        • Re: I Can't get the current cursor time
          nicka

          Trend.CursorTime gets the time of the cursor time for Trend.CurrentCursor, which by default is Cursor 0 (Now), you can set the CurrentCursor to the newly added/moved cursor to get its time:

           

          Private Sub Trend2_DropCursor(bCancel As Boolean, ByVal nCursor As Integer, ByVal NewTime As String)

              ThisDisplay.Trend2.CurrentCursor = nCursor

              Debug.Print ThisDisplay.Trend2.CursorTime

              EditDataSet "Acumulado caudal", "TagVal('FC3:Q_001','*')-TagVal('FC3:Q_001','" & ThisDisplay.Trend2.CursorTime & "') "

              ThisDisplay.Revert

          End Sub

           

          Although this is the same time as NewTime, so you can use that instead?