IDE - just a thought on Next and Out of Subscript
#11
@bplus - Your sizing [foo(100)] is static. This cannot be resized. This is only possible with a dynamic array.

Code: (Select All)
Option _Explicit

On Error GoTo Fehlermeldung
Dim As Integer feldGroesse

'Otherwise static: feld(10)
feldGroesse = 10
Dim As Integer feld(feldGroesse), neueFeldGroesse

Locate 2, 2
Input "Neue Feldgroesse: ", neueFeldGroesse

'Only with Redim
ReDim feld(neueFeldGroesse)

Locate 4, 2
Print "Neue Feldgroesse: "; neueFeldGroesse

Locate 6, 2
'Muss groesser sein! - Have to be greater!
Input "Neue Feldgroesse: ", neueFeldGroesse

Locate 8, 2
'New array size without ReDim.
Print "Neue Feldgroesse ohne Redim: "; feld(neueFeldGroesse)


Fehlermeldung:
Locate CsrLin + 1, 2
Beep: Print "Fehler bei: "; _ErrorLine

Locate CsrLin + 1, 2
Print "Fehler: "; Err

End

[Image: Ausserhalb-des-Index-ohne-Redim2023-05-14.jpg]
Reply


Messages In This Thread
RE: IDE - just a thought on Next and Out of Subscript - by Kernelpanic - 05-14-2023, 08:40 PM



Users browsing this thread: 12 Guest(s)