Address Book (again)

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4749
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Address Book (again)

Post by Fangbeast »

PB wrote:> Because I got no feedback from the 130 people who dowloaded my app [...]

Remember the old saying: No news is good news. :)

Your new screenshot looks great. All your apps have always looked good to me.
I personally don't need an address book... my wife has all contact info in a real
paper book, which she can take everywhere in her handbag. :) I do have Office,
with some people's e-mail addresses in it, but I don't use it to look up physical
addresses or anything.
Actually, to adress your points in order (evil grin)..

1. 'No news' actually leaves you in limbo, there's nowhere to go from there!
2. Screenshots are ordinary but I am a bad interface designer. Oh well.
3. Wives can organise anything. They are scary!! And the only reason blokes have computers is because we need to salve our manly pride by tring to do things for ourselves. (even bigger evil grin).
4. Office as in Microslothy Orifice? Can't afford it.
5. "don't use it to look up physical
addresses". no, you have a wife who organises you (ROFLMAO).

In this house there are 2 palmpilots, 4 computers, 6 mobile phones and 2 micro elecronic organisers. (We won't even mention the many trees that were sacrificed to keeps scraps of paper around here with dribs and drabs of numbers, addresses, details etc!) It was a flamin nightmare trying to keep them all updated. Strewth, Even the wife couldn't cope (but don't tell her I said that for heaven's sake!!!). Now I keep everything updated in one program only and export the addresses to various places/devices etc. Whew!!
Amateur Radio, D-STAR/VK3HAF
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4749
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Address Book (again)

Post by Fangbeast »

Hells brazen bells and bronze hinges!!! Did I really start this in 2006???

I've just finished the 20'th rewrite of my address book program in pb5.31 and am very happy with the result. Only a few minor things left to do. Nearly up to 30,000 lines including spaces and formatting.

Clean, tidy and commented as much as I was able. I still can't believe the crappy code I used to put out back then (even now!! snigger).

After 30 odd years of doing things for people their way, I did it the way I wanted. If anyone wants a copy of the project, I'll find somewhere to uploaded.

If not, I'll go play with my wife:):):)
Amateur Radio, D-STAR/VK3HAF
jack
Addict
Addict
Posts: 1337
Joined: Fri Apr 25, 2003 11:10 pm

Re: Address Book (again)

Post by jack »

hello Fangbeast
I would like to try your Address Book, I need to organize addresses of all my relatives. :)
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4749
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Address Book (again)

Post by Fangbeast »

jack wrote:hello Fangbeast
I would like to try your Address Book, I need to organize addresses of all my relatives. :)
It's nice and simple, like me. The help pages aren't done and I haven't finished the _recovertables.pbi module but everything else is ready.

Where do you want me to send the source project?

And promise not to laugh:):)
Amateur Radio, D-STAR/VK3HAF
jack
Addict
Addict
Posts: 1337
Joined: Fri Apr 25, 2003 11:10 pm

Re: Address Book (again)

Post by jack »

I will pm you my email address.
jack
Addict
Addict
Posts: 1337
Joined: Fri Apr 25, 2003 11:10 pm

Re: Address Book (again)

Post by jack »

thank you Fangbeast
I had a quick look and the appearance looks nice, I especially like the icons.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4749
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Address Book (again)

Post by Fangbeast »

jack wrote:thank you Fangbeast
I had a quick look and the appearance looks nice, I especially like the icons.
I think the colours are horrible but suit my bad eyes. I take eye pressure drops and have deteriorated a bit over the years, that's why the fonts, colours and buttons.

Many people hate large buttons, my daughter hates the font, I can't seem to win.

But, I like it!

After 30 years of doing what people wanted and not making sales, I now make things the way I want them.

Got a lot of help from good people in the forum to get this far and this code works all the way up to Windows 10 so I am very happy.

And being source code, you can change what you want and add to it. There are still a few things left that I need to do when I have time.

If you have any suggestions other than "Go away", let me know:)
Amateur Radio, D-STAR/VK3HAF
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4749
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Address Book (again)

