Hi Guys,

In more and more of my functions (althought they still work) i'm getting a warning the function doesn't return a value on all code paths.

for example:

vb.net Code:
  1. Function functionLoadHiddenFields(ByVal fileLocation As String, ByVal Y As Integer)
  2.  
  3.         '// Check if the file exists
  4.         If File.Exists(fileLocation) Then
  5.  
  6.             '// Load the xml document
  7.             Dim XMLDoc As New Xml.XmlDocument
  8.  
  9.             '// Find and load the XML file
  10.             XMLDoc.Load(fileLocation)
  11.  
  12.             '// Tell where to look for the data we need
  13.             Dim XMLItem As Xml.XmlNode = XMLDoc.SelectSingleNode("hiddenFields/hiddenValues")
  14.  
  15.             'MessageBox.Show((XMLItem.Attributes("hiddenFieldsID" & (Y)).InnerText))
  16.             Return XMLItem.Attributes("hiddenFieldsID" & (Y)).InnerText
  17.  
  18.         End If
  19.  
  20.     End Function

if i put in the return false it wouldn't show the message, is it basically a way of saying:

if expression true do this, return true, else return false

i know in PHPO for example i can just return either true, or a value.

thanks for any info guys

Graham