Test for Javascript equality operator - Servoy Editor

Discuss all feature requests you have for a new Servoy versions here. Make sure to be clear about what you want, provide an example and indicate how important the feature is for you

Test for Javascript equality operator - Servoy Editor

Postby Michael Mooney » Thu Jul 26, 2007 11:11 pm

This is simply to rescue me when I have not had enough coffee or can't see the woods for the trees. I recently spent wading through some code for a few hours and lo and behold: I had used a single "=" instead of a "==" (as in if (x ==testvar)). As you might guess I *have* been down this road before ... yes, I do know better :oops: and with all of the attendant variable re-assignment fun of this mistake.

A button or special highlighting to check code for inappropriate (likely) use of the equality operator(s) would be handy.

It's would be one of those little nice-to-have's ... in 4.0 or whenever ...
Michael Mooney
 
Posts: 269
Joined: Thu Apr 12, 2007 2:26 am
Location: Canada

Postby pbakker » Thu Jul 26, 2007 11:14 pm

You do know that if (var x=myfunction()) or if(x=y) is valid code though?

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Michael Mooney » Thu Jul 26, 2007 11:27 pm

Paul,

Sure do ... hence my use of the word "likely". The editor would only suggest that I might have made a mistake (ie - the code could be ok as in your examples). It's just that when one comes from other languages that I am in the habit of using a single '=' so the '==' isn't in my brain as readily :-).

Again, it's definitely in the nice-to-have-category (but only if it will aid the community as a whole ... perhaps it might be a nuisance to other coders).

Michael
Michael Mooney
 
Posts: 269
Joined: Thu Apr 12, 2007 2:26 am
Location: Canada

Postby IT2Be » Thu Jul 26, 2007 11:48 pm

Hmm, would have to be an option and not something fixed.

I use both and would not like to be bothered all the time with a message saying that I may have done something wrong...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany


Return to Discuss Feature Requests

Who is online

Users browsing this forum: No registered users and 13 guests