Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Departamental PSGBD
Botón Nuevo
Asistente para formularios (De Uno o De Uno a Varios)
Selección de Base de Datos (Tabla y campos que integrarán el formulario)
Elegir el estilo del formulario
Elegir campo por el que se ordenará y el tipo de ordenamiento
Escribir un título para el formulario
Botón Nuevo
Asistente para informes
Selección de Base de Datos (Tabla y campos que integrarán el formulario)
Elegir el estilo del informe
Elegir el diseño del informe y la orientación
Indicar el ordenamiento para los registros
Escribir un título para el informe.
1
Material de Apoyo para 3er. Departamental PSGBD
NOTA:
También se pueden diseñar informes en blanco utilizando la barra de herramientas de
controles de informes, mediante el arrastre de los diferentes controles a las secciones
correspondientes.
VARIABLES PÚBLICAS
Las variables públicas en VFP es un tipo de variables que pueden ser utilizadas en cualquier
formulario, independientemente en cual se haya declarado.
SINTAXIS
Public as [nombre de la variable]
EJEMPLOS:
Public as x Public as y
X=0 y=” “
EJEMPLO:
do form clientes
2
Material de Apoyo para 3er. Departamental PSGBD
report form [nombre del reporte] to printer
EJEMPLO:
report form clientes to printer
EJEMPLO:
report form clientes to preview
close database
UPPER
SINTAXIS:
UPPER(objeto o cadena de caracteres)
LOWER
SINTAXIS:
LOWER(objeto o cadena de caracteres)
SELECT
SINTAXIS
Select [identificador]
***El identificador puede ser una letra o un número y se usa en combinación del comando
use.
USE
GO TOP
SINTAXIS
Go top
GO BOTTOM
SINTAXIS
Go bottom
BOF
Determina si el puntero de registro está colocado al principio (en el primer registro) de una
tabla.
SINTAXIS
BOF( )
EOF
Determina si el puntero de registro está colocado al final (en el último registro) de una tabla.
SINTAXIS
EOF( )
SKIP
SINTAXIS
Skip #
REPLACE
Actualiza los registros de una tabla reemplazando lo contenido en los campos con el contenido de
los objetos del formulario.
SINTAXIS
Replace [campo] with [objeto, variable o valor]
LOCATE
Permite realizar búsquedas de manera secuencial en los archivos de datos (tablas en uso)
SINTAXIS
4
Material de Apoyo para 3er. Departamental PSGBD
LOCATE FOR [EXPRESIONES O CONDICIONES]
FOUND
SINTAXIS
FOUND()
APPEND BLANK
SINTAXIS
Append blank
DELETE
SINTAXIS
DELETE FOR [EXPRESION] O DELETE
PACK
SINTAXIS
PACK
ZAP
Elimina todos los registros que se encuentran a la tabla que esté en uso
SINTAXIS
ZAP
5
Material de Apoyo para 3er. Departamental PSGBD
SISTEMA DE VENTAS
CODIGOS DEL FORMULARIO DE LA CLAVE DE ACCESO
RELEASE THISFORM
CLOSE DATABASE
***ABRIR BD VENTAS
SELECT A
USE PRODUCTOS
7
Material de Apoyo para 3er. Departamental PSGBD
SELECT D
USE FACTURA
DO FORM PRODUCTOS
DO FORM CLIENTES
DO FORM VENTAS_FACTURAS
DO FORM IMPRIME_FACTURA
DO FORM CONSULTAS_CLIENTES
RELEASE THISFORM
8
Material de Apoyo para 3er. Departamental PSGBD
CODIGOS DEL FORMULARIO CLIENTES
Select B
Locate for thisform.clavec.value=clave
if thisform.clavec.value<>0
if found() then
thisform.nombrec.value=nombre
thisform.direccionc.value=direccion
thisform.edadc.value=edad
thisform.telefonoc.value=telefono
thisform.ingresosc.value=ingresos
thisform.fechac.value=fecha
thisform.modificar.enabled=.t.
thisform.guardar_cambios.enabled=.t.
thisform.eliminar.enabled=.t.
9
Material de Apoyo para 3er. Departamental PSGBD
thisform.cancelar.enabled=.t.
thisform.nuevo.enabled=.t.
thisform.guardar.enabled=.f.
else
=messagebox("LA CLAVE DEL CLIENTE NO EXISTE")
resp=messagebox("DESEA DAR DE ALTA UN CLIENTE CON LA CLAVE
INTRODUCIDA",4+0+32,"NUEVO CLIENTE")
if resp=6
*Inhabilitar y habilitar objetos
thisform.clavec.enabled=.f.
thisform.nombrec.enabled=.t.
thisform.direccionc.enabled=.t.
thisform.edadc.enabled=.t.
thisform.telefonoc.enabled=.t.
thisform.ingresosc.enabled=.t.
thisform.fechac.enabled=.t.
thisform.guardar.enabled=.t.
thisform.cancelar.enabled=.t.
thisform.modificar.enabled=.f.
thisform.guardar_cambios.enabled=.f.
thisform.eliminar.enabled=.f.
thisform.cancelar.enabled=.t.
*Limpiar objetos
thisform.nombrec.value=" "
thisform.direccionc.value=" "
thisform.edadc.value=0
thisform.telefonoc.value=" "
thisform.ingresosc.value=0
thisform.fechac.value={ / / }
thisform.nuevo.enabled=.f.
thisform.nombrec.Setfocus
else
thisform.guardar.enabled=.f.
thisform.cancelar.enabled=.f.
thisform.nuevo.enabled=.t.
thisform.clavec.value=0
thisform.clavec.Setfocus
endif
endif
endif
10
Material de Apoyo para 3er. Departamental PSGBD
BOTON NUEVO PROCEDIMIENTO: CLICK
thisform.clavec.enabled=.t.
thisform.guardar.enabled=.t.
thisform.cancelar.enabled=.t.
thisform.modificar.enabled=.f.
thisform.guardar_cambios.enabled=.f.
thisform.eliminar.enabled=.f.
*Limpiar objetos
thisform.clavec.value=0
thisform.nombrec.value=" "
thisform.direccionc.value=" "
thisform.edadc.value=0
thisform.telefonoc.value=" "
thisform.ingresosc.value=0
thisform.fechac.value={ / / }
thisform.nuevo.enabled=.f.
thisform.clavec.setfocus
thisform.clavec.value=0
thisform.nombrec.value=" "
thisform.direccionc.value=" "
thisform.edadc.value=0
thisform.telefonoc.value=" "
thisform.ingresosc.value=0
thisform.fechac.value={ / / }
thisform.clavec.Setfocus
thisform.nuevo.enabled=.t.
thisform.modificar.enabled=.t.
thisform.guardar_cambios.enabled=.t.
thisform.eliminar.enabled=.t.
11
Material de Apoyo para 3er. Departamental PSGBD
select B
append blank
replace clave with thisform.clavec.value
replace nombre with thisform.nombrec.value
replace direccion with thisform.direccionc.value
replace edad with thisform.edadc.value
replace telefono with thisform.telefonoc.value
replace ingresos with thisform.ingresosc.value
replace fecha with thisform.fechac.value
=messagebox("EL REGISTRO HA SIDO GUARDADO")
thisform.nuevo.enabled=.t.
thisform.guardar.enabled=.f.
thisform.modificar.enabled=.t.
thisform.nombrec.enabled=.t.
thisform.direccionc.enabled=.t.
thisform.edadc.enabled=.t.
thisform.telefonoc.enabled=.t.
thisform.ingresosc.enabled=.t.
thisform.fechac.enabled=.t.
thisform.nuevo.enabled=.t.
thisform.clavec.enabled=.f.
thisform.nombrec.setfocus
12
Material de Apoyo para 3er. Departamental PSGBD
select B
replace clave with thisform.clavec.value
replace nombre with thisform.nombrec.value
replace direccion with thisform.direccionc.value
replace edad with thisform.edadc.value
replace telefono with thisform.telefonoc.value
replace ingresos with thisform.ingresosc.value
replace fecha with thisform.fechac.value
thisform.nombrec.enabled=.f.
thisform.direccionc.enabled=.f.
thisform.edadc.enabled=.f.
thisform.telefonoc.enabled=.f.
thisform.ingresosc.enabled=.f.
thisform.fechac.enabled=.f.
RELEASE THISFORM
Select B
13
Material de Apoyo para 3er. Departamental PSGBD
if .not. bof()
skip -1
thisform.clavec.value=clave
thisform.nombrec.value=nombre
thisform.direccionc.value=direccion
thisform.edadc.value=edad
thisform.telefonoc.value=telefono
thisform.ingresosc.value=ingresos
thisform.fechac.value=fecha
thisform.siguiente.enabled=.t.
else
=messagebox("YA ESTAS EN EL PRIMER REGISTRO")
thisform.anterior.enabled=.f.
endif
SELECT B
GO TOP
thisform.clavec.value=clave
thisform.nombrec.value=nombre
thisform.direccionc.value=direccion
thisform.edadc.value=edad
thisform.telefonoc.value=telefono
thisform.ingresosc.value=ingresos
thisform.fechac.value=fecha
*Deshabilitar Botones
thisform.anterior.enabled=.f.
thisform.siguiente.enabled=.t.
Select B
if .not. eof()
skip
thisform.clavec.value=clave
thisform.nombrec.value=nombre
thisform.direccionc.value=direccion
thisform.edadc.value=edad
thisform.telefonoc.value=telefono
thisform.ingresosc.value=ingresos
thisform.fechac.value=fecha
thisform.anterior.enabled=.t.
else
=messagebox("YA ESTAS EN EL ULTIMO REGISTRO")
thisform.siguiente.enabled=.f.
endif
14
Material de Apoyo para 3er. Departamental PSGBD
SELECT B
GO BOTTOM
thisform.clavec.value=clave
thisform.nombrec.value=nombre
thisform.direccionc.value=direccion
thisform.edadc.value=edad
thisform.telefonoc.value=telefono
thisform.ingresosc.value=ingresos
thisform.fechac.value=fecha
*Deshabilitar Botones
thisform.siguiente.enabled=.f.
thisform.anterior.enabled=.t.
RELEASE THISFORM
DO FORM MENU_REPORTES
15
Material de Apoyo para 3er. Departamental PSGBD
report form reporte_clientes preview
RELEASE THISFORM
• Tag.- Se utiliza en la clave de acceso para establecer en ella la clave o contraseña de acceso
que tendrá el sistema.
• ReadOnly.-Se utiliza para tener acceso a algún control, pero que no se pueda modificar el
contenido de éste.
16