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!

foxpro 2.6 label printing

Status
Not open for further replies.

Shri1979

Technical User
Jul 15, 2003
3
IN
I've have a database consisting fields :name,address, city, state, phone1, phone2. I'm printing label from this database & I want to print phone1 & phone2 as Phone1/phone2
e.g.24960033/4595554
There are cases where phone2 is blank. In such cases the label is printed with phone1/ eg. 24960033/
I want to avoid the slash after phone1 in cases where phone2 is blank. How can I do this in Label printing ?

TIA
Shri
 
I would try:
Varname = phone1 + iif(empty(phone2),"","/") + phone2

G'luck
 
if .not. empty(phone2)
allphone = phone1+"/"+phone2
else
allphone = phone1
endif
** use allphone to print

Ken F
 
If it's a label form, you can use Gilesy's method in the actual field, with 1 minor change:

phone1 + iif(empty(phone2),"","/" + phone2), instead of phone1 + iif(empty(phone2),"","/") + phone2

Or, you can use two separate fields on the label. For the second number, use '/' + phone2 in the 'Expression' text box, and select the 'Print When' box on the Report Expression dialog. In the Print When expression, select the 'Print only when expression is true', and use:
!empty(phone2). It makes it a little tidier I think.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
Thanks for the reply, but I'm sorry for not mentioning that, there are cases where PHONE1 is blank & PHONE2 contains a number. So in such cases it prints /PHONE2. Now I want to check in where there are cases when:-
1)Phone1 & Phone2 are not blank
2)Phone1 is not null & Phone2 is blank
3)Phone1 is blank & Phone2 is not null


TIA
Shri
 
do case
case empty(phone1)=.f. and empty(phone2)=.f.
allphone = phone1+"/"+phone2
case empty(phone1)=.f. and empty(phone2)=.t.
allphone = phone2
case empty(phone1)=.t. and empty(phone2)=.f.
allphone = phone1
endcase
** use allphone to print
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top