05-14-2023, 08:40 PM
(This post was last modified: 05-14-2023, 08:43 PM by Kernelpanic.)
@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