【delphi开源代码栏目提醒】:网学会员--在 delphi开源代码编辑为广大网友搜集整理了:COP_SORT.PAS绩等信息,祝愿广大网友取得需要的信息,参考学习。
{project CopySort
Delphi 16 and 32
26.12.96
Author
(c) Jose Maria Gias Zaragoza - Spain
email :
COP_SORT.PAS为[网学网-网友上传,谢谢支持]。
Freeware - This is an example therefore are not admitted claims neither is
offer garantias of no class.
In the Project is shown an example of as accomplishing some functions that in
dBase they were very simple and customary, but that in Delphi have been
complicated and it that it is worse, they are scarcely documented.
# Borland. But is that never learn .............. #
With the project of demo that is attached, they can be accomplished the following
functions:
- CopyTablefull(. .) Uses the function of the BDE dbiCopyTable() , that it
makes a copy integrates of table though it be filtered
- To copy or to duplicate tables complete with its Indices
- SortTable(. .) uses components Ttable and BatchMove
- To order tables
- CopySort(. .) Uses components Ttable and BatchMove
- To copy or to duplicate tables complete without Indices.
( Eye. if we copy on the same Alias we will eliminate the references from
the Indices)
- To copy data to other in a way ordered table
- To export data ordered by an Index to dBase, Paradox, or ASCII .Txt
( Eye. If is exported in ASCII format, the Memo fields are not sustained
and will give a mistake)
All the Mail with commentaries and alterations to the example will be extremely
thanked and resulted in benefit of the developers community of Delphi.
The encapsulation these functions and other of similar characteristic in
components would be an interesting labor. I invite you to continue the work.
The author thanked the one which sends your examples of applications
to exchange development and knowledge experiences.
#################################3
Castellano
Delphi 16 y 32
26.12.96
Autor
(c)J.M.G韆s Zaragoza - Espa馻
email :
COP_SORT.PAS为[网学网-网友上传,谢谢支持]。
Freeware - Esto es un ejemplo por lo que no se admiten reclamaciones ni se
ofrece garantias de ninguna clase.
En el Project se muestra un ejemplo de como realizar algunas funciones que en
dBase eran muy sencillas y habituales, pero que en Delphi se han complicado y
lo que es peor, est醤 esc醩amente documentadas.
# Borland. Pero es que nunca aprenderas.............. #
Con el proyecto de demo que se adjunta, se pueden realizar las siguientes
funciones:
- CopyTablefull(..) Utiliza la funcion del BDE dbiCopyTable() que hace una
copia integra de la tabla aunque est?filtrada
- Copiar o duplicar tablas completas con sus Indices
- SortTable(..) Utiliza componentes Ttable y BatchMove
- Ordenar tablas
- CopySort(..) Utiliza componentes Ttable y BatchMove
- Copiar o duplicar tablas completas sin Indices.
- Copiar datos a otra tabla de forma ordenada
- Exportar datos ordenados por un Indice a dBase, Paradox, o ASCII .Txt
(Ojo. Si se exporta en formato ASCII, los campos Memo no son soportados
y dar?un error)
Todos los Mail con comentarios y correcciones al ejemplo ser醤 sumamente
agradecidos y redundar醤 en beneficio de la comunidad de desarrolladores de Delphi.
El encapsular estas funciones y otras de similares caracter韘ticas en componentes
ser韆 una labor interesante. Os invito a continuar el trabajo.
El autor agradecera el que envieis vuestros ejemplos de aplicaciones
para intercambiar experiencias de desarrollo y conocimientos.
}
unit Cop_Sort;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, Buttons, DB, DBTables, DbiProcs, DbiErrs,
DbiTypes, ExtCtrls, Mask, Grids, DBGrids, FileCtrl;
type
TCopia_Dbf = class(TForm)
BotonSalir: TBitBtn;
BCopiar: TBitBtn;
GroupBox2: TGroupBox;
Label2: TLabel;
CBTable: TComboBox;
CBAlias: TComboBox;
Label3: TLabel;
CBIndex: TComboBox;
Label4: TLabel;
EditFic: TEdit;
Label5: TLabel;
BatchMove1: TBatchMove;
Table1: TTable;
Table2: TTable;
DS1: TDataSource;
DS2: TDataSource;
GroupBox1: TGroupBox;
RbCopiarTodo: TRadioButton;
RbCopySort: TRadioButton;
RbCopiarSoloDatos: TRadioButton;
RbSort: TRadioButton;
CbTipoTabla: TComboBox;
Label6: TLabel;
DriveComboBox1: TDriveComboBox;
Directory1: TDirectoryListBox;
Panel1: TPanel;
Edit1: TEdit;
Edit2: TEdit;
EditDirectory: TEdit;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure CBAliasChange(Sender: TObject);
procedure BCopiarClick(Sender: TObject);
procedure BotonSalirClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure CBTableChange(Sender: TObject);
procedure EditFicEnter(Sender: TObject);
procedure EditFicExit(Sender: TObject);
procedure EditFicKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure DirectoryKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure DirectoryEnter(Sender: TObject);
procedure DirectoryExit(Sender: TObject);
procedure RbCopySortKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure CBAliasKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure CBTableKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure CBIndexKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure CBAliasEnter(Sender: TObject);
procedure CBAliasExit(Sender: TObject);
procedure CBTableEnter(Sender: TObject);
procedure CBTableExit(Sender: TObject);
procedure CBIndexEnter(Sender: TObject);
procedure CBIndexExit(Sender: TObject);
procedure RbCopiarSoloDatosKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure RbCopiarTodoKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure CbTipoTablaEnter(Sender: TObject);
procedure CbTipoTablaExit(Sender: TObject);
procedure CbTipoTablaKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure Directory1Change(Sender: TObject);
public
function Ltrim(Cadena: string): string;
function Rtrim(Cadena: string): string;
function Alltrim(Cadena: string): string;
function SortTable(Alias_S,Table_S,Index_S :String; var Retorno :String):Boolean;
function CopySort(Alias_S,Table_S,Index_S,Directory_T,Table_T :String;
var Retorno :String; TableType_T : TTableType):Boolean;
function CopyTableFull(Alias_S, Table_S, Table_T: String; var Retorno :String): Boolean;
procedure Mensaje(Escribe : String);
procedure HandleExcepcion(Sender: TObject; E: Exception);
end;
var
Copia_Dbf: TCopia_Dbf;
implementation
{$R *.DFM}
procedure TCopia_Dbf.HandleExcepcion(Sender: Tobject; E: Exception);
begin
if E.Message <> '' then begin
Screen.Cursor := crArrow;
MessageDlg(E.Message, mtError, [mbOK], 0);
end;
end;
{# Elimina los espacios a la izquierda de una cadena
## Eliminate the spaces to the left from a string}
function TCopia_Dbf.Ltrim(
上一篇:
frmDataBackup.frm
下一篇:
多功能数据挖掘平台的CS架构扩展的研究与实现