Jump to content
  • 0

Move up or down one VISIBLE layer


P Retondo

Question

2 answers to this question

Recommended Posts

  • 0

Found it. Hopefully it works. Not tested now, not sure if these are the working versions.

PROCEDURE VisibleLayersUp; { ? Petri Sakkinen 1995-2007 } 
VAR
layerName : STRING; 
layerVisibility : INTEGER; 
theLayer : HANDLE;

BEGIN
theLayer := ACTLAYER; 
layerVisibility := 1;
WHILE NOT(layerVisibility = 0) DO BEGIN
	theLayer := NEXTLAYER(theLayer); 
	layerVisibility := GETLVIS(theLayer);
END;
layerName := GETLNAME(theLayer);
IF NOT(layerName = '') THEN LAYER(layerName); 
END; 

RUN(VisibleLayersUp);

-----------

PROCEDURE VisibleLayersDown; { ? Petri Sakkinen 1995-2007 } 
VAR
layerName : STRING; 
layerVisibility : INTEGER; 
theLayer : HANDLE;

BEGIN
theLayer := ACTLAYER; 
layerVisibility := 1; 
WHILE NOT(layerVisibility = 0) DO BEGIN
	theLayer := PREVLAYER(theLayer); 
	layerVisibility := GETLVIS(theLayer);
END;
layerName := GETLNAME(theLayer);
IF NOT(layerName = '') THEN LAYER(layerName); 
END; 

RUN(VisibleLayersDown);

They do not go to the first layer after the last; this is by design (but changing the behaviour is easy:

IF NOT(layerName = '') THEN LAYER(layerName) ELSE BEGIN 
   layerName := GETLNAME(FLAYER);
   LAYER(layerName); 
END; 

I think...

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...