|
Post by natalieegh on Nov 23, 2022 17:37:53 GMT
I am tryiing to write a program to extract meta data about recordings I have created using Windows Media Center. The file type is .wtv. Code is as follows: On error goto errroutine 1000 Open "l:\atest.wtv" for binary as #3 1010 a$="" for i=1 to 100 1020 get #3,,a$ 1030 print a$, len(a$), if len(a$)>0 then print asc(left$(a$,1)) else print next i close #3 end errroutine: print "err =";err,"erl=";erl return No error is detected on the OPEN or GET. When I attempt to look at what is returned the length is zero. I have included a screen capture of a hex editor dump of the start of the .wtv file. I have tried reading into an array. I have tried providing a starting location to read. I have added line numbers to the lines in question because I kept getting an error code 5, that turned out to be because of using left$ on a null string hence the if statement added. Nothing is returned from the GET. It has been a decade or more since I wrote in any flavor of BASIC but I am sure this was the type instruction I used in the past and comparing with examples on several sites plus the build in qb64 helps it appears correct? Can someone help me? Please. Attachments:
|
|
|
Post by bplus on Nov 23, 2022 18:08:24 GMT
Sure one thing jumps right out at me: 1010 a$=""
You have a no length variable for a buffer. Maybe a$ = space$(1) ? then at least a byte to eat!
Also might want to print asc(a$) not A$, and not len(a$) which should always be 1 if we go a byte at a time. Some things should not or will not be printed nice, asc numbers don't cause problems.
|
|
|
Post by bplus on Nov 24, 2022 5:04:05 GMT
Thought I was going to help someone yesterday
|
|
|
Post by mikesharpe on Nov 25, 2022 0:01:33 GMT
some people are beyond help, B+
|
|