Sign in to follow this  
Followers 0
NickO

Citect and using Strings

4 posts in this topic

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);//

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Thanks Sparky, yes string should be STRING, that was me being quick on my post, apologies. Any other input would be appreciated. Cheers Nick

Share this post


Link to post
Share on other sites
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)?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0