/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-11 *) |
(* Revision: 2022-10-10 *) |
(* License: Apache 2.0 *) |
(* This file contains: *) |
(* - "OIDplus for DOS" program *) |
417,23 → 417,30 |
function NextPossibleFileID: string; |
var |
DirInfo: SearchRec; |
iId, imax: LongInt; |
list: PStringList; |
iId: 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); |
if IsPositiveIntegerOrZero(sId) then |
ListAppend(list, sId); |
FindNext(DirInfo); |
end; |
(* Search for the first non existing item in the list *) |
sId := ''; |
for iId := 0 to 99999999 do |
begin |
iId := StrToInt(sId); |
if iId > iMax then iMax := iId; |
sId := ZeroPad(iId, 8); |
if not ListContains(list, sId) then break; |
end; |
FindNext(DirInfo); |
NextPossibleFileId := sId; |
FreeList(list); |
end; |
NextPossibleFileId := ZeroPad(iMax+1, 8); |
end; |
function NumIdAlreadyExisting(parentOID: POID; arcval: string): boolean; |
var |
/trunk_dos/VTSFUNCS.PAS |
---|
3,7 → 3,7 |
(************************************************) |
(* VTSFUNCS.PAS *) |
(* Author: Daniel Marschall *) |
(* Revision: 2022-10-11 *) |
(* Revision: 2022-02-22 *) |
(* License: Apache 2.0 *) |
(* This file contains: *) |
(* - Various functions *) |
32,9 → 32,8 |
function StripLeadingZeros(s: string): string; |
function IsPositiveIntegerOrZero(s: string): boolean; |
function IsBase36String(s: string): boolean; |
function TryStrToInt(s: string; var i: LongInt): boolean; |
function StrToInt(s: string): LongInt; |
function IntToStr(Value: LongInt): string; |
function StrToInt(s: string): Integer; |
function IntToStr(Value: Integer): string; |
function StringReplace(s, search, replace: string): string; |
252,20 → 251,7 |
IsBase36String := true; |
end; |
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; |
function StrToInt(s: string): Integer; |
var |
i, Error: Integer; |
begin |
273,7 → 259,7 |
StrToInt := i; |
end; |
function IntToStr(Value: LongInt): string; |
function IntToStr(Value: Integer): string; |
var |
s: string; |
begin |