Instalacion
Instalacion
Esoty iniciandome en la programacion de FiveWin, hace tiempo desarrolle algo en FoxPro 2.5. Tengo dudas en cuanto a si mi instalacion quedo correctamente instalada, ya que al compilar los demos que vienen de ejemplo me marca errores, segun entiendo de librerias, aunque tengo las librerias, debido a eso supongo que el error viene en las rutas que busca el BUIILDCE. A continuacion les listo el contenido de este archivo y el error que envia a intentar compliar los archivos PRG
Contenido de archivo BUILDCE.BAT
@ECHO OFF
CLS
ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
ECHO ³ FiveWin for Pocket PC - June 2006 Harbour development power ³Ü
ECHO ³ (c) FiveTech, 1993-2006 for Microsoft Windows Pocket PC ³Û
ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST
ECHO Compiling...
set hdir=c:\harbour_CE
set vcdir=c:\vce
set include=%vcdir%\include\arm;%hdir%\include;%include%
set lib=%vcdir%\lib;%hdir%\lib;%lib%
%hdir%\bin\harbour %1 /n /i..\include;%hdir%\include /p %2 %3 > clip.log
@type clip.log
IF ERRORLEVEL 1 PAUSE
IF ERRORLEVEL 1 GOTO EXIT
%vcdir%\bin\clarm -TP -W3 -c /DARM /DUNICODE /I%hdir%\include /I..\include %1.c
:ENDCOMPILE
IF EXIST %1.rc %vcdir%\bin\rc -r -d_CE %1
echo %1.obj > msvc.tmp
echo ..\lib\FiveCE.lib ..\lib\FiveCEC.lib >> msvc.tmp
echo %hdir%\lib\rtl.lib >> msvc.tmp
echo %hdir%\lib\vm.lib >> msvc.tmp
echo %hdir%\lib\gtwin.lib >> msvc.tmp
echo %hdir%\lib\lang.lib >> msvc.tmp
echo %hdir%\lib\macro.lib >> msvc.tmp
echo %hdir%\lib\rdd.lib >> msvc.tmp
echo %hdir%\lib\dbfntx.lib >> msvc.tmp
echo %hdir%\lib\dbfcdx.lib >> msvc.tmp
echo %hdir%\lib\dbffpt.lib >> msvc.tmp
echo %hdir%\lib\hbsix.lib >> msvc.tmp
echo %hdir%\lib\debug.lib >> msvc.tmp
echo %hdir%\lib\common.lib >> msvc.tmp
echo %hdir%\lib\pp.lib >> msvc.tmp
echo %hdir%\lib\codepage.lib >> msvc.tmp
rem Uncomment these two lines to use Advantage RDD
rem echo %hdir%\lib\rddads.lib >> msvc.tmp
rem echo %hdir%\lib\ace32.lib >> msvc.tmp
echo %vcdir%\lib\arm\coredll.lib >> msvc.tmp
echo %vcdir%\lib\arm\corelibc.lib >> msvc.tmp
echo %vcdir%\lib\arm\aygshell.lib >> msvc.tmp
echo %vcdir%\lib\arm\ws2.lib >> msvc.tmp
echo %vcdir%\lib\arm\mfcce400.lib >> msvc.tmp
echo %vcdir%\lib\arm\ole32.lib >> msvc.tmp
echo %vcdir%\lib\arm\ceshell.lib >> msvc.tmp
echo %vcdir%\lib\arm\commctrl.lib >> msvc.tmp
echo %vcdir%\lib\arm\wininet.lib >> msvc.tmp
IF EXIST %1.res echo %1.res >> msvc.tmp
%vcdir%\bin\link @msvc.tmp /nologo /SUBSYSTEM:WINDOWSCE,4.20 /MACHINE:ARM
rem delete temporary files
@del %1.c
@del %1.obj
@del %1.exp
@del %1.lib
@del %1.ppo
@del msvc.tmp
IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built
GOTO EXIT
ECHO
:LINKERROR
rem PAUSE * Linking errors *
GOTO EXIT
:SINTAX
ECHO SYNTAX: Build [Program] {-- No especifiques la extensi¢n PRG
ECHO {-- Don't specify .PRG extension
GOTO EXIT
:NOEXIST
ECHO The specified PRG %1 does not exist
:EXIT
ERROR QUE ENVIA AL COMPILAR
Compiling…
Harbour Compiler Alpha build 45.0 (Flex)
Copyright 1999-2005, http://www.harbour-project.org/
Compiling `client.prg´ and generating preprocessed output to `client.ppo´...
Lines 359. Functions/Procedures 13
Generating <R> C/C++ Optimizing Compiler Version 12.20.9615 for ARM
Copyright <C> Microsoft Corp 1984-2002. All rights reserved.
Client.c
Creating library client.lib and object client.exp
Vm.lib(hvm.obj) : warning LNK1166: cannot adjust code at offset=0x00001000, rva=
0x00038328
rdd.lib(dbf1.obj) : warning LNK1166: cannot adjust code at offset=0x00001000, rva=
0x0008D5BC
dbfntx.lib(dbfntx1.obj) : warning LNK1166: cannot adjust code at offset=0x00001000,
rva=0x0009B014
dbfftp.lib(dbfftp1.obj) : warning LNK1166: cannot adjust code at offset=0x00001000,
rva=0x000B0AF0
• Application successfully built
C:\FWPPC\SAMPLES>
Contenido de archivo BUILDCE.BAT
@ECHO OFF
CLS
ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
ECHO ³ FiveWin for Pocket PC - June 2006 Harbour development power ³Ü
ECHO ³ (c) FiveTech, 1993-2006 for Microsoft Windows Pocket PC ³Û
ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST
ECHO Compiling...
set hdir=c:\harbour_CE
set vcdir=c:\vce
set include=%vcdir%\include\arm;%hdir%\include;%include%
set lib=%vcdir%\lib;%hdir%\lib;%lib%
%hdir%\bin\harbour %1 /n /i..\include;%hdir%\include /p %2 %3 > clip.log
@type clip.log
IF ERRORLEVEL 1 PAUSE
IF ERRORLEVEL 1 GOTO EXIT
%vcdir%\bin\clarm -TP -W3 -c /DARM /DUNICODE /I%hdir%\include /I..\include %1.c
:ENDCOMPILE
IF EXIST %1.rc %vcdir%\bin\rc -r -d_CE %1
echo %1.obj > msvc.tmp
echo ..\lib\FiveCE.lib ..\lib\FiveCEC.lib >> msvc.tmp
echo %hdir%\lib\rtl.lib >> msvc.tmp
echo %hdir%\lib\vm.lib >> msvc.tmp
echo %hdir%\lib\gtwin.lib >> msvc.tmp
echo %hdir%\lib\lang.lib >> msvc.tmp
echo %hdir%\lib\macro.lib >> msvc.tmp
echo %hdir%\lib\rdd.lib >> msvc.tmp
echo %hdir%\lib\dbfntx.lib >> msvc.tmp
echo %hdir%\lib\dbfcdx.lib >> msvc.tmp
echo %hdir%\lib\dbffpt.lib >> msvc.tmp
echo %hdir%\lib\hbsix.lib >> msvc.tmp
echo %hdir%\lib\debug.lib >> msvc.tmp
echo %hdir%\lib\common.lib >> msvc.tmp
echo %hdir%\lib\pp.lib >> msvc.tmp
echo %hdir%\lib\codepage.lib >> msvc.tmp
rem Uncomment these two lines to use Advantage RDD
rem echo %hdir%\lib\rddads.lib >> msvc.tmp
rem echo %hdir%\lib\ace32.lib >> msvc.tmp
echo %vcdir%\lib\arm\coredll.lib >> msvc.tmp
echo %vcdir%\lib\arm\corelibc.lib >> msvc.tmp
echo %vcdir%\lib\arm\aygshell.lib >> msvc.tmp
echo %vcdir%\lib\arm\ws2.lib >> msvc.tmp
echo %vcdir%\lib\arm\mfcce400.lib >> msvc.tmp
echo %vcdir%\lib\arm\ole32.lib >> msvc.tmp
echo %vcdir%\lib\arm\ceshell.lib >> msvc.tmp
echo %vcdir%\lib\arm\commctrl.lib >> msvc.tmp
echo %vcdir%\lib\arm\wininet.lib >> msvc.tmp
IF EXIST %1.res echo %1.res >> msvc.tmp
%vcdir%\bin\link @msvc.tmp /nologo /SUBSYSTEM:WINDOWSCE,4.20 /MACHINE:ARM
rem delete temporary files
@del %1.c
@del %1.obj
@del %1.exp
@del %1.lib
@del %1.ppo
@del msvc.tmp
IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built
GOTO EXIT
ECHO
:LINKERROR
rem PAUSE * Linking errors *
GOTO EXIT
:SINTAX
ECHO SYNTAX: Build [Program] {-- No especifiques la extensi¢n PRG
ECHO {-- Don't specify .PRG extension
GOTO EXIT
:NOEXIST
ECHO The specified PRG %1 does not exist
:EXIT
ERROR QUE ENVIA AL COMPILAR
Compiling…
Harbour Compiler Alpha build 45.0 (Flex)
Copyright 1999-2005, http://www.harbour-project.org/
Compiling `client.prg´ and generating preprocessed output to `client.ppo´...
Lines 359. Functions/Procedures 13
Generating <R> C/C++ Optimizing Compiler Version 12.20.9615 for ARM
Copyright <C> Microsoft Corp 1984-2002. All rights reserved.
Client.c
Creating library client.lib and object client.exp
Vm.lib(hvm.obj) : warning LNK1166: cannot adjust code at offset=0x00001000, rva=
0x00038328
rdd.lib(dbf1.obj) : warning LNK1166: cannot adjust code at offset=0x00001000, rva=
0x0008D5BC
dbfntx.lib(dbfntx1.obj) : warning LNK1166: cannot adjust code at offset=0x00001000,
rva=0x0009B014
dbfftp.lib(dbfftp1.obj) : warning LNK1166: cannot adjust code at offset=0x00001000,
rva=0x000B0AF0
• Application successfully built
C:\FWPPC\SAMPLES>
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Warnings
El problema es que no corre en la pocket despues de estos warnings, le instale el programa client.exe que ya esta compilado en el ejemplo y ese si funciona perfectamente bien, si compilo el client.prg (sin modificaciones) me marca esos avisos y trato de correrlo en la misma pocket y no funciona.
Por eso creo que si existe algun problema con esos avisos o no la verdad no entiendo que pasa realmente.
Por eso creo que si existe algun problema con esos avisos o no la verdad no entiendo que pasa realmente.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Creo que empiezo a entender un poco el problema pero no lo se resolver, este es el mensaje que me envia despues de agregar la linea MsgInfo("Test").
Compiling…
Harbour Compiler Alpha build 45.0 (Flex)
Copyright 1999-2005, http://www.harbour-project.org/
Compiling ´client.prg´ and generating preprocessed output to ´client.ppo´...
Client.prg(7) Error E0001 Statement not allowed outside of procedure or fuction
Client.prg(16) Error E0004 STATIC declaration follows executable statement
Client.prg(17) Error E0004 STATIC declaration follows executable statement
3 errors
No code generated
Microsoft (R) C/C++ Optimizing Compiler Version 12.20.9615 for ARM
Copyright (C) Microsoft Corp 1984-2002. All rigths reserved.
Client.c
Fatal error C1083: Cannot open source file: ´client.c´: no such file or directory
LINK : fatal error LNK181: cannot open input file ´client.obj´
No se encuentra C:\FWPPC\SAMPLES\client.c
No se encuentra C:\FWPPC\SAMPLES\client.obj
No se encuentra C:\FWPPC\SAMPLES\client.exp
No se encuentra C:\FWPPC\SAMPLES\client.lib
*Aplication succesfully built
Compiling…
Harbour Compiler Alpha build 45.0 (Flex)
Copyright 1999-2005, http://www.harbour-project.org/
Compiling ´client.prg´ and generating preprocessed output to ´client.ppo´...
Client.prg(7) Error E0001 Statement not allowed outside of procedure or fuction
Client.prg(16) Error E0004 STATIC declaration follows executable statement
Client.prg(17) Error E0004 STATIC declaration follows executable statement
3 errors
No code generated
Microsoft (R) C/C++ Optimizing Compiler Version 12.20.9615 for ARM
Copyright (C) Microsoft Corp 1984-2002. All rigths reserved.
Client.c
Fatal error C1083: Cannot open source file: ´client.c´: no such file or directory
LINK : fatal error LNK181: cannot open input file ´client.obj´
No se encuentra C:\FWPPC\SAMPLES\client.c
No se encuentra C:\FWPPC\SAMPLES\client.obj
No se encuentra C:\FWPPC\SAMPLES\client.exp
No se encuentra C:\FWPPC\SAMPLES\client.lib
*Aplication succesfully built
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Estoy probando el compilador con el ejemplo client.prg, lo enlisto a continuacion, opte por probarlo con este ya que como te explique al inicio de mi consulta, cuando compilaba alguna prueba que yo hacia me envia esos warnings y como no apenas estoy aprendiendo a desarrollar en fivewin no sabia si estaba mal mi archivo PRG, por eso probe compilar un programa que se que funciona y me encontre que en ese caso tambien envia los errores y no corre despues de compilarlo, sin embargo en el EXE que ya viene generado corre sin problemas.
Este es el PRG que envia los errores que te envie
/*
Programa := Client.prg
Autor := Carles Aubia
Fecha := 09.02.2006
Descripcion := Ejemplo sencillo de mantenimiento usando FWPPC
*/
MsgInfo("Test")
#include "FWCE.ch"
REQUEST HB_LANG_ESWIN
#define DBF_LON 10
#define DBF_CUSTOMER 1
STATIC oWnd
STATIC aDbf
*--------------
FUNCTION Main()
*--------------
LOCAL oBmp
Config()
DEFINE BITMAP oBmp NAME 'Five'
DEFINE WINDOW oWnd TITLE "FWPPC System"
ACTIVATE WINDOW oWnd ;
ON PAINT oWnd:SayBitmap( 60, 10, oBmp ) ;
ON INIT Control()
DbCloseAll()
oBmp:End()
RETU NIL
*-----------------------
STATIC FUNCTION Config()
*-----------------------
* RddRegister( "DBFCDX", 1 )
* RddSetDefault( "DBFCDX" )
HB_LANGSELECT( "ESWIN" )
SET DELETED ON
SET DATE TO ITALIAN
SET SOFTSEEK ON
SET CENTURY ON
SET EPOCH TO 2000
RETU NIL
*------------------------
STATIC FUNCTION Control()
*------------------------
LOCAL oDummy
aDbf := Array( DBF_LON )
USE ( CurDir() + "\Customer" ) NEW
aDbf[ DBF_CUSTOMER ] := Alias()
@ 0, 0 BTNBMP NAME "exit" SIZE 30, 30 OF oWnd ;
ACTION IF( MsgYesNo( 'Desea salir ?', 'Sistema' ), oWnd:End(), )
@ 0, 30 BTNBMP NAME "client" SIZE 30, 30 OF oWnd ;
ACTION Client()
@ 0, 210 BTNBMP NAME "info" SIZE 30, 30 OF oWnd ;
ACTION About()
@ 0, 0 BTNBMP oDummy NAME "" SIZE 240, 30 OF oWnd
oDummy:Disable()
RETU NIL
#define O_LON 50
#define O_DLG 1
#define O_LOAD 2
#define O_RECNO 3
#define O_FIRST 10
#define O_LAST 11
#define O_STREET 12
#define O_CITY 13
#define O_STATE 14
#define O_ZIP 15
#define O_HIREDATE 16
#define O_MARRIED 17
#define O_AGE 18
#define O_SALARY 19
*-----------------------
STATIC FUNCTION Client()
*-----------------------
LOCAL o := Array( O_LON )
LOCAL v := Array( O_LON )
Cli_IniVar( o, v )
DEFINE DIALOG o[ O_DLG ] RESOURCE "Client"
REDEFINE GET o[ O_FIRST ] VAR v[ O_FIRST ] ID 200 OF o[ O_DLG ]
REDEFINE GET o[ O_LAST ] VAR v[ O_LAST ] ID 210 OF o[ O_DLG ]
REDEFINE GET o[ O_STREET ] VAR v[ O_STREET ] ID 220 OF o[ O_DLG ]
REDEFINE GET o[ O_CITY ] VAR v[ O_CITY ] ID 230 OF o[ O_DLG ]
REDEFINE GET o[ O_STATE ] VAR v[ O_STATE ] ID 240 OF o[ O_DLG ]
REDEFINE GET o[ O_ZIP ] VAR v[ O_ZIP ] ID 250 OF o[ O_DLG ]
REDEFINE GET o[ O_HIREDATE] VAR v[ O_HIREDATE] ID 260 OF o[ O_DLG ]
REDEFINE CHECKBOX o[ O_MARRIED ] VAR v[ O_MARRIED ] ID 270 OF o[ O_DLG ]
REDEFINE GET o[ O_AGE ] VAR v[ O_AGE ] ID 280 OF o[ O_DLG ] PICTURE '99'
REDEFINE GET o[ O_SALARY ] VAR v[ O_SALARY ] ID 290 OF o[ O_DLG ] PICTURE '999999'
ACTIVATE DIALOG o[ O_DLG ] CENTERED ;
ON INIT ( Cli_Bar( o, v ), .f. )
HideKeyboard()
RETU NIL
*------------------------------
STATIC FUNCTION Cli_Bar( o, v )
*------------------------------
LOCAL oDummy
@ 0, 0 BTNBMP NAME "Exit" SIZE 30, 30 OF o[ O_DLG ] ;
ACTION o[ O_DLG ]:End()
@ 0, 30 BTNBMP NAME "New" SIZE 30, 30 OF o[ O_DLG ] ;
ACTION Cli_New( o, v )
@ 0, 60 BTNBMP NAME "Busca" SIZE 30, 30 OF o[ O_DLG ] ;
ACTION Cli_Find( o, v )
@ 0, 90 BTNBMP NAME "Save" SIZE 30, 30 OF o[ O_DLG ] ;
ACTION Cli_Save( o, v )
@ 0, 120 BTNBMP NAME "Brosa" SIZE 30, 30 OF o[ O_DLG ] ;
ACTION Cli_Del( o, v )
@ 0, 0 BTNBMP oDummy NAME "" SIZE 240, 30 OF o[ O_DLG ]
oDummy:Disable()
ShowKeyboard()
o[ O_FIRST ]:SetFocus()
RETU NIL
*---------------------------------
STATIC FUNCTION Cli_IniVar( o, v )
*---------------------------------
v[ O_RECNO ] := 0
v[ O_FIRST ] := Space( 20 )
v[ O_LAST ] := Space( 20 )
v[ O_STREET ] := Space( 30 )
v[ O_CITY ] := Space( 30 )
v[ O_STATE ] := Space( 30 )
v[ O_ZIP ] := Space( 10 )
v[ O_HIREDATE ] := CToD( ' - - ' )
v[ O_MARRIED ] := .F.
v[ O_AGE ] := 0
v[ O_SALARY ] := 0
RETU NIL
*-------------------------------------
STATIC FUNCTION Cli_RefreshVar( o, v )
*-------------------------------------
o[ O_FIRST ]:Refresh()
o[ O_LAST ]:Refresh()
o[ O_STREET ]:Refresh()
o[ O_CITY ]:Refresh()
o[ O_STATE ]:Refresh()
o[ O_ZIP ]:Refresh()
o[ O_HIREDATE ]:Refresh()
o[ O_MARRIED ]:Refresh()
o[ O_AGE ]:Refresh()
o[ O_SALARY ]:Refresh()
o[ O_FIRST ]:SetFocus()
RETU NIL
*------------------------------
STATIC FUNCTION Cli_New( o, v )
*------------------------------
IF v[ O_RECNO ] > 0 .AND. ! MsgYesNo( 'Nuevo registro?', 'Sistema' )
o[ O_FIRST ]:SetFocus()
RETU NIL
ENDIF
Cli_IniVar ( o, v )
Cli_RefreshVar( o, v )
RETU NIL
*-------------------------------
STATIC FUNCTION Cli_Find( o, v )
*-------------------------------
LOCAL cAlias := aDbf[ DBF_CUSTOMER ]
LOCAL nRecno := Sel_Client()
IF nRecno > 0
( cAlias )->( DbGoto( nRecno ) )
v[ O_FIRST ] := ( cAlias )->first
v[ O_LAST ] := ( cAlias )->last
v[ O_STREET ] := ( cAlias )->street
v[ O_CITY ] := ( cAlias )->city
v[ O_STATE ] := ( cAlias )->state
v[ O_ZIP ] := ( cAlias )->zip
v[ O_HIREDATE ] := ( cAlias )->hiredate
v[ O_MARRIED ] := ( cAlias )->married
v[ O_AGE ] := ( cAlias )->age
v[ O_SALARY ] := ( cAlias )->salary
v[ O_RECNO ] := nRecno
Cli_RefreshVar( o, v )
ELSE
o[ O_FIRST ]:SetFocus()
ENDIF
RETU NIL
*-------------------------------
STATIC FUNCTION Cli_Save( o, v )
*-------------------------------
LOCAL lOk := .f.
LOCAL cAlias := aDbf[ DBF_CUSTOMER ]
IF ! MsgYesNo( 'Actualizar datos ?', 'Sistema' )
o[ O_FIRST ]:SetFocus()
RETU NIL
ENDIF
IF v[ O_RECNO ] == 0
( cAlias )->( DbAppend() )
IF ( cAlias )->( NetErr() )
MsgAlert( 'Error a¤adiendo registro', 'Sistema' )
RETU NIL
ENDIF
ENDIF
( cAlias )->first := v[ O_FIRST ]
( cAlias )->last := v[ O_LAST ]
( cAlias )->street := v[ O_STREET ]
( cAlias )->city := v[ O_CITY ]
( cAlias )->state := v[ O_STATE ]
( cAlias )->zip := v[ O_ZIP ]
( cAlias )->hiredate := v[ O_HIREDATE ]
( cAlias )->married := v[ O_MARRIED ]
( cAlias )->age := v[ O_AGE ]
( cAlias )->salary := v[ O_SALARY ]
Cli_IniVar ( o, v )
Cli_RefreshVar( o, v )
RETU NIL
*------------------------------
STATIC FUNCTION Cli_Del( o, v )
*------------------------------
LOCAL lOk := .f.
LOCAL cAlias := aDbf[ DBF_CUSTOMER ]
IF v[ O_RECNO ] == 0
Cli_IniVar ( o, v )
Cli_RefreshVar( o, v )
RETU NIL
ENDIF
IF ! MsgYesNo( 'Eliminar registro ?', 'Sistema' )
RETU NIL
ENDIF
( cAlias )->( DbDelete() )
Cli_IniVar ( o, v )
Cli_RefreshVar( o, v )
RETU NIL
*---------------------------
STATIC FUNCTION Sel_Client()
*---------------------------
LOCAL oDlg, oFont, oLbx
LOCAL nRecno := 0
LOCAL cAlias := aDbf[ DBF_CUSTOMER ]
HideKeyboard()
DEFINE FONT oFont NAME "Arial" SIZE 0, -12
DEFINE DIALOG oDlg RESOURCE "Sel_Client"
REDEFINE LISTBOX oLbx ;
FIELDS (cAlias)->first, (cAlias)->last ;
HEADERS "First", "Last" ;
ID 500 OF oDlg ALIAS cAlias
oLbx:aColSizes := { 100, 100 }
oLbx:blDblClick := {|| ( nRecno := (cAlias)->( Recno() ),;
oDlg:End() ) }
REDEFINE BUTTON ID 100 OF oDlg ACTION oDlg:End()
REDEFINE BUTTON ID 110 OF oDlg ;
ACTION ( nRecno := (cAlias)->( Recno() ) , oDlg:End() )
ACTIVATE DIALOG oDlg CENTERED
ShowKeyboard()
RETU nRecno
*----------------------
STATIC FUNCTION About()
*----------------------
LOCAL oBmp, oDlg, oSay, oFont
LOCAL cText := 'Ejemplo de uso de FWPPC' + CRLF + CRLF + ;
'(c) Carles Aubia'
DEFINE FONT oFont NAME 'Arial' SIZE 0, -10
DEFINE DIALOG oDlg RESOURCE "About"
REDEFINE BITMAP oBmp NAME 'FWPPC' ID 200 OF oDlg
REDEFINE SAY oSay PROMPT cText ID 210 OF oDlg ;
FONT oFont COLOR CLR_BLACK, CLR_WHITE
oDlg:blClicked := {|| oDlg:End() }
oBmp:blClicked := {|| oDlg:End() }
ACTIVATE DIALOG oDlg CENTERED
oBmp:End()
oFont:End()
RETU NIL
Este es el PRG que envia los errores que te envie
/*
Programa := Client.prg
Autor := Carles Aubia
Fecha := 09.02.2006
Descripcion := Ejemplo sencillo de mantenimiento usando FWPPC
*/
MsgInfo("Test")
#include "FWCE.ch"
REQUEST HB_LANG_ESWIN
#define DBF_LON 10
#define DBF_CUSTOMER 1
STATIC oWnd
STATIC aDbf
*--------------
FUNCTION Main()
*--------------
LOCAL oBmp
Config()
DEFINE BITMAP oBmp NAME 'Five'
DEFINE WINDOW oWnd TITLE "FWPPC System"
ACTIVATE WINDOW oWnd ;
ON PAINT oWnd:SayBitmap( 60, 10, oBmp ) ;
ON INIT Control()
DbCloseAll()
oBmp:End()
RETU NIL
*-----------------------
STATIC FUNCTION Config()
*-----------------------
* RddRegister( "DBFCDX", 1 )
* RddSetDefault( "DBFCDX" )
HB_LANGSELECT( "ESWIN" )
SET DELETED ON
SET DATE TO ITALIAN
SET SOFTSEEK ON
SET CENTURY ON
SET EPOCH TO 2000
RETU NIL
*------------------------
STATIC FUNCTION Control()
*------------------------
LOCAL oDummy
aDbf := Array( DBF_LON )
USE ( CurDir() + "\Customer" ) NEW
aDbf[ DBF_CUSTOMER ] := Alias()
@ 0, 0 BTNBMP NAME "exit" SIZE 30, 30 OF oWnd ;
ACTION IF( MsgYesNo( 'Desea salir ?', 'Sistema' ), oWnd:End(), )
@ 0, 30 BTNBMP NAME "client" SIZE 30, 30 OF oWnd ;
ACTION Client()
@ 0, 210 BTNBMP NAME "info" SIZE 30, 30 OF oWnd ;
ACTION About()
@ 0, 0 BTNBMP oDummy NAME "" SIZE 240, 30 OF oWnd
oDummy:Disable()
RETU NIL
#define O_LON 50
#define O_DLG 1
#define O_LOAD 2
#define O_RECNO 3
#define O_FIRST 10
#define O_LAST 11
#define O_STREET 12
#define O_CITY 13
#define O_STATE 14
#define O_ZIP 15
#define O_HIREDATE 16
#define O_MARRIED 17
#define O_AGE 18
#define O_SALARY 19
*-----------------------
STATIC FUNCTION Client()
*-----------------------
LOCAL o := Array( O_LON )
LOCAL v := Array( O_LON )
Cli_IniVar( o, v )
DEFINE DIALOG o[ O_DLG ] RESOURCE "Client"
REDEFINE GET o[ O_FIRST ] VAR v[ O_FIRST ] ID 200 OF o[ O_DLG ]
REDEFINE GET o[ O_LAST ] VAR v[ O_LAST ] ID 210 OF o[ O_DLG ]
REDEFINE GET o[ O_STREET ] VAR v[ O_STREET ] ID 220 OF o[ O_DLG ]
REDEFINE GET o[ O_CITY ] VAR v[ O_CITY ] ID 230 OF o[ O_DLG ]
REDEFINE GET o[ O_STATE ] VAR v[ O_STATE ] ID 240 OF o[ O_DLG ]
REDEFINE GET o[ O_ZIP ] VAR v[ O_ZIP ] ID 250 OF o[ O_DLG ]
REDEFINE GET o[ O_HIREDATE] VAR v[ O_HIREDATE] ID 260 OF o[ O_DLG ]
REDEFINE CHECKBOX o[ O_MARRIED ] VAR v[ O_MARRIED ] ID 270 OF o[ O_DLG ]
REDEFINE GET o[ O_AGE ] VAR v[ O_AGE ] ID 280 OF o[ O_DLG ] PICTURE '99'
REDEFINE GET o[ O_SALARY ] VAR v[ O_SALARY ] ID 290 OF o[ O_DLG ] PICTURE '999999'
ACTIVATE DIALOG o[ O_DLG ] CENTERED ;
ON INIT ( Cli_Bar( o, v ), .f. )
HideKeyboard()
RETU NIL
*------------------------------
STATIC FUNCTION Cli_Bar( o, v )
*------------------------------
LOCAL oDummy
@ 0, 0 BTNBMP NAME "Exit" SIZE 30, 30 OF o[ O_DLG ] ;
ACTION o[ O_DLG ]:End()
@ 0, 30 BTNBMP NAME "New" SIZE 30, 30 OF o[ O_DLG ] ;
ACTION Cli_New( o, v )
@ 0, 60 BTNBMP NAME "Busca" SIZE 30, 30 OF o[ O_DLG ] ;
ACTION Cli_Find( o, v )
@ 0, 90 BTNBMP NAME "Save" SIZE 30, 30 OF o[ O_DLG ] ;
ACTION Cli_Save( o, v )
@ 0, 120 BTNBMP NAME "Brosa" SIZE 30, 30 OF o[ O_DLG ] ;
ACTION Cli_Del( o, v )
@ 0, 0 BTNBMP oDummy NAME "" SIZE 240, 30 OF o[ O_DLG ]
oDummy:Disable()
ShowKeyboard()
o[ O_FIRST ]:SetFocus()
RETU NIL
*---------------------------------
STATIC FUNCTION Cli_IniVar( o, v )
*---------------------------------
v[ O_RECNO ] := 0
v[ O_FIRST ] := Space( 20 )
v[ O_LAST ] := Space( 20 )
v[ O_STREET ] := Space( 30 )
v[ O_CITY ] := Space( 30 )
v[ O_STATE ] := Space( 30 )
v[ O_ZIP ] := Space( 10 )
v[ O_HIREDATE ] := CToD( ' - - ' )
v[ O_MARRIED ] := .F.
v[ O_AGE ] := 0
v[ O_SALARY ] := 0
RETU NIL
*-------------------------------------
STATIC FUNCTION Cli_RefreshVar( o, v )
*-------------------------------------
o[ O_FIRST ]:Refresh()
o[ O_LAST ]:Refresh()
o[ O_STREET ]:Refresh()
o[ O_CITY ]:Refresh()
o[ O_STATE ]:Refresh()
o[ O_ZIP ]:Refresh()
o[ O_HIREDATE ]:Refresh()
o[ O_MARRIED ]:Refresh()
o[ O_AGE ]:Refresh()
o[ O_SALARY ]:Refresh()
o[ O_FIRST ]:SetFocus()
RETU NIL
*------------------------------
STATIC FUNCTION Cli_New( o, v )
*------------------------------
IF v[ O_RECNO ] > 0 .AND. ! MsgYesNo( 'Nuevo registro?', 'Sistema' )
o[ O_FIRST ]:SetFocus()
RETU NIL
ENDIF
Cli_IniVar ( o, v )
Cli_RefreshVar( o, v )
RETU NIL
*-------------------------------
STATIC FUNCTION Cli_Find( o, v )
*-------------------------------
LOCAL cAlias := aDbf[ DBF_CUSTOMER ]
LOCAL nRecno := Sel_Client()
IF nRecno > 0
( cAlias )->( DbGoto( nRecno ) )
v[ O_FIRST ] := ( cAlias )->first
v[ O_LAST ] := ( cAlias )->last
v[ O_STREET ] := ( cAlias )->street
v[ O_CITY ] := ( cAlias )->city
v[ O_STATE ] := ( cAlias )->state
v[ O_ZIP ] := ( cAlias )->zip
v[ O_HIREDATE ] := ( cAlias )->hiredate
v[ O_MARRIED ] := ( cAlias )->married
v[ O_AGE ] := ( cAlias )->age
v[ O_SALARY ] := ( cAlias )->salary
v[ O_RECNO ] := nRecno
Cli_RefreshVar( o, v )
ELSE
o[ O_FIRST ]:SetFocus()
ENDIF
RETU NIL
*-------------------------------
STATIC FUNCTION Cli_Save( o, v )
*-------------------------------
LOCAL lOk := .f.
LOCAL cAlias := aDbf[ DBF_CUSTOMER ]
IF ! MsgYesNo( 'Actualizar datos ?', 'Sistema' )
o[ O_FIRST ]:SetFocus()
RETU NIL
ENDIF
IF v[ O_RECNO ] == 0
( cAlias )->( DbAppend() )
IF ( cAlias )->( NetErr() )
MsgAlert( 'Error a¤adiendo registro', 'Sistema' )
RETU NIL
ENDIF
ENDIF
( cAlias )->first := v[ O_FIRST ]
( cAlias )->last := v[ O_LAST ]
( cAlias )->street := v[ O_STREET ]
( cAlias )->city := v[ O_CITY ]
( cAlias )->state := v[ O_STATE ]
( cAlias )->zip := v[ O_ZIP ]
( cAlias )->hiredate := v[ O_HIREDATE ]
( cAlias )->married := v[ O_MARRIED ]
( cAlias )->age := v[ O_AGE ]
( cAlias )->salary := v[ O_SALARY ]
Cli_IniVar ( o, v )
Cli_RefreshVar( o, v )
RETU NIL
*------------------------------
STATIC FUNCTION Cli_Del( o, v )
*------------------------------
LOCAL lOk := .f.
LOCAL cAlias := aDbf[ DBF_CUSTOMER ]
IF v[ O_RECNO ] == 0
Cli_IniVar ( o, v )
Cli_RefreshVar( o, v )
RETU NIL
ENDIF
IF ! MsgYesNo( 'Eliminar registro ?', 'Sistema' )
RETU NIL
ENDIF
( cAlias )->( DbDelete() )
Cli_IniVar ( o, v )
Cli_RefreshVar( o, v )
RETU NIL
*---------------------------
STATIC FUNCTION Sel_Client()
*---------------------------
LOCAL oDlg, oFont, oLbx
LOCAL nRecno := 0
LOCAL cAlias := aDbf[ DBF_CUSTOMER ]
HideKeyboard()
DEFINE FONT oFont NAME "Arial" SIZE 0, -12
DEFINE DIALOG oDlg RESOURCE "Sel_Client"
REDEFINE LISTBOX oLbx ;
FIELDS (cAlias)->first, (cAlias)->last ;
HEADERS "First", "Last" ;
ID 500 OF oDlg ALIAS cAlias
oLbx:aColSizes := { 100, 100 }
oLbx:blDblClick := {|| ( nRecno := (cAlias)->( Recno() ),;
oDlg:End() ) }
REDEFINE BUTTON ID 100 OF oDlg ACTION oDlg:End()
REDEFINE BUTTON ID 110 OF oDlg ;
ACTION ( nRecno := (cAlias)->( Recno() ) , oDlg:End() )
ACTIVATE DIALOG oDlg CENTERED
ShowKeyboard()
RETU nRecno
*----------------------
STATIC FUNCTION About()
*----------------------
LOCAL oBmp, oDlg, oSay, oFont
LOCAL cText := 'Ejemplo de uso de FWPPC' + CRLF + CRLF + ;
'(c) Carles Aubia'
DEFINE FONT oFont NAME 'Arial' SIZE 0, -10
DEFINE DIALOG oDlg RESOURCE "About"
REDEFINE BITMAP oBmp NAME 'FWPPC' ID 200 OF oDlg
REDEFINE SAY oSay PROMPT cText ID 210 OF oDlg ;
FONT oFont COLOR CLR_BLACK, CLR_WHITE
oDlg:blClicked := {|| oDlg:End() }
oBmp:blClicked := {|| oDlg:End() }
ACTIVATE DIALOG oDlg CENTERED
oBmp:End()
oFont:End()
RETU NIL
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: