'************************************** ' Name: Toggles & Array Size - "One line ' rs" ' Description:Two simple Boolean mathema ' tical functions; the first is Toggles! A ' switch function! Simply what it does is ' use math and data type conversions to to ' ggle the input of 1, 0 or -1 and keep it ' changing like a turbine with subsequent ' calls. The exception is of the ability o ' f calling it twice with adding on a nega ' tive to the input. Example, Toggles(-Tog ' gles(#)), then it toggles from 1 to -1 a ' nd -1 to 1, but leaves 0 at 0. The secon ' d function returns the number of element ' s in an array taking into the considerat ' ion of allowances to zero elements and z ' ero indices as well as non-zero indices. ' I wanted both of these functions one lin ' e and it was sort of simplistic, but sor ' t of brain racking as well too with the ' single line formality personally obtaine ' d. ' By: Nicholas Forystek ' ' ' Inputs:None ' ' Returns:None ' 'Assumes:None ' 'Side Effects:None '************************************** Public Function Toggles(ByVal Value As Long) As Long Toggles = (-CInt(CBool(Value)) + -1) + -CInt(Not CBool(-Value + -1)) End Function Public Function ArraySize(InArray) As Long ArraySize = (UBound(InArray) + -CInt(Not CBool(-LBound(InArray)))) End Function