Download - Clases en Visual Foxpro 9-Libre
![Page 1: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/1.jpg)
����
��������
����
������� ���������
�������������� ��������
������
������������ ���������������
![Page 2: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/2.jpg)
���������������������
���
������Introducción ................................................ 3
Como se llegó a las clases .................................. 4
Beneficios al usar clases ................................... 6
Características de las cosas que existen .................... 7
Propiedades, métodos y eventos .............................. 9
Clases y objetos ............................................ 10
Clasificación de las clases ................................. 11
Ejemplo Nº 1 ................................................ 12
Ejemplo Nº 2 ................................................ 15
Simplificando la escritura .................................. 17
Clases base ................................................. 19
Como crear subclases ........................................ 23
Bibliotecas de clases ....................................... 24
Ejemplo Nº 4 ................................................ 25
Protegiendo y ocultando miembros de las clases .............. 32
Modelando objetos ........................................... 37
Creando formularios por programa ............................ 38
Comandos, funciones y métodos usados en la P.O.O. ........... 40
Como acceder a una propiedad de la clase padre .............. 43
Como ejecutar un método de la clase padre ................... 45
Una clase label desplazante ................................. 48
Una clase label titilante ................................... 52
Una clase label sombreada ................................... 53
Una clase label para títulos ................................ 55
Una clase de botones ........................................ 59
Una clase para mostrar fotografías .......................... 60
Varias clases para ingresar datos ........................... 66
Agregar un formulario a otro formulario ..................... 69
Métodos ACCESS y ASSIGN ..................................... 71
El objeto _SCREEN ........................................... 74
Manejo de errores en la P.O.O ............................... 76
Automatización de Word ...................................... 78
Automatización de Excel ..................................... 81
Una clase grilla mejorada ................................... 83
Creando un constructor ...................................... 85
La función BINDEVENT() ...................................... 88
¿Se puede convertir a VFP en un lenguaje fuertemente tipeado? 89
Trucos y consejos ........................................... 92
Conclusión .................................................. 95
![Page 3: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/3.jpg)
���������������������
���
����������������� ������
���������� ��� ����������!�"��#��$���$�����������������%�����$��������&���%�� �'�$��%�� #�� ��$������ ()�"����* �� �� ��� �����+��� ��+,� #�� �� �� ���������������������� ��+,�#�� �� ���#������� ���)-������#�������.��/����0�����������$������$��������$�����������+����������0������� ��#������/��������������� 1������� � �����$��������0�������$�������$#����������#������,���������-��������"#����2#������������������������ ����#���������#�����+������������������������$,��,#������������#���/��� 3�/����$������+���������������#�� ��$�����0�����#������$���0��,������ �����������$����� 4��$��%�� ���$#����$��%��#�� ��$�� ��� ��� ���#����0�� ���� �� )������ �� ���$#�&�� � ���� ����$����� .� �$#������� �� � $����� �� ��� 0����������������������#, ������$/�5����0��������������������$#�������#��� �����������$���� ������ ��%�������$���%����� .��������������#�� ��$����6���������)��$��������378 �����������,�����$��$����#���������������������������$����� ��� ����������$�������,/�������������!�"��9������������$#�����%�������� �0���)�����������0��������� ��� �����$��%��� �� ��������� ��$/�5��#����/���0�������������������3���������0������9����/�����,������:����������$�����#���� ���$�������� ���������,�
![Page 4: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/4.jpg)
���������������������
�;�
��������������������������� <�� #�� ���� $�� ��$'� ��= (>#�� �5 �� ��/��-� �#������ � ���� ������ ����������&�������%�������$�%����$��/�����������?* ������#����������#�� ����%���$����#�����4�������� .� ���#��$���� ��� �������#�� ��$����� @7�/���!�������A����� ����B �� ��������/����$,����� �������%�/-�#����������0���������.�������� ������������� ���-� �������� ���� � �� �� �� ��������/� �� �� �� ������ �-��� ��� #�� ��$� �����/��������������6�C�@���B�.���������)�������#�� ��$���/-��/���/������$����� ��������� �$#���/�� �� ������ �������� ���-�$���)������ � �������� �)��������$����$#������#�� ����������/�����/������%��-�� �����),���$������#����������� �$#����� �������� ����� ���0����/�������#'/������ ��� �� ��������� 0���/��� �� ����� #����� � �� �� #�� ��$� ����� )��������$���� �����-� �� ��#�� ��$����#����/� �����0����/�����-���������0����#����������������-������� ���� )��$� �� #�� ��$�� ��������$���� �� �� ����$��� (#�� ��$����� �#� %����*#�� ���������������/-�����#�#����)�������#�� ��$�����$����#����-���#��������$�����������������#� %�������������$#��$-������� �)�������0�����%������#�#������ ������/��- ��)���,#�+�� ���-��� ������������������� �����/�������������D� �����/���-�������#� %����� .� ��� #��/��$� ��� �� #�� ��$����� �#� %���� ��� �� �� ��$��-��$��%�������������$����)-�������� ������A��������������/�������������� ������$�/�$��%����$#������#��������/��� ����(����� ����*���&����������0���������� .�#����� ����#��������$��0������������$��$���)�$���6�C����- )�� ��0������ �� �� �� ���$� (#�� ��$����� ������������*� .� ���� $������� -�#�����$/����������������������������������������������������������������#�=
1��4ED.FF.G11�
�..�C F F <GCED ���$������� D�(#�� ��$�����������������*)���� ����0�����D������������������ ������$��-����#�� ��$�����$���)����#�� ��$�����$�����$��%-��$����$�������#�� �� ����� �� ��������� ���#�� ��$�� ����$���������� ���$#�#��� )�����+������#���������H��$����$#������������ ���$��%������� ������������
![Page 5: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/5.jpg)
���������������������
�I�
��� �� 4������� �� ���$��� �%-� >�� �5? #�� �� ��� �� �� (#�� ��$�����������������* ��� $��%� $���� �� �� (#�� ��$����� �#� %����* �'� ���-� �� ���#��/��$�= �� ��� ),��� ���$#��+�� �� ���� � )����� #�� ���� � �� �� ����� �� ���#�������� ���������� � ���� .������� �� #���� �� ��$� ����� ��� �� � ��$���� ��%���J��� �� �����#��/��$���3����#��+���%���J��� �����#��/��$�����$������#�� ���$#�� > �5 �� #���� %����? K������� � ����������� #�� ����� >G� )������� ���������?D�����������#�������>G�)������������������?D�����������#������� 3��� �����������/�������� � �������+���������$����������=>���������$��%-��$�$,�),����$��%-��$�$,��,#������������������ ������#�������� ��0��0��������/����?���$,��������� ��"�����#���������$��/�����������������$��/���#��/������������������$��%�$,������$� ���'� .�#�� ��$�����$��%��0���������� �����������������/�������� �)�����$����$������� ��� ������%�/-������������������������K��+,��'$��$�� ��+,�����#�� ��$���������-��������������� ��3���0���0��������/�������������$�=(����0������������*�H#������#�������0�����/��-������0�����$��%��������� D� #�� ��$����� �� �����+� ������ �� ���$� (��������� � ��� �/�����* � �� ���/��0�� ��$� �� �� ���������� � ��$� �� @�/���� �������� �� ��$$�� B ���� �5�� ��������������$��=
�� �� ��$������#� %������ �� ��$������������������� �� ��$�������������������/�����
.�����@�� ��$�������������������/�����B���0����/���������������
��� )�������� �� ���� � ���� 0����/��� �� ���������� ������� @�� ��� ����� �����=(����#�������*B �� �� ���� �� ��� .�� )������� � �� �� ���0�� )�������������� ���������������� �����������#�� ��$������
�������
��#��������������/����
L5�����@!���������������$������B�������/����
1�� ��$�GM�
![Page 6: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/6.jpg)
���������������������
�N�
���������������������� 7����� �� ���� ������ �� #����� ����������� �#���������� ���$���� ������� ����$�������$,��,#���$���� ��������������������+��H� ���/������$��=
�� ������� �� !" � # �$%&' ( .�� �� ��)��� �� �����/�� �� ���� � )����� ��� ����0�+���� ���#�����������$��%���#��������������������
�� �������)*$��*+�'�� �)%!" ! #(.�������������� ��������������$,������������ �!+%,$�'%+��!(D� ��%�������#������������ �#����������������������
���#��������#��� ����%��������)��������������������������#������������0��� ���� ����� ��0�������#������������� ��������������� ��0���
�� �&$"#%++��!( K�� #��$��� ������������ �� �� �� ����$���� �� ��������� ���#�����#����#���������������/�����0���
�� �# %+��!�� �$�&+'%$ $(<����/�������������������0��������������� ��#����������������@�����$������ ����B�������������-��������������������$,��� ������������-������������������
�� �*$� �*+�'� %,# !��-%. � � � �"#�$� ' !��%. $� � � ,#��#%)%+��!(L��%�� �� ������0�� ��� ����� �� #�� ��$����� �����+�� ������� 3� �#�����$�� � �����+��������������!�"�����������#�����������0���� ���������������,$,�),����
![Page 7: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/7.jpg)
���������������������
�O�
����������������������������/��� �����
C��� �� �� �"���� �� �� <��0���� ����� �� ���� ��������-������ �� ������ �������)����������)��������������������������"��������������$#���#���������������������$����#��������$�&�����0�������������/����������$���������� �����,������������������ C�$�$��#�����$#�����$���=
�� ���������$�&� ����#����$������$������� ������������������$/������������������ ����� ��� )��$�� �� #���� ��� ������ ����� ��������� �0������
�������������� ���, %��%� �� �� $������� @� $,� �� ���B= $������ %������ #������
��$�����#�,������������ �������#��� ����#����$������P��� ��$���� �������#������� ����
C������������� �������� ���������$��������$��,#�,� �%� $�
���$,���� ���������������"����������$/�5�#����������+��������������� �� #����� %���� �� �� C�$�$�� �%��� ��$� ���$#�� �� ����$�0��� ����� �������#��#���������$�=
�� ��$�&��� ������� )��$��� $��������� #����� �������������$������ ��#�����$/����/�� �������+��� ��$/�����)�/��������� �&���)�/���������� #������� ����
������$,��������$�0��#���������+������������������$�=
�� ���������� ������������� ����������� ��������+ �������� ������������%��� �����������)������ �#� �����)������ ����
C����� ��#����%����������$�0��������)0"���$�
![Page 8: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/8.jpg)
���������������������
�Q�
<���/ ��#������������)0"���$������ 1 !"�$(>K�5���� 1 !"�?.���)0"��� �������������� ����#���������������
.� �� ���$#�� ��� ����$�0�� �� 1 !"� �� �� �� �������� �� �� ������� ���
��������������������#������������������� �������������� ������$,����$������� ��������$�0����$������������������������-������
.����������)0"����+�)2!���� ��%���������$�0��#�� ���������������
#���� ��%��������� 1 !"����� ��%���������$�0��#���-����������������������������@����������������$��=���#���������0����B�
.�����$�0����$��0�$,��,#���#�� ��������������#�������������������
$��0�$,������$����#�� ���������#�����������������#�� ���#������)�����.������)0"���$�+�)�! $�.���������� �� ���,����������� ����$�0�� �� ��5�����/�%����� �������������������������������������#�����5��������,���������������$�0�� �������� ���������������� �������.����%���������$�0��#���-��������������$#���������������@����������� �������������#�������������������������������������B�.������ 1 !"�� ��������/��$����� ������$�����������$�����$�������)0"������� ���������������)0"���$�+�)�! $�
![Page 9: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/9.jpg)
���������������������
�9�
����������3��4������5��������� <��,#�,� �%��������������-����� ��#�������/����@������������$�&����#��������B <�)0"�������������� �������+����/�����
�� 3�����#���� �����������@��/���/��������������)������ ���������B������������)0"����+�)2!���$#��$����)0"���(
�� 3� �� �� �� #���� �� �� ������� #��� � ���$���� �� �����+� #�� �����������%��%� ���������������������������� 1 !"�(
� C��������/�����������,#�,� �%� $#�������$������ ����������)0"���$��� 1 !"�$�
<��$���� ��� ������ ��� ����� ��� ������ ��� %��� �� #�#��� ��� /������� ��+�#���� ������ ,#�,� �%� $� <�� 0���� ��� $����� �� ����$�0��� �� ����0����� �����$#�����������#���������$/�5�������)0"���$� .�����������#�� ��$�����$#���������� 1 !"��� �����������#�������������������������������0������ ��#���������/�����+ ���������$�����������H%��$��%�� 1 !"�$$,����$���0��,$,���������� >7�$� ������ ��� �� �� ��)0"���� +�)2! � �� �� �� 1 !"�? 3� �� �������#�� �� �� #�� ��$���� �� #���� �� �� ������� �������� �� ��)0"���� +�)2!� 3� ������������ ����#�� ��$������%���#������������������ 1 !"�� �������$�� ���������� 1 !"�$���)0"���$#�������������)0"���$��� 1 !"�$� H �� �� ����� ��� 1 !"�$ ��� )0"���$� �� )��$� �� #�� ��$����� ���"����$������$��$����'���� ��0��-�������������������,�� <�� ,#�,� �%� �� � ��0������ � ��� 0����/��� #��� ����$���� #���� ���������������������������.���������/��������)����������� <�)0"������ ��0���������,#�+ ��)� !"��������!+��!�#�������$����#�������������������������������.���������/��������)����������� D��#�� ��$������#������������������)0"���$ ��������#�����#���������� ���0�� 1 !"�$� H �� �������� �� �� ��������� ����� ���0��� �� �� �� ������!�"��������������� ��#���������������
![Page 10: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/10.jpg)
���������������������
����
�������5����������6/�0� $��!%�+'%$ 7��� .� ��� #������ �� ���� � )����� �� �� �����+� ��$� �� $����� ��� ���� ������0��,��&. "�$ �������,���������������������������-����������+'%$ ���� D�� #�� ��$������ ��)���$�� +'%$ $� ��� ������ ���,� ��$#������ #��,#�,� �%� $�#��)0"���$(��� .�� �� ��)��� �� �� ���������� ������ @�� ���� �� ����= ����#�������B ������������#������� ��$����������������� ��%��%�����#���)���� ����������������-������ �������,��� �����/������������$�=� ��!�#�'%+'%$ �6/�0� $��!��&. "�7 7���������)������+'%$ ����#���)��������������������-������@#��#��������$5�����B �� �����,� ����&. "�$�����+'%$ �#����'����"������ '��&. "� ��#����������������-���������� ���"�������&. "��������������������-�����������+'%$ ������/����������6/�0�$��!���+%#�����������!��&. "�7� 7�������&. "� ����� �����������������-�����������+'%$ �����������������������
![Page 11: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/11.jpg)
���������������������
����
������������������������� D��+'%$ $#����������)�������� '���=
�� C�#��� ����/�������� ��� ��
� �2!�$����,��
o� 7����������o� 7������
<��+'%$ �� ����������� ������#���� ����� ��&. "�$ �������+'%$ $ ������
����� .��$#��� �� +'%$ $ ������������ ��� ��� )��$�������� ��� ������������� ���$�������#, ������� ������� <��+'%$ �������������������#�����������������+'%$ �����������������������+'%$ $�������������������$5��������/����@B�G�#������ �� �������/������ �2!�$��1�$�&�'��%�
o� ����/��o� G�0���/��
D��+'%$ $0���/��� @���$#���= )��$�������� ��� ������ ������� �$, ����B#�����
0���� �� ��$������ �� �� ��$#�������� D�� �� 0���/��� @���$#���= ��$��� �����$B ��#�����0�������%��)��$���0������� �2!�$���#�� !
o� A����������+'%$ ����������������o� A����������+'%$ ����������
![Page 12: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/12.jpg)
���������������������
����
���������8�9� .� ���� ���$#�� ��)�����$�� ��� +'%$ ���$��� .�3�G� @#�� �������� ��� �/������������$/��������+'%$ $�������/������� ������������#�����B.�.LD�����6Local loNovia1, loNovia2
CLEAR
loNovia1 = CreateObject("PERSONA")
loNovia1.cNombre = "Marcela"
loNovia1.dFechaNacimiento = CtoD("07/10/1980")
loNovia2 = CreateObject("PERSONA")
loNovia2.cNombre = "Silvia"
loNovia2.dFechaNacimiento = CtoD("28/09/1988")
loNovia1.MostrarDatos()
loNovia2.MostrarDatos()
Release loNovia1, loNovia2
Return
*
*
DEFINE CLASS PERSONA AS CUSTOM
cNombre = Space(20)
cApellido = Space(20)
dFechaNacimiento = {}
PROCEDURE MostrarDatos
? This.cNombre, This.dFechaNacimiento
RETURN
ENDDEFINE
*
*
�:,'�+%+��!� ��$���� �� ���������� ��� 0����/��� ������� ���$���� ��G�0��� � ��G�0������#����0�$�����D������(�*��������� ��)��� �������0����/��������D������(�* ������ ���� ��)��� �������/�����G���������������$����-����0����/������$/�5������#���-�%�/�����$���G�0����G�0����%�/����)���������#��)����$�����#�����������0������ ���������+�#���%����$,��������/�������� �)������ D�� ����������&. "�/���������+'%$ .�3�G� �����,��)�������)������� #�� ��$��� ��� �� �� ���$� ��������� ��� � ����� .� �$#������� �������� �� �����)�����������+'%$ $���$#����/�������/������)�������#�� ��$��>�� �5?#�� �������� � ���������/����#�5��������)��������������+'%$ $��������,����������
![Page 13: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/13.jpg)
���������������������
����
1��#�5��������� ���0����������,#�,� �%� $�G�$/����!��%�G���$�����������)����������,#�,� �%����$#��%�� ��������������������$/������&. "�������#��������>#�� �5���?�� ��#����%�/��$��%���&. "�$�+'%$ $���������� ����� ��,#�,� �%� $���$����� ������������!�"������������/���������������������$����)�������������$���0�����$#��%�� �������/���������)��$�= �&. "�(,#�,� �%�
������������������������&. "�/���������+'%$ .�3�G��.���� ��)��� ����������&. "���#���������������������,#�,� �%� $����������)0"���$ ��#������+'%$ .�3�G�� D�� �������� ���0����������,#�,� �%� $����&. "�����5�������� 3� ����$���� �� ������� ��)0"��� ��� �&. "�� .��)0"��� �� �� %��� ��$����������#�����������������������,#�,� �%� $����&. "�(��� ��� ��������,#�,� �%� $������� ����$����)����������)0"�����/�$��%�����������/�����= �&. "�()0"���;<� G�C�= D�� #��5������ ��� �#��������� #��� �� $���� �����/����� #��� �� ������ ����$,��� �/��� ���������0�$��������� ���������/��= loNovia1.MostrarDatos()
��#���%�/���������= ? loNovia1.cNombre, loNovia1.dFechaNacimiento
3�� �$/�� �� �� ��� ���������� �� #��$��� )��$� ��$��%�$,� #��)���/��>#�� �5? #�� �� ���� �� �� #���� �����+���� ������ �� �� �&. "� ��/� �����+����������������&. "�� 1��#�5� �� ��/���� ��� �&. "�$ �� �� $�$���� ��� �� ����������� �.D.�3.�7���0�+ �� �� �������&. "� 5������#��� ������ ��#���� �� ��$�$�����3� �� �����$����������������/��������#�����������������,���#����������$�$�����H��/���#�� ��$��������/��-����#����������� L,� �/��� �� ��)��� ���+'%$ ���$���.�3�G�����$�� �� ��)������� ���$,�������$������ 1.!EG.7D�33
��������������!�"�� �� ����$����)����@�����B������0�+'%$ � .�3�G�
������$/�� �������,�����0�+'%$ (�
![Page 14: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/14.jpg)
���������������������
��;�
�37<3C�L����� ��� +'%$ $ ��/�� ����� ��� +'%$ � &%$ � � ��� �� ��/�� �����/������������+'%$ �G���#������������+'%$ �������5/��������������#����0�������������-��-��/�#��0����������+'%$ �
�G�$/��
.����,#�,� �%�����#����,����� ���������������� ��#������
.����,#�,� �%�����#����,����� ���������������� �!��%�G���$�����
.����,#�,� �%�����#�)��%�
��7.1<�.L������1����.���#������$���������������+'%$ .�3�G������$����#����������$���#�����&. "������%�+'%$ �.���� ��)��� ��������#�� ��$�#�����#�������/�$��L������1����@B�/������$����$��������������3-��-��/�$�����$�������������&. "�����+'%$ .�3�G��L������1����@B �.�����������)��������,��G�0����L������1����@B �.����������)�������#��)����$����
?C%����G�$/���C%����!��%�G���$�����
7����� ����$�� ������ �� ��� +'%$ � ����$�� ��)������� � ���,#�,� �%� �� ��� $��$� +'%$ ��/�$�� ��������� �� ��$/�� ��� ��#���/��C4E3@����B�3�����%���$����/������$����$��������������?�G�$/�� �.�����������)��������,?C%����G�$/�� �.����������)�������#��)����$����
�.C<�G
!�����+� �� #������$����� ���$��� L������1����� C�$/�5� #���������/����.G1��7 �� �� #��)����� �� ����������� �� �� ���� ����� �������)�������� ����
.G11.!EG.
!�����+�����)�����������+'%$ .�3�G��
![Page 15: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/15.jpg)
���������������������
��I�
���������8�=� A��,����������+'%$ .�3�G�����$��������0�+'%$ ���$���3�7E�������������,�����������������������7��/�.�.LD�����6Local loNuevoSocio
CLEAR
loNuevoSocio = CreateObject("SOCIO")
loNuevoSocio.cNombre = "Juan"
loNuevoSocio.cApellido = "Pérez"
loNuevoSocio.dFechaNacimiento = CtoD("03/01/1980")
loNuevoSocio.dFechaIngreso = Date()
loNuevoSocio.MostrarDatos()
loNuevoSocio.MostrarDatos2()
Release loNuevoSocio
Return
*
*
DEFINE CLASS PERSONA AS CUSTOM
cNombre = Space(20)
cApellido = Space(20)
dFechaNacimiento = {}
PROCEDURE MostrarDatos
? This.cNombre, This.dFechaNacimiento
RETURN
ENDDEFINE
*
*
DEFINE CLASS SOCIO AS PERSONA
dFechaIngreso = {}
PROCEDURE MostrarDatos2
? This.cNombre, This.cApellido, This.dFechaIngreso
RETURN
ENDDEFINE
*
*
3�$���$������)�����������+'%$ 3�7E�0���$�� ��=
��� .��, /����� �� �� +'%$ .�3�G� �� %�/-�$�� ��)����� ��������$�����.�� �� ��)��� �� #���� ����� ���,#�,� �%� $ � ����� ���)0"���$ �� ��+'%$ .�3�G��.������$����� -������������� ����������
��� 3���� �� �������0�,#�,� �%�@���$���=�!��%�E� ����B��� 3���� �� ������0�)0"���@���$���L������1�����@BB�;�� D�� ,#�,� �%� $ �G�$/�� � ��#������ �� )����� ��)������ �� �� +'%$
3�7E����� ��)�������)����������+'%$ .�3�G�������$�3�7E������������.�3�G���������%�%�����������,#�,� �%� $�
![Page 16: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/16.jpg)
���������������������
��N�
I�� .�)0"���L������1����@B��)����)���������+'%$ 3�7E��)����)���������+'%$ .�3�G��#�����$�3�7E�������������������.�3�G���������%�%����������)0"���(
D� ������������ ��)����� �����&. "��������#���������+'%$ 3�7E�
����� ������ � ����� ��� ,#�,� �%� $ � � ����� ���)0"���$ �� �� ����� 3�7E� ���$/�5� ����� ������ � ����� ��� ,#�,� �%� $ � � ����� ��� )0"���$ �� �� �����.�3�G��E�����������>0�����? .� ���� @�� ��$�������������� � ����/�����B �� �������� �� ����� ������/���������������������0����/������ ��������$,�)������������������������������0�� ��/������ �� ������$,� )������������ � ��- ������0�$����� 3� 0� )��$�������������������,�/�����$���0������� ��������� ��$�=
Clase 1
Clase 1.1 Clase 1.2 Clase 1.3
Clase 1.1.1 Clase 1.1.2 Clase 1.2.1 Clase 1.3.1 Clase 1.3.2
Clase 1.1.1.1 Clase 1.1.2.1 Clase 1.3.1.1
1�� ��$�GM�
.�������� ��$�#���$��0�� ���������������� ��������)��������������@,#�,� �%� $� �)0"���$B �� �� ����� ��#������ ��- #�� ���$#��� �� ����� ������� %�%������� �� )�������������� ������������ ������%�%������� �� )�������������� �����������������%�%���������)����������������������� 6������ � �������� �� #���� �����/��$��%�$���� ���� � )����� � %������$,�),���$����$������/���3�%������������������������������#��#� �� ����������/�������#���������� �������$/�5�������� �������������/��������
![Page 17: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/17.jpg)
���������������������
��O�
���������������������� 7��������/���$�����+'%$ $$��%��0��������$�� �������/����#�����$���������$/���������&. "�$�.�������!�"��������������������� ������������������ ����� � �� )������� � ��$#��)���$��%� �� ������������ ���� � )������ %���5�����$,��� �/���.����������������EC4F.G1�EC4� 3����$���EC4F.G1�EC4���������=
��� .����/�$��$������� �%����$�����$#��������/����� 4���$������������� �)�����$,��� �/��;�� G������#�� ��$����������$,��,#���
>7�,�����/�$�������EC4F.G1�EC4?7�����%������$,��-������
���� ��� ����� ������)�������$��$��/��������$����$�)�������=��#�� ��$�.�.LD�����6����5�������#�� ��$�
.�.LD�����6�%�����"����$���� ��$��$��D�'������)������� �� ���%��� ��������������������EC4F.G1�EC4�.�.LD�����6Local loNuevoSocio
CLEAR
loNuevoSocio = CreateObject("SOCIO")
with loNuevoSocio
.cNombre = "Juan"
.cApellido = "Pérez"
.dFechaNacimiento = CtoD("03/01/1980")
.dFechaIngreso = Date()
.MostrarDatos()
.MostrarDatos2()
endwith
Release loNuevoSocio
Return
*
*
DEFINE CLASS PERSONA AS CUSTOM
cNombre = Space(20)
cApellido = Space(20)
dFechaNacimiento = {}
PROCEDURE MostrarDatos
? This.cNombre, This.dFechaNacimiento
RETURN
ENDDEFINE
*
*
![Page 18: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/18.jpg)
���������������������
��Q�
DEFINE CLASS SOCIO AS PERSONA
dFechaIngreso = {}
PROCEDURE MostrarDatos2
? This.cNombre, This.cApellido, This.dFechaIngreso
RETURN
ENDDEFINE
3� $���$�� ��� ���� �� )����� �� .�.LD�����6 � �� .�.LD�����60���$�� ��������'���$���%���������$��������������� �������/��$�����������������%� ��������$#�� .�$,�),�����������.�.LD�����6���������������$/��$���K��+,���#�����#����������#����������-�������,� 3� ���$�� �� ������������ �EC4 F .G1�EC4 �������� �� ������ !�"���0��'����&. "��������0�+�3��� �����$����������� ���0��'������� �-����.�����0������$#� ����� ����$-��$����$#������ �� >7���������?3��$#����/��-�$�������EC4F.G1�EC4����������$,��-���������� ������5���)���������$��$��&. "��
�#�����������$�$������������������$#�������������$�������������,�
![Page 19: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/19.jpg)
���������������������
��9�
������������ .���������!�"������������������/������0������������������#���$��������������� ���#�����������������/��/�� ������$��������0����������������D��������������������0������$���+'%$ �&%$ � H ��$� �� %�/-�$�� 0����� ����+'%$ �� �������� ����$������� ����� ���)������������������+'%$ �&%$ � D��+'%$ $�&%$ ���������!�"���������� �������=7%��PA�"
��$�����$/�������������������=����������!�����G����7���������
� ��#� -��$�������������� ������$�����&. "�$� ��#�������������� ������#��
7���$�
7��� ��� ����$�� �� ��� ����� @ ��� �� �� �5�B� ���� �������� ����� �� ����$#����0���������������
7�$/�A�"
E������$���� $������ �� ���� -��$� #��� ������ �� �� ���������� $������ ������������������-��$� ��#����������������������
7�$$���A�����
.����������������7�$$���6���# 7����� ��#�@����=� ��#�B�0�����/����������$�����7��������
7��� �� �&. "� �� #���� �������� � ����� �&. "�$� 3� #���� ������� � ����&. "�$��������������������$#�������&���$������$#�������������
7������
7������&. "� ��#�������������������&. "�$�.���$������7��������#������ �&. "�$ ���������� ��� ��������/��� ����� �� ���$#� �� ����&� ��$� �����$#�������������
7�����
3� ���� ������ ��� ��/�� � ��� 0���� �� � �� ��� �� ������� �� ����� �� ��)��$�������������������)��$�������������)��$��
7��������#���
��$���$������$��%����#����������"��������$���)��������������0����������!�"���E�������1A7��1��8LD�
![Page 20: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/20.jpg)
���������������������
����
7����$7������&. "���)�����#�����������@����#�����#�� ��$������B�
1���.�0����$���
3� ���� ����$,����$���� �� �� $�$���� �� ����� �� )��$������� �������� ��)��$������� � ��)��$�� !������� ��$� �� ���������� �� ��� ������ 7������7��������#�������������
.���A�"
7����� ��$#��� �������� �� ����#���� �������� ��"���� ��� ��� �����.����"����#�������������#����#� ���
.$#��
7�����������0��-� ������������,#�,� �%� $��)0"���$�� 1 !"�$�G���#���������0����������������� �� ����)0"���$�3���$/�� �������$#����������������#������ �� ��,#�,� �%� $�����)�����������#����@B�
."��#����
.� ������ ����$,����$���� ������ ������ �� ����� �� �� /�� �� C�H �� ���������������C�HF7�C74F!EG�DDH�.���$����C4�����$/�5��������/��������#����������
!��$
7�����)��$����������������#������ �� ������������!��$3��
7���������������)��$��������6���
7������ ������.����&. "� ��#����$�������������)�����������$����.���$/�5������������� �����������&. "�$����#��������
4�����
7��������/�����#����������$������� ����������$����������"�������$� ������#������#�������������$�����$/�5�#�������#�������0������
4�#�����P
��$�����0� ����E�������."#������E$� �
L���������%�0�� �,)�����D�/��
L��������"�� �������������#������$/����������$�����D��� L����������-���%���+������0���������/�-����D���A�" L������������������������-��$� ��#����������������������
![Page 21: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/21.jpg)
���������������������
����
�D.A������$���$����������������������&. "��D.@��$����#�������."����������$��������B������$#� �������������/���
�D.7��������
��$���� �� ���&. "�$�D.����#���������E�������������������0�8@���"B�#��������."��������$����������
�#����A�����
7�����/�������#������#����6���#
7����� ��#���/���������#���������� ����������������������$,��� �������$�����������������
� �
7������#, �������$������#, ������ �!��$�
7�����$������#, ������������������0�����#, �����������4��P
3� ���� ����$,����$���� ���� 0�+ �� �� #������� �� �/������ #��$�������������#��#�� ��$����� 1 !"�$���#��������
��������
3���������$,����$����������������/��������������������������������������#�����)��$�����������������)��$����������)��$��
��#���D�������
.�����$�����.��C!��L�D�A.D!��L������� ���� ��������������0��������������@#���������$#�����������B������#���#�������&. "�������#��$��������$�������������0����������$���������)��$��
3�#������
� �� ���#���������������������������/������%����$�������3�������/����
7��� �� �/���� ��� ������� @� ���= #�� ��$����B �� #���� � ��$������� ��#��#����������������
3%�#�
L������������,� ������������������-���������0����3#�����
��$��� �� �� ������� ����� �� �'$��� �� ����� 0����� 0������ ��$5��������������0���
![Page 22: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/22.jpg)
���������������������
����
C�"�A�"3��0�#���� �� ���/�������$���)��������"�������0����/����$�$��������� ���$���� �� �� 0����� �$����+� � �� �� ��$#��3� #���� ������� ��#��� �#� ����"���
C�$��
.������������ ���������� ���$�$����#�������$������.���0���/��#�������������#��������������0���/�������$#�������&��
C���A��
.� �� ���������� �� �#����� ���$#�� �� �� #���� ��#����� �� �� �#��������� � �� #���� �������� ���� ���� ��#� �� �������� #�� ���$#��= D�/��� C�"�A�"�7�$$���A������7�$/�A�"�E$� ������
8LD���#���
3����$#������8LD��#������������/������$/�5���������/�����#�����������/�����8LD�
8LD!����
.����/����8LDC�/�������������!��������������/�����8LD!�����H������$#�8LD!������#�������������������������$#� ������ ��)�����0�#�����������!�"���
8LDC�/��
D� ���������C�/��� �� �� �/����8LD���#��� �������� �/�����8LDC�/�� �������/�8LD��$�����������������!�"��������������)��$���������������������
7D�3.3K<.G�<.1.GC.G.�7D�3.31.�E��1�3 D���� �������+'%$ $��#��������������#��������$�&+'%$ $=
�� 7���$��� .$#���� 4�����
��E.1�1.3K<.C�1�3D�37D�3.3�3..G@�"��#��.$#��B
�� 7������ A���7������ 7����D�/������ �����7����
.�.GC�3K<.C�1�3D�37D�3.3�3..G@�"��#��.$#��B
�� E����� 1�������� .����
![Page 23: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/23.jpg)
���������������������
����
�������������������� 7�$� �� %�/-�$�� 0����� ��� $�&+'%$ #���� ������� ����� � �� ���� �� �����������-����������+'%$ ������������0����������������$�+'%$ �,%�# �D�+'%$ ��%���������+'%$ �>�.%� 7�������������$�&+'%$ $#��0�����/���)����������� ������@���������#��$��� �����/��$����B � �������� @�� ���� ��� �%���� ���$#�#�� �� ���������+'%$ �,%�# ���������+���$/�5�����$,����$�������������+����������+'%$ $�>�.%$B� .�������!�"��%�����)��$���������$�&+'%$ $=
��� ��#�� ��$�@�������%�0���6B��� <�������1���&������7�����
7�.�G1�7D�3.3����6��L� 3��������$���������������� .� �� �� %�$�� ����� �� ��� #�� ��$�� %���� �%��� @.�.LD�����6�.�.LD�����6�.�.LD�����6B7�.�G1�7D�3.3<3�G1�.D1E3.R�1��1.7D�3.3
� �-#���$��%�����������$������=��� 7��!���SG�JFS7����SG�J!���S��� 7��7�.�C.7D�33
.� ����� ��� ���$#��� �� ���� ����$���� ������$�� ���0�� +'%$ $ �����+����
1.!EG.7D�33������+����7�.�C.7D�33�
![Page 24: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/24.jpg)
���������������������
��;�
�������������������� 7����� ����$�� $��%�� +'%$ $� �� �� �� �� �������� ����� ��#�����������#����$���� #�� �%-� �� $��%� $,� ���0������� �������� � ��#���� �� �� �������%�0���������%�0��������$�&�&'��" +%�� �+'%$ $� .�������!�"����������/�/�������������������������"���������78 1����� �� ��� /�/������� �� ������ #���$�� ����� ��� � @�����$����B$��%��+'%$ $�D�$,��� ����� �����������+'%$ $���5�������������������-� �� ���$#��� �� ��� /�/������� �� ������ @� �� ���� #���-�$�� ���$���� ��$�A�C�G.3��78B #���$�� ����� ��� $������ #����)������ �� �������� /������ ����$�����.����������������������$�������0�/������$#��$����������0�$�������������+'%$ $#����)������� >H#�� �5��������$#��$������/���� ��0������������������!? �� �� �� /���� �� �������� %���$�� ���, ������������� ����� ����� ���)�����������������/�������,��������$,�������0��)�������������� ����%�$��� �� ���� 7�����#�� ��$�$����������!�"����$������������������#��#��������������0���������+'%$ $�&%$ �.�� ���������� ������ �������������������/����#��)���/����������������������������������/���.��� �����������������)��$��$����������������������������������)��$�H��-������0�$�����
![Page 25: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/25.jpg)
���������������������
��I�
���������8�?� .� ���� ���$#�� ������$�� �� )��$������ /���� � ��� �� )��$������ �������+���$����$�/���������������$,�)��$�����������������#��������� ����%�����%���$��0�����$���������� ��)��� ���������$���������������1.!EG.7D�33���� �������$��7�.�C.7D�33� �������/������0����������$��������������!�"��= CREATE CLASS FormBase OF Formularios AS Form
����$������ ������#�������=
�������GM�
>K�5)���� ��%���$��? 7���$�����+'%$ ���$���!��$A���������)������0���������+'%$ ����$���!��$�)�� ��/����������%�0����$���!��L<D��E�3��78� 7�$� !��L<D��E�3��78 �� �"���-�� ��$/�5� )�� ������� 3� �� %�/�����"����������������+'%$ !��$A�����%�/����� �� ����5�� .������#���/���=����$�����+'%$ ���$���!��$A����������)�� ��/����������%�0� ���$���!��L<D��E�3��78�����+'%$ !��$A����������������� @�%���B����+'%$ !��$� ����������������������!��$A���%����������������#��#����������������$5���������+'%$ �,%�# ���������+'%$ !��$�
![Page 26: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/26.jpg)
���������������������
��N�
�%��� �� ��$/����$�� �� ���� ,#�,� �%� $ � ������� )��$������ !��$A������$�0�$��������� �������#���������
�������GM�
�������GM�
![Page 27: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/27.jpg)
���������������������
��O�
�������GM;
6��/�$�� ������� )��$������ @#���������� 7C�D T�B � ��� !��� T 3�0� �%�����������P���������������P������� ����$�����0����������$���������!� �%����������$�������0�)��$�������#�������0�+�����,/�������!��$A������������/�$����������>7�$�%���$�����?.����/�����=
CREATE CLASS MENSAJES OF FORMULARIOS AS FORMBASE FROM FORMULARIOS
H��������!�"�����$������,���� ������#�������=
�������GMI
>K�5��%�$��#����� ��%������? K�� ������ ��� ���0� +'%$ � /����� �� !��$A���� �� ���� #��0���� ��!��L<D��E�3��78������0�+'%$ ��%�$�����������$/�5� ����$�� ����� ��/�����������!��L<D��E�3��78�
![Page 28: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/28.jpg)
���������������������
��Q�
�0���� ����$����������+'%$ ����0���������+'%$ �����������������������/�/����������������H��������0�+'%$ ������$��������� ����$�� ��/����������/�/���������������� �������+'%$ �,%�# �����, ��/��������/�/������������������+'%$ �>�.%�����, ��/���������/�/���������������� H�0���$���� �������$#���$,���������� .��������> �5����$��%����� �-?
7����!��$
7����!��$A���
7����L�������
1�� ��$�GM� D�+'%$ !��$A���������0���@�%���B����+'%$ !��$�.���� ��)��� ����������,#�,� �%� $���������)0"���$����+'%$ !��$���,�������#�����������0�+���+'%$ L�������������0���@�%���B����+'%$ !��$A����.���� ��)��� ����������,#�,� �%� $ � ����� ���)0"���$ �� !��$A��� ���,� � ���#������� �� L������� ���$/�5���������,#�,� �%� $���������)0"���$��!��$� 3�$���$�����0�����������,#�,� �%� $0���$�� ��L�������%������������������������������������0������������$��$��������5������� �%�������%���$���� ������$/������+'%$ L��������
��� D���� ��$����0����I;����#��#���������%��� D���� ��$����0����9����#��#�����4�� %���� D�� �� �$������������� ��������������,=
a.� BackStyle = 0 (transparente) b.� Left = 2 c.� Top = 25 d.� Width = 40
![Page 29: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/29.jpg)
���������������������
��9�
;�� D�� �� �$����/��������$�����������������,=a.� Caption = “OK” b.� Height = 27 c.� Left = 228 d.� Top = 60 e.� Width = 84
4���$����/������P��/����/��������$�����������/�$��=C%��!��$��������@B��$���0������� ������#�������=
�������GMN
D� ��������$������������������!�"����=(���������������%� �����P��/������/��������$���������/�����������)0"����������@B������)��$�������* >H �5%�����)0"����������@B?D�/�����)��$����������$�$�������%�����������������)��$������� �%��������)0"���EGEC���)��$�����������/�$��=
�������GMO
![Page 30: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/30.jpg)
���������������������
����
>K�5����$��%�������� �-? 1���5����� �� �� )��$������ ��/� ����/�� �� #��,$����� �� ���� ���$�$����L������@(�*�� ��)���=(#��,$����*��(�*�� ��)���=(����#����,����*B�.���)��$�����$/�������#��,$��������#�������#������0�������#���� �/������� � ������������ ��� ��$�� �� #��,$���� ����/��� � �� ,#�,� �%�������� ������������ ������������,��������������+'%$ �+�!" ! ��#%����0�����!��$� >7�$�����������������L������ �����/�$���������? ��$����%�� ���������������/�/���������������������������������������%���$�������/�����= 3.C7D�33DEAC�!��L<D��E�3 3� ����$���������$�����&. "�����+'%$ L������� �L�!��$L������U7������/����@(L.G3��.3*�(.�����$�#��$��$������*B H� �� %� ������ ���&. "� �L�!��$L������ @� ���� �� ���, ����������B #����'� �� �� 0�$��� >�� �5 ��? �� �� �� �� %�$�� ���%� �� ������ !�"�� �� ����$��0��������%�����������/�$��= �L�!��$L�������3%�J@B H��������VVV0���,WWW�#�������)��$���������$�#���$��0�������� ������#��������
�������GMQ
����$�������� ��%�$���������%����� �-)��=
SET CLASSLIB TO FORMULARIOS
oMiFormMensaje = CREATEOBJECT("MENSAJES", "Este es mi primer mensaje")
oMiFormMensaje.Show()
7���������������3.C7D�33DEAC�!��L<D��E�3������$������������������ !�"�� �� �/�� �� /�/������� �� ������ ���$��� !��L<D��E�3 #��� ��#���$�������������+'%$ $@�������#���/���=#��� ��#���$��������&. "�$�����+'%$ $ ��������������������������%�0�!��L<D��E�3��78B� .� �� �� ������ �-�������$������������&. "� ���$����L�!��$L������� ������ �� �� �� +'%$ L.G3��.3� ���$,�� �� ����$�� ��0����� �� #��,$����� ��������#��������"�� �������$��0������)��$�������
![Page 31: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/31.jpg)
���������������������
����
.� �� ������� �-��� �� ����$�� ��$������ �� )��$������ #�� �� ��� �� �� ���� �����-�����%�/-�$������������0-������0���/��� �%��������$�������&. "���$/�5�/���������+'%$ L.G3��.�
oMiOtroForm = CREATEOBJECT("MENSAJES", "Este es otro mensaje")
oMiOtroForm.Show()
�������GM9
� �-��)����������������/��3.C7D�33DEAC�!��L<D��E�3�>#�� �5�� )�� ���������? �� �� �� �� %�/-�$�� ������� ��� ������������ � �� /�/���������������/��/������ 3������$�����������/�/�����������������%���$�������/�����= 3.C7D�33DEAC� ������ '�#��,$�����
![Page 32: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/32.jpg)
���������������������
����
�����������5��������������������������������
D��$��$/����� ��� ������ ��� ���,#�,� �%� $ � ���)0"���$(H ������ ����0���/��������#���/���=
�� '/������ ���� ����� ������
����/������ #'/���� �� ��)��� �� �� ,#�,� �%� � �� )0"��� #����� ���
������������������ ����#�� ��$�������� ����/������ #���� ��� �� ��)��� �� �� ,#�,� �%� � �� )0"��� #����� ���������������������������������� ������������/������� ����/�������������� ��)��� ����,#�,� �%����)0"���#���������������������$�����������������.�.LD��I��6Local loNuevoEmpleado, loNuevoGerente
CLEAR
loNuevoEmpleado = CreateObject("EMPLEADO")
with loNuevoEmpleado
.cNombre = "Raquel"
.cApellido = "Martínez"
.dFechaNacimiento = CtoD("12/02/1975")
.dFechaIngreso = CtoD("15/09/1994")
.MostrarFechaIngreso()
.MostrarFechaEgreso()
.MostrarSueldo()
.dFechaEgreso = CtoD("15/09/2010") && Esto es un ERROR, no
funcionará porque dFechaEgreso es una propiedad PROTEGIDA
.nSueldo = 1234567 && Esto es un ERROR, no
funcionará porque nSueldo es una propiedad OCULTA
.PonerFechaEgreso(CtoD("15/10/2010")) && Esta es la forma
correcta de asignarle un valor a la propiedad dFechaEgreso
.PonerSueldo(1234567) && Esta es la forma
correcta de asignarle un valor a la propiedad nSueldo
?
.MostrarFechaIngreso()
.MostrarFechaEgreso()
.MostrarSueldo()
endwith
![Page 33: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/33.jpg)
���������������������
����
loNuevoGerente = CreateObject("GERENTE")
with loNuevoGerente
.cNombre = "Mercedes"
.cApellido = "Candia"
.dFechaIngreso = CtoD("21/03/2009")
.PonerSueldoGerente(5678901) && Esto es un ERROR
endwith
Release loNuevoEmpleado, loNuevoGerente
Return
*
*
DEFINE CLASS PERSONA AS CUSTOM
cNombre = Space(20)
cApellido = Space(20)
dFechaNacimiento = {}
PROCEDURE MostrarDatos
? This.cNombre, This.dFechaNacimiento
RETURN
ENDDEFINE
*
*
DEFINE CLASS EMPLEADO AS PERSONA
PROTECTED dFechaEgreso && dFechaEgreso es una propiedad
PROTEGIDA, por lo tanto es visible en esta clase y en todas sus
subclases.
HIDDEN nSueldo && nSueldo es una propiedad OCULTA, por
lo tanto solamente es visible en esta clase.
dFechaIngreso = {}
dFechaEgreso = {}
nSueldo = 0
cNombreJefe = ""
PROCEDURE MostrarFechaIngreso
with This
? .cApellido + ", " + .cNombre + " Ingresó el día: " +
DtoC(.dFechaIngreso)
endwith
ENDPROC
PROCEDURE MostrarFechaEgreso
with This
? .cApellido + ", " + .cNombre + " Egresó el día: " +
DtoC(.dFechaEgreso)
endwith
ENDPROC
PROCEDURE MostrarSueldo
with This
? .cApellido + ", " + .cNombre + " Sueldo = " +
Transform(.nSueldo, "999,999,999")
endwith
ENDPROC
![Page 34: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/34.jpg)
���������������������
��;�
PROCEDURE PonerFechaEgreso
LParameters tdFecha
This.dFechaEgreso = tdFecha
ENDPROC
PROCEDURE PonerSueldo
LParameters tnSueldo
This.nSueldo = tnSueldo
ENDPROC
ENDDEFINE
*
*
DEFINE CLASS GERENTE AS EMPLEADO
PROCEDURE MostrarNombreGerente
? This.cNombre
ENDPROC
PROCEDURE MostrarFechaEgresoGerente
? This.dFechaEgreso
ENDPROC
PROCEDURE MostrarSueldoGerente
? This.nSueldo && Esto es un ERROR
ENDPROC
PROCEDURE PonerSueldoGerente
LParameters tnSueldo
This.nSueldo = tnSueldo && Esto es un ERROR, nSueldo es una
propiedad OCULTA, por lo tanto no se puede acceder a ella desde esta
subclase
ENDPROC
ENDDEFINE
*
*
�������$������#�� ��$�������������0���������������������#��#�����#���$�������� ������/�%������� ��$��������$�����&. "����$�����G��0�.$#����������� ��$���� ����0����������#��#�������������������������������#�� ��$���� �������-���= .dFechaEgreso = CtoD("15/09/2010")
��������!�"�������������$����������$������=
�������GM��
![Page 35: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/35.jpg)
���������������������
��I�
>�� �5 �� �����?�� �� �!��%�. ���� �� ��� #��#����� �� ���, #���� �������������������.���� ��)��� ��#����������������������$��������������+'%$ �����������$�&+'%$ $� 4���$�� ����P �� �� /���� (E ����* �F�������� !�"�� 0���0� � �������������0�+������ �������-������$�0�$�������� ������#�������=
�������GM��
>H�%���#�� �5�������?�� ����#��#������3��������,����������������������.���� ��)��� ������$������#�����������������������#��#���������������� '�������������� �����#����������������������������/������ H���������>��$������ ��$����0��������#��#����� �����,#���� ���� �����,������?D�%���$��$���������#������$���������)���������$���0������� �������-���= .PonerFechaEgreso(CtoD("15/10/2010")) .����� �� )��$��.������$����#������$����� ���$���(����!��%�. ����@B*����������/���$�#��,$������)��%����� ����� ��� #���� � ��$/��� �� ������ �� �� �$#����� ���$�� �� #������$���������3�����@B�����������/���$�#��,$����������������$#�����������$�0�$�������� �������-���= �����3�����@���;INOB .���-���#����������!�"�����- ����#�� ��$�������'������������%���� ��F����0�+�������>��%���#�� �5?
���������
![Page 36: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/36.jpg)
���������������������
��N�
�%����������#�� ������+'%$ 6.�.GC.�����������$/�����0��������#��#������3�����������#��#������3�����#�����������+'%$ .LD.�1�����,���������������������$������0���/��#�����+'%$ .LD.�1��#��������$,��G� �� ����� ��0���/��#��� ��� $�&+'%$ $ �� ��+'%$ .LD.�1���� �� ������� ��0���/��#�����+'%$ 6.�.GC.� ����$�����=
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ ���� ���������� �������� �� ��������� ��� ��� ������ �������� ��� ������ �� �������� ��������� ���������� ������ ��� ������ ���� ��� ����� �� ������ ���� ��� ���� ���������� ��������������������������������������������������������������������������������������������������������������������������������������������������������������!�!"����#���$������%&����$������'&�(&����$�������)������������������������������������������������������������������������������������������������������������������������� ��������������������������������������������������������������������������������������������������������������������������������������������������������������!�!"����#���$������%&����$������'&�(&����$�������)���
7�����$5�����@#������$�������)��������B���#������$��$-��$������
![Page 37: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/37.jpg)
���������������������
��O�
������������������ 3������$�)�� '%#��&. "�$��%��%�����)�������#��#�����������$5�����@)�������� � #������$������B �� �����, ��� +'%$ @� #�� ����� ������� ����� ����&. "�$ #������������� � ��� +'%$ B #��� ��#�������� �� �������� @� ��� #���� �� ����������B� �� ���$#��� ��������$�� ��)���� ��� +'%$ �� ��#������� � ��� �������� �� ��.$#���� ��������������
>7�,���#��#������������,���+'%$ ?>H��,���$5�����?
1��#�5���#������� �������� ������ �/��,�������� �� ������������$��#�����������#��������#���-�$������������#������ ������=��#������� �7��� � 7��,���� I �G�$/�� 7��,���� �� ��#������ 7��,���� �� �1�������� 7��,���� I� �C��5)���X� 7��,���� �� �7������X��@$�0��B 7��,���� �� �D�������� 7��,���� �� ��-� 7��,���� �I �.$��� 7��,���� �� �GM�������$��������������� 7��,���� �I �3�"� G�$5���� � �.�����7�0�� G�$5���� � �!��%���G���$����� !��%� QL5����� L������1����@B YY7��� ��G�$/���1���������C��5)����.�$��� G�$/��H�#������@B YYL��������G�$/������#�5����#������ �#������HG�$/��@B YYL���������#������������$�����G�$/�� ������������%��%�����)������������#��#����������������$5����� �������,�������+'%$ 7DE.GC.�����$�$������������� �������������
![Page 38: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/38.jpg)
���������������������
��Q�
�������������������������������
G��$��$���� ������ ����$�� ����� �� )��$������ �� %���$�� ��� �����$�����7�.�C.!��L�L�1E!H!��L�3���$/�� ����$/�5�#���$����������+'%$ /�������)��$������F���������6.�.LD��N��6Local loMiForm
*--- Primero, creamos una instancia de FORM y la llamamos loMiForm
loMiForm = CreateObject("FORM")
with loMiForm
*--- Segundo, asignamos valores a las propiedades
.BackColor = RGB(64, 255, 255)
.Caption = "Mi primer formulario usando clases"
.Height = 600
.Width = 800
*--- Tercero, le agregamos botones de comando
.AddObject("BotonOK" , "MiBoton1")
.AddObject("BotonSALIR", "MiBoton2")
*--- Cuarto, hacemos a los botones visibles
.BotonOK.Visible = .T.
.BotonSALIR.Visible = .T.
*--- Quinto, mostramos el formulario y los botones
.Show()
endwith
*-- Sexto, leemos los eventos
READ EVENTS
*--- Séptimo, liberamos al objeto de la memoria
Release loMiForm
Return
*
*
DEFINE CLASS MiBoton1 AS COMMANDBUTTON
Caption = "OK"
Height = 30
Left = 50
Top = 570
Width = 100
PROCEDURE Click
WAIT WINDOW "Has presionado el botón OK"
ENDPROC
ENDDEFINE
*
![Page 39: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/39.jpg)
���������������������
��9�
*
DEFINE CLASS MiBoton2 AS COMMANDBUTTON
Caption = "SALIR"
Height = 30
Left = 650
Top = 570
Width = 100
PROCEDURE Click
CLEAR EVENTS
ENDPROC
ENDDEFINE
*
*
>K�5)���� ��%���$��?
��� 7���� ��� 0����/�� ���$��� ��L�!��$� �� ���� �� ��� ��������� �� �� +'%$ !��L�.���� ��)��� ���������������#��#����������������$5������
��� ��� ���0��������� ���������#��#�������������&. "����� � �� �� ��� /������ �� ��$����� ��� ���$��� A�����Z � �� ���� ���$���
A����3�DE�;�� ��������0����0��������@�C�B����#��#�������(����/��*���$/��/������I�� L��������)��$������@������/������������BN�� D�������0�����O�� D�/�������/��������$�$����Q�� 7���������/����������0�����7�$$���A������.���� ��)��� ��#���������
��� #��#������� � ����� ��� $5����� �� �� +'%$ 7�$$���A����� �� ���#'/������#���� �����
��� D���� ��$��0��������� ����#��#�������/�� .����/�$�������� � ������������,���������������%� �����P�����
/���� �+ ������ ��� $���� ��/�� �� /����� .� ���� ���� $������, ��$�������
9�� 7����������/��������$/�5�����0�����7�$$���A��������� D���� ��$��0��������� ����#��#�������/�� .����/�$�������� � ������������,���������������%� �����P�����
/���� �+ ������ ��� $���� ��/�� �� /����� .� ���� ���� ��$#���, ����0�����#������������#������$����������$��$���
![Page 40: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/40.jpg)
���������������������
�;��
��������3���������5��4������������������������������
������������������������7D�33@B 6���������$/��������������������������������������������������117D�33 � �� ������)������������������/�/�����������������78�11�A�.7C@B � �� ����/��������������������/����������$#��������������.�.GC3@B ����#������'$������0���������+�����EG3C�G7.@B 6����� ��� ���������� �� ��� ����� �� �� ����� � ��0���0� �� �������� ������������ ��%������������L.LA.�3@B 6����������$/��������#��#�����������#������$�����������$��$/��������/��������������������L�<3.�A�@B 7���������� ������������)��$�������/����#����������#���������$��������/������/�����������,#������������#��������3.D�A�@B D�����+������)����������/����#�����������������������������������������787D�33.3@B 6����� �� ��)��$����� �� ��� ������ �� ��� /�/������� �� ������ ������ �� �������7�L�A�@B 7�$#������#��#�������������/��������0���0��C������#��#�����������0������������������5������7�.�C.7D�33 �/����1���&������7������#��� ����#���������������0���)��������������7�.�C.7D�33DEA 7���������0�@�0��-�B/�/���������������7�.�C.�A�.7C@B 7������/��������0����������)��������������
![Page 41: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/41.jpg)
���������������������
�;��
1.!EG.7D�33 7��� ��� ����� � ��� ��/����� ��)����� #�� �� #�� ��$���� � ��#���)��� ���#��#��������$5������1E3D�H�A�.7C3 L��������)��$�������/�����/�������/���������������/�����1�1.!�<DC@B .��������$5�������������#���� ���������$��$���$/�� ����$5����������������/������)������6.C�A�.7C@B ����0����/����������$���+���������������)������������/����6.C.L 1�0���0���0���������������#��#���������� ���#�� ��$�#�����$5��������0����������$#�������&�DE3C�A�.7C3 7�������$����$��������)��$�������/�����/����������������/�����G.��A�.7C@B 7��������0��/������������������/�/���������������@��78B��������#�� ��$�@��6B#�������/��������%�0��G�1.!�<DC E$#��� �������������$5�������������#���� ���������$��$���$/��L�1E!H7D�33 �/����1���&������7������#��$�������$���)���� ����)������������ ������"�������������������0���)���������������A�C�7DE.GC@B 1�0���0���#����������$�����������/������������������)��$������.L3C�C<3@B ����#���������/���#������#��#�������0�����$5������/�����.L��.�A�.7C A�������/���������/�������������������$#�������������.D.�3.7D�33DEA 7��������/�/����������������.G�L.7D�33 D���$/������$/��������)�������������� �����,��������������������/�/���������������3.C7D�33DEA �/�����/�/���������������0������������������������)�����������������
![Page 42: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/42.jpg)
���������������������
�;��
3H3@��N9B 1�0���0���0���� �������������#��#�����%���$/������0����#����)���������#��#��������������������@���������B3H3@��O�B 1�0���0������)�������#������/���� ���������������/������L����������� ��������#���������#���)������3H3@��O�B 1�0���0� �� ��$/�� ��� ���%�0� �378 �� �� ���� �� ��������� ��� �/������#���)��������, �������3H3@��O�B 1�0���0�������� �-����/����#������/������#���)������C4E3 ��0�������)����������/���������������0������������)���������������EC4F.G1�EC4 .�#���)���$'���#���#��#�������#������/����
![Page 43: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/43.jpg)
���������������������
�;��
���������������������������������������������
� 3� ��������$�� ������� �� 0���� �� ��� #��#����� �� �� +'%$ � ,%�# � �� ����$����$/������0�����#���$��%��������������#��#�������.GC���$������� ���������$#���
�� 7���$�������0�)��$�������� D�� �� �$����7�$$���A������� .���$5��������P���/���������/�$��=
C%���������7�#����U(.����������0���#�������)��$������*�� .������$����)��$�������� 4���$������P��/����/��������$�����
.�.LD��O��6Local loForm
loForm = CreateObject("FORM")
with loForm
.Caption = "Este es el caption original del formulario"
.AddObject("Boton1", "BotonCAMBIA")
.AddObject("Boton2", "BotonSALIR")
.Boton1.Visible = .T.
.Boton2.Visible = .T.
.Show()
endwith
READ EVENTS
Release loForm
Return
*
*
DEFINE CLASS BotonCAMBIA AS COMMANDBUTTON
Caption = "Cambiar título"
Left = 20
PROCEDURE Click
This.Parent.Caption = "Este es el nuevo caption del formulario"
ENDPROC
ENDDEFINE
*
*
DEFINE CLASS BotonSALIR AS COMMANDBUTTON
Caption = "SALIR"
Left = 200
PROCEDURE Click
CLEAR EVENTS
ENDPROC
ENDDEFINE
*
*
![Page 44: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/44.jpg)
���������������������
�;;�
>K�5%���$��? ��$��������$�����&. "�����#�)��$������@�����!��LB���������$�$����!��$ @�� 0�$�� �� �� (�* ������� �� ��)��� (�����* � �� (�* �� �� �� �� �� ��)���(�/����*����� �������������(�/���������*B� 3� �������$/��$������#�������)��$������ C������� �� � �� �$�� ��� /������ ���$���� A����� � A������ D� +'%$ ���#��$�����A����7�LAE����+'%$ ����� ������A����3�DE�� 7������%���$�� ���$/��/��������������0���/���� K������$�����$����)��$������� 3�"���#������$������0������ 35#��$�� ��/���$�� �� �&. "� ��!��$ �� �� $�$����� #��� �� ����#���+�������$����� .���#������$���������P����+'%$ A����7�LAE���$/��$����0���������#��#������� ��+'%$ �,%�# ��A����7�LAE��$,���#��-)���$������ ��#��#�����(7�#����*� .�� �� ��)��� �� �����������/������ ��$���� @A����7�LAE�B#���$����$/�����0���������#��#��������)��$������@����������+'%$ �,%�# B� .���)��������������#�� ����0������ ����#���/������������#��#��������#��������#��������#����������� ���$�� C%���������������������������7�#����U(.����������0���#����* C%�������������������������%U��� C%���������������������������D�)�U�I�
������
![Page 45: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/45.jpg)
���������������������
�;I�
����������������4�����������������������
� �0��������������$������������$5������������$������������$5��������+'%$ �,%�# ���)��$���%��������������#����������������������������D������"�������� ������=
������� ������ � .��� ���������$#����$����$������.�.LD��I��6�#����%��������+����#���������������������������#����������� ��)������L������!��%�E� ����@B ��#�����������+'%$ ,%�# @��������#�����������+'%$ .LD.�1�B�.�.LD��Q��6FDEFINE CLASS GERENTE AS EMPLEADO
PROCEDURE MostrarNombreGerente
? This.cNombre
ENDPROC
PROCEDURE MostrarFechaIngresoGerente
EMPLEADO::MostrarFechaIngreso() && Aquí se utilizó el operador
de resolución de alcance para ejecutar un método de la clase padre.
ENDPROC
ENDDEFINE
*
*
� .��� ���������$#����$����$���������������#��� �������� ���������������6������ ����� �� #��#�� #������$������ ��� �� �� ����� �� ��$���$�� � #��#������#��� ����0��$,������$������ ��G�1.A.4�7.�3.�.�.LD��9��6Local loNuevoEmpleado, loNuevoGerente
CLEAR
loNuevoEmpleado = CreateObject("EMPLEADO")
with loNuevoEmpleado
.cNombre = "Raquel"
.cApellido = "Martínez"
.dFechaNacimiento = CtoD("12/02/1975")
.dFechaIngreso = CtoD("15/09/1994")
.MostrarFechaIngreso()
.MostrarFechaEgreso()
.MostrarSueldo()
![Page 46: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/46.jpg)
���������������������
�;N�
.PonerFechaEgreso(CtoD("15/10/2010")) && Esta es la forma
correcta de asignarle un valor a la propiedad dFechaEgreso
.PonerSueldo(1234567) && Esta es la forma
correcta de asignarle un valor a la propiedad nSueldo
?
.MostrarFechaIngreso()
.MostrarFechaEgreso()
.MostrarSueldo()
?
endwith
?
loNuevoGerente = CreateObject("GERENTE")
with loNuevoGerente
.cNombre = "Mercedes"
.cApellido = "Candia"
.dFechaIngreso = CtoD("21/03/2009")
.MostrarNombreGerente()
.MostrarFechaIngresoGerente()
.PonerSueldoGerente(9876543) && Esto es un ERROR.
endwith
Release loNuevoEmpleado, loNuevoGerente
Return
*
*
DEFINE CLASS PERSONA AS CUSTOM
cNombre = Space(20)
cApellido = Space(20)
dFechaNacimiento = {}
PROCEDURE MostrarDatos
? This.cNombre, This.dFechaNacimiento
RETURN
ENDDEFINE
*
*
DEFINE CLASS EMPLEADO AS PERSONA
PROTECTED dFechaEgreso && dFechaEgreso es una propiedad
PROTEGIDA, por lo tanto es visible en esta clase y en todas sus
subclases.
HIDDEN nSueldo && nSueldo es una propiedad OCULTA, por
lo tanto solamente es visible en esta clase.
dFechaIngreso = {}
dFechaEgreso = {}
nSueldo = 0
cNombreJefe = ""
PROCEDURE MostrarFechaIngreso
with This
? .cApellido + ", " + .cNombre + " Ingresó el día: " +
DtoC(.dFechaIngreso)
endwith
ENDPROC
![Page 47: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/47.jpg)
���������������������
�;O�
PROCEDURE MostrarFechaEgreso
with This
? .cApellido + ", " + .cNombre + " Egresó el día: " +
DtoC(.dFechaEgreso)
endwith
ENDPROC
PROCEDURE MostrarSueldo
with This
? .cApellido + ", " + .cNombre + " Sueldo = " +
Transform(.nSueldo, "999,999,999")
endwith
ENDPROC
PROCEDURE PonerFechaEgreso
LParameters tdFecha
This.dFechaEgreso = tdFecha
ENDPROC
PROCEDURE PonerSueldo
LParameters tnSueldo
=MESSAGEBOX(TRANSFORM(TNSUELDO))
This.nSueldo = tnSueldo
ENDPROC
ENDDEFINE
*
*
DEFINE CLASS GERENTE AS EMPLEADO
PROCEDURE MostrarNombreGerente
? This.cNombre
ENDPROC
PROCEDURE MostrarFechaIngresoGerente
EMPLEADO::MostrarFechaIngreso() && Aquí se utilizó el operador
de resolución de alcance para ejecutar un método de la clase padre.
ENDPROC
PROCEDURE PonerSueldoGerente
LParameters tnSueldo
EMPLEADO::PonerSueldo(tnSueldo) && Esto es un ERROR, porque
tnSueldo es una propiedad oculta de la clase EMPLEADO
ENDPROC
ENDDEFINE
*
*
7�$� 0�$��� �����+�� �� #������$����� ����3�����6������@B �� �� +'%$ 6.�.GC. �� �� ������ >#�� �5 ���? �� �� ���, ���$���� �� #������$���������3�����@B �� �� ����� .LD.�1�� � ��� #������$����� ��$/�� �� 0���� �� ��#��#����� �3������ ��� ������� �� �3����� �� ��� #��#����� �+�'"%� #�� �� ���������������/���������#������������5�����������$���������������$����@��$����������%����� �-B� �.7<[�1�D�=����#��#������+�'"%����$������#����������������������� ������)��������$#���/����������������3�����������������������������������������������#�� ����$��+�'"%�
![Page 48: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/48.jpg)
���������������������
�;Q�
���������������������@����� �%���������$��0�����$�������+'%$ ��$������,�����"�����#��+,������������%���+ �������#������������+���$���������������=
�� <������������ <����� ������ <���$��
.�������������0��,#���������������������������������D���� ����$������,
����"�� �������$��������$��$�����,��0��������������#��+�$������ .���0����������$����������/�$��=
CREATE CLASS ETIQUETA1 OF CONTROLES AS CONTAINER
>K�5������$����������� �-��������!�"��?K�� ����$�������������0�+'%$ ������������$��,.CEK<.C��������, ��/����������%�0�7�GC��D.3��78���+'%$ �&%$ ���,7�GC�EG.�� G��$������,���� ������#�������=
�������GM��
7�$�#���$��0������#������������+'%$ �����$�.CEK<.C��������%�0������$�7�GC��D.3��78
![Page 49: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/49.jpg)
���������������������
�;9�
D���$/��$������$�&����� �� �$������������� ����������������#��� �� ������-=
�������GM�;
.� �� #��#������������� ��� ������� D�A.D� #���$�� �!� � �� �� #��#����� ����#���$��O��@#�����#������$,������������#�������B� .���#��#����������������������CEL.���#���$��=��� H����$5������������������CEL.�������/�$��=
�������GM�I
6��/�$��������)���$���������#���0���$�� ���%�������$�������������%�0����$���7�GC��D.3��78�����������%�0�������������������+'%$ �����/�$����������.���+'%$ �%���#������������+��������� ����)��$������� ��$���0���)������� .���0����������$��������������!�"�������/�$��= L���)�)��$�<.A��
![Page 50: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/50.jpg)
���������������������
�I��
G��$������,��)��$������0��-��%���$������P���������(���J7������*
�������GM�N
.�� �$��(���F*���� �7�GC��D.3��78�G��$������,��������+'%$ $ �� ���,���������7�GC��D.3��78� �� ����$�$���� ����$����%�� ���#��� �$����� ��0���$������������0��+'%$ $5������,�� �� ,������ E������$�� �� ������� .CEK<.C�� �� ������� )��$������ � 0���$�� ���#���������$��������� ������=
�������GM�O
![Page 51: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/51.jpg)
���������������������
�I��
.���$5����EGEC���)��$�����������/�$��=
�������GM�Q
.������$�� �� )��$������ � F 0���$�� �� ��"�� ���#��+,����� �� �����%� ��+ ������� 3� ����$�� �� ��$��0�$,� �,#����$,� ������ �� ���������� ��$/��� ��0��������#��#����������������������CEL.��� ����#����� ����$/�5�#���$����$/�������"��������/���� �������$��� 7�$� 0�$��� �� $�� #��� ���$#� %�$�� ����� ���� ����� �� ������� ��/�����#��+,�����#�� ��#��������.����������$#��$����$#��� ���$��0������� ����$,���$#�������������� �������#, ����� .� ���%�0� 7�GC��D.3��78� �� )��$������ �<.A���37C � ����� �����$,����$#����������������������%�0���$#��$�������������������$����� .� �$#������� �� ��� �����$#��$�� ��$/�5� � ��� 0���� �/���0���� #�����������$�����H #�� ��#������ �� ������ �� ���� ������ #����� �����/��$� �� ��$��� ���#���������'���$�#, ����
![Page 52: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/52.jpg)
���������������������
�I��
����������������������� �%���������$�����+'%$ ��/�� ���������,������0������ �������D�)��$���%����������$�������������$#�����������<����+���$���������������=
�� <������������ <����� ������ <���$��
.���0����������$��������������!�"�������/�$��=
CREATE CLASS ETIQUETA2 OF CONTROLES AS CONTAINER 1��#�5� �� � �� �� �� ������� �� �� � �� ������� ���� ����$�� ��� ���0�#��#�����������$�$�����!����"��� �����$���0������� ������#�������=
�������GM�9
.� ��#��#����������������������� ��/��#���$�� �!�� �� ��#��#����� ����#���$��O��@��� ����#���+��$,���������B� .���#��#����������������������C�$���#���$��=I�� .���$5������������������C�$��������/�$��=
This.Parent.Label1.Visible = !This.Parent.Label1.Visible 6��/�$�� �� ����� � 0���)���$�� �� )�������� ��� ��� ����$�� �� ���0�)��$���������$����<.A������������$��������������!����#�����$5����EGEC���)��$�����������/�$��= ThisForm.Etiqueta21.Label1.Caption = "Este texto está titilando"
.������$����)��$�������FVVV�-�����"�����,���������WWW
![Page 53: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/53.jpg)
���������������������
�I��
������������������������� �%���������$�����+'%$ �� ����$/�����������$�����#������, ������"�����,��������$�������������������/����)�����$�����$��%������5���������������#����������� <����+���$���������������=
�� <������������������� 1�������������/��
.���0����������$��������������!�"�������/�$��=
CREATE CLASS ETIQUETA3 OF CONTROLES AS CONTAINER
.������������.�� �����=- BackStyle = 0. Transparent
- BorderWidth = 0
.���/���=- BackStyle = 0. Transparent
- ForeColor = 0, 0, 128
- Left = 0
- Top = 0
- Width = 720 (o el que te parezca más adecuado)
.���/���=- BackStyle = 0.Transparent
- ForeColor = 192, 192, 192
- Left = 2
- Top = 2
- Width = 720 (o el que te parezca más adecuado)
.������������.�� �����=- Height = 17
- Width = 720
��� ����0�����)��������$/������������ �����/����������/����� ��#�#����������������������� ����� ����$�� �����5����/������ ����$�� �����5�/������$������$�������� ��3���������$����� ������� �������$�������� �����������$��������� ��������������#���������#������
�������GM��
7����������� ����$�� ���� ������5����/�� ���� ��#���5��/���
![Page 54: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/54.jpg)
���������������������
�I;�
1��#�5�����$��'��� �$��= 7����SG�JL��%��F
���G�$�=�����/�$��(����7�#����*
.������0�$5���� ������$������������#��$����,��� �����$��$���#�������������� �����������+'%$ ���$/�5���� ������� �����#����������������$,���������� #��� �� �� �)���� �� ��$/�� ��� 0���/�� � ���5����$���� � ����/��� G����� ���$�� ���� ���� ���� ��#���5�������������� .���$5����%���������������/�$��=
�������GM��
>!��������,?��$���0���)�������7���$�������0�)��$������������$�$��!��L�� .����)��$�������������$��������������!����& �����/�$���������� D�� ������$5����EGEC���)��$�����������/�$��=
�������GM��
.������$����)��$�������FVVV�-�)�������WWW
![Page 55: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/55.jpg)
���������������������
�II�
��������������������������� .� $�� )�������� �� �� �������� )��$������� ��������$�� #���� �-����� ���/�-����� #��� �� �� ������� ��� � $,� ����� �� �� ��)����� �� ��� ��$#�� �� ��������������/���������-�������/�-������%���������$�����+'%$ ��������0��,�����$����#�������������������$����/����������+'%$ $��$������������$#������ #���-� ����� �� )���� �$������� ���� #���-� ����� �� )���� �+�� ��� ���� ��#� ���$�&�������������������������������������0����� .���0����������$��������������!�"�������/�$��=
MODIFY CLASS ETIQUETA4 OF CONTROLES AS CONTAINER
D��������$�������������������$�0�$�������� ������#�������=
�������GM��
.� ������� ����� ���0� #��� ��/���� ����,� ����� ���������� �-��������0������-����� .�������������!����'= - BackStyle = 0. Transparent
- BorderWidth = 0
- Height = 23
- Width = 720
.����������������=
- BackColor = 255, 255, 128
- Curvature = 20
- Height = 23
- Left = 0
- Top = 0
- Width = 720
�%������ �� �$��������������!����'������������!����&��� ������$���������$#�����������>���$��� �� �������������������������������#����������$��$��?7���� ���-������� '�#��/��$��D����������� ��������������$��#�������������$���)������������������0�����������!�"�������������$������������ ������ 0������� �� ����$�� �� ���/���� ��� +'%$ $� ��� ����0�� � ��� ������� #����������#���������������������$�����
![Page 56: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/56.jpg)
���������������������
�IN�
.�������������!����&�= - Height = 23
- Left = 0
- Top = 0
- Width = 720
- Label1.Alignment = 2 – Center
- Label1.FontBold = .T.
- Label1.FontSize = 12
- Label1.Left = 0
- Label1.Top = 3
- Label2.Alignment = 2 – Center
- Label2.FontBold = .T.
- Label2.FontSize = 12
- Label2.Left = 2
- Label2.Top = 5
H�%����#���#��������"�� ��$������,���!����'����$����$5���� ��������� ��,�������+����������=
�������GM�;
�������GM�I
![Page 57: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/57.jpg)
���������������������
�IO�
3���$/�� ��'� )������ �� �� ��$�&�������������!������ �-����� ��%�$��)�������O������>�����������$�� �����$,�������$,���� �?.�����������������, $�������� �� ��"�� �������� � ���5����$���� ���, )��� ��- �� ����$�� ��������������������0������������������$5����EGEC������!����'��� �� �$������� ��������-����=
�������GM�N
D� ���� ��� ��� ��� �� .�� ����; � ����� ��� ��$#������� ��� �� ���$#���"����$������$��$����%��#�������������"������������� �������� ��#�����,���$#����������� A������%�������$�������)����%�������#���/�#���0���)���� �����!����')���������$��������$��������������$�������0�)��$�����������������$�$��!��L;���� �� �$������������������!����'������$5����EGEC�����/�$��=
�������GM�O
![Page 58: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/58.jpg)
���������������������
�IQ�
��- ������$����������������������)��$�������0������$#��������������"#������0�����%���$����������� ���/����$��=
�������GM�Q
H �-� ��� �-����� �#������ #��)����$���� ���������� �� �� �����$���� �� �� ���-�$������� ���� 7�$�������$����������$�����#���-�$�������0������������������� ������$������ ��� �-�����������/�-����������������#������������� �������������������#���-������������������)�����$������������#���-��������������������+��������/������������� �������C�$/�5������#���������������$�&�������������#���-����� ���������� ��- ��$� �� ����� ��� ��"��� H� ���� ��#�����, �� ������� ������0����#�� ����������!�"��������������0�����������$�������#��$���%����$���0������
![Page 59: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/59.jpg)
���������������������
�I9�
��������������������� 4�� $��%-��$�� /������ �� #���-�$�� %����� �� �� ��� /������ �� ����$��%� � ��$��%�� �����"�����%��� %���$�� ��� /��� �������� ���� '���� )���������, ��$#��� ����0������D�%���$����-#���#���� ������������� ������ ��������� ��������$��%�������$,���������� .���0����������$��������������!�"�������/�$��=
CREATE CLASS BOTONCANCELAR OF CONTROLES AS COMMANDBUTTON .���#��#�����������������/�$��= 7������� H����$5�������(�����/�$��= 7D.��.�.GC3 H ��� �� ����� � #����� �� �%��� �� �����$�� ��� �� /���� �� ��� #��$����,������������0������������#����$��������$��%�����������������
![Page 60: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/60.jpg)
���������������������
�N��
����������������������������������
.�$��%�� �#���������� #���$�����������$������ )��� ��)-��= ���� ���-����������$#�������������$�������#��)�������������$�0�������������������� '�������#�������� ������$�������+����$������)����#�������������������� ��+,�������0��������� 7�� �� +'%$ �� ������������$�� � ������������ ��� #��0����$�� � ���������#���������� �� ��� ��������-������ 1���� ��� � �� #���$�� $������ )��� ��)-�� ���������������������+'%$ #��������#���%���5�����������$�������������$��$,�),���� .���0����������$��������������!�"�������/�$��=
CREATE CLASS FOTOS OF CONTROLES AS CONTAINER
D�� ����������$��=
�� 1��������������)���� 1������������������ <���������� ��
.����������*��������/�$��=- BackStyle = 0 - Transparent
- BorderWidth = 0
- Height = 299
- Width = 331
.�������������)�������/�$��=
- Height = 32
- Left = 149
- Top = 0
- Width = 32
.�������������)�#�����/�$��= - Height = 237
- Left = 7
- Stretch = 2 - Stretch
- Top = 36
- Width = 316
.������������ ��������/�$��= - Alignment = 2 - Center
- BackStyle = 0 - Transparent
- Caption = (nada, lo dejamos en blanco)
- FontSize = 8
- Height = 15
- Left = 3
- Top = 282
- Width = 324
![Page 61: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/61.jpg)
���������������������
�N��
.����������+����������/�$��=- BackColor = 0, 128, 128
- Curvature = 20
- Height = 243
- Left = 3
- Top = 33
- Width = 324
.����������+����#�����/�$��=
- BackColor = 192, 192, 192
- Curvature = 20
- Height = 243
- Left = 7
- Top = 37
- Width = 324
7��������%�$����$#��������#����0�������������������������� ����%�$��#�����0���������������#��#������� ����������������%���)���������/�����$5���������� ��%���$���������������= .���$5����������*����������/�$��=
�������GM�9
D� � �� �$�� �� $5���� �� ���� ���$�$�� %������ �*���)�,�� � �� 5������/�$��=
�������GM��
![Page 62: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/62.jpg)
���������������������
�N��
.� $5���� �������� ��� ���0��, ������ �����$�� $������ ��� )��� ��)-�� D���0��$�� ��$� #��,$���� �� ��$/�� �� �� )��� ��)-� �� ����$�� 0������+�� � ��$5����������� ��,������ .��� ������$5�����#�������������������0��0��,����$/������)��� ��)-� ������$��0������+�����3���$/����- ������� �*���)�,���
�������GM��
��- �������� ����$���/���������$/������)��� ��)-� ������$��0�����#���$�������/���� ���$�=
ThisForm.Fotos1.NombreFotografia() H #��� ������ ����$�� �� ��� �� ������� ���� ����� �� )��� ��)-� �� ��$������,�#���$������ ���������� �����$5�������(�������������)���
�������GM��
7����� 5� %� � ����P ��/�� �� �$� �� �� �� ��$����� �� �/���, �� ������ ����,�� � ����#����, ������������%�0��3���� �������%�0������������,$���������������������)�#�
![Page 63: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/63.jpg)
���������������������
�N��
����)����������������������� ��#���$��� �� �������������������!�C�3����#���/��������$�������������0�)��$��������$��$��$� �� ������$����������������)�#�#���������$�&�$��%�$����#��� �����0������+���$����� �������� ������)���������$5����.�������������/�$��=
�������GM��
>K�5 %���$�� � �-? 7���$�� �� ���0� )��$������� �� ���� �� � �� �$�� ������������= ��� �$� �� � �� /����� .� ������� �$� �� ���0��, #��� $������ �� $��$��$� �� �����,/�$��0�������������������)�#����������*������/0��$����������$�&�$��%�$�����H��/�������0��,#�����������)��$������� .��� )��$������ �"���� ����$���� �� �� $�$���� �� �� ��$#�������� �� ���, ��/�����������������.���)��$��������$#����������������+�$��#�������������#��-)���@�����������$���������)��� ��)-�B���� ������$���$��� �������$�� �� %���� �� ��)���� � �� +'%$ � ,%�# � �� ���$#�� ������ �����)��������/�$��=�4�� %�U�������4�� %��� ������$��%�������������5�������
![Page 64: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/64.jpg)
���������������������
�N;�
������!�"�� �������$�� �������������� �$� �����)��������$��$� �������������)��$������@#�� ����)��$����������+'%$ �,%�# �������������)���B� 3�$����$����� ������ �����/�$�� �����% U �����������% �� �� ����$��%������� ������5����� ��������!�"�� �� �� ���%��� �� �$� ����/� ��� � ��� �����%����)��$������� A����� �%��� ����$���� ��� ���� ����� �� )��$������ #��� #��/�� �� ��������������*����)���������������$�������� ��- ������0����������$��������������!�"�������/�$��=
modify form FORM5 D�� �� �$�����������*���������$5�����������)��$�����������/�$��=
�������GM�;
>��� �5 ����? ��� �� ����� ������ ��� )��$������ #���$�� ��)������� ����� ����������+'%$ $ �����,�������������%�0�7�GC��D.3��78� >H ��������$�� %���� ���? 3-� #�� �� �� �� $5����.�������� ��� ����������)�#%�/-�$���������= .AddObject("BotonC", "BotonCANCELAR") H ��$� (A����7�G7.D��* �� �� ��� �� ��� ��������� ���,���� ��� ������!�"�� ���� �� �� �� ������� �� ����$�� �������� �������� ����$�� �� ��������������������������H����������$������ ��%����������������3.C7D�33DEA��������������/�/������������������ .���������������!�"��/�������������/�����������0������������%�0�7�GC��D.3��78���������������-�F�����)������� A������%��� ����$������� ��������������� )��$�������0�� �� �� ��%�$��%��%� )������� /���� ��- �� �� �������$��� %���$�� ����P ��/�� �� �$� �� �� ����$������ ��� �$�� ��� )��� ��)-� �� ����$�� �� �� ����� ���� � ���� �� �� ���/����$��=
![Page 65: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/65.jpg)
���������������������
�NI�
�������GM�I
�%���$�0�$����L������/����)��� ��)-���������� ���/����$��=
�������GM�N
![Page 66: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/66.jpg)
���������������������
�NN�
�������������������������������� D�������������$��$������ �����$��%������������������#�����������������������������#��#������#�������������������������)��������,���������������#��������� �%���������$���������������0��������� �� �������+���$��#����� ��������� ������#��������������)��������������#�����5��������$���$����)���1��� .���0����������$��������������!�"�������/�$��=
MODIFY CLASS INGRESODATO OF CONTROLES AS TEXTBOX
H������ ��$�������0����������#��#�������= - BackColor = 250, 250, 250
- BackStyle = 1 – Opaque
- DisabledBackColor = 232, 232, 214
- DisabledForeColor = 0, 0, 0
- FontName = Courier New
- ForeColor = 0, 0, 255
- Height = 23
- Width = 100
.��� �������#���-�$�������+����#��� �� ����� ���� ���� ��#��������� #��� �����$�� �)������ #��� �� ����� ����� ��#��-)����� ��� �� ����� )��%�� ������$�� ������0�+'%$ ����������$���$����)���*����.���0����������$��������������!�"�������/�$��=MODIFY CLASS INGRESOFECHA OF CONTROLES AS INGRESODATO FROM CONTROLES
.���������%�$���������������0���,���������$���!��L>#�� �5%���$�����? .� ��� ����� ���������� �� ��� ��������� �����/���� #�� �� ��� ��������� ��������0���������+'%$ $���,�������������!�"���#��������������)���*�����������0��� �� ��� ��� �� ��� +'%$ $� ���,����� ���� �� ��� +'%$ �������� #�� �� �������/�$������������������������������+'%$ �
D����� ��$�������0����������#��#�������= - DateFormat = 3 - British
- InputMask = 99/99/9999
- Value = {}
- Width = 81
3�$����$����� �%��� ������$�� �� ���0� �������� �� ���� ���� #��� �� �������������������������$���$����)������������.���0����������$��������������!�"�������/�$��=
MODIFY CLASS INGRESOCANTIDAD OF CONTROLES AS INGRESODATO FROM CONTROLES
7�$�0�$�����$/�5����,����0���������������)���1����
![Page 67: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/67.jpg)
���������������������
�NO�
D����� ��$�������0����������#��#�������=- InputMask = 9,999.99
- Value = 0
- Width = 67
H����$5�������������/�$���
�������GM�O
>K�5 ����$�� %������� � �-? 1���5����� �� ������ �� ���%� ��� ������� � ���������������������� ��%������#��#����������.��(�>H#��� �5%���$�����?��� �������������������$#����� ������%��"����� �������$����@���������������-�$�����#������������#����B��$����@������������ �����- ����#���-����0����B������������ H�%���������$�����������#�������$#������.�$����$�������������������������$/�����E�#��L��P�������%�.���0����������$��������������!�"�������/�$��=MODIFY CLASS INGRESOIMPORTE OF CONTROLES AS INGRESODATO FROM CONTROLES
H������ ��$�������0����������#��#�������= - InputMask = 999,999,999.99
- Value = 0
- Width = 109
.���$5�������������/�$����$��$� ��%�/-�$�������������$5��������������������)������������ ��- ��%�$��������;���������#������� ������������������������=
�� !�# $��%"� �����0�#������� ������#���������� !�# $�� +>% �����,��#������+�����)��%���� !�# $��%!"��%� �����,��#������+����������������� !�# $�),�#" �����,��#������+������$#�����
3�)�������������#���-�$��� �� ���� ����$,��#�����$#����$"#%#��"%' $
�� ���� #���-� ��#������+���� �� �������� ���-�$�� ��$���� � !�# $�),�#" #��� ��
![Page 68: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/68.jpg)
���������������������
�NQ�
#��#����������.��( �����-�$���������������'$����9�#������#��� �$#������'�$������������-����%�/�������#��� �������������#������$/��������������� � ��+,� !�# $��%A�$+�'%$ #��� ��� ����������� �� ��� ������ ����� ���������������/���������$��'�������H��-������0�$����� A����� ��$� �� �����$/�� ��� )���� #��/�� �� �� %�$�� %��%�� ��/�$��0���)���� ��)������������P������������+���������������������������#����������� �������������$�������0�)��$����������������$���$��!��LN���$���0������� �������-���=
modify form FORM6
D�#���$����A��P7�������9���9���9���������$�������������������#���������$����)��$���������$�0�$�������� ������#�������=
�������GM�Q
H�-������������ ����������%�������������#�����0���������������������$#������������������)�����������2���)������������)���*�����#���$���� ������������H������'���$���/�$���� ��������)��%�0,����#�� �����������$�������/�����)��%���$�=��X��X������������!�"�������%�+��,#�� �����"������$���'$������
![Page 69: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/69.jpg)
���������������������
�N9�
�����������������������������������
.� �� ���$#�� GM N @7������ )��$������� #�� #�� ��$�B � �� �� +'%$ #���$������)��� ��)-����%�/-�$��0������ ����)��$����� �� ������)��$�����������)��$�������� �-#�������$�������5�����= .� ��$5���� ���� �� ������� )��$������ #�����#�� � �� ���� ���� ����$5����@#�����$#�����������%�������P��/����/��������$�����B�����/�$������ ���������� �=
�������GM�9
7���$�������0�)��$���������� �� �$�������� ������������GM�9����$5������������������$����������� ���/����$��=
�������GM;�
![Page 70: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/70.jpg)
���������������������
�O��
���� ���%�������$����)��$����������������������������)��$�������.����0�)��$�������"��������$��������$�$����������, ��/���������������������� ��)��� ����������������������#����������$����� �������$��'���#���$������$�������������������0��������� �����������.� ���������������)��$���������� ��������������)��$������ �������$��%���������#���$��$������������� ���������5��������)��$���������$#������ ��%�$��0����� .�)��$��������$#�����������������#��#����������������$5���������+'%$ �,%�# �!��L�.���� ��)��� ��#���$����$/��������������)���������#������� ��$�&�� �� #�������� �� ��#� �� ������� ����� �� $��$� �� #���$�� %���� �� ���)��$����������$������$/�5�#���$��%������������)��$���������$#������� 3� �� ����$�� ��)������ ��� ��������-������ ���,������ �� �������� )��$���������$#��������������������������,$,��,#��� �������)��$����������$��������$,��#���$��������� ������ �����$#�������,����#���/�������������$�������� �����0������� �� ��#��� �� '� ���%�0� �37C � �378 ������ ��� ��$/��$�� ����$#�������� ��#�������������#��������������)����������������$�����7�����)��$���������$�$�������������#�����������$#��)��������
![Page 71: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/71.jpg)
���������������������
�O��
�4�������������5������� .�������!�"�����#��#����������$5�����$��'�����=���������)��.�#��$��� �� ������� ����$,����$���� ������ �� �/����� @���� ����#���B �� 0���������#��#������H���� �����������������$,����$����������������� �������0�0��������#��#������ .����$5����� ������ ��$��$���$/�� �� ��#��#����� � �� ���� ��)��������#���)�����+�����\����������\���� ���� '�������#����� >7�,���������0������� ���/����$���������+�����? K�� #���$�� 0������ ��� 0������ �� ��� #��#������� ����� �� ��� ���������� ��,��������- ������$��������$��0������0,������ .����$5��������,�$���������$�,#�" ����$�����$#��������������������$#���� ����#�����������������������)����������������������/�������� H ���,� ���#���/��� ����� #��� �������� #��#��� �/����� ��$�#��� ��� �/���������0������!�.�.LD�����6Local loFecha
SET CENTURY ON
SET DATE BRITISH
CLEAR
loFecha = CreateObject("Fecha")
with loFecha
.dFecha = CtoD("01/01/1940")
.ImprimirFecha()
.PonerFecha(CtoD("31/12/1995"))
.ImprimirFecha()
.PonerFecha(CtoD("21/04/2011"))
.ImprimirFecha()
endwith
Release loFecha
Return
*
*
![Page 72: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/72.jpg)
���������������������
�O��
DEFINE CLASS Fecha AS CUSTOM
dFecha = {}
PROCEDURE dFecha_Assign
LParameters tdFecha
if DtoS(tdFecha) < "20000101"
=MessageBox("ERROR...la fecha " + DtoC(tdFecha) + " es
inválida")
else
=MessageBox("La fecha " + DtoC(tdFecha) + " es correcta")
This.dFecha = tdFecha
endif
ENDPROC
PROCEDURE ImprimirFecha
? This.dFecha
ENDPROC
PROCEDURE PonerFecha
LParameters tdNuevaFecha
This.dFecha = tdNuevaFecha
ENDPROC
ENDDEFINE
*
*
7�$� #���$�� 0��� �� $5���� �!��%�\���� � �� ���#�� )��%�� �� �������������������.�����������7��� ���������������� ��������#��#������*������)��%������������,���%�+�������$,���$������,��$�������������� C����������� �������������%�������������$�������= ��!��%���!��%�U7��1@(��X��X�9;�*B ����������$��������05���= ��!��%������!��%�@7���@(��X��X�99I*BB ��$5�����33E6G������� ��,�����%�+������ 7����� �� )��%� �� ������ �� 0,���� � ����$�� �����+���� ��/�$�� ��� ������"#����$�������$���0������-���= This.dFecha = tdFecha
![Page 73: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/73.jpg)
���������������������
�O��
D��$5����� �77.33 � �33E6G ��$/�5� ���,� ���#���/��� #��� ��� �/���������0�����������!�"���#�����$#��#���$�������/��=.�.LD�����6Local loForm1
loForm1 = CreateObject("MiForm")
with loForm1
.Caption = "*** CAPTION DEL FORMULARIO PRINCIPAL ***"
.Left = 100
.Width = 500
=MessageBox("Este es el caption: " + .Caption)
endwith
Release loForm1
Return
*
*
DEFINE CLASS MiForm AS FORM
PROCEDURE THIS_ACCESS
LParameter tcPropiedad
=MessageBox("Se accedió a la propiedad: " + tcPropiedad)
Return(This)
ENDPROC
PROCEDURE LEFT_ASSIGN
LParameters tnLeft
=MessageBox("Se le asignó a la propiedad Left el valor: " +
Transform(tnLeft))
This.Left = tnLeft
ENDPROC
ENDDEFINE
![Page 74: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/74.jpg)
���������������������
�O;�
����������B������� .�������!�"��9��������/����#'/����������$/����\3��������������#��$�����#���)����#��#��������$5�����#�����#�������#�����#��� D�/������%��������� ��#���$�������#��#��������$5�����0���/�������� �� �#�������� ��� ��������� �� �������� � ��� 0����/��� ��$� #'/����� @��� �������������<ADE7B�H ��$���F�� �� ���#��$��� ����� #��#������� �$5����� �����#'/������.��-�������#�������$��'���#���%�� ��$������������������� >K�5 #���-�$�� ����� �� �� �/���� \3�����? 7��� ���� ���� �� ��� ����������������#���/�������� ����#��������������#��������� *--- Se definen las propiedades y métodos del objeto _Screen
*--- Es decir, los que se usarán en todo el Sistema
with _Screen
.AddProperty("cNombreAplicacion", "Mi Gran Sistema Informático")
.AddProperty("cCarpetaUbicacionEjecutable", JustPath(SYS(16, 0)))
.AddProperty("cUsuario")
.AddProperty("cContrasena")
.AddObject("MiProcedimiento", "MiClase")
endwith
*--- AQUI VIENE TU PROGRAMA PRINCIPAL
with _Screen
.cUsuario = "nombre del usuario"
.cContrasena = "contraseña del usuario"
endwith
*--- AQUI FINALIZA TU PROGRAMA
*--- Se eliminan las propiedades y métodos del objeto _Screen
with _Screen
.RemoveProperty("cNombreAplicacion")
.RemoveProperty("cCarpetaUbitacionEjecutable")
.RemoveProperty("cUsuario")
.RemoveProperty("cContrasena")
.RemoveObject("MiProcedimiento")
endwith
Return
*
*
DEFINE CLASS MiClase AS CUSTOM
PROCEDURE MiProcedimiento
ENDPROC
ENDDEFINE
!-���� ���������������J��%\3��������,��#������0����= D��]���0�#���� �� ����#��#��������$5��������/����\3����� D��]����� ��0��������� ���������#��#������� D��]���$������#��#��������$5����� ����%�/-��� �� ��������] .�$5���������#����@B#��$���� �� ����������0�#��#���������/�����3�����������$/�5�#�������#���)���������0�0��������#��#������
![Page 75: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/75.jpg)
���������������������
�OI�
�����$#��������-���=.AddProperty("cUsuario")
����� �� �������0�#��#��������/����\3���������$���3������#���������������0���������#��#����������$/�������-���=
.AddProperty("cNombreAplicacion", "Mi Gran Sistema Informático") ����� �� �������0�#��#��������/����\3���������$������ ������������$/�5�������� �����0��������������=(L�6���3����$�E�)��$,����*� .� �� ���� with _Screen �� ��� �� 0������ � ��� #��#������� ��������$����� �� �����\3�����#��������������'�������%�/-����� �����0������� .������� with _Screen ��$��0�@/��������$���������%�B���#��#���������/����� ����#��$�� with _Screen %�/-�� �� ���>#�� �5%�������?�� �����/���� �� ���� ��#�� ��$���������= (����������������� �� ���5���� ��$�����/��������������*� .���������� ���� ��$�0�$�� ���#��#�������� ���$5������������ ���$�����������#��������������'����������,�����������/����\3������3����/���$������0����������$��������������!�"���#����$����$#��/�����>7<^G1�<3��.D�A�.C�\37�..G? 7����� ����$�� ����0�������$5�������5���#���/�����������#���������������$#�������5����������� �������� ��= (D���� ����������/�%�������������� �������$���������*� ��� ����������������� �� <����+��������$��%���� ���� .���� ��)��� ���������$,���/�$����� ���������#��#�������\3�����0����������$,��� ������)�������#�� �����������#���-�$�������#��/��$����-#���$��������������$�� ����#��#������������0����#����������������������� ���$��������0��������#��#�������������0���� ���������$��������������� ���� ���������$��F#�������� ��$����0�������������� ��� 3���������$�������� ����������������,�/����H������������$������������#���F�
![Page 76: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/76.jpg)
���������������������
�ON�
�������������������������(�(�(� .���!�"�������������$������$����������������������� ��������%��-������������������G.�����!�������/���� ��)�����������#�����0�$�������������%������������������ ����$��%�$�����
3��������C�HF7�C74F!EG�DDH >7�$����������+�? 1�/�����C�H#���$������������������ �� ����$������������ 1�/�����7�C74���������������� ��$���������������������������� 1�/�����!EG�DDH���������������� �� ����$�������������$#���.�.LD�����6Local lnMiNumero
CLEAR
*--- Quita uno solo de los asteriscos de abajo y mira lo que sucede.
Luego ponlo a ese y quita otro. Todos son errores puestos a propósito.
TRY
* abc
* lnMiNumero = lnMiGranNumero
* do MiProcedure
* set printer ot
CATCH TO oExcepcion
lnErrorNro = oExcepcion.ErrorNo
lcMensaje = ""
do case
case lnErrorNro = 1
lcMensaje = "El archivo no existe"
case lnErrorNro = 10
lcMensaje = "Error de sintaxis"
case lnErrorNro = 12
lcMensaje = "La variable no existe"
case lnErrorNro = 16
lcMensaje = "Comando no reconocido"
case lnErrorNro = 36
lcMensaje = "El comando contiene una palabra no reconocida"
endcase
=StrToFile(DtoC(Date()) + " " + Time() + " Ocurrió el error Nº "
+ Transform(lnErrorNro) + " " + lcMensaje + " " + Chr(13),
"SISTEMA.ERR", .T.)
FINALLY
ENDTRY
Return
*
*
.���#�� ��$�������/���������$����������������#�����������0�����������%�0� �� ��"�� ���$��� 3E3C.L��.��� ��0������ ��� ���%�0� �� #���, ������� ��)��%����%����������������������������-��$���$/�5����'$������$������
![Page 77: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/77.jpg)
���������������������
�OO�
������#��0��.�$���$#�������#������������������ ��$���������������������H�������$���� ����#���-��� �� �������$,����$���$/�������#�����������$/�����#�� ��$����$/���������������$/��������$#������������ G������������%������������$������C�$/�5�#���-��%�/������#�������������������������7�C74�$�����������-������$#�����#���%�/���������= CATCH TO oExcepcion
lnErrorNro = oExcepcion.ErrorNo
lcMensaje = ""
do case
case lnErrorNro = 1
lcMensaje = "El archivo no existe"
case lnErrorNro = 10
lcMensaje = "Error de sintaxis"
case lnErrorNro = 12
lcMensaje = "La variable no existe"
case lnErrorNro = 16
lcMensaje = "Comando no reconocido"
case lnErrorNro = 36
lcMensaje = "El comando contiene una palabra no reconocida"
endcase
=MessageBox(lcMensaje)
H#����#����� ��%��0�������������������0��������������������� �������#�� ��$����� D� �$#������� � �- �� �� ��� �� ������������ C�HF .G1C�H ��#���������#������������������$�����������������+���$����� .�� %��, �� ������� �#�������� ��� $,� ����/�� � �� ��� ������� ����������������������� ������������ ����0�����<3�G1�.DL[C�1�.����@B ���$,� ��C�HF.G1C�H���� #���/������ �� ����$�� #���$������ ��������������������#���������������/������ �����$5����.����@B �����������������/������ .�����$5����#���$����#������#���������������������� ����������
![Page 78: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/78.jpg)
���������������������
�OQ�
������@��������C���� <�� �� ��� ������ 0������� �� ����$�� �� �����+�� ������ �� �� #���$������$���+�� �� ���� #�� ��$��� #�� ���$#��= ���� � ."���� �%��� 0���$�� ��$�����$���+������������� ��������#-����0���$����$�����$���+��."���� ��� ������� �� ������ !�"�� �� ����$�� ����$���+�� ���� �$#�+�$������������/�����������FL3�����
Local loWord
loWord = CreateObject("MSWORD")
with loWord
endwith
Release loWord
Return
*
*
H �%���� ������ ���J��%F���J��% �����/���$�� ����� ��� ������������� #���%������ �������$��������$#��=
�� 7���������0�����$������ �/���������$������ � �� ����"���� L����������"������ ��������/������������� L��������0����#��0���������$������ E$#��$��������$������ 6������������$����@��$��1�7��1!�����B�� 7�����������$����
����������������������������L3���1#�����$�����#��#�������=
DEFINE CLASS MSWORD AS CUSTOM
cNombreDocumento = ""
cNombreImpresora = ""
oWord = NULL
oDocumento = NULL
oRango = NULL
ENDDEFINE
D� #��#����� ��� �1������� $�������, �� ��$/�� ��� ����$���� ������$����������� D� #��#����� ��� �������� $�������, �� ��$/�� �� �� �$#������ �������$��������0���$����$#��$���1�/��������$/��������$#��������������������������$#��������
![Page 79: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/79.jpg)
���������������������
�O9�
.�0���� ��������� ��#��#������ �� ��G<DD>#�� �5���?#�� ��������������$�����/�������0�����������������/�����#���$����)��������$�G<DD�.����/����� ��������$��#��#��������$5����� ��/����� .� �� �/���� �1������� ������$�� ��� #��#������� � ��� $5����� �� ����)����������������$����� H�����/�������� ����#��#��������$5����� ������)����������� ��������$����� >7�$�%��-�$����$5����#�������������0�����$����? PROCEDURE AgregarDocumento
with This
.oWord = CreateObject("WORD.APPLICATION")
.oWord.Visible = .F. && No queremos que Word sea visible
.cNombreDocumento = ""
.oDocumento = .oWord.Documents.Add()
.oRango = .oDocumento.Range()
endwith
ENDPROC
>H#����/���������$�������"�������? PROCEDURE AbrirDocumento
LParameters tcNombreDocumento
with This
.oWord = CreateObject("WORD.APPLICATION")
.oWord.Visible = .F. && No queremos que Word sea visible
.cNombreDocumento = tcNombreDocumento
.oDocumento = .oWord.Documents.Open(.cNombreDocumento)
.oRango = .oDocumento.Range()
endwith
ENDPROC
3� ��$#���$�� �$/�� $5����� 0���$�� �� ��� /������� #��������� D� �����)��������� ������$5����� �1���������#���)���$������$/�� �� �����������$���� �� ����$���/�������$����$5����-���45����/����� ��� 3�$����$�����������$�����$5�����#��������+�������$,��������>K����$��$����������"������ �����? PROCEDURE FontNegrita
LParameters tlNegrita && debe ser .T. o .F.
This.oRango.Font.Bold = tlNegrita
ENDPROC
>K����$���$#��$��������$����? PROCEDURE ImprimirDocumento
with This.oWord
.ActivePrinter = This.cNombreImpresora
.PrintOut()
endwith
ENDPROC
![Page 80: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/80.jpg)
���������������������
�Q��
>K����$��$������������$����? PROCEDURE MostrarDocumento
This.oWord.Application.Visible = .T.
ENDPROC
.� �� #�� ��$� .�.LD�����6 �� ���$#�&� � ���� ����$���� #���,������������#�� ��$� �� �����/� ��"�� �������G�%� �������� ���#�� ��$�� �-#�� ����$���"������#������-�����������,��/����"#������� ����$���+�����1#�������$#������#�����������������$,��$#������������������ ��#���$����)�������������$������$#����������� ��������$�������������������������$���������#���/��� H��������������#���$�������+�����#��#��������$5����� ������)������#�����$#������#�������������$�&��������������� C�$/�5���/�$���������� ����/�$������#��������� ��#��� ��)�����������0������ ��#���$��� H ��#���#��������� �������-�����/�$����0�������������������@����������� �74�@��B�3�����%���$����-�����"�����������,����$��$��-����
![Page 81: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/81.jpg)
���������������������
�Q��
������@��������� ���� ����$���+��."�������#��� ��/������������#��������#����/������������������#�����������������/�������)�����������- ��0�����#�����/����$�%������� 7�����0�$��� ��/�������#�������."�������$������#������=
�� 6��/�������#����������0��� 6��/�������#��������"�������
.� �������#����%��������$#��%������/����������#��$���0�+����� ����
�#��������#��)���/��� 3� ����$�� ��� #������� ���0�� �������� �������� ����� �� ������ !�"������$�� ������������������/�����-�����������������������$/������������$��������������������$�&�������������������$/���������������%������������ ���-�#��� ���0� ���$#������ ����� ��0��������� � ����0�+ �� �� ����������/�������� ������������������� .� ��$/��� �� $���)���$�� ��� #������� �� �"������� �� ����$�� $��%� $,�),����>�� �5?#�� ����������������@�-��������#��������������������$/������������$���� ��#�� �� ������� �������� ����B �� ���, ������ �� �� #������� � �� '���� ��%���$���������������������������� 7��������� ��0���$���������������#����$��%������������ �������������$���������� ��������$����/������������ �����#����%�����$��%����$#�� G������������������������ ������=
DEFINE CLASS EXCEL AS CUSTOM
cNombrePlanilla = ""
oExcel = NULL
oAplicacion = NULL
ENDDEFINE
������������$��� �� ����)���������#������$������#���%������$,�'����#�������� ��������������0�#������������/�$������ ������#������$�����=
PROCEDURE NuevaPlanilla
with This
.oExcel = CreateObject("EXCEL.APPLICATION")
.oAplicacion = .oExcel.Application
with .oAplicacion
.Visible = .F.
.WorkBooks.Add()
endwith
endwith
ENDPROC
![Page 82: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/82.jpg)
���������������������
�Q��
H #��� �/��� ��� #������� �� �� ���-�$�� ��/��� �� �� ������ �����/�$�� ���� ������=
PROCEDURE AbrirPlanilla
LParameters tcNombrePlanilla
with This
.oExcel = CreateObject("EXCEL.APPLICATION")
.oAplicacion = .oExcel.Application
with .oAplicacion
.Visible = .F.
.WorkBooks.Open(tcNombrePlanilla)
endwith
endwith
ENDPROC
��������/����0����@��"����'$����)��%�B���������������$������ ������#������$������$��������������$����=
PROCEDURE EscribirCelda
LParameters tnFila, tnColumna, tuValor
This.oAplicacion.Cells(tnFila, tnColumna).Value = tuValor
ENDPROC
H#��� �/����� �� 0���� @��"��� �'$���� )��%�B �� �� ��������� �� ��� ����������$������ ������)���������$/�5�$����������=
FUNCTION LeerCelda
LParameters tnFila, tnColumna
Local lnValor
lnValor = This.oAplicacion.Cells(tnFila, tnColumna).Value
RETURN(lnValor)
H#���$������ ��#������� @�����#��� �����0���/�����������B ����$������#������$�������������-��$�=
PROCEDURE MostrarPlanilla
This.oAplicacion.Visible = .T.
ENDPROC
7�$� 0��� ����$���+�� ."��� �� $�� ),���� #���-�$�� � �� ���� �'� $��%��#������$������� )��������=#�����/��������������#���� ��"������ �������$/������������� ��"��������#�������� ����� ����� ����$�����������.�)����-��$���� ��%���)������)��$�����������+��� �������6�� ��� ������������� ��������#��0���,��������#������ ������������
![Page 83: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/83.jpg)
���������������������
�Q��
������������������������ <�� +'%$ �� 0�����$���� ���$�$��%� �� �������� �� �� ������ H ��� �� �� ����� ��#��0����������!�"���� )��$����,������$��/�����%��0���������� �� �� )����� � ��#���$��� �� ����#���%������$���� �$,� �������� ��������������������������$#���#���-�$��� �� ��������� ���������������-������=
�� K��������������������� '��������$����������%�������P ��/�� ��6�������������$��
�� K��$������ ��� ����� ��� �� ����� �������� �� ����� �� ��� ��$,� ����������$#�������$��������������$#��������������
�� K�� $������ ��� )���� �� ��������� �������� �� '� �� ��$#��� �� ���������������
�� K��$�������������������������$�����$5������� K��$������ �,)�������� ������������ K��#��$��������+��/'� �����
.���0����������$��������������!�"�������/�$��=
MODIFY CLASS GRILLA OF CONTROLES AS CONTAINER
7��������������$����������������������0�+'%$ ����$���6�EDD�� ���� ��/��, �� �� ���%�0� 7�GC��D.3��78 � �� ���, ������������ �� �� +'%$ 7�GC�EG.��>7���������#�� �5�����������?�� ���������+'%$ �� �����,������� ��������� ����$/�5������,��"�/�"� ��$������,��������������������$����#�������#���$��%���� ���������������$������6�E1�7��������+'%$ ��/������ ��$#����� #�� ��� � $,� �&. "�$ �������� ��/�$�� ������� ��� �� �/���������������#�����$#��������7�GC�EG.��7�D��.31.D�3!ED�3 <����$���� ������ �� �����$������ ��� )���� �� ��� ����� �� ��� ������� �������/��� ���$�=
Thisform.Grid1.SetAll("DynamicBackColor", ;
"IIF(MOD(RECNO(), 2)=0, RGB(255, 255, 255), RGB(0, 255, 0))", ;
"Column")
D�������������)������$���������)����#����@��;�N�Q�����B�������/���������)�����$#����@����I�O�9�����B�������0�����.���������������#��/�������� ����$��$�����������������#���F>��� ����$��$��������I�Q����������?���-����$�� ��� ����������= � �����+�$�� ��$����� �� )�������� EE!@B � �����+�$�� ���)������E7�3.@B�3���$/�� �%��������������0�$��%�$����=�����+����$5��������)������#��#�����#������+�������0��0���������� 3�#�� �$�� �� ����$��$���������)�����������������=
�� ����������$#�������� ���0��� A�����������$#�������,������������������ �+��������$#������$���� �����������
![Page 84: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/84.jpg)
���������������������
�Q;�
.��������������/��-�$��=ThisForm.Grid1.SetAll("DynamicBackColor", ;
“Thisform.ObtenerColor(MiCondicion)", "Column")
H��$5����C%��!��$��/�����7����@B#���-������ ���$���������=L[C�1��/�����7����D���$�������E$#����D������7����
������ ������E$#����_� ��7����U�6A@�II����B YY7�������� ������E$#����`U���G1���E$#����_U������� ��7����U�6A@�II��II��IIB YY7����/����� ������E$#����`������� ��7����U�6A@�����IIB YY7�����+�� �������������@��7����Baa
![Page 85: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/85.jpg)
���������������������
�QI�
��������������������� 7����� �� � �� �$�� �� ��$/�/�" � �� )��$������� �� %���$�� ����P ��� ��/���������%���/��5����� �����P��/�����#����(A������*0�$���� ���$�����=
�������GM;�
.���0������ ���#������ �� �������$��-����=(7�$/�A�"A������*����+�!$"#�+"�#���������7�$/�/�"� >H#��� �5���0�?��� )������������� ���������������$/�/�"=� �� ,������#���������� ������������������� ����������������� .�$��%�$,�),�����)��������$/�/�"�������������������� ����)���������������������$����#�������"����� H ��$� �� ������ !�"�� �� ��� /���� � ��� #�������F ��� #��$��� ������������������#�����������#��#�������������� ��������$����#���$�������+������������������#����)���������$/�5�#���$��������������������#��#����
![Page 86: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/86.jpg)
���������������������
�QN�
�3�3�3.6<E����7�.��<G7�G3C�<7C��
��� �������������0�������/�$��� �� �������#��#��������$���A<ED1.���� .�0���������#��#��������,����$/�� �������@������,B�����%�0������ 7���$�� �� ���%�0� ��6 �� ����/��, ��� #��,$����� � �� ���$��, � ��
)��$�������#�����$#��=
L�EG\6�EDD���6LParameters toMiObjeto, toParametro2
DO FORM CONFIGURAR_GRILLA with toMiObjeto, toParametro2
;�� 7���$�� �� ���0� )��$������� ��� ����� ��� �#������ �� �����$�� #���� ����#��������������������@���������$#��=7�G!E6<���\6�EDD�B
I�� 7���$�� �� ���0� #������� � #���$�� ��$� ���%�0� #�����#�� �� #�� ��$�����������#����@����������=L�EG\6�EDD���6B
N�� 4���$������P��/����/����(A����F*���� �$��(�##��������@�##BO�� .�� �$������$/��#�����������#��������@ ����/���� � �������$/�� ��
#���$������#��#����������#����B��� �����$��Q�� H����,
�%���������������$�������+��������������� �����/�$������������$#��$����
��� �� �$����������0��������)��$������@������������$#������ �����B�%���$������P�����/���������%���/��������������@���������$#����� �����B���� �����P��(A������F*�F0���$����)��$������ ��%�/-�$������������#���GM;� ���$�������$#���%�$�������������0�)��$���������%�$��� �� ������ ������#���$����$������/�������#�������$����/���������%����� �$�����#����(A������F*��������� �������$�������
�������GM;�
![Page 87: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/87.jpg)
���������������������
�QO�
����#����� ���������+�!$"#�+"�##�������$��%-��$�$,���$#����������$#��#���-�#��$���������� ������$/������������$�������#�������������$�&��� ��� ������� �� ����$�� ����/����� ������$�����$�������� ������� ����� ������#����������$��$��%-��$��� �����������������$�/������������ ��������������� ������� �� ���������� ������ .�������� �%��� �� ����$���� ��/�� ��$� ����� ���0�� ������� ��$/�5� ��/����$�� �� ������������������������������������������%��,�$��%�$,�0�������� 3� ��� ������ ��� %��,� #��� �� #��#�� ���� �������� ��+,� �� ��������� ������������������ #��� ������ #��� �� ������ �� ��������� �� �� ����� #������� ��� �����������������-���-�$��/���� ����� ����������������#���)��������������
�
![Page 88: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/88.jpg)
���������������������
�QQ�
�����������������;<� .��� )������#���� ����$���� ���$���#���$��'����G��#��$��� ����+����$5���������������������$5���������������� 4�� ��� ���$#��� �� �� �����+�� � �� ����� #���� 0���� ��$� )������� � ���������� ��#�����/�������������)������� .��������)��$������1.L����378#���0�������������
�������GM;�
7�$/������$�&�����0�������������������/���������� �%�+����P��/����/����(7����/������*�)-������ ������������/����0�������$�&����0����������������������������/������� C� ����$����� �� �������� �� )�������$����� �� ���� )��$������� �� ���#��������#���,��������$��'����
![Page 89: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/89.jpg)
���������������������
�Q9�
6�������������������������� ����������������������������
������7�� <���� ������ #" ) !" �"�, %����� ��� ��=
��� �� ����� ����������0����/������������������������������������ .������������������0����/������/���#���)��������#�������� �����#����� G����#������#���������������������������
<����$#������� ����)�����$������#������7������$#���#���-�$�������/��= $���@Bb
���L�G�$���.�����2 �%��L�G�$/��c;�d2 e 7�� �� ���� �� ����$�� ��L�G�$���.����� �� ��� 0����/�� �� ����$�������#���,�'$������������ ��L�G�$/�������0����/�� �����#���,��$�$,"�$�;������������ D� 0����/��L�G�$���.����� �� ���#���, ���������� �� �� 0����/��L�G�$/�����#���,�'$����������$#������������$�������+�������� ��������$����� ��������/������$�������������$#�������= L�G�$/��U���;IN2 .���$/���������!�"��������� �����0&�') !" �"�, %���.���$#���� ��#���$�������/��= L�G�$/��U(������* L�G�$/��U���;IN L�G�$/��U��O9 �5����#������%��������������0������#�����0����/��L�G�$/��� <� ��� ���� �� #" ) !" � "�, %�� ����� ��� 0������� � ��� ���0�������� D�0������ �� �� ���%�+��, ��� �������� �� �� ������#����� � �� ��#� ��������� ��0����/�� @��$� ��� ��� �������� ��$5����� �L�G�$/�� �� ��� �-���� ����������B � �����0�������� ��F���%�+��,������� ��������� .�����������������!�"��%��������������������=
4�J��=E$#��$���3���� C�#�� )��7������/������������/��7��� D������ ��� �-���� @��$� �$#��$����� �� ��#���� )����� #��� ������� �/����� �0����/��� �� ���� �B �� #���-� #����� �� �� ������ !�"�� ��� #��$��� �� �� ���$��������0���������)�����$������#�����
![Page 90: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/90.jpg)
���������������������
�9��
L,��/�������������$������/�-���� ������= C��$#��$�������� ��#�� .� �� ���� ���� �� %�� �� ���� �� ��,������3 #��� ����� ��� ��� �/����0��>!��������,?4$$$$F�#��/�$���.����/�$�������0�#�� ��$�= D�7�D��L�G�$����3EGC.6.����L�G�$/���33C�EG6 ��L�G�$���U(.���������"��* ��L�G�$/��U������ ?��L�G�$������L�G�$/�� .������$������#�� ��$�#���0�� ���������F� VVV���#����WWW��$�� ������#��������#�����= .���������"�� ������ D�����!��� & #D%��+�##�#���������,������3��#���������0��������!������� ������ #" ) !" �"�, %��� 7������,������3�-#���$���/��������E������3������)�������������� �����$����������������#����0����/������#���/����#�����$#��������������/�$������ �������-�������#�� ��$�=
�������GM;;
G�� ������ ������ ��� ��� ��#�� �� ����� ���#���/��� � ������ �����/�$�� EG�0�$�� ����#����������/����#���/��(E��� ��*�
![Page 91: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/91.jpg)
���������������������
�9��
.���������������������#������������������-������������0�������������!�"�� ���� ��� ���� )�����$���� ��#�����.� �����#���/���� �� ����� ����!���,� ��0������)�!"��� D� ���� ����� ��� $�������= �� ����� ���� �� �� ����� #��5/���� 0���)-�����3��$#����#��)���/��������5#��������������0�����������5�������������������%�/������$#��/����
![Page 92: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/92.jpg)
���������������������
�9��
������5������������E.1�11.3�D�D.7C<�� �0����#���$������������������ �����#��#���������������������������#���$��%����$��),���$���������$5�����33E6G���$�0�$�������� ���������$#��=
Local loSoloLectura
loSoloLectura = CreateObject("PROPIEDAD_SOLO_LECTURA")
with loSoloLectura
.cMiVariable = "Este es el nuevo texto"
? "Mi texto = " + .cMiVariable
endwith
Release loSoloLectura
Return
*
*
DEFINE CLASS PROPIEDAD_SOLO_LECTURA AS CUSTOM
cMiVariable = "Este es el valor original"
PROCEDURE cMiVariable_ASSIGN
LParameters tcValor
=MessageBox("Error, la propiedad cMiVariable es de solo
lectura")
*--- Quita el asterisco de la siguiente línea para asignar
* This.cMiVariable = tcValor
ENDPROC
ENDDEFINE
*
*
.� ���� ���� �� #��#����� .�"��� �� �� �� ���� �������� �� �� ��� ��$�� ��0����5����������,�)�������#��#��������������,�����0������������� .�$5�����L������/��\�33E6G����������, ����0�+ ���� �� ��� �� �� '�0�������#��#�����.�"��� ��� 3� ����$�� �� �� 0���� ��� ���� #��� � �� #��#����� �������� ��/�$�������/��= C%����L������/��U�������
![Page 93: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/93.jpg)
���������������������
�9��
>7fL�3�A.�3E<G��D�A��.3C^7���.7C�L.GC..37�EC�? �0���� ����$����/�������#���/��� �������/�����������������������������"�������������$���������������D�)��$�$,�������������/����������05���������$���+���������������$�0�$�������� ���������$#��=Local lcMiPalabra, loWord, llResultado
lcMiPalabra = "Visuel" && quiso escribir 'Visual'
loWord = CreateObject("WORD.APPLICATION")
llResultado = loWord.CheckSpelling(lcMiPalabra)
? "¿Existe la palabra " + lcMiPalabra + "? ", llResultado
Release loWord
Return
*
*
���E�AD.3H!<G7E�G.3.GD�37�CE�G C���� ��/�$�� �� #���$�� ��$/��� �� 0���� ��� ��#���� �� �� )��$�������/�������� ���������/���������$5������ ���$�= C%��!��$�7�#����U(.���������#������$�)��$������* C%��!��$�D�/����7�#����U(4�������-�*T1C�7@1�C.@BB H ��$/�5���/�$�� ��#���$����$/����������$���� ��#��#������#������%���$������P��/��������������� �����0��������#��#�������/����$����������#���$�����-��0���� �������������� 3���$/�� ���������!�"�����������#���/���������� ��$��#��� �����������.���0��������#��#��������/����$�����������������/�$��= U*4�������-�(T1C�7@1�C.@BB D��$#�������� �-������������-$/������ ������@UB������������� ��������#���$������������)�������� ���$��0�������$#������)��$������1.L��Q�378><3��.DL[C�1�+6- 45�D���E.1�1"�+�/�����L�3C���<G!��L<D��E�? 4�����)��$��#���/�����$��������)��$�������#���$�������/��= ��L�!��$�������34��@B �#���$�������/��= ��L�!��$�����������/��U�C�
![Page 94: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/94.jpg)
���������������������
�9;�
>7�,�������)����������,���$����?
.�$5����+6- 45$�������� )��$������� ����� ��� ��#��#�����"��� ����0�����C�
D���)������������+6- 45���"��� ���� ��34��@B����$5�������� ��#����� �����/�� ���� � ������ �� 5�� .� ��$/�� � �� #��#����� ����$���� �� #����0���������)�����
.�� �$#���� ������������$�������� )��$������ ��$/�5� ������%������������ �������� ����-�� �� $5���� +6- 45 #��� �� �� '���� �� �� �������� �� �� ��)��$���������50���/����������#����������+������� ��������������>7fL� 3�A.� 7<�D.3 3�G D�3 ���E�AD.3 1.7D���1�3 .G <G�!<G7EfG���7.1ELE.GC�? 3�������%�/���������E������3������������������/�-'�+���� �����#������/��������-0��,���������0����/��� ��%������������7�L�7�LAE��D�3��D��.31.D�3��E.1�1.31.<G�6�EDD� En modo ejecución, con la función SetAll():
ThisForm.Grid1.SetAll('WIDTH', 40, 'COLUMN')
En modo diseño, selecciona la grilla, y escribe en la ventana
de comandos:
ASelObj(laGrilla, 1)
laGrilla[1].SetAll('Width', 120, 'column')
Release laGrilla
����0����)��$�������$����� ������0��,� ��F������������$�����������$��$����%������������������%������#�"����� �� ��#����� �� #����� �����+�� ����� #��#������� ��$/�5� �� �� ������@A��P7�����!���7�����!���G�$��!���3�+������B�
![Page 95: Clases en Visual Foxpro 9-Libre](https://reader034.vdocuments.pub/reader034/viewer/2022042514/563dbac7550346aa9aa7f7d3/html5/thumbnails/95.jpg)
���������������������
�9I�
��������� 7�$���%�/�,�������������#��������$����� ������������������!�"�������� �����)-��������$#�����������������)5�����C�������0��������-�#���������$���� ����������$#��+���#������������� �'�%��$��%�$,� ��#������#��������/������������� �-����%����%�������/��������#��������$������� ���%��������������$������#������$#�+���������#��$����#����� .� )�����$���� ��������/�� �� ������ �� ��$�������� #�� �� �� )����� �� ������ �������#�� ��$����� ������ ������� ���, ���-� ���0������� ���$��%��� ��$�%�/�,�#�������$#��/�����#�5���������������$����� 7�$����$#����#�� ��$������ �� �$#��������� ��#����� ���$��%����- ����$��,���#�������������,�$��� ������������� �������� ��$/�5� �� %�� $��%�� ���$#��� �� �� ����� ����� �� �� ���#�������������� ������������$������������"#������������%���������������� �-#��)���������$#����������� ����%�/�������������%�/�����������0������-��$,���#�/������� ��%����-��� ����������$#������,����-���#������ �������0����� 7��� ���� ����� �� �������� ��������� � ���������� �� ������ �����+��� #�������$�����������$� ��$���$���� �����$#�����,�/���0������������/�����/���������
���������������������J��0g%��$������$