@@ -892,11 +892,10 @@ Function KillStorage()
892892 killGlobalvar ( "parsingTime" )
893893End
894894
895- // Returns a list with the following optional suffixes removed:
896- // -Module " [.*]"
897- // -Ending ".ipf"
898- // -Both ".ipf [.*]"
899- Function /S nicifyProcedureList ( list)
895+ /// @brief Return a list of procedures with the module suffix " [.*]" removed
896+ //
897+ /// @see ProcedureListRemoveEnding
898+ Function /S ProcedureListRemoveModule ( list)
900899 string list
901900
902901 variable i , idx
@@ -905,6 +904,23 @@ Function/S nicifyProcedureList(list)
905904 for ( i = 0; i < ItemsInList ( list) ; i += 1 )
906905 item = StringFromList ( i , list)
907906 item = RemoveEverythingAfter ( item, " [" )
907+ niceList = AddListItem ( item, niceList, ";" , inf )
908+ endfor
909+
910+ return niceList
911+ End
912+
913+ /// @brief Return a list of procedures with the ending ".ipf" removed
914+ //
915+ /// @see ProcedureListRemoveModule
916+ Function /S ProcedureListRemoveEnding ( list)
917+ string list
918+
919+ variable i , idx
920+ string item, niceList= ""
921+
922+ for ( i = 0; i < ItemsInList ( list) ; i += 1 )
923+ item = StringFromList ( i , list)
908924 item = RemoveEverythingAfter ( item, ".ipf" )
909925 niceList = AddListItem ( item, niceList, ";" , inf )
910926 endfor
@@ -1189,15 +1205,32 @@ static Function/Wave getSaveVariables()
11891205 return wv
11901206End
11911207
1192- // Returns a list of all procedure files of the given independent module/ProcGlobal
1193- Function /S getProcList ( module)
1194- String module
1208+ // Get a list of all procedure files of the given independent module/ProcGlobal
1209+ //
1210+ // @param module Independent Module or ProcGlobal Namespace
1211+ // @param addModule [optional, default 0] add the module to the list
1212+ // Module is added as Module#Procedure in a way similar to Module#Function()
1213+ Function /S getProcList ( module, [ addModule] )
1214+ string module
1215+ variable addModule
1216+
1217+ string procedures
1218+
1219+ addModule = ParamIsDefault ( addModule) ? 0 : !! addModule
11951220
1196- if ( isProcGlobal ( module) )
1197- return getGlobalProcWindows ()
1221+ if ( isProcGlobal ( module))
1222+ module = "ProcGlobal"
1223+ procedures = getGlobalProcWindows ()
11981224 else
1199- return getIMProcWindows ( module)
1225+ procedures = getIMProcWindows ( module)
1226+ endif
1227+
1228+ if ( addModule)
1229+ procedures = ProcedureListRemoveEnding ( procedures)
1230+ module = module + "#"
1231+ procedures = AddToItemsInList ( procedures, prefix= module)
12001232 endif
1233+ return procedures
12011234End
12021235
12031236static Function getParsingTime ()
0 commit comments