View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default Use static arrays

This worked for me

'-------------------------------------------------------------------------'
Public Function KeysResult(aPResult, bSet As Boolean) As Variant
'-------------------------------------------------------------------------'
Static aResult
If bSet Then
ReDim aResult(conTotalModules)
aResult = aPResult
Else
KeysResult = aResult
End If
End Function


--
HTH

Bob Phillips

"François" wrote in message
...
Hello,

I would like to use the static declaration for an array. However I have
some difficulties on the subject.

Public Function KeysResult(aPResult, bSet As Boolean) As Variant

'-------------------------------------------------------------------------'
If bSet Then
Static aResult(conTotalModules) As Boolean
aResult = aPResult
Else
KeysResult = aResult
End If
End Function
Public Function KeysDLine(aPDLines, bSet As Boolean) As Variant
'------------------------------------------------------------------------'
If bSet Then
Static aDLines(conTotalModules) As Variant
aDLines = aPDLines
Else
KeysResult = aDLines
End If
End Function

This give an error like : <can't assign to array. Any idean how to solve
this ?

Many thanks