Assembly: EDKB12WS (in EDKB12WS.exe)

Syntax

Visual Basic

Public Shared Function Bar25Ics( _
   ByVal BarTextIn As String _
) As String

C#

public static string Bar25Ics(
   stringBarTextIn
)

C++

public: 
static String^ Bar25Ics(
   StringBarTextIn

JScript

public static function Bar25Ics(
    BarTextIn : String
) : String;

Parameters

BarTextIn

 

 

 

 

Source code

Visual Basic

 Public Function Bar25Ics(ByVal BarTextIn As String) As String
 
    ' Initialize input and output strings
    BarTextOut = ""
    BarTextIn = RTrim(LTrim(BarTextIn))
 
    ' Throw away non-numeric data
    TempString = ""
    For II = 1 To Len(BarTextIn)
        If IsNumeric(Mid(BarTextIn, II, 1)) Then
            TempString = TempString & Mid(BarTextIn, II, 1)
        End If
    Next II
 
    ' If not an odd number of digits, add a leading 0
    If (Len(TempString) Mod 2) = 0 Then
        TempString = "0" & TempString
    End If
 
    ' Figure out the checksum digit
    Sum = 0
    For II = 1 To Len(TempString)
        CharValue = Mid(TempString, II, 1)
        If (II Mod 2) = 1 Then
            Sum = Sum + (3 * CharValue)
        Else
            Sum = Sum + CharValue
        End If
    Next II
 
    ' Figure checksum, add it as last digit
    CheckSum = 10 - (Sum Mod 10)
    If CheckSum = 10 Then CheckSum = 0
    TempString = TempString & Chr(48 + CheckSum)
 
    ' Break digit pairs up and convert to characters- build output string
    For II = 1 To Len(TempString) Step 2
        'Break string into pairs of digits and get value
        CharValue = Mid(TempString, II, 2)
        'translate value to ASCII and save in BarTextOut
        If CharValue < 90 Then
            BarTextOut = BarTextOut & Chr(CharValue + 33)
        Else
            BarTextOut = BarTextOut & Chr(CharValue + 71)
        End If
    Next II
 
    'Build ouput string, trailing space for Windows rasterization bug
    barcodeout = "{" & BarTextOut & "} "
 
    'Return the string
    Bar25Ics = barcodeout
 
 End Function 

Platforms

Windows 8, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

 

Version Information

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0
 

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0
 

XNA Framework

Supported in: 3.0, 2.0, 1.0
 

 

See Also