Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Losing data from random files

Posted on 2004-08-23
2
Medium Priority
?
185 Views
Last Modified: 2010-04-17
we have need for still reading 'dos' files created in pds-compiler (basic)
we do this
'at main form
Private Type RFile
  Id As String * 5
  Money As String * 8
 End Type
Dim Myfile As RFile

'load form1

' at test location on form1
Private Sub txtbal_GotFocus()
Dim y As Integer
Dim Myfile As RFile
' this file was created in qbasic compiler  is still needed thats why i want to open it in VB
Open "test.tst" For Random As #12 Len = 13
For i% = 1 To 4
Get #12, i%, Myfile
DUM$ = ""
For y% = 1 To 8
DUM$ = DUM$ + Str$(Asc(Mid$(Myfile.Money, y%, 1)))
Next
Printer.Print i%, Len(Myfile.Id); "/"; Len(Myfile.Money); "/"; DUM$; "/"      
' prints len= 5 and = 8, so len is ok,  but   dum$ contains only chr(0) values
' and i'm sure it contains non-zero chr's
'what wrong?
Next
Close 12
End Sub
Regards Jack

0
Comment
Question by:BIAPRO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 750 total points
ID: 11875818
try with
DUM$ = DUM$ + Str$(Asc(Mid$(CStr(Myfile.Money), y%, 1)))
0
 

Author Comment

by:BIAPRO
ID: 11876361
plus i found out  that the old-dos-programmers habbit,  open a file and like the
old days assuming that windows will open it the file in your 'working' vb-directory is
false, i really  have to say:  open "I:\vbwork\test.tst"  instead of "test.tst"
together it solved.
regards Jack Biapro Aruba
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Simple Linear Regression
Introduction to Processes

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question