Index of Functions ------------------ 1: TabNumber Function Name ( 1): TabNumber -------------------------------------------------------------------------------- 'Date Created: 03-Mar-1999 08:23:24 PM 'Last Updated: 15-Jul-2008 01:01:21 PM 'Created By : Ira J. Perlow 'Updated By : Ira J. Perlow function TabNumber as N(TabbedForm=NULL_VALUE() as A) 'DESCRIPTION: Get the total # of tabs of the current Tab object '========================================================================= ' Created by Computer Systems Design & Associates ' Copyright 2008 Computer Systems Design & Associates, All Rights Reserved ' http://www.csda1.com ' You may use this code at your own risk in whole or as a part. ' Use in full or part is permitted with proper attributions to the source, ' except it may not be sold as part of any software package that is a ' library of functions '========================================================================= ' TabNumber - Version 1.01 Release Date: 20080716 ' ' Syntax: C TabNumber([A TabbedForm]) ' ' Purpose: Get the total # of tabs of the current Tab object ' ' Input: TabbedForm = Object name or pointer ' If not specified, uses current selected object ' If pointer, uses that pointer to object ' If non-blank character type, uses current form and object name given ' ' Output: The number of tabs on the current object ' ' Errors: Returns negative value if not a tab object ' ' Typical Usage: ' ' Examples: ' ?TabNumber() ' ?TabNumber(Tab_pointer) ' ?TabNumber(Tab_object_name) ' ' Notes: '====================================================================== ' Returns 0 if no tab exists TabNumber=0 IF typeof(TabbedForm)=="P" ' If pointer type tabptr=TabbedForm ' Use passed pointer ELSE IF typeof(TabbedForm)=="C" ' If character type IF Trim(TabbedForm)=="" TabNumber=-1 ' Return -1 if no such object EXIT FUNCTION END IF dim global A_FORM_CURRENT as C FormNm=A_FORM_CURRENT if is_object(TabbedForm) tabptr = obj(TabbedForm) ELSE IF is_object(FormNm+":"+Tabbedform) tabptr = obj(FormNm+":"+Tabbedform) ELSE TabNumber=-1 ' Return -1 if no such object EXIT FUNCTION end if ELSE IF typeof(TabbedForm)=="Z" ' If null type ' Use the current object tabptr = obj(eval(a5.active()+".active()")) ELSE TabNumber=-1 ' Return -1 if no such object EXIT FUNCTION END IF on error goto Error_handler_TabNumber error_code=0 ' This is the total number of tabs TabNumber=tabptr.tabs.sheet.size() on error goto 0 IF error_code>0 TabNumber=-1 END IF EXIT FUNCTION '----------------------------- Error_handler_TabNumber: error_code=error_code_get() resume NEXT EXIT FUNCTION end function End Function ( 1)---------------------------------------------------------------