AS400 RPG DSPF字符级别颜色更改 [英] AS400 RPG DSPF Character Level Color Change
问题描述
我想更改子文件中字段中各个字符的颜色.
I want to change the color of individual characters in a field in a subfile.
斯科特·劳伦斯
约翰·史密斯
SCOTT LAWRENCE
JOHN SMITH
我喜欢将SCOTT中的CO显示为红色,而SMITH中的MI显示为红色,所有其他字符均为绿色.能做到吗?我很难在单个字符级别而不是在DSPF中的字段级别找到DSPATR.基本上,我想在子文件中以不同颜色在具有CO和MI值的字段中显示字符.
I like to show CO in SCOTT as RED color and MI in SMITH in RED color and all other character is GREEN. Can this be achieved ? I am having hard to finding a DSPATR at the individual character level instead of field level in the DSPF. Basically, I want to show characters in a field having values CO and MI in a subfile in a different color.
推荐答案
如果您的"NAME"字段为固定长度的10个字符,则可以创建一个数据结构 每个字符...
if your "NAME" field is a fixed length 10 characters, you'd make a data structure for each character...
DS 1 10名
1 1 Name1
2 2 Name2 ... etc.
然后,您将使用输入名称SMITH加载NAME. 该名称分为几个字段. 彼此相邻使用10个显示字段&定义它们将是什么颜色. 使用您的DS字段加载屏幕字段SName1 = Name1 SName2 = Name2 用您选择的颜色显示字段. SName1 SName2 SName3 .....
Then you'd load NAME with your input name SMITH. The name breaks down into individual fields. Use 10 display fields next to each other & define what color they would be. Load the screen fields with your DS fields SName1 = Name1 SName2 = Name2 Display the fields with colors you selected. SName1 SName2 SName3 .....
这篇关于AS400 RPG DSPF字符级别颜色更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!