Skip to content

Commit

Permalink
Initial commit of Frequency Finder
Browse files Browse the repository at this point in the history
  • Loading branch information
bellic-code committed Sep 5, 2023
0 parents commit ae2a69e
Show file tree
Hide file tree
Showing 12 changed files with 698 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Frequency_p.dpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
program Frequency_p;

uses
Forms,
Frequency_u in 'Frequency_u.pas' {frmFrequency};

{$R *.res}

begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TfrmFrequency, frmFrequency);
Application.Run;
end.
106 changes: 106 additions & 0 deletions Frequency_p.dproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{4FC048A3-4407-4689-A08A-E1D0C5DF9F6A}</ProjectGuid>
<ProjectVersion>12.0</ProjectVersion>
<MainSource>Frequency_p.dpr</MainSource>
<Config Condition="'$(Config)'==''">Debug</Config>
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_UnitAlias>WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;$(DCC_UnitAlias)</DCC_UnitAlias>
<DCC_DependencyCheckOutputName>Frequency_p.exe</DCC_DependencyCheckOutputName>
<DCC_K>false</DCC_K>
<DCC_F>false</DCC_F>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_Platform>x86</DCC_Platform>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_E>false</DCC_E>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_DebugInformation>false</DCC_DebugInformation>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="Frequency_p.dpr">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="Frequency_u.pas">
<Form>frmFrequency</Form>
</DCCReference>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Parameters>
<Parameters Name="UseLauncher">False</Parameters>
<Parameters Name="LoadAllSymbols">True</Parameters>
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
</Parameters>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">7177</VersionInfo>
<VersionInfo Name="CodePage">1252</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
</VersionInfoKeys>
<Source>
<Source Name="MainSource">Frequency_p.dpr</Source>
</Source>
</Delphi.Personality>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
</Project>
8 changes: 8 additions & 0 deletions Frequency_p.dproj.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<Transactions>
<Transaction>2023/09/03 10:51:59.768.pas,C:\Users\pilla\OneDrive\Documents\RAD Studio\Projects\Unit1.pas=C:\Users\pilla\OneDrive\Documents\Delphi Projects (Personal)\Frequency Finder\Frequency_u.pas</Transaction>
<Transaction>2023/09/03 10:51:59.768.dfm,C:\Users\pilla\OneDrive\Documents\RAD Studio\Projects\Unit1.dfm=C:\Users\pilla\OneDrive\Documents\Delphi Projects (Personal)\Frequency Finder\Frequency_u.dfm</Transaction>
<Transaction>2023/09/03 10:52:06.918.dproj,C:\Users\pilla\OneDrive\Documents\RAD Studio\Projects\Project1.dproj=C:\Users\pilla\OneDrive\Documents\Delphi Projects (Personal)\Frequency Finder\Frequency_p.dproj</Transaction>
</Transactions>
</BorlandProject>
Binary file added Frequency_p.exe
Binary file not shown.
Binary file added Frequency_p.identcache
Binary file not shown.
Binary file added Frequency_p.res
Binary file not shown.
Binary file added Frequency_u.dcu
Binary file not shown.
159 changes: 159 additions & 0 deletions Frequency_u.dfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
object frmFrequency: TfrmFrequency
Left = 0
Top = 0
Caption = 'Frequency Finder '#55357#56589
ClientHeight = 227
ClientWidth = 467
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object lblDataHeader: TLabel
Left = 8
Top = 5
Width = 27
Height = 13
Caption = 'Data:'
end
object lblResultsHeader: TLabel
Left = 143
Top = 111
Width = 39
Height = 13
Caption = 'Results:'
end
object lblFrequency: TLabel
Left = 277
Top = 111
Width = 55
Height = 13
Caption = 'Frequency:'
end
object lblInterval: TLabel
Left = 277
Top = 5
Width = 70
Height = 13
Caption = 'Class Interval:'
end
object lstData: TListBox
Left = 8
Top = 19
Width = 129
Height = 200
ItemHeight = 13
TabOrder = 0
end
object btnAdd: TButton
Left = 143
Top = 19
Width = 75
Height = 25
Caption = 'Add Data'
TabOrder = 1
OnClick = btnAddClick
end
object btnDelete: TButton
Left = 143
Top = 50
Width = 75
Height = 25
Caption = 'Delete'
TabOrder = 2
OnClick = btnDeleteClick
end
object pnlFrequency: TPanel
Left = 275
Top = 19
Width = 183
Height = 78
TabOrder = 3
object lblEndHeader: TLabel
Left = 12
Top = 38
Width = 22
Height = 13
Caption = 'End:'
end
object lblStartHeader: TLabel
Left = 6
Top = 11
Width = 28
Height = 13
Caption = 'Start:'
end
object edtStartRange: TEdit
Left = 40
Top = 8
Width = 121
Height = 21
NumbersOnly = True
TabOrder = 0
end
object edtEndRange: TEdit
Left = 40
Top = 34
Width = 121
Height = 21
NumbersOnly = True
TabOrder = 1
end
object btnScan: TButton
Left = 64
Top = 56
Width = 75
Height = 20
Caption = 'Scan Data'
TabOrder = 2
OnClick = btnScanClick
end
end
object memResults: TMemo
Left = 143
Top = 130
Width = 315
Height = 89
ReadOnly = True
TabOrder = 4
end
object pnlCancel: TPanel
Left = 143
Top = 81
Width = 75
Height = 25
Caption = 'Reset'
Color = clRed
Font.Charset = DEFAULT_CHARSET
Font.Color = clWhite
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentBackground = False
ParentFont = False
TabOrder = 5
OnClick = pnlCancelClick
end
object edtFrequency: TEdit
Left = 337
Top = 105
Width = 121
Height = 21
ReadOnly = True
TabOrder = 6
end
object sedValue: TSpinEdit
Left = 224
Top = 19
Width = 33
Height = 22
MaxValue = 0
MinValue = 0
TabOrder = 7
Value = 0
end
end
85 changes: 85 additions & 0 deletions Frequency_u.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
unit Frequency_u;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Spin;

