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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display file

Status
Not open for further replies.

hpaul14

Programmer
Feb 24, 2004
3
US
I'm trying to write a program where you have 2 search fields, which is the part number and description. And which ever field I search by should be the first field displayed. How would i fix the display file to display the field i'm searching by
 
In a subfile, you can't directly condition fields. But you can use DSPATR(ND) to not display them. Use the same indicator with the opposite condition for your two fields.


A FIELD1
A 01 DSPATR(ND)
A FIELD2
A N01 DSPATR(ND)


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
You could make the subfile record one long continuous field and just substr the fields into place.

Assuming field1 is 10 chars and field2 is 30 and using rpgiv

if (search on field1)

eval %subst(subrec:1)=field1
eval %subst(subrec:12)=field2

else

eval %subst(subrec:1)=field2
eval %subst(subrec:31)=field1

endif

If outputting a numeric field use the %char/%editw/%editc bif's.

eval %subst(subrec:1)=%editw(field1:"0 / / ")


--------------------------------
Codito, ergo sum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top