Attribute VB_Name = "Begin"
Option Explicit
Public ActualLanguage As MONIERLANGUAGE
Public CanSave As Integer
Public DIR_HELP As String

Sub Main()
    Dim TmpInt As Integer
    Dim TmpStr As String
    
    DIR_HELP = App.Path & "\Help"
    
    F_SAVERATE = App.Path & "\Bin\Score.hsg"
    LoadRates
    TmpInt = Val(mGetSettings("Settings", "Language", "D", -1))
    If (TmpInt < 3) And (TmpInt > -1) Then
        ActualLanguage = TmpInt
    Else
        ActualLanguage = ML_ENGLISH
    End If
    Translate ActualLanguage
    If Dir(App.Path & "\Bin", vbDirectory) = "" Then
        On Error GoTo nocopy
        MkDir App.Path & "\Bin"
        CanSave = 1
    Else
        Dim MyFile As Integer
        MyFile = FreeFile
        On Error GoTo nocopy
        Open App.Path & "\Bin\pwrfile.tmp" For Output As MyFile
            Print #MyFile, "Can write"
        Close MyFile
        On Error GoTo nocopy
        Kill App.Path & "\Bin\pwrfile.tmp"
        CanSave = 1
    End If
    SplashForm.Show
    Exit Sub
nocopy:
    MsgBox "You cannot save your rates if you run the program in a read-only disk"
    CanSave = 0
    MainForm.Show
End Sub
