Command Parameter Formats

4D Internet Commands

Parameter Formats

version 6.8.1 (Modified)


The descriptions that follow provide details on the meaning and formatting of many key parameters used throughout this manual.

ParameterTypeDescription
hostNameStringHost name (Ex: "www.companyname.com")
IP address (Ex: "204.118.90.2")
ip_LongIntLongIntLong Integer reference to a IP address
mailAddressTextEx: "[email protected]"
addressListTextEx: "[email protected], [email protected]" or
"[email protected]"+Char(13)+"[email protected]"
localPathText- Document
Mac: "My Hard Drive:4DDB:SalesDB:Report"
Win: "C:\MyDrive\4DDB\SalesDB\Report.txt"
- Directory
Mac: "My Hard Drive:CoolStuff:" (Note trailing ":")
Win: "C:\MyDrive\CoolStuff\"
hostPathText- Document
"/usr/jsmith/reports/salesreport.txt"
- Directory
"/usr/jsmith/reports/"(Note trailing "/")
tcp_IDLongIntReference to an open TCP session
smtp_IDLongIntReference to a new mail message
pop3_IDLongIntReference to an open POP3 session
imap_IDLongintReference to an open IMAP connection
ftp_IDLongIntReference to an open FTP session

Function result Integer Error Code

hostName

The hostName is the host name or IP address, such as "dns.4d.com" or "204.118.90.2". Host names are resolved through a domain name system. The default and secondary domain name systems are typically set within the Control Panel of the installed TCP/IP driver. Any 4D Internet command requiring a hostName as a parameter will accept its value in either the name ("www.4d.com") or IP address ("204.118.90.2") format. The "name" format is always preferred since it buffers your application from ill effects due to hardware changes at remote sites.

ip_LongInt

All host names can be resolved via the methods described above to an IP address. Mathematical formulas can then be applied to the IP address to convert the value to a unique long integer number. Commands within the 'Special Functions' section such as NET_NameToAddr and NET_AddrToName automate this conversion process. This LongInt value is referred to as the ip_LongInt throughout this documentation. The LongInt value will only be of use in special circumstances by developers doing direct TCP communication. Some developers may also prefer to store the LongInt value of a domain name in order to conserve disk space compared to its string equivalent. However, for compatibility reasons with IPV6, 4D advises developers against using this feature.

mailAddress

The MailAddress is a fully qualified mail specification in the format "user_name@domain_name". Within this document, mailAddress refers to a single e-mail address. Any 4D Internet Commands parameter which can take more than one address will specifically state addressList. If a parameter has mailAddress as its only type, it can take one and only one mail address. The format of the mailAddress should be a full reference containing both the user name and domain name:

"Felix Unger" <[email protected]>
[email protected] (Oscar Madison)

addressList

An addressList contains one or more e-mail addresses in the format of mailAddress, each delimited by a comma or carriage return. Carriage return delimiting is useful when providing users with a text field to enter or paste a number of addresses. The following three examples would each generate an acceptable $AddressList value:

   $AddressList:="[email protected]"

   $AddressList:="[email protected],[email protected],[email protected]"

   For ($i;1;Size of Array(aAddresses))
      $AddressList:=$AddressList+aAddresses{$i}+Char(13)
   End For 

localPath

The localPath is the location of a file or directory on the users machine (Mac or Windows). On a Macintosh, colons delimit items within folders. For example, the file "My Report" in the "Reports" folder on the hard drive titled "My Hard Drive" would have a pathname of "My Hard Drive:Reports:My Report". A directory specification on a Macintosh should end with a colon character. For example, if you wanted to place a new report in the same folder as the above example, you would refer to the directory as "My Hard Drive:Reports:". The decision to reference a File or Directory name is based on the context called for by the command. A similar format is used under the Windows environment, except a backward slash "\" is used in place of the colon character.

hostPath

The hostPath is the location of a file or directory on a computer running under the Unix operating system. In the Unix environment, directories are separated with slashes ("/"). For example, the file "report.txt" in the "reports" directory in the "4D" directory would be specified as "/4D/reports/report.txt". A directory pathname should end with a "/" character. Note that a full pathname begins with a "/" which represents the root of the volume.

smtp_ID, pop3_ID, imap_ID, ftp_ID, tcp_ID

Throughout each section of 4D Internet Commands, references are made to an "ID" number in most of the commands. Each set of communication functions will establish their own "session" represented by a Long Integer "ID" number. Subsequent commands related to the open session will use this value to direct their effects down the proper channel.

The "ID" numbers obtained in each section (SMTP, POP3, IMAP, FTP, TCP) may not be passed as values to different sections. For instance, an FTP session identified by a ftp_ID variable cannot be passed to the TCP routines for any special processing.

Session ReferenceOpened byClosed by
tcp_IDTCP_Open or TCP_ListenTCP_Close
smtp_IDSMTP_NewSMTP_Clear
pop3_IDPOP3_LoginPOP3_Logout or POP3_VerifyID
imap_IDIMAP_LoginIMAP_Logout or IMAP_VerifyID
ftp_IDFTP_LoginFTP_Logout or FTP_VerifyID

Function result

All 4D Internet Commands (with the exception of IT_ErrorText & IT_Version) return an integer value as the result of the function. This integer contains any error number that the command needs to convey back to the 4D database.

If a command is successful, a zero will be returned. Else, an error code is returned. For more information about 4D Internet Commands error codes, please refer to Appendix C, 4D Internet Commands Error codes.