Skip to content

Commit

Permalink
findJavaPath will now return the path of the latest java version
Browse files Browse the repository at this point in the history
  • Loading branch information
cohenadair committed Dec 20, 2013
1 parent 3f48fc4 commit e0004e2
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions lib/misc/smart.simba
Expand Up @@ -100,19 +100,18 @@ Example:
*)
function findJavaPath(out res: string): boolean;

function GetDirectoryName(Directory, Path: String): String;
var
function GetDirectoryName(Directory, Path: String): String;
var
I: Integer;
Directories: TStringArray;
begin
Directories := GetDirectories(Path);
for I := 0 To High(Directories) Do
if ExecRegExpr(Directory, Directories[I]) then
begin
Result := Directories[I];
Exit;
end;
end;
begin
Directories := GetDirectories(Path);

for I := 0 To High(Directories) Do
if ExecRegExpr(Directory, Directories[I]) then
if (Directories[I] > Result) then
Result := Directories[I];
end;

function FindDirectory(Directory, Path: String): Boolean;
begin
Expand Down

0 comments on commit e0004e2

Please sign in to comment.