J
Jay B. Harlow [MVP - Outlook]
Crirus,
As your other post suggests. If you already have the X & Y that "operate as
the flags" I would not bother with the flags, I would simply send in the x &
y values. (or two booleans where I compare the values. Which in many ways
simplify your code. I would use the Enum, where you just know that you need
those values, not based on other conditions (for example the sides of a
box).
function myarrayfunction (firstRow as Boolean, firstColumn As boolean,
rows,columns)
If firtRow Then
RowIndexStart = 0
RowIndexEnd = rows
Else
RowIndexStart = rowtable.length - (rows + 1)
RowIndexEnd = rowtable.length - 1
End If
If firstColumn Then
ColIndexStart = 0
ConIndexEnd = columns
Else
ColIndexStart = coltable.length - (columns + 1)
ColIndexEnd = coltable.length - 1
End If
Then when you call it you can use:
myarrayfunction (x > 0, y > 0, rows , columns )
I would still separate the check (x >0) from the process, as it makes the
process slightly clearer...
Hope this helps
Jay
As your other post suggests. If you already have the X & Y that "operate as
the flags" I would not bother with the flags, I would simply send in the x &
y values. (or two booleans where I compare the values. Which in many ways
simplify your code. I would use the Enum, where you just know that you need
those values, not based on other conditions (for example the sides of a
box).
function myarrayfunction (firstRow as Boolean, firstColumn As boolean,
rows,columns)
If firtRow Then
RowIndexStart = 0
RowIndexEnd = rows
Else
RowIndexStart = rowtable.length - (rows + 1)
RowIndexEnd = rowtable.length - 1
End If
If firstColumn Then
ColIndexStart = 0
ConIndexEnd = columns
Else
ColIndexStart = coltable.length - (columns + 1)
ColIndexEnd = coltable.length - 1
End If
Then when you call it you can use:
myarrayfunction (x > 0, y > 0, rows , columns )
I would still separate the check (x >0) from the process, as it makes the
process slightly clearer...
Hope this helps
Jay