looking for a macro

looking for a macro

cheidenfelder
Advocate Advocate
691 Views
2 Replies
Message 1 of 3

looking for a macro

cheidenfelder
Advocate
Advocate

I am looking for a macro to put my levels in alphabetical order. Does anybody know how to do this?

0 Likes
Accepted solutions (1)
692 Views
2 Replies
Replies (2)
Message 2 of 3

Sean570
Advocate
Advocate
Accepted solution

Here is a macro that should do what you want

 

 

 

ENTITY LIST sortedLevels = sort(folder('level'), 'name')
ORDERSESSION Level $sortedLevels[0].name FIRST
int i = 0
FOREACH lvl IN sortedLevels {
	IF $i+1 < size(sortedLevels) {
	    string previousLevel = $sortedLevels[i].name
		string currentLevel = $sortedLevels[i+1].name
		ORDERSESSION Level $currentLevel AFTER $previousLevel
		$i = $i + 1
	}	
}

 

 

 

0 Likes
Message 3 of 3

cheidenfelder
Advocate
Advocate

Works perfect, thank you very much.

0 Likes