.. highlightlang:: us .. index:: GetProfileSection .. _getprofilesection: GetProfileSection ================= .. us.tag GetProfileSection ENGLISH uniplot-registry New400 :ref:`GetProfileSection` returns all keys with their values of the specified section in the form key=value. .. function:: svVal = GetProfileSection(ssSection, ssIniFile) .. us.return **Return Value** *svVal* is a string vector with all keys of the given section. The key name is followed by a ``=`` character followed by the value. Use :ref:`strtok` to split the values into key and value. In case of an error the function returns an empty string (""). .. us.params **Parameters** .. uparam:: ssSection *ssSection* specifies the section containing the key name. The name of the section is case-insensitive. .. uparam:: ssIniFile *ssFileName* is a string naming the initialization file. .. us.example **Example** If the file d:/test.ini contains the following text :: [Section] Key=123 the call to GetProfileSection returns the string "Key=123" :: svString = GetProfileSection("Section", "d:/test.ini"); if (svString[1] == "") { error() } nKeys = len(svString); smKey = strempty(nKeys, 2); for (i in 1:nKeys) { svKeyVal = strtok(svString[i], "=", FALSE); smKey[i;1] = svKeyVal[1]; smKey[i;2] = svKeyVal[2]; } .. seealso:: :ref:`overview-files`, :ref:`WriteProfileString`, :ref:`WriteProfileInt`, :ref:`GetProfileSectionNames` :sub:`id-1346108`