home *** CD-ROM | disk | FTP | other *** search
Wrap
'***************************************************************************** ' The parameter structure definition that is used by your application ' to specify the operation parameters and text data to the 'form' routine. ' For an example for using this structure, refer to the demo.c file. '***************************************************************************** Type TypeForm x As Integer 'Initial x position of the editing window, 'you may specify CW_USEDEFAULT to use default values. y As Integer 'Initial y position of the editing window. width As Integer 'Initial width of the window in device units, 'you may specify CW_USEDEFAULT to use default values. height As Integer 'Initial height of the editing window. When you ' use CW_USEDEFAULT for width, the height parameter is ' ingnored. reserved1 As Long ' Reserved for internal use. Do not modify the ' value in this field reserved2 As Long ' Reserved for internal use. Do do not modify the ' value in this field. file As String * 130 ' form file name. If an existing file is specified, ' the following fields are ignored. ' You must append chr(0) to NULL terminate this string DataSetName As String * 20' (Specify for a new file) Your application can ' specify a data set name which can be used to ' associate the application data to the form. This ' is an optional field. ' You must append chr(0) to NULL terminate this string ShowMenu As Integer ' show the menu bar ShowHorBar As Integer ' show the horizonatal scroll bar ShowVerBar As Integer ' show the vertical scroll bar hInst As Integer ' Handle of the current instanaces. hPrevInst As Integer ' Handle of the previous instances. hParentWnd As Integer ' Handle to the parent window hFrWnd As Integer ' Form main window handle, will be filled by RE later style As Long ' Editor window style FontTypeFace As String * 32' Default type face, example: TmwRmn Courier, etc ' You must append chr(0) to NULL terminate this string open As Integer ' TRUE indicates an open window (parameter block in use) modified As Integer ' TRUE when the file modified, and needs to be saved End Type '***************************************************************************** ' The parameter structure definition that is used by your application ' to specify the operation parameters to start a report execution session. ' For an example for using this structure, refer to the demo.c file. '***************************************************************************** Type TypeRep file As String * 129 ' form file name ' You must append chr(0) to NULL terminate this field device As String * 1 ' P=Printer,S=Screen,A=Ask the user. The following ' 4 parameters are not used if the device is ' set to 'P' x As Integer ' Initial x position of the report window, ' you may specify CW_USEDEFAULT to use default values. y As Integer ' Initial y position of the report window. width As Integer ' Initial width of the window in device units, ' you may specify CW_USEDEFAULT to use default values. height As Integer ' Initial height of the editing window. When you ' use CW_USEDEFAULT for width, the height parameter is ' ingnored. reserved1 As Long ' Reserved for internal use. Do not modify this field TotalFields As Integer ' (OUTPUT) Number of fields in the 'field' array. reserved2 As Long ' Reserved for internal use. Do not modify this field TotalSortFields As Integer ' (OUTPUT) Number of fields in the 'SortField' array. DataSetName As String * 20' (OUTPUT) This field returns the data set name ' associated with the form. Your application ' may use this information to prepare data for ' the report executer ' This field is NULL terminated SwapDir As String * 60 ' Directory path to store swapped screen pages ' When this variable is equal to NULL, RE will use ' the current working directory for swapping. ' You must append chr(0) to NULL terminate this field hInst As Integer ' Handle of the current instanaces. hPrevInst As Integer ' Handle of the previous instances. hParentWnd As Integer ' Handle to the parent window style As Long ' Report window style - needed for screen output only reserved3 As Long ' Reserved for internal use. Do not modify the ' value in this field End Type '***************************************************************************** ' Global Constants '***************************************************************************** Global Const UNITS_PER_INCH = 250 Global Const FORM_SIGN = &HDEBC Global Const NAME_WIDTH = 50 Global Const SRC_APPL = 0 Global Const SRC_CALC = 1 Global Const SRC_SYS = 2 Global Const SRC_CONST = 3 Global Const SRC_NONE = 4 Global Const SRC_DLG = 5 Global Const TYPE_NUM = 1 Global Const TYPE_DBL = 2 Global Const TYPE_TEXT = 3 Global Const TYPE_LOGICAL = 4 Global Const TYPE_DATE = 5 Global Const TYPE_PICT = 6 Global Const SUM_NONE = 0 Global Const SUM_TOTAL = 1 Global Const SUM_AVERAGE = 2 Global Const SUM_COUNT = 3 Global Const SUM_MAX = 4 Global Const SUM_MIN = 5 Global Const DT_MMDDYY = 0 Global Const DT_DDMMYY = 1 Global Const DT_MMDDYYYY = 2 Global Const DT_MMMDDYYYY = 3 Global Const FLAG_TRIM = &H1 Global Const FLAG_SUP_ZERO = &H2 Global Const FLAG_PAD_ZERO = &H4 Global Const FLAG_CAPS = &H8 Global Const FLAG_FIRST_CAP = &H10 Global Const FLAG_SMALL = &H20 Global Const FLAG_COMMA = &H40 Global Const FLAG_WRAP = &H80 Global Const FLAG_WORD_WRAP = &H100 Global Const FLAG_RETAIN = &H200 Global Const FLAG_FLEX_SIZE = &H400 Global Const RFLAG_TRIAL = &H1 Global Const REP_CLOSE = &H400 Global Const ERR_NO_FILE = 1 Global Const ERR_NO_DEVICE = 2 Global Const ERR_NO_MEM = 3 Global Const ERR_BAD_EXP = 4 Global Const ERR_SUSPEND = 5 Global Const ERR_ZERO_DIVIDE = 6 Global Const ERR_TYPE_MISMATCH = 7 Global Const ERR_INCOMPLETE = 8 Global Const ERR_DUPLICATE = 9 Global Const ERR_PRINTER = 10 Global Const ERR_IO = 11 Global Const ERR_DISPLAY = 12 Global Const ERR_WRAP = 13 Global Const ERR_FONT = 14 Global Const ERR_OTHER = 15 Global Const ERR_BAD_WND = 16 Global Const WS_OVERLAPPEDWINDOW = &HCF0000 Global Const WS_CHILD = &H40000000 Global Const MF_ENABLED = 0 Global Const MF_GRAYED = 1 Global Const MF_CHECKED = 8 Global Const MF_UNCHECKED = 0 '****************************************************************************** ' Form Header Structure '****************************************************************************** Type TypeFormHdr FormSign As Integer ' Form File Signature name As String * 52 ' report name (NAME_WIDTH+2) ' This field is NULL terminated DataSetName As String * 20' Your application can specify a data set ' name which can be used to associate the ' application data to the form. This ' is an optional information. ' This field is NULL terminated TotalItems As Integer ' screen items in the form template FieldCount As Integer ' total number of fields BreakFieldCount As Integer ' total number of break fields FontCount As Integer ' number of entries in the font table LeftMargin As Single ' margins in inches RightMargin As Single TopMargin As Single BottomMargin As Single SelExp As String * 104 ' record selection expression 2*(NAME_WIDTH+2) Orientation As Integer ' DMORIENT_PORTRAIT or DMORIENT_LANDSCAPE PaperSize As Integer ' paper size given by DMPAPER_* variables used for DEVMODE PaperLength As Integer ' specified in tenths of millimeter, used only if PaperSize = 0 PaperWidth As Integer ' specified in tenths of millimeter, used only if PaperSize = 0 PrintQuality As Integer ' print quality PrinterName As String * 104' name of the printer 2*(NAME_WIDTH+2) PrinterDriver As String * 104' printer driver name 2*(NAME_WIDTH+2) flags As Integer ' RFLAG_ series flags DateFormat As Integer ' 0=MM/DD/YY, 1=DD/MM/YY RulerType As Integer ' RULER_OFF,RULER_INCH,RULER_CM SecBannerHeight As Integer ' height (logical units) of the section banner FileFormatId As Integer ' records the file format changes reserved1 As String * 146 ' reserved bytes End Type '****************************************************************************** ' Field Structure '****************************************************************************** Type TypeField ' define each field source As Integer ' source of field data: application,calculation,system, constant etc name As String * 52 ' field name (NAME_WIDTH+2) ' Append chr (0) to NULL terminate this field FileId As Integer ' an optional id that may be defined by the calling application FieldId As Integer ' another optional id that may be defined by the calling application type As Integer ' numeric/alphanumeric/logical/date width As Integer ' field data width as stored in your database DecPlaces As Integer ' decimal places for numeric fields AllowChanges As Integer ' Allow modification of the following fields InUse As Integer ' TRUE=in use, FALSE=not in use flags As Integer ' flags SumType As Integer ' summary type: total/average/minmum/maximum/none SysIdx As Integer ' index into the system field table for system fields DateFormat As Integer ' date format DateDelim As String * 2 ' date delimiter character, i.e. / or - CurrencySymbol As String * 4' currency symbol LogicalSymbols As String * 2' logical TRUE and FALSE symbols NegSignPrefix As String * 4 ' negative sign prefix NegSignSuffix As String * 4 ' negative sign suffix PosSignPrefix As String * 4 ' positive sign prefix PosSignSuffix As String * 4 ' positive sign suffix CalcExp As String * 104 ' expression for the calculated fields 2*(NAME_WIDTH+2) reserved1 As Long ' character data, pointer to an object of size = field.width+1 NumData As Long ' numeric data (long) DblData As Double ' numeric data for field = TYPE_DBL HoldNum As Long ' long accumulater: total,minimum,maximum,etc... HoldDbl As Double ' double accumulater: total,minimum,maximum,etc... count As Long ' number of records in a group during execution section As Integer ' section that holds the field (report time only) misc As Integer ' used for miscellaneous purposes ParaChar As String * 2 ' specify the new paragraph indicator character ' in the first byte. Needed only for a word/wrapped ' text field. ' You must append chr(0) to NULL terminate this field reserved2 As String * 14 ' reserved to pad to 256 End Type '****************************************************************************** ' Picture information structure '****************************************************************************** Type TypePict hDC As Integer ' Device Context of the report output device PictId As Integer ' picture id value FileId As Integer ' FileId of the picture FieldId As Integer ' FieldId of the picture x As Integer ' picture location y As Integer ' picture location width As Integer ' picture width height As Integer ' picture height End Type Rem ***************************************************************************** Rem Function Prototype Rem ****************************************************************************** Declare Function RvbForm Lib "RVB.VBX" (FormParm As TypeForm) As Integer Declare Function RvbInit Lib "RVB.VBX" (ByVal hWnd As Integer, RepParm As TypeRep) As Integer Declare Function RvbRec Lib "RVB.VBX" (ByVal hWnd As Integer) As Integer Declare Function RvbExit Lib "RVB.VBX" (ByVal hWnd As Integer) As Integer Declare Function RvbGetFormField Lib "RVB.VBX" (ByVal hWnd As Integer, field As TypeField, SortLevel As Integer) As Integer Declare Function RvbGetDataField Lib "RVB.VBX" (ByVal hWnd As Integer, ByVal FieldNo As Integer, field As TypeField) As Integer Declare Function RvbGetSortField Lib "RVB.VBX" (ByVal hWnd As Integer, ByVal FieldNo As Integer, field As TypeField) As Integer Declare Function RvbSetFormField Lib "RVB.VBX" (ByVal hWnd As Integer, field As TypeField, ByVal valid As Integer) As Integer Declare Function RvbSetTextField Lib "RVB.VBX" (ByVal hWnd As Integer, ByVal FieldNo As Integer, ByVal TextData As string, ByVal TextDataLen As Integer) As Integer Declare Function RvbSetNumField Lib "RVB.VBX" (ByVal hWnd As Integer, ByVal FieldNo As Integer, ByVal NumData As Long) As Integer Declare Function RvbSetDoubleField Lib "RVB.VBX" (ByVal hWnd As Integer, ByVal FieldNo As Integer, ByVal DoubleData As Double) As Integer Declare Function RvbGetPictureInfo Lib "RVB.VBX" (ByVal hWnd As Integer, PictInfo as TypePict) As Integer Declare Function RvbDrawBitmap Lib "RVB.VBX" (ByVal hWnd As Integer, ByVal hWnd As Integer, ByVal hBM as Integer, ByVal PictX as Integer, ByVal PictY as Integer, ByVal PictWidth As Integer, ByVal PictHeight As Integer) As Integer Rem ************************************************** Rem When a string is passed for OUTPUT to the DLL Rem ,the output string created by the DLL has an extra Rem NULL character. For such strings, you must call Rem this routine to strip the null character from the Rem given string Rem ************************************************** Function DiscardNull (InText As String) As String Dim i As Integer Dim StrLen As Integer Dim CurChar As String StrLen = Len(InText) For i = 1 To StrLen CurChar = Left(InText, i) CurChar = Right(CurChar, 1) If Asc(CurChar) = 0 Then DiscardNull = Left(InText, i - 1) Exit Function End If Next i DiscardNull = InText End Function