Permalink
Browse files

verse

  • Loading branch information...
vrybant committed Oct 16, 2018
1 parent 54599c1 commit d48d08c1259ffd31e245c68329e7c65ec4517ccd
Showing with 12 additions and 11 deletions.
  1. +11 −11 unitcommentary.pas
  2. +1 −0 unittool.pas
View
@@ -51,8 +51,8 @@ TCommentary = class
public
constructor Create(filePath: string);
procedure OpenDatabase;
function GetData(v: TVerse): string;
function GetFootnote(v: TVerse; marker: string): string;
function GetData(Verse: TVerse): string;
function GetFootnote(Verse: TVerse; marker: string): string;
procedure SavePrivate(const IniFile: TIniFile);
procedure ReadPrivate(const IniFile: TIniFile);
destructor Destroy; override;
@@ -226,22 +226,22 @@ function TCommentary.SortingIndex(number: integer): integer;
end;
end;
function TCommentary.GetData(v: TVerse): string;
function TCommentary.GetData(Verse: TVerse): string;
var
id : integer;
num_to: string;
begin
Result := '';
id := EncodeID(format, v.book);
num_to := ToStr(v.number + v.count - 1);
id := EncodeID(format, Verse.book);
num_to := ToStr(Verse.number + Verse.count - 1);
try
try
Query.SQL.Text := 'SELECT * FROM ' + z.commentary +
' WHERE ' + z.book + ' = ' + ToStr(id) +
' AND ' + z.chapter + ' = ' + ToStr(v.chapter) +
' AND ((' + z.fromverse + ' BETWEEN ' + ToStr(v.number) + ' AND ' + num_to + ')' +
' OR (' + z.toverse + ' BETWEEN ' + ToStr(v.number) + ' AND ' + num_to + ')) ' ;
' AND ' + z.chapter + ' = ' + ToStr(Verse.chapter) +
' AND ((' + z.fromverse + ' BETWEEN ' + ToStr(Verse.number) + ' AND ' + num_to + ')' +
' OR (' + z.toverse + ' BETWEEN ' + ToStr(Verse.number) + ' AND ' + num_to + ')) ' ;
Query.Open;
try Result := Query.FieldByName(z.data).AsString; except end;
@@ -253,18 +253,18 @@ function TCommentary.GetData(v: TVerse): string;
end;
end;
function TCommentary.GetFootnote(v: TVerse; marker: string): string;
function TCommentary.GetFootnote(Verse: TVerse; marker: string): string;
var
id : integer;
begin
Result := '';
id := EncodeID(format, v.book);
id := EncodeID(format, Verse.book);
try
try
Query.SQL.Text := 'SELECT * FROM ' + z.commentary +
' WHERE ' + z.book + ' = ' + ToStr(id) +
' AND ' + z.chapter + ' = ' + ToStr(v.chapter) +
' AND ' + z.chapter + ' = ' + ToStr(Verse.chapter) +
' AND ' + 'marker' + ' ="' + marker + '" ';
Query.Open;
View
@@ -181,6 +181,7 @@ procedure Load_Commentary(Stream: TRichStream);
for i:=0 to Commentaries.Count-1 do
begin
if Commentaries[i].footnotes then Continue;
comment := Commentaries[i].GetData(ActiveVerse);
if comment = '' then Continue;
s:= '\par\cf3 ' + Commentaries[i].Name + '\par\par\cf1 ';

0 comments on commit d48d08c

Please sign in to comment.