Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

AJGermano

@AJGermano
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Does this count?
    A AJGermano

    This is a function of mine, could I get a critique on this? The reason for it being there is because exceptions coming out of the lower level library were not very descriptive or helpful to the guy trying to understand where the config was screwed so this layer was added to get some extra info into the exceptions that were coming up if files were missing and so on. Public Shared Function GetInt(ByVal iniFile As String, ByVal sectionName As String, ByVal keyName As String) As Integer Dim i As Integer Dim ConfigFile As IniConfigSource Dim ConfigSection As IConfig Try 'check file exists If (Not System.IO.File.Exists(iniFile)) Then Throw New Exception("Config file does not exist: " & iniFile) End If 'Access the file ConfigFile = New IniConfigSource(iniFile) 'Get section ConfigSection = ConfigFile.Configs(sectionName) 'check section exists If (IsNothing(ConfigSection)) Then Throw New Exception("Config section does not exist: " & iniFile & vbTab & sectionName) End If 'get key and check it is a valid value Try i = ConfigSection.GetInt(keyName) Catch ex As Exception Throw New Exception("Exception attempting to access integer key: " & iniFile & vbTab & sectionName & vbTab & keyName) End Try Return i Catch ex As Exception 'Exceptions come in here Throw ex End Try End Function

    The Weird and The Wonderful help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups