Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 994 → Rev 995

/trunk_dos/OIDPLUS.EXE
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk_dos/OIDPLUS.PAS
3,7 → 3,7
(************************************************)
(* OIDPLUS.PAS *)
(* Author: Daniel Marschall *)
(* Revision: 2022-10-10 *)
(* Revision: 2022-10-11 *)
(* License: Apache 2.0 *)
(* This file contains: *)
(* - "OIDplus for DOS" program *)
417,30 → 417,23
function NextPossibleFileID: string;
var
DirInfo: SearchRec;
list: PStringList;
iId: LongInt;
iId, imax: LongInt;
sId: string;
begin
(* Put all found files into a list *)
CreateList(list);
FindFirst(RepeatStr('?',8)+OID_EXTENSION, Archive, DirInfo);
imax := -1;
while DosError = 0 do
begin
sId := Copy(DirInfo.Name, 1, 8);
ListAppend(list, sId);
if IsPositiveIntegerOrZero(sId) then
begin
iId := StrToInt(sId);
if iId > iMax then iMax := iId;
end;
FindNext(DirInfo);
end;
 
(* Search for the first non existing item in the list *)
sId := '';
for iId := 0 to 99999999 do
begin
sId := ZeroPad(iId, 8);
if not ListContains(list, sId) then break;
NextPossibleFileId := ZeroPad(iMax+1, 8);
end;
NextPossibleFileId := sId;
FreeList(list);
end;
 
function NumIdAlreadyExisting(parentOID: POID; arcval: string): boolean;
var
/trunk_dos/VTSFUNCS.PAS
3,7 → 3,7
(************************************************)
(* VTSFUNCS.PAS *)
(* Author: Daniel Marschall *)
(* Revision: 2022-02-22 *)
(* Revision: 2022-10-11 *)
(* License: Apache 2.0 *)
(* This file contains: *)
(* - Various functions *)
32,8 → 32,9
function StripLeadingZeros(s: string): string;
function IsPositiveIntegerOrZero(s: string): boolean;
function IsBase36String(s: string): boolean;
function StrToInt(s: string): Integer;
function IntToStr(Value: Integer): string;
function TryStrToInt(s: string; var i: LongInt): boolean;
function StrToInt(s: string): LongInt;
function IntToStr(Value: LongInt): string;
 
function StringReplace(s, search, replace: string): string;
 
251,7 → 252,20
IsBase36String := true;
end;
 
function StrToInt(s: string): Integer;
function TryStrToInt(s: string; var i: LongInt): boolean;
begin
if IsPositiveIntegerOrZero(s) then
begin
TryStrToInt := true;
i := StrToInt(s);
end
else
begin
TryStrToInt := false;
end;
end;
 
function StrToInt(s: string): LongInt;
var
i, Error: Integer;
begin
259,7 → 273,7
StrToInt := i;
end;
 
function IntToStr(Value: Integer): string;
function IntToStr(Value: LongInt): string;
var
s: string;
begin