Comfort  Automation/ Security System Forums Home
Home Search search Menu menu Not logged in - Login | Register
Comfort Automation/ Security System Forums > Software Applications > Comfigurator > Comfigurator 2.X > Small problem with If statement in Comfigurator 2.1.0

Small problem with If statement in Comfigurator 2.1.0
 Moderated by: admin
 New Topic   Reply   Printer Friendly 
 Rate Topic 
AuthorPost
 Posted: Tuesday Nov 28th, 2006 05:38 am
   PM  Quote  Reply 
1st Post
lms
Member
 

Joined: Monday Aug 7th, 2006
Location: Durban, South Africa
Posts: 45
Status: 
Offline

  back to top

Not a major issue, but this one had me going for a while until I realised I had made a stupid mistake...

The Edit Response Manually option allows the following syntax:

If Counter001 = 1 Then
......

This should obviously be:

If Counter Counter001 = 1 Then
......

Comfigurator accepts this, but the system appears to always resolve the statement as false.

Hope this will save someone else the hours that I've wasted!

I must also say that, despite the furstrations of non-alphabetic order and such, which have already received coverage, G2 and Comfigurator 2.1.0 is vastly superior to the old setup. I have been able to do quite complex things with the new system, which really gave me some frustrating times previously. So, well done to Cytech!



 Posted: Saturday Dec 2nd, 2006 05:13 am
   PM  Quote  Reply 
2nd Post
slychiu
Administrator


Joined: Saturday Apr 29th, 2006
Location: Singapore
Posts: 5524
Status: 
Offline

  back to top

When I try this, Comfigurator flags an error.
I am using a new beta vetsion 2.1.1, so there may be more syntax checking implemented
When it is released try it agin and let us know



 Posted: Saturday Dec 2nd, 2006 02:40 pm
   PM  Quote  Reply 
3rd Post
lms
Member
 

Joined: Monday Aug 7th, 2006
Location: Durban, South Africa
Posts: 45
Status: 
Offline

  back to top

Hi Chiu:

Thanks for your response and apologies for leaving out the word "sometimes" in my original post!

I've spent hours trying to repeat the problem, but have not been able to do so. Was starting to think that I'd lost my head :shock::(:D, when I found another strange problem, this time with the "If Flag" statement - see "problem 2" below. Am trying to tackle this one in a step-by-step and more scientific way!

But first, some more about the "Counter" problem. When I leave the "Counter" word out, it DOES complain about the syntax and I've been unable to repeat the problem. But I found four or five instances in my code where the word had been left out. These instances were found during different editing sessions, meaning that the ccl was loading "successfully" into Comfigurator. Also, the only way it could have been originally coded without the "Counter" is in Comfigurator as I've not edited the ccl outside of Comfigurator. (I've also just done a test using a text editor - Comfigurator DOES complain about the syntax on loading the file!)

When this first occurred, I had spent hours looking for a problem in my code when a response wasn't behaving as expected. I had opened and closed this particular response numerous times while making small unrelated changes in trying to debug the problem, and then, on one occasion, on clicking OK, Comfigurator suddenly complained about the syntax! I assumed that I had made the error previously. But I was more concerned about how this could have happened in the first place and why Comfigurator hadn't complained when loading the file! I have had a few instances where Comfigurator (or maybe some external influence?) has completely corrupted a ccl from a certain point onwards on saving the file so I do feel that there may be some obscure bugs somewhere (as they say, there's always one more bug!:)). But this wasn't a complete or random corruption - it's a very subtle, specific occurrence. If it happens again, I'll try to be more exact with my observations.


Problem 2:

Didn't save a copy of the ccl with the "Counter" problem, so, hoping I had some more instances of this which I could investigate in more detail, I've just searched through the ccl with a text editor to check all the "If ..." statements and found the following:

"If Flah flagname Then"

Yes, that's an "h" instead of a "g" in "Flag". Comfigurator loads the ccl without complaints. If I make an unrelated change to the response containing the "Flah", thereby forcing a syntax check(?), the response is saved silently. Guessing that the syntax checker may only be checking the first 3 characters or something like that, I then changed a later Flag statement in the same response to Flah - the syntax checker complained. I also changed "Flag" to "Flah" in another response - the syntax checker also complained!! I then created a new response and cut & pasted from the "Flah" response into the new one - NO complaints from the syntax checker! Have also edited the Flah to Flag, saved the response, opened it again, changed Flag back to Flah - NO complaints!:?

Right now I don't have the time to do further checks nor test whether the statement works as expected or not - will do this when I can and report back - unless you beat me to it and find the problem!

Comfigurator 2.1.1 beta?!?! When can I have it?:)

Regards,
Leon



 Posted: Monday Dec 4th, 2006 07:53 am
   PM  Quote  Reply 
4th Post
malgre
Member
 

Joined: Wednesday Aug 9th, 2006
Location: United Kingdom
Posts: 8
Status: 
Offline

  back to top

Both these problems were caused by a syntax checking error in the response compilation process, and will be fixed in the forthcoming beta version.  Thanks for reporting these.

Malcolm Green



 Current time is 10:42 am
Comfort Automation/ Security System Forums > Software Applications > Comfigurator > Comfigurator 2.X > Small problem with If statement in Comfigurator 2.1.0
Top




UltraBB 1.172 Copyright © 2007-2014 Data 1 Systems