Hi everybody,
a long time I'm fed up with writing:
And so I decided to write the same Sub known from Turbo Pascal: "Inc"Code:intThisIncreasingVariable = intThisIncreasingVariable + 1
The hole stuff should look like this. I think you then will know what I mean:
But in Basic it seems to be impossible to write back to the Variable in the calling statement. Is this right?Code:Private Sub Form_load() Dim TestVar as integer TestVar = 1 inc(TestVar) MsgBox "Should be 2 but is only: " & TextVar End Sub Public Sub inc(ByRef x, Optional step = 1) x = x + step End Sub
Regards,
Frank




Reply With Quote