OK - I misread the source of those two functions.. they're fine.

Most of my UDF posts reference this and many of the older farts around here know, but my web site always hosts the most current copy of the UDFs we use in production coding. I rewrote the PostPrep utility to run from a command line, and it has the ability to convert an entire folder's worth of UDFs to HTML format. Our web management server runs a task at 10pm nightly that converts all of our UDFs to HTM, so any updates will appear nightly. I do give a heads-up on KORG for some of the more popular UDFs and even update some of them here, but it's a good idea to always check our site for the most current versions.. Click the IT Resources menu, then Kixtart. The UDF Library link is in the middle of that page. There are 141 items on that link, including 4 "libraries" - collections of related UDFs for database access, WSUS management, task scheduler control, an MS Excel manipulation. The version string for IniArray() is
 Code:
;;VERSION        1.0 / 2011-08-02
;;		 1.1 / 2013-04-17 - improve file load on large files, bugfix

My reference to UCase didn't indicate it was wrong or bad form, just that it was unnecessary in Kix.

Before you just move the global declaration out of your UDF, take a look at the tcLib UDF Library, specifically the tcInit() function for an alternate method. This function declares global vars only if they don't already exist, allowing the first call to tcInit to initialize the environment and preload the arrays, following calls only preload the arrays.

I still think your method is complex. Tell me how your computer naming scheme works and I might be able to offer some ways to simplify. Right off the bat, with computer/user definitions, you might be able to do something like
 Code:
; configuration for a specific computer, with user-specific default printers. Unlisted users default to Printer1
[computer 1]
fred=Printer2
mary=Printer3
; printers map for all users, printer1 is set default unless a user-specific override is defined
Printer1=printer UNC
Printer2=printer UNC
Printer3=printer UNC
; disable mapping of all printers - default is to map
Building_Printers=No
to handle both generic and user-specific defaults with one record. Look at the Bool() UDF so your setting values can be Yes/No, True/False, On/Off, or 1/0.

Think about the data before the code.. realize that an INI value can hold many data items:
 Code:
[SECTION]
Value=D1,d2,"last, first",d5
Use the CSV() UDF to read a CSV data set:
 Code:
$aRecordData=CSV(ReadIniArray($Array, $Section, $Value))
This will create an array of the related data from just one read of the INI file or INI_Array. Packing data like this might simplify your code significantly. You might also consider a two-layer approach.. create a section for the school that defines the classrooms, this would point to sections that define the specific mappings. A slight increase in data complexity can result in sigificant reduction in code complexity. This is important with scripts like this that touch your entire user population. Simplicity = reliability.

Tell us more about the layout of the district and we'll be able to offer some specific ideas to make this nearly bullet-proof for you.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D