home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hot Shareware 35
/
hot35.iso
/
ficheros
/
LVB
/
T2W32543.ZIP
/
_SERIALZ.FRM
< prev
next >
Wrap
Text File
|
1998-05-21
|
7KB
|
218 lines
VERSION 5.00
Begin VB.Form frmSerialization
BorderStyle = 4 'Fixed ToolWindow
Caption = "Serialization"
ClientHeight = 4020
ClientLeft = 1890
ClientTop = 3270
ClientWidth = 8340
MaxButton = 0 'False
MDIChild = -1 'True
PaletteMode = 1 'UseZOrder
ScaleHeight = 4020
ScaleWidth = 8340
ShowInTaskbar = 0 'False
Begin VB.Frame Frame1
Height = 570
Left = 0
TabIndex = 1
Top = -90
Width = 8310
Begin VB.CommandButton cmdNP
Caption = ">"
Height = 285
Index = 1
Left = 7920
TabIndex = 6
Top = 195
Width = 285
End
Begin VB.CommandButton cmdNP
Caption = "<"
Height = 285
Index = 0
Left = 7020
TabIndex = 5
Top = 195
Width = 285
End
Begin VB.CommandButton Command1
Caption = "&Go"
Default = -1 'True
Height = 285
Left = 7380
TabIndex = 4
Top = 195
Width = 465
End
Begin VB.ComboBox cmb_Function
Height = 315
Left = 1365
TabIndex = 2
Top = 180
Width = 5565
End
Begin VB.Label Label2
Caption = "&Select a function"
Height = 255
Left = 90
TabIndex = 3
Top = 210
Width = 1275
End
End
Begin VB.TextBox txt_Result
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 3270
Left = 105
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 0
Top = 630
Width = 8100
End
End
Attribute VB_Name = "frmSerialization"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1
Private Const Iteration = 250
Dim IsLoaded As Integer
Dim TimerStartOk As Integer
Dim TimerCloseOk As Integer
Dim TimerHandle As Integer
Dim TimerValue As Long
Private Sub cmdNP_Click(Index As Integer)
Call sub_NextPrev(cmb_Function, Index)
End Sub
Private Sub cmb_Function_Click()
If (IsLoaded = False) Then Exit Sub
Call cDisableFI(mdiT2W.Picture1)
txt_Result = ""
Select Case cmb_Function.ListIndex
Case 0
Call TestSerialization
End Select
DoEvents
Call cEnableFI(mdiT2W.Picture1)
End Sub
Private Sub Form_Activate()
mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
End Sub
Private Sub Form_Load()
IsLoaded = False
Show
Call sub_Load_Combo(cmb_Function, T2WDirInst + "_serialz.t2w")
IsLoaded = True
End Sub
Private Sub Command1_Click()
Call cmb_Function_Click
End Sub
Private Sub TestSerialization()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim j As Integer
Dim getSD As tagSERIALDATA
Dim putSD As tagSERIALDATA
Dim File1 As String
Dim File2 As String
strResult = ""
strDisplay = ""
File1 = T2WFileTest
File2 = "autoexec.serialized"
strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
strDisplay = strDisplay & "File '" & File2 & "' is " & IIf(cIsSerial(File2) = True, "serialized", "not serialized") & vbCrLf & vbCrLf
putSD.Description1 = "T2WIN-32 demo"
putSD.Description2 = "Under the blue sky"
putSD.Number = 136
strDisplay = strDisplay & "Put/Modify '" & Trim$(putSD.Description1) & "' - '" & Trim$(putSD.Description2) & "' - '" & putSD.Number & "' into file '" & File2 & "' is " & IIf(cSerialPut(File2, putSD) = True, "OK", "KO") & vbCrLf & vbCrLf
intResult = cSerialGet(File2, getSD)
strDisplay = strDisplay & "Get from '" & File2 & "' is : " & vbCrLf
strDisplay = strDisplay & " description 1 : " & Trim$(getSD.Description1) & vbCrLf
strDisplay = strDisplay & " description 2 : " & Trim$(getSD.Description2) & vbCrLf
strDisplay = strDisplay & " number : " & getSD.Number & vbCrLf & vbCrLf
strDisplay = strDisplay & "Add 2 to serialized number part into file '" & File2 & "' is " & IIf(cSerialInc(File2, 2) = True, "OK", "KO") & vbCrLf & vbCrLf
intResult = cSerialGet(File2, getSD)
strDisplay = strDisplay & "Get from '" & File2 & "' is : " & vbCrLf
strDisplay = strDisplay & " description 1 : " & Trim$(getSD.Description1) & vbCrLf
strDisplay = strDisplay & " description 2 : " & Trim$(getSD.Description2) & vbCrLf
strDisplay = strDisplay & " number : " & getSD.Number & vbCrLf & vbCrLf
strDisplay = strDisplay & "Substract 9 to serialized number part into file '" & File2 & "' is " & IIf(cSerialInc(File2, -9) = True, "OK", "KO") & vbCrLf & vbCrLf
intResult = cSerialGet(File2, getSD)
strDisplay = strDisplay & "Get from '" & File2 & "' is : " & vbCrLf
strDisplay = strDisplay & " description 1 : " & Trim$(getSD.Description1) & vbCrLf
strDisplay = strDisplay & " description 2 : " & Trim$(getSD.Description2) & vbCrLf
strDisplay = strDisplay & " number : " & getSD.Number & vbCrLf & vbCrLf
strDisplay = strDisplay & "File '" & File2 & "' is " & IIf(cIsSerial(File2) = True, "serialized", "not serialized") & vbCrLf & vbCrLf
strDisplay = strDisplay & "Remove serialization in '" & File2 & "' is " & IIf(cSerialRmv(File2) = True, "unserialized", "not unserialized") & vbCrLf & vbCrLf
strDisplay = strDisplay & "File '" & File2 & "' is " & IIf(cIsSerial(File2) = True, "serialized", "not serialized") & vbCrLf & vbCrLf
txt_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
intResult = cSerialGet(File2, getSD)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub