var AppLevels=UserLevels(); return AppLevels; var qUserLevels=UserLevels(); //Instance.DataUserLevels; var qUserLevelsOut=[]; Select LevelID,TextDesc From qUserLevels Where 0=0 And LevelID = And HasMenu >= return qUserLevelsOut; var AppLevelsArray=ArrayNew(1); var qAppLevels=queryNew("LevelID,TextDesc,HasMenu","integer,varchar,integer"); var i=0; /* LevelID: numeric representation of user level TextDesc: text description of user level Menu: 0 = no menus, 1 = has menus assigned in the menu model */ //----------------------------------------------------------------------------------------------------- AppLevelsStruct=StructNew(); AppLevelsStruct.LevelID="1"; AppLevelsStruct.TextDesc="Administrator"; AppLevelsStruct.HasMenu=1; ArrayAppend(AppLevelsArray,AppLevelsStruct); AppLevelsStruct=StructNew(); AppLevelsStruct.LevelID="2"; AppLevelsStruct.TextDesc="Mall"; AppLevelsStruct.HasMenu=1; ArrayAppend(AppLevelsArray,AppLevelsStruct); AppLevelsStruct=StructNew(); AppLevelsStruct.LevelID="3"; AppLevelsStruct.TextDesc="Store"; AppLevelsStruct.HasMenu=1; ArrayAppend(AppLevelsArray,AppLevelsStruct); AppLevelsStruct=StructNew(); AppLevelsStruct.LevelID="4"; AppLevelsStruct.TextDesc="Instance"; AppLevelsStruct.HasMenu=1; ArrayAppend(AppLevelsArray,AppLevelsStruct); AppLevelsStruct=StructNew(); AppLevelsStruct.LevelID="5"; AppLevelsStruct.TextDesc="Systems"; AppLevelsStruct.HasMenu=0; ArrayAppend(AppLevelsArray,AppLevelsStruct); //----------------------------------------------------------------------------------------------------- for(i=1;i<=ArrayLen(AppLevelsArray);i++){ QueryAddRow(qAppLevels,1); QuerySetCell(qAppLevels,"LevelID",AppLevelsArray[i].LevelID); QuerySetCell(qAppLevels,"TextDesc",AppLevelsArray[i].TextDesc); QuerySetCell(qAppLevels,"HasMenu",AppLevelsArray[i].HasMenu); } return qAppLevels;