home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 24
/
CD_ASCQ_24_0995.iso
/
vrac
/
apdtr.zip
/
ADMODDB.INT
< prev
next >
Wrap
Text File
|
1995-05-26
|
3KB
|
99 lines
{$G+,X+,F+}
{Conditional defines that may affect this unit}
{$I AWDEFINE.INC}
{*********************************************************}
{* ADMODDB.PAS 1.00 *}
{* Copyright (c) TurboPower Software 1995 *}
{* All rights reserved. *}
{*********************************************************}
unit AdModDB;
{-Delphi modem database component}
interface
uses
{-----RTL}
SysUtils,
Classes,
Messages,
WinTypes,
DsgnIntf,
Forms,
Controls,
{-----APD}
OoMisc,
AwModDB,
AdMisc,
AdExcept,
AdIniDB;
const
DefModemDBName = 'AWMODEM.INI';
type
TCustomModemDBase = class(TComponent)
private
DB : PModemDatabase; {record passed to DLL calls}
Strs : TStringList; {for returning lists of modems}
Scratch : TModemData; {scratch record for passing into DLL}
Changed : Boolean; {TRUE if database data has changed}
FOpen : Boolean; {TRUE if database has been opened}
FFileName : String; {file name, used mostly at design time}
{property read/write}
procedure SetFileName(const NewName : String);
{-Update the database's file name. Reopen under the new name}
procedure SetOpen(const OpenIt : Boolean);
{-Open or close the database}
function GetRecordList : TStrings;
{-Returns the names of each modem in the database}
function GetNumModems : Integer;
{-Returns the number of modems in the database}
{utility}
procedure AssureOpen;
{-Make sure that the database is open, otherwise raise an exception}
protected
property FileName : String
read FFileName write SetFileName;
public
constructor Create(AOwner : TComponent); override;
destructor Destroy; override;
procedure AddModem(const Modem : TModemInfo);
{-Add a modem to the database}
procedure UpdModem(ModemName : TModemName; const Modem : TModemInfo);
{-Update a modem's record in the database}
procedure DelModem(ModemName : TModemName);
{-Delete a modem from the database}
procedure GetModem(ModemName : TModemName; var Modem : TModemInfo);
{-Get a modem from the database}
procedure WriteToIni(const Rec : TModemInfo; Section, IniFile : String);
{-Write the modem to a user-specified .INI file}
procedure ReadFromIni(var Rec : TModemInfo; const Section, IniFile : String);
{-Read the modem from a user-specified .INI file}
property NumModems : Integer
read GetNumModems;
property Modems : TStrings
read GetRecordList;
property Open : Boolean
read FOpen write SetOpen;
end;
TModemDBase = class(TCustomModemDBase)
published
property FileName;
end;
procedure StrsToPChars(const StrRec : TModemInfo; var PCharRec : TModemData);
{-Convert a record with string variables to a record with PChars}
procedure PCharsToStrs(const PCharRec : TModemData; var StrRec : TModemInfo);
{-Convert a record with PChar variables to a record with strings}