Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set conditionaly field format on a screen

Status
Not open for further replies.

Phil6972

Programmer
Nov 20, 2003
7
FR
Hello,
I'm using Fpw26.
On a .SCX screen, is it possible to set the field format (font, background color) according to a parameter.
If it's not possible, what is the best way to do so...

(I'm french...)

Thanks
 
Phil,
It is possible, but a bit convaluted. Haven't done it in ages. There are a few ways. Best is to either utilize an existing scheme, or with color pairs. There are 10 pairs that correspond to various states. X/X is black. I don't remember the pairings off the top of my head, but do a search in the help file for color pairs, and it should point you in the right direction.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Thank you Scott,
But I would like to find a solution inside the .SCX and not in the .SPR file; because everytime I will change my screen and generate my project, my updates will be erased.
 
I use FP 2.6 but don't do what you want to do.

However, I set up my SCXs to automatically intialize all field variables used by the SCX by adding the code to the SCREEN LAYOUT SETUP SNIPPET. I never have errors anymore related to field variables that I forgot to initialize. If I add/delete fields in the SCX, I never need to remember to initialize the variable for that field. And, of course, I never lose the code since I never modify the SPR.

Similarly, you should be able to somehow do what you want to do in the same snippet, although I personally don't know how to make it work.

I would add some of your code to the end of the setup snippet and then play with it to see if you can solve your problem.


mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top