Skip to content

Instantly share code, notes, and snippets.

@KaiSforza
Created June 29, 2012 18:25
Show Gist options
  • Save KaiSforza/3019824 to your computer and use it in GitHub Desktop.
Save KaiSforza/3019824 to your computer and use it in GitHub Desktop.
example for visual basic UOM module
Public Function UOM(PackName As String) As String
Select Case Packname
Case "drum"
UOM = "LB"
Case else
UOM = "NA"
End Select
End Function
' I want it to output LB not only when the string is "drum" but also if it is
' "SigmaCure drum" or "SigmaCure drum 2.5M#"
' How it used to look (there were about 30 lines, about 5 for each different UOM.
' Basically a mass of unorganized if-else statements.
Public Function UOM_old(PackName As String) As String
If InStr(PackName, "drum") >=1 Then
UOM_old = "LB"
Else
UOM_old = "NA"
End If
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment