VS:GetFolder: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
 
No edit summary
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Prompts for the selection of a folder. Defaults to the folder name in the argument list. Returns 0 if the user hits OK, and -1 if the user hits cancel.
Gets the path to a user selected folder</desc>
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION GetFolder(promptStr :STRING; VAR directoryPath :STRING) :INTEGER;
FUNCTION GetFolder(promptStr:STRING; VAR directoryPath:STRING) : INTEGER;
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 30: Line 29:
directoryPath
directoryPath
STRING
STRING
Output parameter.
 
</line>
</line>
</lineList>
</lineList>
</params>
</params>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<return>
<remark></remark>
</return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<sample></sample>
On the Mac, directoryPath will use foreslashes instead of colons.
 
[[User:Orso.b.schmid| Orso]] 2010.09.24: Foreslashes on Mac have been introduced by VW12. If you happen to script for older versions, be aware that this routines returned path with colons until VW11.
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<seeAlso></seeAlso>
<code lang="pas">
PROCEDURE Example;
VAR
  promptStr :STRING;
  directoryPath :STRING;
  result :INTEGER;
BEGIN
  promptStr := 'Select the folder...';
  directoryPath := GetFolderPath(2);
  result := GetFolder(promptStr, directoryPath);
  Message(directoryPath);
END;
Run(Example);</code>
 
</sample>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<version>
<version>
Availability: from All Versions
Availability: from Vectorworks 2014


This is drop-in function.
</version>
</version>
-----------------------------------------------------------------------------------------------------------
<seeAlso>
</seeAlso>


</vwDoc>
</vwDoc>

Revision as of 17:38, 18 September 2013

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Gets the path to a user selected folder

FUNCTION GetFolder(
promptStr :STRING;
VAR directoryPath :STRING) : INTEGER;
def vs.GetFolder(promptStr):
    return (INTEGER, directoryPath)

Parameters

promptStr STRING
directoryPath STRING

Version

Availability: from Vectorworks 2014