Você está na página 1de 4

*LABEL Lbl

*TEXTBOX Txt
*COMMANDBUTTON Cmd
*OPTIONBUTTON Opt
*IMAGE Img
-------------------------------------------

1-Aligment
2-FontBold
3-Forecolor
4-Fontsize
5-FontName
6-BackColor
7-BackStyle
8-PasswordChart
9-Caption
10-Namen
11-ControlSource
-----------------------------------------
NAME = CmdSalir
CAPTION = CANCELAR
-----------------------------------------
OBJETO: cmdSalir Procedimiento: Destroy
Thisform.cmdsalir.click

-----------------------------------------
OBJETO: Form1 Procedimiento: click
THISFORM.RELEASE
-------------------------------------------

------------------------------------------------------------
C: = DISCO LOCAL
D: = CD ROM / DVD
I: = PENDRIVE

PROMTP

Set Default To (mas el promtp de la memoria)

EJEMPLO:
SET DEFAULT TO I:
E:
D:
F:
H:

-------------------------------------------
CAMPOS DE LA TABLA PARTES.DBF
-------------------------------------------
codigo n 9 0 ?
descrip c 30
precio_u n 9 2
exist n 5 0
-------------------------------------------
CommandButton 1
--------------------------------------------
Name = CmdGuardar
Caption = Guardar
-------------------------------------------
CommandButton 2
--------------------------------------------
Name = CmdSalir
Caption = Salir
--------------------------------------------

--------------------------------------------
CODIGO DE LA APLICACION
--------------------------------------------
OBJETO: FORM1 PROCEDIMIENTO: LOAD
--------------------------------------------
Select Partes
Set order to Codigo
--------------------------------------------
--------------------------------------------
OBJETO: TXTCODIGO PROCEDIMIENTO: INIT
--------------------------------------------
Thisform.txtcodigo. Value = 0
Thisform.txtdescrip.value = Space(0)
Thisform.txtprecio_u.value = 0.00
Thisform.txtexist.value = 0
Thisform.cmdguardar.Enabled = .F.
Thisform.Refresh
-------------------------------------------------------------
OBJETO: TXTDESCRIP PROCEDIMIENTO: GOTFOCUS
-------------------------------------------------------------
If Seek(Thisform.txtcodigo.Value)
MessageBox("El C�digo ya esta Registrado",48,"Error")
Thisform.txtcodigo.SetFocus
Else
Thisform.cmdguardar.Enabled = .T.

Endif
----------------------------------------------------------
OBJETO: CMDGUARDAR PROCEDIMIENTO: CLICK
----------------------------------------------------------
Do Case

Case Empty(Thisform.txtcodigo.value)
Messagebox("El codigo esta en blanco",48,"Error")
Thisform.txtcodigo.setfocus

Case Empty(Thisform.txtdescrip.value)
Messagebox("La descripcion esta en blanco",48,"Error")
Thisform.txtdescrip.setfocus

Case Empty(Thisform.txtprecio_u.value)
MessageBox("EL precio esta en blanco",48, "Error")
Thisform.txtprecio_u.setfocus

Case Empty(Thisform.txtexist.value)
Messagebox("La existencia esta en blanco",48,"Error")
Thisform.txtexist.setfocus

OTHERWISE
Append Blank

Replace codigo with Thisform.txtcodigo.value,;


descrip with thisform.txtdescrip.value,;
precio_u with thisform.txtprecio_u.value,;
exist with thisform.txtexist.value

Thisform.txtcodigo.Init
Thisform.txtcodigo.Setfocus

EndCase

----------------------------------------------------------
OBJETO: CMDSALIR PROCEDIMIENTO: CLICK
----------------------------------------------------------
Close Tables
Thisform.Release
----------------------------------------------------------
OBJETO: FORM1 PROCEDIMIENTO: DESTROY
----------------------------------------------------------
Thisform.cmdsalir.click

Você também pode gostar