SUBROUTINE WRITE_A_NOTE(PARMS) * Write the CONTACTS table rows into a Lotus Notes database * 01/02/95 - BTS - Original release $INSERT NOTES_EQUATES EQUATE CRLF$ TO \0D0A\ Declare Function Msg, CreateNote, SetNoteField, UpdateNote, CloseNote, OpenNotesDB, CloseNotesDB databasename = "C:\NOTES\CONTACTS.NSF" password = '' OPEN "CONTACTS" to FILE_CONTACTS THEN OPEN "DICT.CONTACTS" TO @DICT ELSE X = msg("","File DICT.CONTACTS is not found.") END END ELSE X = msg('',"File CONTACTS is not found.") RETURN END status = OpenNotesDB(databasename) If status ne 1 then x = msg('',"Status = ":status) end DONE = 0 SELECT FILE_CONTACTS LOOP READNEXT @ID ELSE DONE = 1 UNTIL DONE READ @RECORD FROM FILE_CONTACTS, @ID ELSE NULL * create a note (creates an object and returns the key in oinoteid) status = CreateNote(databasename, NOTE_CLASS_DOCUMENT$, oinoteid, password) fieldinfo = "Type" value = "Person" ;* class of note row (like a record type) Gosub SetNote fieldinfo = "FirstName" value = {FIRST_NAME} Gosub SetNote fieldinfo = "LastName" value = {LAST_NAME} Gosub SetNote fieldinfo = "FullName" value = {CONTACT_NAME} Gosub SetNote fieldinfo = "Owner" value = {CONTACT_NAME} Gosub SetNote fieldinfo = "CompanyName" value = {COMPANY_NAME} Gosub SetNote fieldinfo = "Location" value = {CITY_STATE} Gosub SetNote fieldinfo = "JobTitle" value = {TITLE} Gosub SetNote fieldinfo = "OfficePhoneNumber" value = OCONV({COMPANY_PHONE},"[PHONE_FORMAT]") Gosub SetNote fieldinfo = "OfficeFAXPhoneNumber" value = OCONV({FAX},"[PHONE_FORMAT]") Gosub SetNote fieldinfo = "StreetAddress" value = {ADDRESS} ;* LH column is multi-valued Gosub SetNote fieldinfo = "City" value = {CITY} Gosub SetNote fieldinfo = "State" value = {STATE} Gosub SetNote fieldinfo = "Zip" value = {ZIP} Gosub SetNote fieldinfo = "Comment" value = {COMMENTS} ;* LH column is multi-valued swap @TM with " " in value ;* unjustified text in notes db Gosub SetNote status = UpdateNote(oinoteid) REPEAT status = CloseNotesDB(databasename) return SetNote: status = SetNoteField(oinoteid, fieldinfo, value, flags) return