In REALbasic 5.5 we made it easier to create arrays in code. Rather
than having to do this:
Dim months(11) as String
months(0) = "Jan"
months(1) = "Feb"
etc., now you can do this:
Dim months() as String
months = Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec")
And if you need to loop through an array, you can even do this:
dim month as String
for each month in Array("Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
next
As you can see, the array function can save many lines of code and make
your code easier to read.
He doesn't know it, but this tip was inspired by Will Leshner and
suggested by Matt Quagliana.
--
Geoff Perlman
President and CEO
REAL Software, Inc.
REAL World 2005 - The REALbasic User Conference
March 23rd - 25th, 2005, Austin, Texas
<http://www.realsoftware.com/realworld>
|