Is there a function to get the layer number from the layer name in MapBasic? I am writing a script to loop through each layer I have and apply styles and labelling. Each layer is named _#_LINE or _#_BUFFER
So I was thinking of assigning the layer number as an integer, applying the styles then incrementing the # by one so it moves onto the next layer.