0

I found some helpful code online where only the library file was provided and I recreated the source code but found a couple errors I am not sure of.

<StandardModule()> _
Friend NotInheritable Class CreateFiles
' Methods

' Fields
Private Shared Configuration As Configuration = New Configuration

' Nested Types
Private Delegate Sub showITDelegate(ByVal message As String)

<STAThread()> _
Public Shared Sub Main()
    CreateFiles.Configuration.ReadConfig()
    CreateFiles.DisplayConfig(CreateFiles.Configuration)
    CreateFiles.CreateFiles()
End Sub

Public Shared Sub CreateFiles()

I am trying to understand if there is another class missing because there are errors on the CreateFiles.* lines in the main and these reference subs within this very class: CreateFiles has 'expression does not produce a value' under it. Why would it reference itself and the methods and subs within the same class.

vbNewbie
  • 3,291
  • 15
  • 71
  • 155

1 Answers1

2

Seems like it looks at the Sub CreateFiles() rather than the class. And a sub (routine) doesn't return any value. You could remove the (first) CreateFiles in the Main subroutine.

This should work:

<StandardModule()> _
Friend NotInheritable Class CreateFiles
' Methods

' Fields
Private Shared Configuration As Configuration = New Configuration

' Nested Types
Private Delegate Sub showITDelegate(ByVal message As String)

<STAThread()> _
Public Shared Sub Main()
    Configuration.ReadConfig()
    DisplayConfig(Configuration)
    CreateFiles()
End Sub

Public Shared Sub CreateFiles()

Given that you don't have a problem anywhere else.

Styxxy
  • 7,462
  • 3
  • 40
  • 45
  • thanks for your response. I initially thought of that but then wondered why someone would code like that or is this just a result of the decompiler I used. – vbNewbie Jan 23 '13 at 19:38
  • It might be indeed a result of the decompiler. (I don't know which one you used.) – Styxxy Jan 23 '13 at 20:16