home *** CD-ROM | disk | FTP | other *** search
/ World of Ham Radio 1997 / WOHR97_AmSoft_(1997-02-01).iso / amsoft / win95 / source.zi_ / AMSOFT.BAS < prev    next >
BASIC Source File  |  1996-04-14  |  6KB  |  105 lines

  1. Attribute VB_Name = "AmSoft1"
  2. 'AmSoft.EXE - Windows "AmSoft-World of Ham Radio" Callsign CDRom Lookup
  3. '(C)1995-96 AmSoft (C)1995-96 Alan Freeman KC5JGP
  4. 'Written in Visual Basic Professional 16-Bit, April 1996
  5. 'Last Mod: 04/14/1996
  6.  
  7. DefInt A-Z
  8. Public Declare Sub Lower Lib "QPRO200.DLL" (Work As String)
  9. Public Declare Sub ProperName Lib "QPRO200.DLL" (Work As String)
  10. Public Declare Function ExeName Lib "QPRO200.DLL" () As String
  11. Public Declare Function Exist Lib "QPRO200.DLL" (ByVal Filename As String) As Integer
  12. Public Declare Function Num2Time Lib "QPRO200.DLL" (Tim As Long) As String
  13. Public Declare Function Num2Date Lib "QPRO200.DLL" (ByVal X As Integer) As String
  14. Public Declare Function Date2Num Lib "QPRO200.DLL" (ByVal Dat As String) As Integer
  15. Public Declare Function Time2Num Lib "QPRO200.DLL" (ByVal Tim As String) As Long
  16. Public Declare Function QPTrim Lib "QPRO200.DLL" (Work As String) As String
  17. Public Declare Function CVL Lib "QPRO200.DLL" (Number As String) As Long
  18.    
  19. Public Declare Sub CallSignClose Lib "amsoftcs.dll" ()
  20. Public Declare Function CallSignOpen Lib "amsoftcs.dll" (ByVal DataFileName As String) As Integer
  21. Public Declare Function CallSignSetIndex Lib "amsoftcs.dll" (ByVal IndexNum As Integer) As Long
  22. Public Declare Function CallSignCloseIndex Lib "amsoftcs.dll" () As Integer
  23. Public Declare Function CallSignSearchRec Lib "amsoftcs.dll" (ByVal SearchFor As String) As Long
  24. Public Declare Function CallSignPrevRec Lib "amsoftcs.dll" () As Long
  25. Public Declare Function CallSignNextRec Lib "amsoftcs.dll" () As Long
  26. Public Declare Function CallSignFirstRec Lib "amsoftcs.dll" () As Long
  27. Public Declare Function CallSignLastRec Lib "amsoftcs.dll" () As Long
  28. Public Declare Function CallSignGetNumRecs Lib "amsoftcs.dll" () As Long
  29. Public Declare Function CallSignGetRecord Lib "amsoftcs.dll" (ByVal RecNum As Long, CSRec As CallSignRec) As Integer
  30.    
  31. ' -------------------------------------------------------------------
  32. ' Constants used to specify which index will be used when searching
  33. ' for a record using the CallsignSearchRec&() function.
  34. 'Global Const NoIndex = 0
  35. 'Global Const CallsignIndex = 1
  36. 'Global Const NameIndex = 2
  37. 'Global Const CityIndex = 3
  38. 'Global Const OldCallIndex = 4
  39. ' ----------------------------------------------------------------------------
  40. 'Declare Function CallSignOpen% Lib "amsoftcs.dll" (ByVal DataFileName$)
  41. 'Declare Sub CallSignClose Lib "amsoftcs.dll" ()
  42. ' CallSignOpen() opens the data file.  This must be called before any other
  43. '        routines in the library.  Returns 1 if okay, 0 if an error occurs.
  44. ' CallSignClose() closes the data file, and any open indexes (if they haven't
  45. '   been closed already with CallSignCloseIndex().  Returns 1 unless an error
  46. '        occurs.  If an error happens, it returns 0.
  47. ' ----------------------------------------------------------------------------
  48. 'Declare Function CallSignSetIndex& Lib "amsoftcs.dll" (ByVal IndexNum%)
  49. 'Declare Function CallSignCloseIndex% Lib "amsoftcs.dll" ()
  50. ' CallSignSetIndex%() sets the index order to the specified value.  See the
  51. '        constants defined above for the value of IndexNum% to use.  Returns 1
  52. '         if successful, 0 if an error occurs (file not found, etc.)
  53. ' CallSignCloseIndex%() - If you just want to close the index without closing
  54. '        the data file, this function does that.
  55. ' ----------------------------------------------------------------------------
  56. 'Declare Function CallSignSearchRec& Lib "amsoftcs.dll" (ByVal SearchFor$)
  57. 'Declare Function CallSignPrevRec& Lib "amsoftcs.dll" ()
  58. 'Declare Function CallSignNextRec& Lib "amsoftcs.dll" ()
  59. 'Declare Function CallSignFirstRec& Lib "amsoftcs.dll" ()
  60. 'Declare Function CallSignLastRec& Lib "amsoftcs.dll" ()
  61. ' CallSignSearchRec&() - Searches through the current index (if set to 1 thru
  62. '        4 only) for the specified key.  It returns the record number (1 to # of
  63. '        records) of the first matching record.  For example, if you search for
  64. '        "Adams", it will return the first Adams found.  You may also search on
  65. '        a partial string, as long as it's the first characters.  For example,
  66. '        doing a search for 'N9' in callsign index order sets the record to the
  67. '        first record that starts with "N9".  Probably "N9AA".
  68. ' --- NOTE:  The following functions operate in indexed order.  If you have
  69. '                         not set the index (or if it has been set to 0), the records
  70. '                         will be accessed in FILE order.
  71. ' CallSignPrevRec&() - Returns the previous record number in the index.  If at
  72. '        the beginning of the file, it returns the first record number.
  73. ' CallSignNextRec&() - Returns the next record number in the index.  If at the
  74. '        end of the file, it returns the last record number.
  75. ' CallSignFirstRec&() - Returns the first record number in the index.
  76. ' CallSignLastRec&() - Returns the last record number in the index.
  77. ' ----------------------------------------------------------------------------
  78. 'Declare Function CallSignGetNumRecs& Lib "amsoftcs.dll" ()
  79. '        CallSignGetNumRecs&() returns the number of records in the database
  80. ' ----------------------------------------------------------------------------
  81. 'Declare Function CallSignGetRecord% Lib "amsoftcs.dll" (ByVal RecNum&, CSRec As CallSignRec)
  82. ' Read a record from the database.  RecNum& is 1 to # of records in the data
  83. ' file.  CSRec is a type CallSignRec that will be filled in with the data
  84. ' read from the file.  Returns 1 if okay.  Returns 0 if an error occurs.
  85. ' ----------------------------------------------------------------------------
  86.  
  87. Type CallSignRec
  88.     CallSign    As String * 8
  89.     LastName    As String * 20
  90.     Suffix      As String * 4
  91.     FirstName   As String * 11
  92.     Initial     As String * 1
  93.     ExpDate     As String * 5
  94.     BirthDate   As String * 5
  95.     Address     As String * 35
  96.     City        As String * 20
  97.     State       As String * 2
  98.     ZipCode     As String * 10
  99.     ClassLic    As String * 1
  100.     OldCall     As String * 8
  101. End Type
  102.  
  103. Global Search As Integer, Record As Long, Drive As String, PrintFile As String
  104. Global LabelFileAppend As Integer, LabelFile As String, Rcd As CallSignRec
  105.