Size Property

 

Description

 

Returns the size, in bytes, of all files and subfolders contained in the folder.

 

PowerBASIC Syntax

 

PROPERTY GET Size () AS VARIANT

 

Return Value

 

VARIANT. The size, in bytes, of all files and subfolders contained in the folder.

 

Example [PowerBASIC]

 

#INCLUDE "windows.inc"

#INCLUDE "scrrun.inc"

 

DIM fso AS IFileSystem

DIM pFolder AS IFolder

DIM vSize AS VARIANT

 

' Create an instance of the FileSystemObject

fso = NEWCOM "Scripting.FileSystemObject"

' Get a reference to the IFolder interface

pFolder = fso.GetFolder(UCODE$("C:\MyFolder"))

' Get and display the size

vSize = pFolder.Size

MSGBOX "Folder size: " & STR$(VARIANT#(vSize)) & " bytes"

 

Valid XHTML 1.0 Transitional