Forum » Programiranje » VB: Kako uporabiti vrsto zunaj if zanke???
VB: Kako uporabiti vrsto zunaj if zanke???
DirtyS ::
if nekaj="xx" then dim y(0 to 2) as double y(0)=435 y(1)=4564 y(2)=8956 elseif nekaj="yy" dim y(0 to 1) as double y(0)=45436 y(1)=45654 else dim y(0 to 1) as double y(0)=4578 y(1)=87578 endif dim x as integer x=ubound(y)
V kakšno obliko moram spraviti ta primer da spodnji izraz deluje (x=ubound(y))
- spremenil: Mavrik ()
majlo ::
kaj bi sploh rad naredil?
na hitro:
Dim y() As Double
If nekaj = "xx" Then
ReDim y(0 To 2)
y(0) = 435
y(1) = 4564
y(2) = 8956
ElseIf nekaj = "yy" Then
ReDim y(0 To 1)
y(0) = 45436
y(1) = 45654
Else
ReDim y(0 To 1)
y(0) = 4578
y(1) = 87578
End If
Dim x As Integer
x = UBound(y)
na hitro:
Dim y() As Double
If nekaj = "xx" Then
ReDim y(0 To 2)
y(0) = 435
y(1) = 4564
y(2) = 8956
ElseIf nekaj = "yy" Then
ReDim y(0 To 1)
y(0) = 45436
y(1) = 45654
Else
ReDim y(0 To 1)
y(0) = 4578
y(1) = 87578
End If
Dim x As Integer
x = UBound(y)
Zgodovina sprememb…
- spremenilo: majlo ()
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | vba arrayOddelek: Programiranje | 923 (616) | Vazelin |
» | SQL sortiranje JOINOddelek: Programiranje | 1162 (929) | korenje3 |
» | vb.net: dynamic textboxOddelek: Programiranje | 1180 (1070) | saule |
» | visual basic 2008 express editionOddelek: Programiranje | 1816 (1243) | sel |
» | VB in StringOddelek: Programiranje | 909 (847) | mov ax 0x7c0 |