/
Forside
/
Teknologi
/
Udvikling
/
VB/Basic
/
Nyhedsindlæg
Login
Brugernavn
*
Kodeord
*
Husk mig
Brugerservice
Kom godt i gang
Bliv medlem
Seneste indlæg
Stil et spørgsmål
Skriv et tip
Pointsystemet
Kontakt Kandu.dk
Emnevisning
Kategorier
Alfabetisk
Karriere
Interesser
Teknologi
Reklame
Top 10 brugere
VB/Basic
#
Navn
Point
1
berpox
2425
2
pete
1435
3
CADmageren
1251
4
gibson
1230
5
Phylock
887
6
AntonV
790
7
strarup
750
8
Benjamin...
700
9
tom.kise
610
10
EXTERMINA..
600
How Can I Know the dimensions of arrays di~
Fra :
pippo
Dato :
20-11-02 12:01
I.E. How I chek if array dinamic is located.
DIM arr() Long
if (Ubound(arr)) then '<<<< Error. Ho not is dimensionate with REDIM
-------------------------------------------------
At me not LIKE the management Errors (On Error ) of VB.
-------------------------------------------------
Alfonso.
John Doe (
21-11-2002
)
Kommentar
Fra :
John Doe
Dato :
21-11-02 14:28
A dirty "hack" is to make a function which tests the array
if not dim - then return -1
like this
Option Explicit
Private Sub Form_Load()
Dim arr() As Long
'ReDim Preserve arr(10)
MsgBox TestArray(arr)
End Sub
Function TestArray(vArr() As Long) As Integer
Dim i As Integer
On Error Resume Next ' turn off errorchecking
i = UBound(vArr)
If Err <> 0 Then 'Array is not dim
i = -1
Err.Clear ' clean up
End If
On Error GoTo 0 'turn on normal errorchecking
TestArray = i
End Function
"pippo" <pippo@iol.it> wrote in message
news:KXJC9.42856$Yw.2017031@news2.tin.it...
> I.E. How I chek if array dinamic is located.
>
> DIM arr() Long
> if (Ubound(arr)) then '<<<< Error. Ho not is dimensionate with REDIM
>
> -------------------------------------------------
> At me not LIKE the management Errors (On Error ) of VB.
> -------------------------------------------------
>
> Alfonso.
>
>
>
pippo (
22-11-2002
)
Kommentar
Fra :
pippo
Dato :
22-11-02 10:51
Tank You, but I don't like managente Error On Error. I can chek the memory
pointer?.
"John Doe" <john@doe.com> ha scritto nel messaggio
news:arin1t$n3g$1@news.net.uni-c.dk...
> A dirty "hack" is to make a function which tests the array
>
> if not dim - then return -1
>
> like this
>
> Option Explicit
>
> Private Sub Form_Load()
>
> Dim arr() As Long
> 'ReDim Preserve arr(10)
> MsgBox TestArray(arr)
>
> End Sub
>
> Function TestArray(vArr() As Long) As Integer
>
> Dim i As Integer
>
> On Error Resume Next ' turn off errorchecking
> i = UBound(vArr)
> If Err <> 0 Then 'Array is not dim
> i = -1
> Err.Clear ' clean up
> End If
> On Error GoTo 0 'turn on normal errorchecking
> TestArray = i
>
> End Function
>
>
>
> "pippo" <pippo@iol.it> wrote in message
> news:KXJC9.42856$Yw.2017031@news2.tin.it...
> > I.E. How I chek if array dinamic is located.
> >
> > DIM arr() Long
> > if (Ubound(arr)) then '<<<< Error. Ho not is dimensionate with REDIM
> >
> > -------------------------------------------------
> > At me not LIKE the management Errors (On Error ) of VB.
> > -------------------------------------------------
> >
> > Alfonso.
> >
> >
> >
>
>
Søg
Alle emner
Teknologi
Udvikling
VB/Basic
Indstillinger
Spørgsmål
Tips
Usenet
Reklame
Statistik
Spørgsmål :
177817
Tips :
31980
Nyheder :
719565
Indlæg :
6410968
Brugere :
218912
Månedens bedste
Årets bedste
Sidste års bedste
Copyright © 2000-2026 kandu.dk. Alle rettigheder forbeholdes.