I have seen Expand function mentioned few times before on thos forum and would like to share another technique (that you may find useful)...
Say, we are building a GL hierachies and we have level codes from data source as follow vlevel1code, vlevel2code, vlevel3code and so on. We also have names/aliases: vlevel1name, vlevel2name and so on.
Instead of having to write long block of code to populate Name and Description of those hierarchies, I have turned my eyes onto the EXPAND function to "Expand" elements under these variables to populate aliases in one simple loop... sample code below:
Loop will run through 8 variables to get out vLevel1code, etc and vLevel1Name etc by "Expanding" elements of each variable and assigning appropriate alias.
nIndex = 1;
nLimit = 8;
vLevelCode = Expand ( '%' | Expand ( 'vLevel'|NumberToString(nIndex)|'Code')| '%');
vLevelName = Expand ( '%' | Expand ( 'vLevel'|NumberToString(nIndex)|'Name')| '%');
CellPutS( vLevelCode|' - '|vLevelName, cCube, vLevelCode, 'Code + Description' );
nIndex = nIndex + 1;
END;
Please let me know if its any use to you guys

Evgeny