Post by Fangbeast »

Jack, any bugs that need fixing?

I'm just clearing up some dialogs at the moment and adding ENTER to edit a record. Tried to add as many keyboard shortcuts and menu options for people who have sore wrists (like me) from years of mouse work.
Amateur Radio, D-STAR/VK3HAF
jack
Addict
Addict
Posts: 1337
Joined: Fri Apr 25, 2003 11:10 pm

Re: Address Book (again)

Post by jack »

Hi Fangbeast, hope you are doing well
everything is working ok, will study your program a little later. :)
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4749
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Address Book (again)

Post by Fangbeast »

For anyone interested. Updates:17/07/2015

ADDED::

1. Added the help window search cue text.
2. Added the RETURN key to start searches in the shortcuts for all missing shortcuts.
3. Added two extra categories to the contacts dropdown with icons, amateur and other.
4. Added LeftDoubleClick on the data window photo to add a new photo, RightDoubleClick to clear the current photo.

CHANGED::

1. Pressing RETURN used to run the search routine. Now, the module checks to see which gadget has the focus before doing anything after RETURN:

a. If category list, current category enters edit mode.
b. If title list, current title enters edit mode.
c. If search box, addresses are searched.
2. Resized the contact type column to show the full text of the description.
3. Updated the category count in the category list. One time code.
4. The dymo label print dialogue is formatted a lot better to represent the label.

FIXED::

1. Added the missing shortcuts for the help screen. No wonder they kept disappearing!
2. Fixed the help procedure names that were different to the others. Commented or not, they were different.
3. Fixed the transparency on the help window options.
4. Fixed missing child parameters for some of the windows.
5. Added missing references to help window printing.
6. Fixed the forgotten background colour of the help screen.
7. Category list correctly updates the count each time a record is added, deleted or changed.
8. Fixed the display of the current record number in the statusbar.
Amateur Radio, D-STAR/VK3HAF
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4749
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Address Book (again)

Post by Fangbeast »

Since I just got a hold of a Brother QL-700 label printer (My Dymo labeller died), I had to write a small program to convert my address book to a CSV file that the Brother P-Touch Address book could import, so here it is.

I already provided very basic label support for the Dymo in this program (no size detection, just a straight print with template per user with whatever label size that is in the thing at the time), I am looking to add the Brother labeller support at some stage.

Code: Select all

;==============================================================================================================================================================================
; Use the SQLite database backend
;==============================================================================================================================================================================

UseSQLiteDatabase()                                                                                   ; 

;==============================================================================================================================================================================
; My personal constants
;==============================================================================================================================================================================

#Basename                       = "Address Book  "                                                    ; Base name for ini and dataabse
#Version                        = "v0.00 beta"                                                        ; Program version
#Program                        = #Basename + #Version                                                ; Copyright string

;==============================================================================================================================================================================
; Program data structure for where contents change
;==============================================================================================================================================================================

Structure ProgramData
  CurrentRecord.s                                                                                     ; Currently selected record
  ; Database details
  DatabaseName.s                                                                                      ; Local database name
  DatabaseDirectory.s                                                                                 ; Local database directory
  DatabaseHandle.i                                                                                    ; Opened database handle
  ; Directories
  CurrentDirectory.s                                                                                  ; Current working directory
  ; File stuff
  CSVOutputFile.s                                                                                     ; CSV data output file handle
EndStructure                                                                                         ; 

;==============================================================================================================================================================================
; Address database fields (Might change)
;==============================================================================================================================================================================

