ParsX.com
پذیرش پروژه از دانشجویی ... تا سازمانی 09376225339
 
   ProfileProfile   Log in to check your private messagesLog in to check your private messages  |  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups Log inLog in   RegisterRegister 

تازه کار

 
Post new topic   Reply to topic    ParsX.com Forum Index -> ويژوال بيسيك .NET
View previous topic :: View next topic  
Author Message
mazamir
مهمون يكي دو روزه


Joined: 06 Aug 2006
Posts: 12

PostPosted: Sun Aug 06, 2006 7:45 pm    Post subject: تازه کار Reply with quote

دو سال است وی بی کار می کنم ولی نسبت به شما تازه کار هستم. می خواستم یک کمک کلی نسبت به ذخیره آرایه ها در یک فایل و سپس جستجو از طریق مقادیر آرایه ها بگیرم. چطور می توان هنگام باز کردن آن فایل آخرین آرایه ای که ذخیره شده است روی صفحه قرار گیرد.
متشکرم
احمد
mazamir_69@yahoo.com
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Sun Aug 06, 2006 9:20 pm    Post subject: Reply with quote

مقادير آرايه رو با يه كنتور تو فايل مي نويسي . تا اينجاش كه كاري نداره .
براي خوندن هم مي ري آخر فايل به اندازه فضاي عنصر يه آرايه بر مي گردي و مي خوني ...
Back to top
mazamir
مهمون يكي دو روزه


Joined: 06 Aug 2006
Posts: 12

PostPosted: Mon Aug 07, 2006 12:31 am    Post subject: Reply with quote

دوباره سلام.راستش هیچی نفهمیدم. قسمتی از کد برنامه رو این زیر می ذارم
بازم ممنون
قسمتی از کد ماژول
Public Const MaxRecords As Integer = 20000
Public Type AddrRec
Radif As String * 7
NGabli As String * 15
Date As String * 8
Saheb As String * 50
Sharh As String * 500
Payvast As String * 10
NDate As String * 8
End Type
Public AddrEntrys(MaxRecords) As AddrRec
قسمتی از کد فرم

Option Base 1
Option Explicit
Public RecIndex As Integer
Public recLength As Integer
Public CNumber As Integer
Public X As Integer

Private Sub UpDate_Form()
txtRadif.Text = AddrEntrys(RecIndex).Radif
txtNGably.Text = AddrEntrys(RecIndex).NGabli
txtDate.Text = AddrEntrys(RecIndex).Date
txtSaheb.Text = AddrEntrys(RecIndex).Saheb
txtSharh.Text = AddrEntrys(RecIndex).Sharh
txtPayvast.Text = AddrEntrys(RecIndex).Payvast
txtNDate.Text = AddrEntrys(RecIndex).NDate
End Sub

Private Sub Get_Data()
AddrEntrys(RecIndex).Radif = txtRadif.Text
AddrEntrys(RecIndex).NGabli = txtNGably.Text
AddrEntrys(RecIndex).Date = txtDate.Text
AddrEntrys(RecIndex).Saheb = txtSaheb.Text
AddrEntrys(RecIndex).Sharh = txtSharh.Text
AddrEntrys(RecIndex).Payvast = txtPayvast.Text
AddrEntrys(RecIndex).NDate = txtNDate.Text
End Sub

Private Sub cmdNextRec_Click()
If RecIndex < MaxRecords Then
Call Get_Data
RecIndex = RecIndex + 1

Call UpDate_Form
End If
End Sub

Private Sub cmdPrevRec_Click()
If RecIndex > 1 Then
Call Get_Data
RecIndex = RecIndex - 1
lblShomare.Caption = lblShomare.Caption - 1
Call UpDate_Form
End If
End Sub

Private Sub cmdSaveRec_Click()
CNumber = FreeFile
Call Get_Data
Open "give.dat" For Random As CNumber Len = recLength
Put CNumber, RecIndex, AddrEntrys(RecIndex)
Close CNumber
End Sub

Private Sub Form_Load()
RecIndex = 1
recLength = Len(AddrEntrys(1))

CNumber = FreeFile
Open "give.giv" For Random As CNumber Len = recLength
If Not EOF(1) Then
For X = 1 To MaxRecords
Get CNumber, X, AddrEntrys(X)
Next X
End If
Close CNumber
RecIndex = 1
Call UpDate_Form
End Sub
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Mon Aug 07, 2006 6:46 am    Post subject: Reply with quote

اگه مي توني پروژه ات رو بفرست .
چون تقريبا كار مي بره .
Back to top
Display posts from previous:   
Post new topic   Reply to topic    ParsX.com Forum Index -> ويژوال بيسيك .NET All times are GMT + 3.5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum