If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Other > how to use UDT in Visual Basic to depict decimal field in BTR file?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-14-03, 13:31
simonye simonye is offline
Registered User
 
Join Date: Mar 2003
Posts: 2
how to use UDT in Visual Basic to depict decimal field in BTR file?

Hi, I am a VB developer. Right now, I am using Betrieve API to access the btr file and I got some problem.
I don’t know how to use UDT in Visual Basic to depict decimal field in BTR file?
For example, in the Invent.btr(This btr file come from business vision), the definition of fields is following:

(Field, Data Type, Size, Precision, Scale)
(I_WHSE,Char,2)
(I_PART_NO,Char,15)
(I_DESCRIPTION,Char,40)
…..
(I_COST_CURRENT,Decimal,8,15,5)
…..
I use the UDT below in Visual Basic:

Public Type InvFull_Fld
I_WHSE As String * 2
I_PART_NO As String * 15
I_DESCRIPTION As String * 40
I_Filler1 As String * 16
I_COST_CURRENT As Double
I_Filler2 As String * 967 ' total 1048
End Type

Note I use double data type to depict I_COST_CURRENT field, this field is a decimal(15,5,8) field (here 15 is precision , 5 is scale, and the betrieve size is 8). but when I use this UDT to get the record with Betrieve API, the result is wrong, for example, actually the original data is 0.00000 , and what I got is 6.98350748929955E-251. I have no ideal how to depict COBOL Decimal Comp-3(precision, scale,betrieve size) . Here is the following (9,0,5) (11,0,6) (17,5,9) (11,2,6) (3,0,2) (13,5,7) (7,0,4)
(11,5,6)

Thanks.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On