Structure AddressData                                                                                ; 
  Title.s       ; 	Titlename					               0	; Addresses
  FirstName.s   ; 	Firstname					               1	; Addresses
  MiddleName.s  ; 	Middlename				               2	; Addresses
  LastName.s    ; 	Lastname					               3	; Addresses
  Suffix.s      ; 							                     4	; Addresses
  Company.s     ; 	Business (Or Medical)				     5	; Addresses
  Department.s  ; 							                     6	; Addresses
  Office.s      ; 							                     7	; Addresses
  JobTitle.s    ; 							                     8	; Addresses
  Street.s      ; 	Pobox + Street + Suburb				   9	; Addresses
  City.s        ; 	City						                10  ; Addresses
  County.s      ; 	State						                11	; Addresses
  PostCode.s    ; 	Postcode					              12	; Addresses
  Country.s     ; 	Country						              13	; Addresses
  
  Phone.s       ; 	Work phone Or Home phone)		    14	; Contacts
  Mobile.s      ; 	Work mobile Or Home mobile)	    15	; Contacts
  Fax.s         ; 	Work fax Or Home fax)		        16	; Contacts
  Email.s       ; 	Work email Or Home email)		    17	; Contacts
  URL.s         ; 	Work web page Or Home web page)	18	; Contacts
  
  PrintCount.s  ; 	0						                    19	; Other
  LastDate.s    ; 	10/06/2016 10:20:37 PM				  20	; Other
  Custom1.s     ; 							                    21	; Other
  Custom2.s     ; 							                    22	; Other
  Custom3.s     ; 							                    23	; Other
  Custom4.s     ; 							                    24	; Other
  
  Notes.s		    ; Comment						                25	; Addresses
EndStructure

;==============================================================================================================================================================================
; Contact data fields
;==============================================================================================================================================================================

Structure ContactData                                                                                ; 
  contactid.s                                                                                         ; 
  contacttype.s                                                                                       ; 
  contactdetails.s                                                                                    ; 
  recordid.s                                                                                          ; 
EndStructure

;==============================================================================================================================================================================
; Global definitions
;==============================================================================================================================================================================

Global Program.ProgramData                                                                           ; All my program variables
Global Address.AddressData                                                                           ; Basic address data
Global Contact.ContactData                                                                           ; Numbers associated with an address

;==============================================================================================================================================================================
; Get working directory variables set up
;==============================================================================================================================================================================

Program\CurrentDirectory    = GetCurrentDirectory()                                                    ; 
Program\DatabaseDirectory   = Program\CurrentDirectory + "Database\"                                   ; 

;==============================================================================================================================================================================
; Create your working file names
;==============================================================================================================================================================================

