I tried using the Space$() but that did not help. I also thought about the redefining of the function, but I can not find any reference to it.
The problem stems from this. I have a project that I created a while back to access the windows API (see below). In a new project that I am creating I require the use of this function, So I copied and pasted it into the project and now VB thinks Space(1024) is an array. But it works fine in my old project!
'=====================
Public Function fileExpandedName( _
ByVal sFilename As String) _
As String
Dim sBuffer As String
sBuffer = Space(1024) '<<<<<<<<<<Errors out here with a message, Expected Array
GetExpandedName sFilename, sBuffer
fileExpandedName = sNT(sBuffer)
End Function
Public Function sNT( _
ByVal sString As String) _
As String
Dim iNullLoc As Integer
iNullLoc = InStr(sString, Chr(0))
If iNullLoc > 0 Then
sNT = Left(sString, iNullLoc - 1)
Else
sNT = sString
End If
End Function
'========================
'API
Public Declare Function GetExpandedName _
Lib "lz32.dll" _
Alias "GetExpandedNameA" ( _
ByVal lpszSource As String, _
ByVal lpszBuffer As String) _
As Long
'=======================
Troy Williams B.Eng.
fenris@hotmail.com