12. Mai 2014 18:36
OpenFolder(WindowTitle : Text[50];FolderName : Text[1024]) : Text[1024]
IF ISCLEAR(ShellControl) THEN
  CREATE(ShellControl);
FolderText := FORMAT(ShellControl.BrowseForFolder(0,WindowTitle,0).Items().Item.Path);
LastString:=strTools.Right(FolderText,1);
IF LastString <> '\' THEN
  FolderText:=STRSUBSTNO('%1\',FolderText);
IF NOT ISCLEAR(ShellControl) THEN
  CLEAR(ShellControl);
EXIT(FolderText); 13. Mai 2014 09:27
13. Mai 2014 10:03
13. Mai 2014 10:12
sweikelt hat geschrieben:es wäre interessant, wenn du uns noch sagen könntest, an welcher codestelle er rausspringt
FolderText := FORMAT(ShellControl.BrowseForFolder(0,WindowTitle,0).Items().Item.Path); 13. Mai 2014 12:06
Natalie hat geschrieben:Es wird auf [...].Items.[...] zugegriffen, obwohl kein Path gewählt worden war. Items ist damit leer --> Laufzeitfehler.
Natalie hat geschrieben:Man sollte diese Zeile eigentlich auf mehrere Zeilen aufbrechen.
CREATE(ShellControl,TRUE); // in Nav 5 ohne Parameter: CREATE(ShellControl);
Folder2 := ShellControl.BrowseForFolder(0,WindowTitle,0);
IF  ISCLEAR(Folder2) THEN
  ERROR('Kein Verzeichnis ausgewählt!')
ELSE
  BEGIN
    FolderItem := Folder2.Self;
    EXIT(FolderItem.Path + '\');
  END;Name    DataType    Subtype    Length
Folder2    Automation    'Microsoft Shell Controls And Automation'.Folder2    
FolderItem    Automation    'Microsoft Shell Controls And Automation'.FolderItem14. Mai 2014 09:29
 
  