Códigos en varios lenguajes 001

Page 1

Códigos nuevos *Sentencias de control en VB6 / .NET 1. Uso de Do..While..Loop Dim tuNombre As String Do While tuNombre <>"Quitar" tuNombre=InputBox("Tu nombre (Quitar para salir): ","Aviso","") If tuNombre<>"Quitar" Then TextBox1.Text=tuNombre Loop 'otra forma Do tuNombre=InputBox("Tu nombre (Quitar para salir): ","Aviso","") If tuNombre<>"Quitar" Then TextBox1.Text=tuNombre Loop While tuNombre <>"Quitar" 2. Uso de estructuras 'en un módulo .bas Public Type IngeEconomica Dim Valor As Double Dim Tasa As Double Dim Periodo As Integer End Type 'también puede ser Public Public inge As IngeEconomica 'en un formulario Option Explicit ' esto se ocupa para definir variables o funciones 'esto puede estar dentro de un botón o dentro del Form principal With inge .Valor=CDbl(Text1.Text) .Tasa=CDbl(Text2.Text) .Periodo=CDbl(Text1.Text) End With 3. Uso de clases 'en un módulo clase llamado CIngenieria 'pueden ser Private o Public Public Valor As Double Public Tasa As Double Public Periodo As Integer 'métodos Set, Let y Get, se puede omitir Let Property Get nValor() As Double nValor=Valor End Property 'nota: tener en cuenta la síntaxis


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
Códigos en varios lenguajes 001 by Fernando Carraro Aguirre - Issuu