VBScript Reference Manual for InduSoft Web Studio
VBScript Reference Manual for InduSoft Web Studio
VBScript Reference Manual for InduSoft Web Studio
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong> <strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong><br />
Method: GetAbsolutePathName<br />
Description: Returns a complete and unambiguous path name that cannot be easily determined from the<br />
specified path in<strong>for</strong>mation.<br />
Use: strPath = fso.GetAbsolutePathName(pathspec)<br />
Arguments: fso<br />
Required. The name of a FileSystemObject object previously instantiated<br />
pathspec<br />
Required. Path specification to change to a complete and unambiguous path<br />
Return: String containing a complete and unambiguous path name<br />
Remarks: A path is complete and unambiguous if it provides a complete reference from the root of the<br />
specified drive. A complete path can only end with a path separator character (\) if it specifies the<br />
root folder of a mapped drive. Assuming the current directory is c:\mydocuments\reports, the<br />
following table illustrates the behavior of the GetAbsolutePathName method:<br />
pathspec Returned path<br />
"c:" "c:\mydocuments\reports"<br />
"c:.." "c:\mydocuments"<br />
"c:\" "c:\"<br />
"c:*.*\may97" "c:\mydocuments\reports\*.*\may97"<br />
"region1" "c:\mydocuments\reports\region1"<br />
"c:\..\..\mydocuments" "c:\mydocuments"<br />
Example: Dim fso, pathSpec, myPath<br />
Set fso = CreateObject("Scripting.FileSystemObject" ‘Current directory is<br />
c:\mydocuments\reports<br />
pathSpec = “C:\”<br />
myPath = fso.GetAbsolutePathName(pathSpec) ‘Returns c:\mydocuments\reports<br />
Method: GetBaseName<br />
Description: Returns just the name of the object specified. It removes all other in<strong>for</strong>mation including the<br />
extension<br />
Use: strBaseName = fso.GetBaseName(path)<br />
Arguments: fso<br />
Required. The name of a FileSystemObject object previously instantiated<br />
path<br />
Required. The path specification <strong>for</strong> the component whose base name is to be returned.<br />
Return: String containing the name of the object specified.<br />
Remarks: The GetBaseName method works only on the provided path string. It does not attempt to resolve<br />
the path, nor does it check <strong>for</strong> the existence of the specified path. The GetBaseName method<br />
returns a zero-length string (“”) if no component matches the path argument.<br />
Example: Dim fso, filespec, baseName<br />
Set fso = CreateObject("Scripting.FileSystemObject"<br />
filespec = $getAppPath() & “recipes.xml”<br />
baseName = fso.GetBaseName (filespec) ‘Returns “recipes”<br />
222 <strong>InduSoft</strong>, Ltd.