-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Not sure if I actually like pascal more tha c++
- Loading branch information
Mark Carter
committed
Feb 28, 2018
1 parent
38932f2
commit bcd80fd
Showing
4 changed files
with
189 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# freepascal local files | ||
*.lps | ||
|
||
backup | ||
lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
unit cells; | ||
|
||
|
||
{$mode objfpc}{$H+} | ||
|
||
interface | ||
|
||
|
||
|
||
uses | ||
Classes, SysUtils | ||
//, contnrs | ||
, fgl; | ||
|
||
type | ||
TCells = specialize TFPGMap<integer, string>; | ||
|
||
procedure test_cells(); | ||
|
||
implementation | ||
|
||
var cell_id: Integer; | ||
var the_cells :TCells; | ||
|
||
procedure test_cells(); | ||
//var h : TFPDataHashTable; | ||
//var test: string; | ||
begin | ||
WriteLn('cells:test_cells()'); | ||
|
||
// the_cells.add(cell_id, 'hello'); | ||
the_cells[cell_id] := 'hello'; | ||
end; | ||
|
||
initialization | ||
begin | ||
cell_id := 1; | ||
the_cells.create; | ||
end; | ||
|
||
end. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CONFIG> | ||
<ProjectOptions> | ||
<Version Value="10"/> | ||
<General> | ||
<Flags> | ||
<MainUnitHasCreateFormStatements Value="False"/> | ||
<MainUnitHasScaledStatement Value="False"/> | ||
</Flags> | ||
<SessionStorage Value="InProjectDir"/> | ||
<MainUnit Value="0"/> | ||
<Title Value="Neoleo"/> | ||
<UseAppBundle Value="False"/> | ||
<ResourceType Value="res"/> | ||
</General> | ||
<VersionInfo> | ||
<StringTable ProductVersion=""/> | ||
</VersionInfo> | ||
<BuildModes Count="1"> | ||
<Item1 Name="Default" Default="True"/> | ||
</BuildModes> | ||
<PublishOptions> | ||
<Version Value="2"/> | ||
</PublishOptions> | ||
<RunParams> | ||
<local> | ||
<FormatVersion Value="1"/> | ||
</local> | ||
</RunParams> | ||
<Units Count="2"> | ||
<Unit0> | ||
<Filename Value="neoleo.lpr"/> | ||
<IsPartOfProject Value="True"/> | ||
</Unit0> | ||
<Unit1> | ||
<Filename Value="cells.pas"/> | ||
<IsPartOfProject Value="True"/> | ||
</Unit1> | ||
</Units> | ||
</ProjectOptions> | ||
<CompilerOptions> | ||
<Version Value="11"/> | ||
<Target> | ||
<Filename Value="neoleo"/> | ||
</Target> | ||
<SearchPaths> | ||
<IncludeFiles Value="$(ProjOutDir)"/> | ||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> | ||
</SearchPaths> | ||
</CompilerOptions> | ||
<Debugging> | ||
<Exceptions Count="3"> | ||
<Item1> | ||
<Name Value="EAbort"/> | ||
</Item1> | ||
<Item2> | ||
<Name Value="ECodetoolError"/> | ||
</Item2> | ||
<Item3> | ||
<Name Value="EFOpenError"/> | ||
</Item3> | ||
</Exceptions> | ||
</Debugging> | ||
</CONFIG> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
program neoleo; | ||
|
||
{$mode objfpc}{$H+} | ||
|
||
uses | ||
{$IFDEF UNIX}{$IFDEF UseCThreads} | ||
cthreads, | ||
{$ENDIF}{$ENDIF} | ||
Classes, SysUtils, CustApp, cells | ||
{ you can add units after this }; | ||
|
||
type | ||
|
||
{ TNeoApp } | ||
|
||
TNeoApp = class(TCustomApplication) | ||
protected | ||
procedure DoRun; override; | ||
public | ||
constructor Create(TheOwner: TComponent); override; | ||
destructor Destroy; override; | ||
procedure WriteHelp; virtual; | ||
end; | ||
|
||
{ TNeoApp } | ||
|
||
procedure TNeoApp.DoRun; | ||
var | ||
ErrorMsg: String; | ||
begin | ||
// quick check parameters | ||
ErrorMsg:=CheckOptions('h', 'help'); | ||
if ErrorMsg<>'' then begin | ||
ShowException(Exception.Create(ErrorMsg)); | ||
Terminate; | ||
Exit; | ||
end; | ||
|
||
// parse parameters | ||
if HasOption('h', 'help') then begin | ||
WriteHelp; | ||
Terminate; | ||
Exit; | ||
end; | ||
|
||
{ add your program here } | ||
test_cells(); | ||
|
||
// stop program loop | ||
Terminate; | ||
end; | ||
|
||
constructor TNeoApp.Create(TheOwner: TComponent); | ||
begin | ||
inherited Create(TheOwner); | ||
StopOnException:=True; | ||
end; | ||
|
||
destructor TNeoApp.Destroy; | ||
begin | ||
inherited Destroy; | ||
end; | ||
|
||
procedure TNeoApp.WriteHelp; | ||
begin | ||
{ add your help code here } | ||
writeln('Usage: ', ExeName, ' -h'); | ||
end; | ||
|
||
var | ||
Application: TNeoApp; | ||
begin | ||
Application:=TNeoApp.Create(nil); | ||
Application.Title:='Neoleo'; | ||
Application.Run; | ||
Application.Free; | ||
end. | ||
|