| The problem stems from Rdb's use of the G-float version of the C RTL while
DECwindows is linked against the D-float version. Hence, an application that
tries to do both Rdb calls and DECwindows calls can run into trouble. This
problem with the C RTL is being fixed by an upcoming version of VAX C. I think
also that Rdb is writing their use of the C RTL out of the product. For
schedules on when this will be fixed, you'll have to contact the VAX C and VAX
Rdb development teams.
--PSW
|
| For those who want to consider using RDB & DECwindows, this short example
shows how to convert a D_FLOATING to a G_FLOATING using a program. Converting
G_FLOATING to D_FLOATING could also use the same logic & a set of it's
own subroutines; again, not complicated.
Jens Moller
$ set verify
$ ! CONVERT_D_TO_G.COM
$ !
$ ! Sample of how to convert a D_FLOATING feild to a G_FLOATING
$ ! feild. This is a simple kludge that may cause some precision
$ ! loss because of the mulitiple translations from floating point
$ ! to character, then back to floating point again. Also be aware
$ ! that you have to compile the modules differently from each
$ ! other to make sure that each module does the proper translations.
$ !
$ ! This sort of thing is useful where someone stored data in
$ ! D_FLOATING & now wants to move the data to a place that only
$ ! supports G_FLOATING (such as RDB).
$ !
$ ! This command file creates all files and compiles & links them.
$ ! To run the program, enter RUN MAIN/NODEB from DCL.
$ ! (It's built with the DEBUGGER in case you want to see what is
$ ! actually happening).
$ !
$ ! Jens
$ !
$ create main.for
c
c This program must be compiled as a D_FLOAT
c
PROGRAM MAIN
REAL*8 D_FLOAT_DATA
BYTE D_BYTES(8)
BYTE G_FLOAT_DATA(8)
EQUIVALENCE (D_FLOAT_DATA,D_BYTES)
D_FLOAT_DATA = 1.234567890e20
c
c This call could be added to a main program that needed this
c functionality
c
CALL CONVERT_STEP1(D_FLOAT_DATA,G_FLOAT_DATA)
TYPE *,'Original Val : ',D_FLOAT_DATA
TYPE *,'D_FLOAT Bytes:',D_BYTES
TYPE *,'G_FLOAT Bytes:',G_FLOAT_DATA
END
$ create convert_step1.for
c
c This subroutine must be compiled as a D_FLOAT
c
SUBROUTINE CONVERT_STEP1(D_FLOAT_DATA,G_FLOAT_DATA)
REAL*8 D_FLOAT_DATA
BYTE G_FLOAT_DATA(8)
CHARACTER*60 CHAR_FLOAT_DATA
WRITE(CHAR_FLOAT_DATA,10)D_FLOAT_DATA
10 FORMAT(D30.25)
CALL CONVERT_STEP2(CHAR_FLOAT_DATA,G_FLOAT_DATA)
RETURN
END
$ create convert_step2.for
c
c This subroutine must be compiled /G_FLOAT
c
SUBROUTINE CONVERT_STEP2(CHAR_FLOAT_DATA,G_FLOAT_DATA)
CHARACTER*60 CHAR_FLOAT_DATA
REAL*8 G_FLOAT_DATA
READ(CHAR_FLOAT_DATA,10)G_FLOAT_DATA
10 FORMAT(G30.25)
RETURN
END
$ !
$ ! Compile the programs
$ !
$ FORTRAN MAIN/noopt/debug
$ FORTRAN CONVERT_STEP1/noopt/debug
$ FORTRAN/G_FLOAT CONVERT_STEP2/noopt/debug
$ !
$ ! Link the Programs
$ !
$ LINK /debug MAIN,CONVERT_STEP1,CONVERT_STEP2
$ set noverify
|