Link to home
Create AccountLog in
Avatar of BulldogMike
BulldogMikeFlag for United States of America

asked on

Lotus Notes - Hiding and Coding Problem

What is the best way to approach this problem:  I have a series of 30 fields that I want to display (print) on a form in the following format::  data comma 3 spaces  repeat.  The design requests components to display as follows.  I need to hide the commas for blank data fields [and also remove the final comma after the last item - later].  

NEXIUM 20MG,   NEXIUM 40MG,   LEXAPRO TAB 10MG,   IMITREX TAB 50MG,   PHENTERMINE CAP 30MG,   EFFEXOR XR CAP 150MG,   LOVENOX(#1)SYN 40/0.4ML,  

If I use one field per line my coding works OK
   
NEXIUM 20MG,  
NEXIUM 40MG,  
LEXAPRO TAB 10MG,  
IMITREX TAB 50MG,  
PHENTERMINE CAP 30MG,  
EFFEXOR XR CAP 150MG,  
LOVENOX(#1)SYN 40/0.4ML,    

But, Notes get confused when I try to hide multiple fields on the same line.  Notes assigns the same coding to each field on the line.  
If, the following components share the same line.  

PXD_DGH_NM1     PXD_DGH_NM2       PXD_DGH_NM3     PXD_DGH_NM4

If I code PXD_DGH_NM1 in the object properties to hide when PXD_DGH_NM1 = “ “ then Notes assigns the same coding to all four fields on this line.  If I change the coding for  PXD_DGH_NM2 to PXD_DGH_NM2 = “ “ it will assign PXD_DGH_NM2 = “ “ to all four fields.  I have set the “Hide paragraph if formula is true” checkbox to OFF for each field.

The coding to display the data, comma and spaces for each field needs refining. For example, I have set the Default Value for PXD_DGH_NM1 to  PXD_DGH_NM1 + “,   ”      -  It seems like this should work however the data displays without the comma for fields with data and for empty fields it display the comma which should be hidden – go figure.  Please advise  
 

Thank You
 
BulldogMike
ASKER CERTIFIED SOLUTION
Avatar of Sam654
Sam654
Flag of Australia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
To remove the separator from the end:
res := 	@If( field_1 = "" ; "" ; field_1 + ",   " ) +
	@If( field_2 = "" ; "" ; field_2 + ",   " ) +
	@If( field_3 = "" ; "" ; field_3 + ",   " );

@LeftBack( res; 4 )

Open in new window

SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Oh, and read up on lists in Designer help.  Both in Formula Language and in LotusScript.  Very different constructs in the two environments, but very VERY useful in both!!
Avatar of BulldogMike

ASKER

Sam was right on target. Lars your comments were helpful since I am a nonprofessionally trained novice programmer.  My problem is syntax and lack of practical examples to work with.  I can figure it out from the examples.  Sief's idea was interesting but didn't work for me they way I need it to.

Thanks to all