Jump to content

Recommended Posts

Posted
Hi Guys, been scratching my head on this one for a while....what do I need to add to _sTagToUse in the TrnGetTable function to get example 2 working the same as example 1 ? Thanks in advance..Nick Example 1 STRING _sDateToUse; STRING _sDateYesterday = ( (TimeToStr(( DateAdd(StrToDate(Date()),2)) - 86400,2))); STRING _sDateToday = ( (TimeToStr(( DateAdd(StrToDate(Date()),2)) - 0,2))); string _sTagToUse; _sDateToUse = _sDateYesterday; TrnGetTable("InletFlow_s",StrToDate(_sDateToUse) + StrToTime("01:00"),1,3600,InletFlowTable1[0],0);//this works Example 2 - doesnt work STRING _sDateToUse; STRING _sDateYesterday = ( (TimeToStr(( DateAdd(StrToDate(Date()),2)) - 86400,2))); STRING _sDateToday = ( (TimeToStr(( DateAdd(StrToDate(Date()),2)) - 0,2))); string _sTagToUse; _sDateToUse = _sDateYesterday; _sTagToUse = "InletFlow_s"; TrnGetTable(_sTagToUse,StrToDate(_sDateToUse) + StrToTime("01:00"),1,3600,InletFlowTable1[0],0);//
Posted (edited)
I don't know anything about Citect. It looks like your declaration of _sTagToUse needs to be capitalized. Like: STRING _sTagToUse = "InletFlow_s"; Your first example defines that variable, but never uses it. I find it odd that a lower case keyword would not work AND not throw an error, but who knows. Everything else looks like it should work the same in both cases. Also, you might be able to simplify your code by not converting back and forth between strings so much. Some of that may have to do with how limited "dates" are versus "times". Edited by Nathan
Posted
Sparky? That must be some kind of forum rank based on posts or something. My name is Nathan. I would call Citect at this point. It makes absolutely no sense to me that the first case would work and the second wouldn't. Have you tried changing the first to the second then back again to the first (testing for non-script, bad copies of objects/windows/etc)?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...