home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / t2win-32 / _dmlang.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-08-24  |  12.0 KB  |  377 lines

  1. VERSION 4.00
  2. Begin VB.Form frmDayMonth 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Days and months in different language"
  5.    ClientHeight    =   4065
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3255
  8.    ClientWidth     =   8130
  9.    Height          =   4470
  10.    Left            =   1830
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4065
  14.    ScaleWidth      =   8130
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2910
  17.    Width           =   8250
  18.    Begin Threed.SSPanel SSPanel1 
  19.       Align           =   1  'Align Top
  20.       Height          =   480
  21.       Left            =   0
  22.       TabIndex        =   1
  23.       Top             =   0
  24.       Width           =   8130
  25.       _Version        =   65536
  26.       _ExtentX        =   14340
  27.       _ExtentY        =   847
  28.       _StockProps     =   15
  29.       ForeColor       =   -2147483640
  30.       BackColor       =   12632256
  31.       Begin VB.ComboBox cmb_Function 
  32.          Height          =   315
  33.          Left            =   1365
  34.          TabIndex        =   2
  35.          Top             =   90
  36.          Width           =   5415
  37.       End
  38.       Begin Threed.SSCommand cmdNP 
  39.          Height          =   300
  40.          Index           =   1
  41.          Left            =   7770
  42.          TabIndex        =   6
  43.          Top             =   90
  44.          Width           =   255
  45.          _Version        =   65536
  46.          _ExtentX        =   450
  47.          _ExtentY        =   529
  48.          _StockProps     =   78
  49.          Caption         =   ">"
  50.          BevelWidth      =   1
  51.          Font3D          =   3
  52.          RoundedCorners  =   0   'False
  53.          Outline         =   0   'False
  54.       End
  55.       Begin Threed.SSCommand cmdNP 
  56.          Height          =   300
  57.          Index           =   0
  58.          Left            =   6930
  59.          TabIndex        =   5
  60.          Top             =   90
  61.          Width           =   255
  62.          _Version        =   65536
  63.          _ExtentX        =   450
  64.          _ExtentY        =   529
  65.          _StockProps     =   78
  66.          Caption         =   "<"
  67.          BevelWidth      =   1
  68.          Font3D          =   3
  69.          RoundedCorners  =   0   'False
  70.          Outline         =   0   'False
  71.       End
  72.       Begin VB.Label Label2 
  73.          Caption         =   "&Select a function"
  74.          Height          =   255
  75.          Left            =   90
  76.          TabIndex        =   4
  77.          Top             =   120
  78.          Width           =   1275
  79.       End
  80.       Begin Threed.SSCommand SSCommand1 
  81.          Default         =   -1  'True
  82.          Height          =   300
  83.          Left            =   7245
  84.          TabIndex        =   3
  85.          Top             =   90
  86.          Width           =   465
  87.          _Version        =   65536
  88.          _ExtentX        =   820
  89.          _ExtentY        =   529
  90.          _StockProps     =   78
  91.          Caption         =   "&Go"
  92.          BevelWidth      =   1
  93.          RoundedCorners  =   0   'False
  94.          Outline         =   0   'False
  95.       End
  96.    End
  97.    Begin VB.Label lbl_Result 
  98.       Appearance      =   0  'Flat
  99.       BackColor       =   &H80000005&
  100.       BackStyle       =   0  'Transparent
  101.       ForeColor       =   &H80000008&
  102.       Height          =   3345
  103.       Left            =   90
  104.       TabIndex        =   0
  105.       Top             =   630
  106.       Width           =   7935
  107.    End
  108. Attribute VB_Name = "frmDayMonth"
  109. Attribute VB_Creatable = False
  110. Attribute VB_Exposed = False
  111. Option Explicit
  112. Option Base 1
  113. Private Const Iteration = 250
  114. Dim IsLoaded         As Integer
  115. Dim TimerStartOk     As Integer
  116. Dim TimerCloseOk     As Integer
  117. Dim TimerHandle      As Integer
  118. Dim TimerValue       As Long
  119. Dim Language(LNG_FRENCH To LNG_POLISH) As String
  120.       
  121. Private Sub cmdNP_Click(Index As Integer)
  122.    Call sub_NextPrev(cmb_Function, Index)
  123. End Sub
  124. Private Sub cmb_Function_Click()
  125.    If (IsLoaded = False) Then Exit Sub
  126.    Call cDisableFI(mdiT2W.Picture1)
  127.    lbl_Result = ""
  128.    DoEvents
  129.    Select Case cmb_Function.ListIndex
  130.       Case 0
  131.          Call TestAscTime
  132.       Case 1
  133.          Call TestTinyDay
  134.       Case 2
  135.          Call TestSmallDay
  136.       Case 3
  137.          Call TestShortDay
  138.       Case 4
  139.          Call TestLongDay
  140.       Case 5
  141.          Call TestTinyMonth
  142.       Case 6
  143.          Call TestShortMonth
  144.       Case 7
  145.          Call TestLongMonth
  146.    End Select
  147.    DoEvents
  148.    Call cEnableFI(mdiT2W.Picture1)
  149. End Sub
  150. Private Sub Form_Activate()
  151.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  152. End Sub
  153. Private Sub Form_Load()
  154.    IsLoaded = False
  155.    Show
  156.    Call FillLanguage(Language())
  157.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_dmlang.t2w")
  158.    IsLoaded = True
  159. End Sub
  160. Private Sub SSCommand1_Click()
  161.    Call cmb_Function_Click
  162. End Sub
  163. Private Sub TestAscTime()
  164.    Dim intResult        As Integer
  165.    Dim strResult        As String
  166.    Dim strDisplay       As String
  167.    Dim i                As Integer
  168.    intResult = 0
  169.    strResult = ""
  170.    strDisplay = ""
  171.       
  172.    For i = LNG_FRENCH To LNG_POLISH
  173.       strDisplay = strDisplay + Language(i) + cGetAscTime(i) + vbCrLf + vbCrLf
  174.    Next i
  175.    lbl_Result = strDisplay
  176.    'time the function
  177.    TimerHandle = cTimerOpen()
  178.    TimerStartOk = cTimerStart(TimerHandle)
  179.    For i = 1 To Iteration
  180.       strResult = cGetAscTime(LNG_FRENCH)
  181.    Next i
  182.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  183.    TimerCloseOk = cTimerClose(TimerHandle)
  184. End Sub
  185. Private Sub TestTinyDay()
  186.    Dim intResult        As Integer
  187.    Dim strResult        As String
  188.    Dim strDisplay       As String
  189.    Dim i                As Integer
  190.    Dim j                As Integer
  191.    intResult = 0
  192.    strResult = ""
  193.    strDisplay = ""
  194.    For i = LNG_FRENCH To LNG_POLISH
  195.       strDisplay = strDisplay + Language(i)
  196.       For j = 1 To 7
  197.          strDisplay = strDisplay + cGetTinyDay(i, j) + " "
  198.       Next j
  199.       strDisplay = strDisplay + vbCrLf + vbCrLf
  200.    Next i
  201.    lbl_Result = strDisplay
  202.    'time the function
  203.    TimerHandle = cTimerOpen()
  204.    TimerStartOk = cTimerStart(TimerHandle)
  205.    For i = 1 To Iteration
  206.       strResult = cGetTinyDay(LNG_FRENCH, 1)
  207.    Next i
  208.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  209.    TimerCloseOk = cTimerClose(TimerHandle)
  210. End Sub
  211. Private Sub FillLanguage(arrLanguage() As String)
  212.    arrLanguage(LNG_FRENCH) = "French : "
  213.    arrLanguage(LNG_DUTCH) = "Dutch : "
  214.    arrLanguage(LNG_GERMAN) = "German : "
  215.    arrLanguage(LNG_ENGLISH) = "English : "
  216.    arrLanguage(LNG_ITALIAN) = "Italian : "
  217.    arrLanguage(LNG_SPANISH) = "Spanish : "
  218.    arrLanguage(LNG_CATALAN) = "Catalan : "
  219.    arrLanguage(LNG_POLISH) = "Polish : "
  220. End Sub
  221. Private Sub TestSmallDay()
  222.    Dim intResult        As Integer
  223.    Dim strResult        As String
  224.    Dim strDisplay       As String
  225.    Dim i                As Integer
  226.    Dim j                As Integer
  227.    intResult = 0
  228.    strResult = ""
  229.    strDisplay = ""
  230.    For i = LNG_FRENCH To LNG_POLISH
  231.       strDisplay = strDisplay + Language(i)
  232.       For j = 1 To 7
  233.          strDisplay = strDisplay + cGetSmallDay(i, j) + " "
  234.       Next j
  235.       strDisplay = strDisplay + vbCrLf + vbCrLf
  236.    Next i
  237.    lbl_Result = strDisplay
  238.    'time the function
  239.    TimerHandle = cTimerOpen()
  240.    TimerStartOk = cTimerStart(TimerHandle)
  241.    For i = 1 To Iteration
  242.       strResult = cGetSmallDay(LNG_FRENCH, 1)
  243.    Next i
  244.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  245.    TimerCloseOk = cTimerClose(TimerHandle)
  246. End Sub
  247. Private Sub TestLongDay()
  248.    Dim intResult        As Integer
  249.    Dim strResult        As String
  250.    Dim strDisplay       As String
  251.    Dim i                As Integer
  252.    Dim j                As Integer
  253.    intResult = 0
  254.    strResult = ""
  255.    strDisplay = ""
  256.    For i = LNG_FRENCH To LNG_POLISH
  257.       strDisplay = strDisplay + Language(i)
  258.       For j = 1 To 7
  259.          strDisplay = strDisplay + cGetLongDay(i, j) + " "
  260.       Next j
  261.       strDisplay = strDisplay + vbCrLf + vbCrLf
  262.    Next i
  263.    lbl_Result = strDisplay
  264.    'time the function
  265.    TimerHandle = cTimerOpen()
  266.    TimerStartOk = cTimerStart(TimerHandle)
  267.    For i = 1 To Iteration
  268.       strResult = cGetLongDay(LNG_FRENCH, 1)
  269.    Next i
  270.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  271.    TimerCloseOk = cTimerClose(TimerHandle)
  272. End Sub
  273. Private Sub TestShortDay()
  274.    Dim intResult        As Integer
  275.    Dim strResult        As String
  276.    Dim strDisplay       As String
  277.    Dim i                As Integer
  278.    Dim j                As Integer
  279.    intResult = 0
  280.    strResult = ""
  281.    strDisplay = ""
  282.    For i = LNG_FRENCH To LNG_POLISH
  283.       strDisplay = strDisplay + Language(i)
  284.       For j = 1 To 7
  285.          strDisplay = strDisplay + cGetShortDay(i, j) + " "
  286.       Next j
  287.       strDisplay = strDisplay + vbCrLf + vbCrLf
  288.    Next i
  289.    lbl_Result = strDisplay
  290.    'time the function
  291.    TimerHandle = cTimerOpen()
  292.    TimerStartOk = cTimerStart(TimerHandle)
  293.    For i = 1 To Iteration
  294.       strResult = cGetShortDay(LNG_FRENCH, 1)
  295.    Next i
  296.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  297.    TimerCloseOk = cTimerClose(TimerHandle)
  298. End Sub
  299. Private Sub TestTinyMonth()
  300.    Dim intResult        As Integer
  301.    Dim strResult        As String
  302.    Dim strDisplay       As String
  303.    Dim i                As Integer
  304.    Dim j                As Integer
  305.    intResult = 0
  306.    strResult = ""
  307.    strDisplay = ""
  308.    For i = LNG_FRENCH To LNG_POLISH
  309.       strDisplay = strDisplay + Language(i)
  310.       For j = 1 To 12
  311.          strDisplay = strDisplay + cGetTinyMonth(i, j) + " "
  312.       Next j
  313.       strDisplay = strDisplay + vbCrLf + vbCrLf
  314.    Next i
  315.    lbl_Result = strDisplay
  316.    'time the function
  317.    TimerHandle = cTimerOpen()
  318.    TimerStartOk = cTimerStart(TimerHandle)
  319.    For i = 1 To Iteration
  320.       strResult = cGetTinyMonth(LNG_FRENCH, 1)
  321.    Next i
  322.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  323.    TimerCloseOk = cTimerClose(TimerHandle)
  324. End Sub
  325. Public Sub TestLongMonth()
  326.    Dim intResult        As Integer
  327.    Dim strResult        As String
  328.    Dim strDisplay       As String
  329.    Dim i                As Integer
  330.    Dim j                As Integer
  331.    intResult = 0
  332.    strResult = ""
  333.    strDisplay = ""
  334.    For i = LNG_FRENCH To LNG_POLISH
  335.       strDisplay = strDisplay + Language(i)
  336.       For j = 1 To 12
  337.          strDisplay = strDisplay + cGetLongMonth(i, j) + " "
  338.       Next j
  339.       strDisplay = strDisplay + vbCrLf + vbCrLf
  340.    Next i
  341.    lbl_Result = strDisplay
  342.    'time the function
  343.    TimerHandle = cTimerOpen()
  344.    TimerStartOk = cTimerStart(TimerHandle)
  345.    For i = 1 To Iteration
  346.       strResult = cGetLongMonth(LNG_FRENCH, 1)
  347.    Next i
  348.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  349.    TimerCloseOk = cTimerClose(TimerHandle)
  350. End Sub
  351. Private Sub TestShortMonth()
  352.    Dim intResult        As Integer
  353.    Dim strResult        As String
  354.    Dim strDisplay       As String
  355.    Dim i                As Integer
  356.    Dim j                As Integer
  357.    intResult = 0
  358.    strResult = ""
  359.    strDisplay = ""
  360.    For i = LNG_FRENCH To LNG_POLISH
  361.       strDisplay = strDisplay + Language(i)
  362.       For j = 1 To 12
  363.          strDisplay = strDisplay + cGetShortMonth(i, j) + " "
  364.       Next j
  365.       strDisplay = strDisplay + vbCrLf + vbCrLf
  366.    Next i
  367.    lbl_Result = strDisplay
  368.    'time the function
  369.    TimerHandle = cTimerOpen()
  370.    TimerStartOk = cTimerStart(TimerHandle)
  371.    For i = 1 To Iteration
  372.       strResult = cGetShortMonth(LNG_FRENCH, 1)
  373.    Next i
  374.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  375.    TimerCloseOk = cTimerClose(TimerHandle)
  376. End Sub
  377.