Includes en .prg (SOLUCIONADO)

Includes en .prg (SOLUCIONADO)

Postby Compuin » Thu Nov 01, 2018 3:26 pm

Buenas tardes

Es posible agregar las definiciones de una archivo .ch (Include) en el .prg para asi no tener que agregar el mismo en los includes de FWH ? Si es posible, algun ejemplo ?

Atento a sus comentarios
Last edited by Compuin on Sun Nov 04, 2018 5:46 pm, edited 1 time in total.
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1213
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: Includes en .prg

Postby karinha » Thu Nov 01, 2018 5:10 pm

Te basta crear un único archivo.ch y en el agregar todos los includes.ch del proyecto.

Ejemplo:

Code: Select all  Expand view

#Include "Fivewin.Ch"
#Include "Dll.ch"
#include "dbinfo.ch"
#Include "FastReph.Ch"
#Include "Directry.ch"
#Include "DSay.Ch"
#include "fileio.ch"
#include "Image.ch"
#Include "Mail.Ch"
#Include "Ord.Ch"
#Include "Report.Ch"
#Include "SSay.Ch"
#Include "URLLink.ch"
// colores
#Define CLR_LGRAY      nRGB( 230, 230, 230 )
#Define CLR_LGREEN     nRGB( 190, 215, 190 )
#Define CLR_VERMELHO   nRGB( 255, 000, 000 )
#Define CLR_AMARELO    nRgb( 255, 255, 000 )
#Define CLR_BOMBOM     nRGB( 000, 000, 000 )
#Define CLR_MARROM     nRGB( 135, 206, 250 )
#Define CLR_MENTA      nRGB( 221, 255, 238 )
#Define CLR_HMENTA     nRGB( 000, 128, 000 )
#Define CLR_SOFTYELLOW nRGB( 255, 251, 225 )
#Define COLOR_BTNFACE  15

#Define TRUE  .T.
#Define FALSE .F.

#Define PAD_LEFT            0
#Define PAD_RIGHT           1
#Define PAD_CENTER          2

#Define SW_SHOWMAXIMIZED 3

#ifndef XPP
   #define  HKEY_CLASSES_ROOT       2147483648
   #define  HKEY_CURRENT_USER       2147483649
   #define  HKEY_LOCAL_MACHINE      2147483650
   #define  HKEY_USERS              2147483651
   #define  HKEY_PERFORMANCE_DATA   2147483652
   #define  HKEY_CURRENT_CONFIG     2147483653
   #define  HKEY_DYN_DATA           2147483654
#else
   #define  HKEY_CLASSES_ROOT       1
   #define  HKEY_CURRENT_USER       2
   #define  HKEY_LOCAL_MACHINE      3
   #define  HKEY_USERS              4
   #define  HKEY_PERFORMANCE_DATA   5
   #define  HKEY_CURRENT_CONFIG     6
   #define  HKEY_DYN_DATA           7
#endif

#define SUCCESS_SUCCESS                      0
#define MAPI_USER_ABORT                      1
#define MAPI_E_FAILURE                       2
#define MAPI_E_LOGIN_FAILURE                 3
#define MAPI_E_DISK_FULL                     4
#define MAPI_E_INSUFFICIENT_MEMORY           5
#define MAPI_E_ACCESS_DENIED                 6
#define MAPI_E_TOO_MANY_SESSIONS             8
#define MAPI_E_TOO_MANY_FILES                9
#define MAPI_E_TOO_MANY_RECIPIENTS          10
#define MAPI_E_ATTACHMENT_NOT_FOUND         11
#define MAPI_E_ATTACHMENT_OPEN_FAILURE      12
#define MAPI_E_ATTACHMENT_WRITE_FAILURE     13
#define MAPI_E_UNKNOWN_RECIPIENT            14
#define MAPI_E_BAD_RECIPTYPE                15
#define MAPI_E_NO_MESSAGES                  16
#define MAPI_E_INVALID_MESSAGE              17
#define MAPI_E_TEXT_TOO_LARGE               18
#define MAPI_E_INVALID_SESSION              19
#define MAPI_E_TYPE_NOT_SUPPORTED           20
#define MAPI_E_AMBIGUOUS_RECIPIENT          21
#define MAPI_E_MESSAGE_IN_USE               22
#define MAPI_E_NETWORK_FAILURE              23
#define MAPI_E_INVALID_EDITFIELDS           24
#define MAPI_E_INVALID_RECIPS               25
#define MAPI_E_NOT_SUPPORTED                26

