$count += 1

The closest you can come in today's RB is to implement your own
Extends routine in a module somewhere:

 Sub Inc(extends byref i as integer, incrementAmount as integer = 1)
   i = i + incrementAmount
 End Sub

At that point, you can do this:

 dim i as integer = 4
 i.Inc                   // after this, i = 5
 i.Inc 2                // after this, i = 7

etc. Or you could do it without the "extends", and use it like this:

 Inc i
 Inc i, 2

In either case, I would argue that neither authors nor readers are
helped -- for one thing, to be sure of what's happening, they have to
examine the "Inc" method in every project they see (and repeatedly
over time, to be extra double sure).

However, I would like it if RB offered the += operator, because once
it's in the language, everybody learns it and can rely upon it.

lj
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to