Created
June 29, 2012 18:25
-
-
Save KaiSforza/3019824 to your computer and use it in GitHub Desktop.
example for visual basic UOM module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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