Attribute VB_Name = "Comm"
Public DBname As String
Public DTPath As String

'**************************************************
'   初期化ファイルを読み込んでグローバル変数にセット
'**************************************************
Sub InitVals()
    Dim IniFile As String
    Dim str, str1, str2 As String
    Dim P As Variant
    
    IniFile = App.Path & "\HT2PC2.ini"
    Open IniFile For Input As #1
    Do While Not EOF(1)
        Line Input #1, str
        P = InStr(1, str, "=")
        If (P > 0) Then
            str1 = Trim(Mid(str, 1, P - 1))
            str2 = Trim(Mid(str, P + 1, Len(str) - P))
            Select Case str1
            Case "DBname"
                DBname = str2
            Case "DATA"
                DTPath = str2
            End Select
        End If
    Loop
    
    Close (1)
    
End Sub

'****************************************************
'   文字列の先頭を０（ゼロ）で埋める
'****************************************************
Function Zero_fix(L, V)
    WL = Len(V)
    If (WL < L) Then
        For i = WL To L - 1
            V = "0" & V
        Next i
    End If

    Zero_fix = V
    
End Function
