Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 VA 2420: To Italic or not italic, 's the question
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Mar 16 2022 :  05:55:41 AM  Show Profile  Reply with Quote
Care to explain that?


In this case, Equals() is one of the .NET methods for Enums. C#, Win7, VS2017, .NET 4.52

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Mar 16 2022 :  06:50:06 AM  Show Profile  Reply with Quote
Already got it. I have many lines like that in this file and can repro this effect on any of them.
Its related to having an error in the expression and then correcting it. Lets recap:
Original code was
if ( Sim.CreditTypeBehaviour.ToString().Equals(CreditTypeBehaviour.AutomobilePrivate.ToString())
  || Sim.CreditTypeBehaviour.ToString().Equals(CreditTypeBehaviour.AutomobileEnterprise.ToString())
  || Sim.CreditTypeBehaviour.ToString().Equals(CreditTypeBehaviour.EquipmentEnterprise.ToString())
  || Sim.CreditTypeBehaviour.ToString().Equals(CreditTypeBehaviour.MortgageLoanEnterprise.ToString()))

(Please ignore the various levels of stupidity in this code, written by an JS coder years ago) Then I edited it to
if ( Sim.CreditTypeBehaviour.Equals(CreditTypeBehaviour.AutomobilePrivate)
  || Sim.CreditTypeBehaviour.Equals(CreditTypeBehaviour.AutomobileEnterprise)
  || Sim.CreditTypeBehaviour.Equals(CreditTypeBehaviour.EquipmentEnterprise)
  || Sim.CreditTypeBehaviour.Equals(CreditTypeBehaviour.MortgageLoanEnterprise)

Notice the missing last closing bracket? Yes, I deleted one too many, thus the line was marked with the squiggly red line, indicating error. Now the erroneous italic started, even after adding the missing bracket, it continues to show the alternating italics on Equals(). After scrolling around the lines get redrawn with correct italics.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19025 Posts

Posted - Mar 18 2022 :  07:52:42 AM  Show Profile  Reply with Quote
Thank you for the update. I was going to ask about scrolling and if it had any effect on this.

The code we used for colouring, and also applying bold and italic is deliberately fast and simple. This is so it can keep up with scrolling and moving through your code at speed, but as a result it is also easier to confuse than a deeper parse, for example Find References. So sometimes a colouring problem will appear that will disappear when you scroll, since that simply causes VA to check and redraw what it thinks is going on, so any changes to the code will be reflected in the colouring.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000