type
TfrmFrequency = class(TForm)
lstData: TListBox;
btnAdd: TButton;
btnDelete: TButton;
pnlFrequency: TPanel;
edtStartRange: TEdit;
edtEndRange: TEdit;
memResults: TMemo;
btnScan: TButton;
lblDataHeader: TLabel;
lblStartHeader: TLabel;
lblEndHeader: TLabel;
lblResultsHeader: TLabel;
pnlCancel: TPanel;
lblFrequency: TLabel;
edtFrequency: TEdit;
sedValue: TSpinEdit;
lblInterval: TLabel;
procedure btnAddClick(Sender: TObject);
procedure btnDeleteClick(Sender: TObject);
procedure btnScanClick(Sender: TObject);
procedure pnlCancelClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
frmFrequency: TfrmFrequency;

implementation

{$R *.dfm}

procedure TfrmFrequency.btnAddClick(Sender: TObject);
var
sInput : String;
begin
sInput := InputBox('Add data', 'Input a number to add to the data set:', '');
lstData.Items.Add(sInput);
end;

procedure TfrmFrequency.btnDeleteClick(Sender: TObject);
begin
lstData.DeleteSelected;
ShowMessage('Entry removed from data set');
end;

procedure TfrmFrequency.btnScanClick(Sender: TObject);
var
I, iStart, iEnd, iData : Integer;
begin
iStart := StrToInt(edtStartRange.Text);
iEnd := StrToInt(edtEndRange.Text);

for I := 0 to lstData.Items.Count - 1 do
begin
iData := StrToInt(lstData.Items[I]);
if (iData >= iStart) and (iData < iEnd) then
memResults.Lines.Add(IntToStr(iData))
end;
edtFrequency.Text := IntToStr(memResults.Lines.Count);
end;

procedure TfrmFrequency.pnlCancelClick(Sender: TObject);
begin
lstData.Items.Clear;
edtStartRange.Clear;
edtEndRange.Clear;
memResults.Clear;

ShowMessage('Application reset to default values');
end;

end.
Loading

0 comments on commit ae2a69e

Please sign in to comment.