[Solved] Select Directory error … delphi 7 [closed]


var
olddir: string; //global variable

procedure olddiris(name:string);
begin
    if name="trick" then
     olddir:= 'c:\program files\'+name;
  end;

procedure MyGetPath(name:string);
  var
    options : TSelectDirOpts;
  begin
    OldDirIs(name);  //returns olddir
    if FileCtrl.SelectDirectory(OldDir,options,0) then
      ShowMessage('i got it');
  end;

procedure TForm1.Button1Click(Sender: TObject);
  begin
   Mygetpath('trick');
  end;

This code runs without error… (Note: changed GetPath -> MyGetPath; added “\” to ‘c:\program files’) If the problem still exists, look elsewhere in you code or post more code/info.

6

solved Select Directory error … delphi 7 [closed]