|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Option Explicit
Dim stremploy(1 To 20, 1 To 2) As String Private Sub cmdExit_Click() Unload frmEmploy End Sub Private Sub cmdFind_Click() Const conbtns = vbOKOnly + vbDefaultButton1 + vbApplicationModal Const conmsg1 = "the name of the employee" Const conmsg2 = "is not avaible" Dim intnum As Integer, intsub As Integer Dim intans As Integer, strfound As String intnum = Val(txtNum.Text) If intnum >= 1 And intnum <= 20 Then lblName.Caption = stremploy(intnum) txtNum.SetFocus End Sub Private Sub cmdPrint_Click() PrintForm End Sub Private Sub Form_Load() frmEmploy.Left = (Screen.Width - frmEmploy.Width) / 2 frmEmploy.Top = (Screen.Height - frmEmploy.Height) / 2 Dim introw As Integer, intcol As Integer Open "c:\vbcourse\tut10\employ.dat" For Input As #1 For introw = 1 To 20 For intcol = 1 To 2 Input #1, stremploy(introw, intcol) Next intcol Next introw Close #1 End Sub Private Sub txtNum_GotFocus() txtNum.SelStart = 0 txtNum.SelLength = Len(txtNum.Text) End Sub i have a problem coding the two-dimensional variable array in the find command please help me thank you |
|
#2
|
|||
|
|||
|
Quote:
F1 key in the IDE www.google.com msdn library You'll find documentation at one or more of those places that explains the syntax to use to declare arrays in your version of VB.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
Quote:
stremploy(intnum) ????, stremploy(intnum,1) or stremploy(intnum,2), try harder next time. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Two-dimensional variable arry |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|