Program\DatabaseName        = Program\DatabaseDirectory + ReplaceString(#Basename, " ", "_") + #Version  +  ".sqlite"
Program\CSVOutputFile       = Program\CurrentDirectory  + ReplaceString(#Basename, " ", "_") + #Version  +  ".csv"

;==============================================================================================================================================================================
; Kill double quotes in strings for display purposes
;==============================================================================================================================================================================

Procedure.s KillQuote(Instring.s)
  
  ProcedureReturn ReplaceString(Instring.s, "''", "'", 1, 1)
  
EndProcedure

;==============================================================================================================================================================================
; Open or create the stystem database and create any needed tables
;==============================================================================================================================================================================

Procedure OpenSystemDatabase()
  
  ;------------------------------------------------------------------------------------------------
  ; 
  ;------------------------------------------------------------------------------------------------
  
  Protected.s DatabaseUpdate.s
  
  Protected.i FileHandle.i 
  
  ;------------------------------------------------------------------------------------------------
  ; 
  ;------------------------------------------------------------------------------------------------
  
  FileHandle.i = OpenFile(#PB_Any, Program\DatabaseName)
  
  ;------------------------------------------------------------------------------------------------
  ; 
  ;------------------------------------------------------------------------------------------------
  
  If FileHandle.i <> 0
    
    ;----------------------------------------------------------------------------------------------
    ; 
    ;----------------------------------------------------------------------------------------------
    
    CloseFile(FileHandle.i)
    
    ;----------------------------------------------------------------------------------------------
    ; 
    ;----------------------------------------------------------------------------------------------
    
    Program\DatabaseHandle = OpenDatabase(#PB_Any, Program\DatabaseName, "", "", #PB_Database_SQLite)
    
    ;----------------------------------------------------------------------------------------------
    ; 
    ;----------------------------------------------------------------------------------------------
    
    If Program\DatabaseHandle
      
      ;--------------------------------------------------------------------------------------------
      ; 
      ;--------------------------------------------------------------------------------------------
      
    Else
      
      Debug "There was a serious problem attempting to connect to " + #BaseName + #Version + " system database. Could be corrupt or open by some other process."
      
    EndIf 
    
    ;----------------------------------------------------------------------------------------------
    ; 
    ;----------------------------------------------------------------------------------------------
    
  Else
    
    Debug "Could not open or create raw database file."
    
  EndIf
  
  ;------------------------------------------------------------------------------------------------
  ; 
  ;------------------------------------------------------------------------------------------------
  
EndProcedure

;==============================================================================================================================================================================
; 
;==============================================================================================================================================================================

Procedure ExportToBrotherLabeller()
  
  ;------------------------------------------------------------------------------------------------
  ; 
  ;------------------------------------------------------------------------------------------------
  
  NewList AddresRecordId.s()
  
  ;------------------------------------------------------------------------------------------------
  ; 
  ;------------------------------------------------------------------------------------------------
  
  DatabaseQuery.s = "SELECT Recordid FROM Addresses"
  
  If DatabaseQuery(Program\DatabaseHandle, DatabaseQuery.s)
    
    While NextDatabaseRow(Program\DatabaseHandle)
      
      AddElement(AddresRecordId.s())
      
      AddresRecordId.s()  = GetDatabaseString(Program\DatabaseHandle,  0)
      
    Wend
    
    FinishDatabaseQuery(Program\DatabaseHandle)
    
  EndIf
  
  ;------------------------------------------------------------------------------------------------
  ; 
  ;------------------------------------------------------------------------------------------------
  
  If ListSize(AddresRecordId.s())
    
    ;----------------------------------------------------------------------------------------------
    ; 
    ;----------------------------------------------------------------------------------------------
    
    CSVOutputFileId.i = CreateFile(#PB_Any, Program\CSVOutputFile)
    
    ;----------------------------------------------------------------------------------------------
    ; 
    ;----------------------------------------------------------------------------------------------
    
    If CSVOutputFileId.i <> 0
      
      ;--------------------------------------------------------------------------------------------
      ; 
      ;--------------------------------------------------------------------------------------------
      
      WriteString(CSVOutputFileId.i, "Title,First Name,Middle Name,Last Name,Suffix,Company,")
      
      WriteString(CSVOutputFileId.i, "Department,Office,Job Title,Street,City,County,Post Code,")
      
      WriteString(CSVOutputFileId.i, "Country,Phone,Mobile,Fax,E-mail,URL,Print Count,Last Date,")
      
      WriteStringN(CSVOutputFileId.i, "Custom1,Custom2,Custom3,Custom4,Notes")
      
      ;--------------------------------------------------------------------------------------------
      ; 
      ;--------------------------------------------------------------------------------------------
      
      ForEach AddresRecordId.s()
        
        ;------------------------------------------------------------------------------------------
        ; 
        ;------------------------------------------------------------------------------------------
        
        DatabaseQuery.s = "SELECT Titlename, Firstname, Middlename, Lastname, Business, "
        
        DatabaseQuery.s + "Medical, Pobox, Street, Suburb, City, State, Postcode, Country, "
        
        DatabaseQuery.s + "Comment "
        
        DatabaseQuery.s + "FROM Addresses "
        
        DatabaseQuery.s + "WHERE Recordid = '"  + AddresRecordId.s()  + "'"
        
        ;------------------------------------------------------------------------------------------
        ; 
        ;------------------------------------------------------------------------------------------
        
        If DatabaseQuery(Program\DatabaseHandle, DatabaseQuery.s) <> 0
          
          ;----------------------------------------------------------------------------------------
          ; 
          ;----------------------------------------------------------------------------------------
          
          While NextDatabaseRow(Program\DatabaseHandle) <> 0
            
            ;--------------------------------------------------------------------------------------
            ; 
            ;--------------------------------------------------------------------------------------
            
            Title.s       = KillQuote(GetDatabaseString(Program\DatabaseHandle,  0))
            
            Firstname.s   = KillQuote(GetDatabaseString(Program\DatabaseHandle,  1))
            
            Middlename.s  = KillQuote(GetDatabaseString(Program\DatabaseHandle,  2))
            
            Lastname.s    = KillQuote(GetDatabaseString(Program\DatabaseHandle,  3))
            
            Business.s    = KillQuote(GetDatabaseString(Program\DatabaseHandle,  4))
            
            Medical.s     = KillQuote(GetDatabaseString(Program\DatabaseHandle,  5))
            
            Pobox.s       = KillQuote(GetDatabaseString(Program\DatabaseHandle,  6))
            
            Street.s      = KillQuote(GetDatabaseString(Program\DatabaseHandle,  7))
            
            Suburb.s      = KillQuote(GetDatabaseString(Program\DatabaseHandle,  8))
            
            City.s        = KillQuote(GetDatabaseString(Program\DatabaseHandle,  9))
            
            State.s       = KillQuote(GetDatabaseString(Program\DatabaseHandle, 10))
            
            Postcode.s    = KillQuote(GetDatabaseString(Program\DatabaseHandle, 11))
            
            Country.s     = KillQuote(GetDatabaseString(Program\DatabaseHandle, 12))
            
            Comment.s     = KillQuote(GetDatabaseString(Program\DatabaseHandle, 13))
            
            ;--------------------------------------------------------------------------------------
            ; 
            ;--------------------------------------------------------------------------------------
            
            Address\Title.s       = Title.s
            
            Address\FirstName.s   = Firstname.s
            
            Address\MiddleName.s  = Middlename.s
            
            Address\LastName.s    = Lastname.s
            
            Address\Suffix.s      = ""
            
            Address\Company.s     = Trim(Medical.s + " "  + Business.s)
            
            Address\Department.s  = ""
            
            Address\Office.s      = ""
            
            Address\JobTitle.s    = ""
            
            Address\Street.s      = Pobox.s + " " + Street.s + " " + Suburb.s
            
            Address\Street.s      = Trim(Address\Street.s, ",")
            
            Address\Street.s      = Trim(Address\Street.s, " ")
            
            Address\Street.s      = ReplaceString(Address\Street.s, "  ", " ")
            
            Address\City.s        = City.s
            
            Address\County.s      = State.s
            
            Address\PostCode.s    = Postcode.s
            
            Address\Country.s     = Country.s
            
            Address\Notes.s       = Comment.s
            
            ;--------------------------------------------------------------------------------------
            ; 
            ;--------------------------------------------------------------------------------------
            
          Wend
          
          ;----------------------------------------------------------------------------------------
          ; 
          ;----------------------------------------------------------------------------------------
          
          FinishDatabaseQuery(Program\DatabaseHandle)
          
          ;----------------------------------------------------------------------------------------
          ; Get the contact numbers for this record: #Gadget_Address_Numbers
          ;----------------------------------------------------------------------------------------
          
          DatabaseQuery.s = "SELECT * FROM Contacts "
          
          DatabaseQuery.s + "WHERE Recordid = '"  + AddresRecordId.s()  + "'"
          
          ;----------------------------------------------------------------------------------------
          ; 
          ;----------------------------------------------------------------------------------------
          
          If DatabaseQuery(Program\DatabaseHandle, DatabaseQuery.s) <> 0
            
            ;--------------------------------------------------------------------------------------
            ; 
            ;--------------------------------------------------------------------------------------
            
            While NextDatabaseRow(Program\DatabaseHandle) <> 0
              
              ;------------------------------------------------------------------------------------
              ; 
              ;------------------------------------------------------------------------------------
              
              Contactid.s       = GetDatabaseString(Program\DatabaseHandle, 0)    ; AutoIncrement field
              
              Contacttype.s     = GetDatabaseString(Program\DatabaseHandle, 1)    ; Heading for type of contact data
              
              Contactdetails.s  = GetDatabaseString(Program\DatabaseHandle, 2)    ; Type of contact data
              
              ;------------------------------------------------------------------------------------
              ; 
              ;------------------------------------------------------------------------------------
              
              Select ContactType.s
                  
                Case "Home phone"             : HomePhone.s   = Contactdetails.s
                  
                Case "Home mobile"            : HomeMobile.s  = Contactdetails.s
                  
                Case "Home fax"               : HomeFax.s     = Contactdetails.s
                  
                Case "Home email"             : HomeEmail.s   = Contactdetails.s
                  
                Case "Home web page"          : HomeWeb.s     = Contactdetails.s
                  
                Case "Work phone"             : WorkPhone.s   = Contactdetails.s
                  
                Case "Work fax"               : WorkFax.s     = Contactdetails.s
                  
                Case "Work mobile"            : WorkMobile.s  = Contactdetails.s
                  
                Case "Work email"             : WorkEmail.s   = Contactdetails.s
                  
                Case "Work web page"          : WorkWeb.s     = Contactdetails.s
                  
              EndSelect
              ;------------------------------------------------------------------------------------
              ; 
              ;------------------------------------------------------------------------------------
              
              If HomePhone.s    <> ""
                
                Address\Phone   = HomePhone.s
                
              Else
                
                Address\Phone   = WorkPhone.s
                
              EndIf
              
              If HomeMobile.s   <> ""
                
                Address\Mobile  = HomeMobile.s
                
              Else
                
                Address\Mobile  = WorkMobile.s
                
              EndIf
              
              If HomeFax.s <> ""
                
                Address\Fax = HomeFax.s
                
              Else
                
                Address\Fax = WorkFax.s
                
              EndIf
              
              If HomeEmail.s <> ""
                
                Address\Email = HomeEmail.s
                
              Else
                
                Address\Email = WorkEmail.s
                
              EndIf
              
              If HomeWeb.s <> ""
                
                Address\URL = HomeWeb.s
                
              Else
                
                Address\URL = WorkWeb.s
                
              EndIf
              
              ;------------------------------------------------------------------------------------
              ; 
              ;------------------------------------------------------------------------------------
              
            Wend
            
            ;--------------------------------------------------------------------------------------
            ; 
            ;--------------------------------------------------------------------------------------
            
            FinishDatabaseQuery(Program\DatabaseHandle)
            
            ;--------------------------------------------------------------------------------------
            ; 
            ;--------------------------------------------------------------------------------------
            
            Address\PrintCount.s  = "0"
            
            Address\LastDate.s    = "10/06/2016 10:20:37 PM"
            
            Address\Custom1.s     = ""
            
            Address\Custom2.s     = ""
            
            Address\Custom3.s     = ""
            
            Address\Custom4.s     = ""
            
            ;--------------------------------------------------------------------------------------
            ; 
            ;--------------------------------------------------------------------------------------
            
          Else
            
            ; Debug "Could not get the contact details for the current address"
            
          EndIf
          
          ;----------------------------------------------------------------------------------------
          ; 
          ;----------------------------------------------------------------------------------------
          
        Else
          
          ; Debug "Could not get the current address data"
          
        EndIf
        
        ;------------------------------------------------------------------------------------------
        ; 
        ;------------------------------------------------------------------------------------------
        
        WriteString(CSVOutputFileId.i, Address\Title.s         + ",")
        
        WriteString(CSVOutputFileId.i, Address\FirstName.s     + ",")
        
        WriteString(CSVOutputFileId.i, Address\MiddleName.s    + ",")
        
        WriteString(CSVOutputFileId.i, Address\LastName.s      + ",")
        
        WriteString(CSVOutputFileId.i, Address\Suffix.s        + ",")
        
        WriteString(CSVOutputFileId.i, Address\Company.s       + ",") ; : Debug Address\Company
        
        WriteString(CSVOutputFileId.i, Address\Department.s    + ",")
        
        WriteString(CSVOutputFileId.i, Address\Office.s        + ",")
        
        WriteString(CSVOutputFileId.i, Address\JobTitle.s      + ",")
        
        WriteString(CSVOutputFileId.i, Address\Street.s        + ",")
        
        WriteString(CSVOutputFileId.i, Address\City.s          + ",")
        
        WriteString(CSVOutputFileId.i, Address\County.s        + ",")
        
        WriteString(CSVOutputFileId.i, Address\PostCode.s      + ",")
        
        WriteString(CSVOutputFileId.i, Address\Country.s       + ",")
        
        WriteString(CSVOutputFileId.i, Address\Phone           + ",") ; : Debug Address\Phone
        
        WriteString(CSVOutputFileId.i, Address\Mobile          + ",")
        
        WriteString(CSVOutputFileId.i, Address\Fax             + ",")
        
        WriteString(CSVOutputFileId.i, Address\Email           + ",")
        
        WriteString(CSVOutputFileId.i, Address\URL             + ",")
        
        WriteString(CSVOutputFileId.i, Address\PrintCount.s    + ",")
        
        WriteString(CSVOutputFileId.i, Address\LastDate.s      + ",")
        
        WriteString(CSVOutputFileId.i, Address\Custom1.s       + ",")
        
        WriteString(CSVOutputFileId.i, Address\Custom2.s       + ",")
        
        WriteString(CSVOutputFileId.i, Address\Custom3.s       + ",")
        
        WriteString(CSVOutputFileId.i, Address\Custom4.s       + ",")
        
        WriteStringN(CSVOutputFileId.i, Address\Notes.s)
        
        ;------------------------------------------------------------------------------------------
        ; 
        ;------------------------------------------------------------------------------------------
        
        ClearStructure(@Address, AddressData)
        
        ;------------------------------------------------------------------------------------------
        ; 
        ;------------------------------------------------------------------------------------------
        
        Title.s       = ""
        
        Firstname.s   = ""
        
        Middlename.s  = ""
        
        Lastname.s    = ""
        
        Medical.s     = ""
        
        Business.s    = ""
        
        Pobox.s       = ""
        
        Street.s      = ""
        
        Suburb.s      = ""
        
        City.s        = ""
        
        State.s       = ""
        
        Postcode.s    = ""
        
        Country.s     = ""
        
        Comment.s     = ""
        
        HomePhone.s   = ""
        
        HomeMobile.s  = ""
        
        HomeFax.s     = ""
        
        HomeEmail.s   = ""
        
        HomeWeb.s     = ""
        
        WorkPhone.s   = ""
        
        WorkFax.s     = ""
        
        WorkMobile.s  = ""
        
        WorkEmail.s   = ""
        
        WorkWeb.s     = ""
        
        ;------------------------------------------------------------------------------------------
        ; 
        ;------------------------------------------------------------------------------------------
        
      Next  ; AddresRecordId.s()
      
      ;--------------------------------------------------------------------------------------------
      ; 
      ;--------------------------------------------------------------------------------------------
      
      CloseFile(CSVOutputFileId.i)
      
      ;--------------------------------------------------------------------------------------------
      ; 
      ;--------------------------------------------------------------------------------------------
      
    Else
      
      Debug "Could not create the CSV output file"  
      
    EndIf
    
    ;----------------------------------------------------------------------------------------------
    ; 
    ;----------------------------------------------------------------------------------------------
    
  Else
    
    Debug "Nothing in the list to process"
    
  EndIf
  
  ;------------------------------------------------------------------------------------------------
  ; 
  ;------------------------------------------------------------------------------------------------
  
EndProcedure

;==============================================================================================================================================================================
; 
;==============================================================================================================================================================================

OpenSystemDatabase()

ExportToBrotherLabeller()
Amateur Radio, D-STAR/VK3HAF
Post Reply