Solved

Losing data from random files

Posted on 2004-08-23
2
174 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
2 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 250 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

705 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now