Normal Topic @Color, Color of element remains on advancing rec. (Read 977 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
@Color, Color of element remains on advancing rec.
Apr 26th, 2007 at 5:21pm
Print Post Print Post  
@Color (element, Fc, Bc), it changes color of the element but when you advance  to next record in result set, the color still remains. I tried this out even with sample database and behaves the same way. As per documentation the color change should remain effective only until you leave record.

There is no reset color command available. I guess one can use "else statement and reset the color but as per documentation it is not required. 

Bharat
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: @Color, Color of element remains on advancing
Reply #1 - Apr 26th, 2007 at 7:33pm
Print Post Print Post  
I think that is a mistake in the docs as a holdover from the behavior in Q&A.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @Color, Color of element remains on advancing
Reply #2 - Apr 26th, 2007 at 7:44pm
Print Post Print Post  
Does that mean, I have to reset the color using code?
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: @Color, Color of element remains on advancing
Reply #3 - Apr 26th, 2007 at 7:59pm
Print Post Print Post  
Bharat_Naik wrote on Apr 26th, 2007 at 7:44pm:
Does that mean, I have to reset the color using code?


If you set it using code.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @Color, Color of element remains on advancing
Reply #4 - Apr 26th, 2007 at 8:05pm
Print Post Print Post  
Is there any code to find out current foreground and background color for any element? This help to reset the color to the original after the condition that prompted the code is taken care of.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: @Color, Color of element remains on advancing
Reply #5 - Apr 26th, 2007 at 8:10pm
Print Post Print Post  
If you are in 1.x you have to retain the color you set it to in SDesigner. If you are in 2.0 there are several ways to do this, most particularly using the attribute stack and the push and pop attribute commands.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @Color, Color of element remains on advancing
Reply #6 - Apr 27th, 2007 at 4:32am
Print Post Print Post  
Code
Select All
If Ins1 = "P" then
   {
	vString = RecNumber
	Check_Medicaid ( )
	    If vValidityTest = "Failed" then
		{
		    Notifyform (1)
		    @Color (RecNumber, 4, 14)
		    @Color (Ins1, 4, 14)
		    //Clear (Ins1)
		   // ThrowFocus (RecNumber)
		    @MsgBox ("Check Recipient#", "Medicaid Number is not Proper", "Correct Insurance if Needed, Record cannot be saved!!!")
		}
		    Else
		{
			vValidityTest = "Passed"
			RGBColor (RecNumber, 0,0,0,255,255,255)
			RGBColor (Ins1, 0,0,0,255,255,255)
			Notifyform (-1)

		}

   }
  Else
   {
	vValidityTest = "Passed"
	RGBColor (RecNumber, 0,0,0,255,255,255)
	RGBColor (Ins1, 0,0,0,255,255,255)
	Notifyform (-1)

   }

 



Using Else statement resetting original colors on exit form event will solve the problem as in the above code.  The color was set to draw attention of certain condition on exit form event.  RBGColor ( ) command is much better than @Color ( ).  One can get the RGB value from the property Viewer for various colors.

Changing the documentation in the Programming Guide need to be taken care of.  I understand since we are moving to version 2.0 in near future it is by no means high priority work.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @Color, Color of element remains on advancing
Reply #7 - Apr 27th, 2007 at 11:50am
Print Post Print Post  
Bharat_Naik wrote on Apr 27th, 2007 at 4:32am:
Changing the documentation in the Programming Guide need to be taken care of.  I understand since we are moving to version 2.0 in near future it is by no means high priority work.


This correction already appears in the Errata document that ships with each new copy of Sesame.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged