We are trying to convert data files from Btrieve 5.01(Basic) to Btrieve 6.15 for Windows (Visual Basic) and need a routine to convert single and double precision numbers to "Currency".
In the old Basic program, fields are defined as follows:
A Single precision field "4 as Field1$"
A double precision field "8 as Field2$"
We converted "Field1$" and "Field2$" inside the program with:
Amount=CVS(Field1$)
Amount#=CVD(Field2$)
In the Visual Basic program, we define the data field in the old file using "single" and "double" such as
OldAmount1 as Single
OldAmount2 as Double
In the Visual Basic program, we define the corresponding data fields in the new file as "currency"
NewAmount1 as Currency
NewAmount2 as Currency
When moving one amount to another we use
NewAmount1=Ccur(OldAmount1)
NewAmount2=Ccur(OldAmount2)
However, the results are that the NewAmount fields contains only zero(0) or we get an "overflow". We have tried to convert using Dbdl, Val and Str, but nothing works. Can you give us a routine or point us in the right direction.
In the old Basic program, fields are defined as follows:
A Single precision field "4 as Field1$"
A double precision field "8 as Field2$"
We converted "Field1$" and "Field2$" inside the program with:
Amount=CVS(Field1$)
Amount#=CVD(Field2$)
In the Visual Basic program, we define the data field in the old file using "single" and "double" such as
OldAmount1 as Single
OldAmount2 as Double
In the Visual Basic program, we define the corresponding data fields in the new file as "currency"
NewAmount1 as Currency
NewAmount2 as Currency
When moving one amount to another we use
NewAmount1=Ccur(OldAmount1)
NewAmount2=Ccur(OldAmount2)
However, the results are that the NewAmount fields contains only zero(0) or we get an "overflow". We have tried to convert using Dbdl, Val and Str, but nothing works. Can you give us a routine or point us in the right direction.