Follow

Different complex formats to display an address

You can have more control over the way an address is displayed.

Syntax

ad_text(<nAddressID>, [nFormat], ['adresses'], [bNotIncludeContact], [nNamesOrder])

 

Parameters

Description

nAddressID

Address ID (ad_numero or any foreign key of it).

nFormat

Specifies in which format the address has to be returned.

Optional and defaulted to 0 if omitted.

 

The possible formats are:

  0: with telephone information but no fax;

  1: without telephone information;

  2: very short address with no civil title, no contact information, no telephone information;

  3: very long address with also fax, URL, email.

nIncludeContact

If set to .f. and a contact is chosen as address of the document, the information of the contact replace the information of the address.

If set to .t., only the address information are considered.

Optional and defaulted to .f. if omitted.

nNamesOrder

Works exactly like in DocAdr.

Optional and defaulted to 0 if omitted.

Example

*/ Display an address with Civil title, Carriage Return, Last and First Name, 2 lines of address, ZIP code and Town, Telephone. The address displayed is the one with ad_numero that equals the value passed as a parameter.

ad_text(100)

ad_text(ad_numero)

ad_text(do_adr1)

*/ Same as above, but without telephone information. If a contact is chosen, it's considered instead of the address.

ad_text(do_adr1, 1)

ad_text(do_adr1, 0, 'adresses', .f.)

*/ Same as in the first example. If a contact is chosen in the document, it is not taken into consideration at all.

ad_text(do_adr1, 0, 'adresses', .t.)

*/ First Name comes before Last Name. Very detailed address If a contact is chosen in the document, it is not taken into consideration at all.

ad_text(do_adr1, 3, 'adresses', .t., 1)

*/ First Name comes before Last Name. Very detailed address If a contact is chosen in the document, it's considered instead of the address.

ad_text(do_adr1, 3, 'adresses', .f., 1)

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments