NewEnum_ Method

 

Description

 

Returns a reference to the standard IEnumVARIANT interface.

 

PowerBASIC Syntax

 

METHOD NewEnum_ () AS IUnknown

 

Return Value

 

IUnknown. A reference to the standard IEnumVARIANT interface.

 

Example [PowerBASIC]

 

#INCLUDE "windows.inc"

#INCLUDE "scrrun.inc"

 

DIM fso AS IFileSystem

DIM pEnum AS IEnumVARIANT

DIM pDrive AS IDrive

DIM vItem AS VARIANT

DIM celtFetched AS DWORD

 

' Create an instance of the FileSystemObject

fso = NEWCOM "Scripting.FileSystemObject"

' Get a reference to the IDrives collection

pDrives = fso.GetDrives

' Get a reference to the standard enumerator

pEnum = pDrives.NewEnum_

' Enumerate the collection

DO

  pEnum.Next 1, vItem, celtFetched

  IF celtFetched = 0 THEN EXIT DO

  pDrive = vItem

  STDOUT ACODE$(pDrive.DriveLetter)

LOOP

 

Valid XHTML 1.0 Transitional