QB to VB5 conversion problem 
Author Message
 QB to VB5 conversion problem

I need to convert an old QB4.5 program into VB 5 and have run into a
problem. The program reads a binary file and at begins by reading the file
header information. The start of the QB4.5 program (which works) is thus:

10 Open myfile$ for random as 1 Len=32
20 Field1, 2 as FLAG$, 2 as MCBNUM$, 2 as SEG$, 2 as PCOUNT$, 4 as RTIME$, 4
as LTIME$, 8 as STDATE$, 4 as STTIME$, 2 as STCHAN$, 2 as NUMCHAN$
30 Get 1
40 Print MCBNUM$
50 Print STDATE$
60 Print STTIME$
70 Close 1

My conversion (for this part) reads:

Private Type CNHHeader
FileFlag as STRING *2
McbNum as STRING *2
Seg as STRING *2
PCount as STRING *2
RTime as STRING *4
LTime as STRING *4
StDate as STRING *8
StTime as STRING *4
StChan as STRING *4
NumChan as STRING *2
End Type

Dim fileinfo as CHNHeader

Open myfile$ for Random as #1 Len = 32
Get #1, , fileinfo
Label1.Caption=McbNum
Label2.Caption=StDate
Label3.Caption=StTime
Close #1

........but the labels are all blank. Can someone shed any light on what i'm
doing wrong?

Thanks in advance.
Steve
*****************************************
Dr Steve Fleischer
Hong Kong

*****************************************



Mon, 04 Jun 2001 03:00:00 GMT  
 QB to VB5 conversion problem
Try this.

Open myfile$ for Random as #1 Len = 32
Get #1, , fileinfo
Label1.Caption=fileinfo.McbNum
Label2.Caption=fileinfo.StDate
Label3.Caption=fileinfo.StTime
Close #1

Best regards

Mika



Tue, 05 Jun 2001 03:00:00 GMT  
 QB to VB5 conversion problem
Yes thanks a lot.........I worked it out a few hours before reading your
post (honest!)
...thanks anyway.

Quote:

>Try this.

                            code snipped
Quote:
>Best regards

>Mika



Tue, 05 Jun 2001 03:00:00 GMT  
 QB to VB5 conversion problem
On Thu, 17 Dec 1998 23:05:50 +0800, "Steve Fleischer"

Quote:

>I need to convert an old QB4.5 program into VB 5 and have run into a
>problem. The program reads a binary file and at begins by reading the file
>header information. The start of the QB4.5 program (which works) is thus:

>10 Open myfile$ for random as 1 Len=32
>20 Field1, 2 as FLAG$, 2 as MCBNUM$, 2 as SEG$, 2 as PCOUNT$, 4 as RTIME$, 4
>as LTIME$, 8 as STDATE$, 4 as STTIME$, 2 as STCHAN$, 2 as NUMCHAN$
>30 Get 1
>40 Print MCBNUM$
>50 Print STDATE$
>60 Print STTIME$
>70 Close 1

>My conversion (for this part) reads:

>Private Type CNHHeader
>FileFlag as STRING *2
>McbNum as STRING *2
>Seg as STRING *2
>PCount as STRING *2
>RTime as STRING *4
>LTime as STRING *4
>StDate as STRING *8
>StTime as STRING *4
>StChan as STRING *4
>NumChan as STRING *2
>End Type

>Dim fileinfo as CHNHeader

>Open myfile$ for Random as #1 Len = 32
>Get #1, , fileinfo

Change the lines below to
Label1.Caption = fileinfo.McbNum
Label2.Caption = fileinfo.StDate
Label3.Caption= fileinfo.StTime

- Show quoted text -

Quote:
>Label1.Caption=McbNum
>Label2.Caption=StDate
>Label3.Caption=StTime
>Close #1

>........but the labels are all blank. Can someone shed any light on what i'm
>doing wrong?

>Thanks in advance.
>Steve
>*****************************************
>Dr Steve Fleischer
>Hong Kong

>*****************************************



Wed, 06 Jun 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. DDE Conversion problem VBA to VB5

2. DDE conversion problem. VBA to VB5

3. Conversion problem VB4 - VB5

4. QB 4.5 to VB Conversion

5. VB4/VB5 form with DBGrid Conversion problem

6. VB5 functions in QB

7. QB 4.0 Docs/QB 4.5 Wanted

8. QB.QLB & QB.LIB

9. New Navigational site for QB + QB Encyclopedia

10. want QB 4.5 QB 7.1 FOR FREE!!!

11. Where's QB.LIB in QB 4.5?

12. qb, quickbasic, or qb

 

 
Powered by phpBB® Forum Software