17 namespace eval ERROR {
    19     if {! [
info exists ::ERROR::msg($::errorCode)] } {
    20       return "Unknown error: $::errorCode\n\n$::errorInfo"
    22     regexp {(.*?)while executing.*} $::errorInfo -> extra
    23     return "$::ERROR::msg($::errorCode)\n\n$extra"
    26   proc MessageBox { {extra ""} {title "ERROR"} } {
    27     tk_messageBox -icon warning -type ok -parent . \
    42   set OldScidVersion   110
    60   set GameLengthLimit  210
    67   set StartOfMoveList  402
    69   set EmptyVariation   404
    70   set VariationLimit   405
    76   set CodecUnsupFeat   701
    83   set ::ERROR::msg($::ERROR::UserCancel) \
    85   set ::ERROR::msg($::ERROR::BadArg) \
    87   set ::ERROR::msg($::ERROR::FileOpen) \
    88     "Error: can not open file."
    89   set ::ERROR::msg($::ERROR::FileWrite) \
    91   set ::ERROR::msg($::ERROR::FileRead) \
    92     "Error: can not read file."
    93   set ::ERROR::msg($::ERROR::FileSeek) \
    94     "Error: can not seek in file."
    95   set ::ERROR::msg($::ERROR::BadMagic) \
    96     "Error: bad magic (corrupted file?)."
    97   set ::ERROR::msg($::ERROR::FileNotOpen) \
    98     "Error: the file is not open."
    99   set ::ERROR::msg($::ERROR::FileInUse) \
   100     "Error: the file is already in use."
   101   set ::ERROR::msg($::ERROR::FileMode) \
   103   set ::ERROR::msg($::ERROR::FileVersion) \
   104     "Database version newer than Scid; please upgrade Scid."
   105   set ::ERROR::msg($::ERROR::OldScidVersion) \
   106     "Old format Scid file, now out of date."
   107   set ::ERROR::msg($::ERROR::FileReadOnly) \
   110   set ::ERROR::msg(CompactCreate) \
   111     "A temporary database from a previous unsuccessfully compact operation already exists.\nPlease remove the files with suffix __COMPACT__ and retry.\n"
   112   set ::ERROR::msg($::ERROR::CompactRemove) \
   113     "A compacted database has been successfully created with suffix __COMPACT__.\nHowever Scid could not remove the original database (due to insufficient privileges or because a file is opened in another program).\nPlease rename it manually.\n"
   114   set ::ERROR::msg($::ERROR::CorruptData) \
   115     "Error while processing data: corrupted.\n"
   116   set ::ERROR::msg($::ERROR::Full) \
   117     "Error: insufficient space"
   118   set ::ERROR::msg($::ERROR::NameDataLoss) \
   119     "Some names (player, event, site or round) are missing and have been replaced by \"?\"\nCompact the database to make the changes permanent."
   120   set ::ERROR::msg($::ERROR::NameTooLong) \
   121     "The entered values are too long"
   122    set ::ERROR::msg($::ERROR::NameLimit) \
   123     "The maximum number of different names allowed by this database type has been reached"
   124    set ::ERROR::msg($::ERROR::OffsetLimit) \
   125     "The maximum space for games allowed by this database type has been reached"
   126    set ::ERROR::msg($::ERROR::GameLengthLimit) \
   127     "The maximum length for a game allowed by this database type has been reached"
   128    set ::ERROR::msg($::ERROR::NumGamesLimit) \
   129     "The maximum number of games allowed by this database type has been reached"
   131   set ::ERROR::msg($::ERROR::CodecUnsupFeat) \
   132     "The requested function is not supported by this type of database."