... Continua
 


Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Includes en .prg

Postby Compuin » Thu Nov 01, 2018 5:11 pm

Gracias

La idea es no crear archivos .ch
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1213
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: Includes en .prg

Postby cnavarro » Thu Nov 01, 2018 5:17 pm

A ver si te he entendido

Code: Select all  Expand view

// Por ejemplo
#ifndef CLR_LGRAY
#Define CLR_LGRAY      nRGB( 230, 230, 230 )
#endif
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Includes en .prg

Postby Compuin » Thu Nov 01, 2018 5:20 pm

cnavarro wrote:A ver si te he entendido

Code: Select all  Expand view

// Por ejemplo
#ifndef CLR_LGRAY
#Define CLR_LGRAY      nRGB( 230, 230, 230 )
#endif
 


Algo como esto:

Code: Select all  Expand view
#INCLUDE "FiveWin.ch"

FUNCTION Main()

   LOCAL oDlg
   LOCAL cGet := 'Code   '
   LOCAL dGet := Date()

//   SET 3D ON

   SET DATE ITALIAN

   DEFINE DIALOG oDlg  TITLE "TBmpGet"

#command @ <nRow>, <nCol> BMPGET [ <oGet> VAR ] <uVar> ;
            [ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ;
            [ PICTURE <cPict> ] ;
            [ VALID <uValid> ] ;
            [ <color:COLOR,COLORS> <nClrFore> [,<nClrBack>] ] ;
            [ SIZE <nWidth>, <nHeight> ]  ;
            [ FONT <oFont> ] ;
            [ <design: DESIGN> ] ;
            [ CURSOR <oCursor> ] ;
            [ <pixel: PIXEL> ] ;
            [ MESSAGE <cMsg> ] ;
            [ <update: UPDATE> ] ;
            [ WHEN <uWhen> ] ;
            [ <lCenter: CENTER, CENTERED> ] ;
            [ <lRight: RIGHT> ] ;
            [ ON CHANGE <uChange> ] ;
            [ <readonly: READONLY, NO MODIFY> ] ;
            [ <pass: PASSWORD> ] ;
            [ <lNoBorder: NO BORDER, NOBORDER> ] ;
            [ <help:HELPID, HELP ID> <nHelpId> ] ;
            [ <resource: NAME, RESNAME, RESOURCE> <cResName> ];
            [ ACTION <uAction> ] ;


   REDEFINE BMPGET cGet ID 101 OF oDlg ;
            RESOURCE "GET_BROWSE" ;
            ACTION MsgStop( Cancel() )

   REDEFINE BMPGET dGet ID 102 OF oDlg SPINNER ;
            RESOURCE "GET_CALENDAR" ;
            ACTION MsgStop( Cancel )

   @ 0,0 GET cGet OF oDLG

   ACTIVATE DIALOG oDlg CENTER

RETURN NIL
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1213
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: Includes en .prg

Postby xmanuel » Fri Nov 02, 2018 11:01 am

Si es posible...
Pero dos cosas al respecto...
1.- Ponlo al principio de tu PRG por que si hay una definición previa tendrás problemas ya que usará el primero.
2.- Es poco elegante e ilegible.

Lo mejor es un include y usar lo que te dice Cristobal:
#ifdef
#undef
#define
etc
______________________________________________________________________________
Sevilla - Andalucía
xmanuel
 
Posts: 756
Joined: Sun Jun 15, 2008 7:47 pm
Location: Sevilla

Re: Includes en .prg

Postby Compuin » Fri Nov 02, 2018 12:05 pm

xmanuel wrote:Si es posible...
Pero dos cosas al respecto...
1.- Ponlo al principio de tu PRG por que si hay una definición previa tendrás problemas ya que usará el primero.
2.- Es poco elegante e ilegible.

Lo mejor es un include y usar lo que te dice Cristobal:
#ifdef
#undef
#define
etc


Muchas gracias a todos!!
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1213
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 80 guests