Portal    Foro    Buscar    FAQ    Registrarse    Conectarse


Publicar nuevo tema  Responder al tema 
Página 1 de 1
 
 
Optimizacion De Código De Novato A Código Inteligente!!
Autor Mensaje
Responder citando   Descargar mensaje  
Mensaje Optimizacion De Código De Novato A Código Inteligente!! 
 
Buenas,

dejo un ejemplo de como a medida que pasa el tiempo uno mejora y empieza a programar de forma normal...
y el contraste entre un código de novato en gambas y un código de un programador normal  


Public Sub btnInsertar_Click()
   Dim EsteCheckBox As CheckBox
   Dim EsteHijo As Object
  
   ' CODIGO INTELIGENTE....
  
   For Each EsteHijo In Me.Children
     If Object.Is(EsteHijo, "CheckBox") = True Then
        EsteCheckBox = EsteHijo
        
        If EsteCheckBox.Value = True Then
           NuevaOrden.txtaDatos.Text &= gb.NewLine & EsteCheckBox.Text & ": OK/Mal"
        Endif
        
        If Marcado = False Then
           Settings["ChequeoOpciones/index"] = cbxEleccion.Index  
           Settings["ChequeoOpciones/" & EsteCheckBox.Name] = EsteCheckBox.Value
        Else
           Settings["ChequeoOpciones/index"] = 0
           Settings["ChequeoOpcionesPersonalizado/" & EsteCheckBox.Name] = EsteCheckBox.Value
        Endif
    
        Settings.Save
      
     Endif
   Next
    
  'CÓDIGO DE NOVATO
  
  '  NuevaOrden.txtaDatos.Text &= gb.NewLine
  '
  ' If chkBMem.Value = True Then
  '   NuevaOrden.txtaDatos.Text &= gb.NewLine & "Memoria: OK/Mal"
  '    ' Lista &= gb.NewLine & "Memoria: OK/Mal"
  ' Endif
  '
  ' If chkBDisco.Value = True Then
  '    NuevaOrden.txtaDatos.Text &= gb.NewLine & "Disco: OK/Mal"
  '    ' Lista &= gb.NewLine & "Disco: OK/Mal"
  ' Endif
  '  
  ' If chkBRed.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Red: OK/Mal"
  ' Endif
  '
  ' If chkBFuente.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Fuente alimentacion: OK/Mal"
  ' Endif
  '
  ' If chkBPila.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Pila: OK/Mal"
  ' Endif
  '
  ' If chkBWifi.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Wifi: OK/Mal"
  ' Endif
  '
  ' If chkBTarjetaSD.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Tarjeta SD: OK/Mal"
  ' Endif
  '
  ' If chkBbateria.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Bateria: OK/Mal"
  ' Endif
  '
  ' If chkBusb2.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Usb 2.0: OK/Mal"
  ' Endif
  '
  ' If chkBusb3.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Usb 3.0: OK/Mal"
  ' Endif
  '
  ' If chkBCD_DVD.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "CD/DVD: OK/Mal"
  ' Endif
  '
  ' If chkBMicrofono.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Microfono: OK/Mal"
  ' Endif
  '
  ' If chkBAuriculares.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Auriculares: OK/Mal"
  ' Endif
  '
  ' If chkBcargador.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Cargador: OK/Mal"
  ' Endif
  '
  ' If chkBWebcam.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Webcam: OK/Mal"
  ' Endif
  '
  ' If chkBParlantes.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Parlantes: OK/Mal"
  ' Endif
  '
  ' If chkBTouchpad.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Touchpad: OK/Mal"
  ' Endif
  '
  ' If chkBTeclado.Value = True Then
  '     NuevaOrden.txtaDatos.Text &= gb.NewLine & "Teclado: OK/Mal"
  ' Endif
  '
  ' ' NuevaOrden.txtaDatos.Insert(Lista)
  '
  '   If Marcado = False Then
  '     Settings["ChequeoOpciones/index"] = cbxEleccion.Index
  '    
  '     Settings["ChequeoOpciones/" & chkBDisco.Name] = chkBDisco.Value
  '     Settings["ChequeoOpciones/" & chkBMem.Name] = chkBMem.Value
  '     Settings["ChequeoOpciones/" & chkBRed.Name] = chkBRed.Value
  '     Settings["ChequeoOpciones/" & chkBFuente.Name] = chkBFuente.Value
  '     Settings["ChequeoOpciones/" & chkBPila.Name] = chkBPila.Value
  '     Settings["ChequeoOpciones/" & chkBWifi.Name] = chkBWifi.Value
  '     Settings["ChequeoOpciones/" & chkBTarjetaSD.Name] = chkBTarjetaSD.Value
  '     Settings["ChequeoOpciones/" & chkBbateria.Name] = chkBbateria.Value
  '     Settings["ChequeoOpciones/" & chkBusb2.Name] = chkBusb2.Value
  '     Settings["ChequeoOpciones/" & chkBusb3.Name] = chkBusb3.Value
  '     Settings["ChequeoOpciones/" & chkBCD_DVD.Name] = chkBCD_DVD.Value
  '     Settings["ChequeoOpciones/" & chkBMicrofono.Name] = chkBMicrofono.Value
  '     Settings["ChequeoOpciones/" & chkBAuriculares.Name] = chkBAuriculares.Value
  '     Settings["ChequeoOpciones/" & chkBcargador.Name] = chkBcargador.Value
  '     Settings["ChequeoOpciones/" & chkBWebcam.Name] = chkBWebcam.Value
  '     Settings["ChequeoOpciones/" & chkBParlantes.Name] = chkBParlantes.Value
  '     Settings["ChequeoOpciones/" & chkBTouchpad.Name] = chkBTouchpad.Value
  '     Settings["ChequeoOpciones/" & chkBTeclado.Name] = chkBTeclado.Value
  '    
  '   Else
  '     Settings["ChequeoOpciones/index"] = 0
  '    
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBDisco.Name] = chkBDisco.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBMem.Name] = chkBMem.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBRed.Name] = chkBRed.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBFuente.Name] = chkBFuente.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBPila.Name] = chkBPila.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBWifi.Name] = chkBWifi.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBTarjetaSD.Name] = chkBTarjetaSD.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBbateria.Name] = chkBbateria.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBusb2.Name] = chkBusb2.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBusb3.Name] = chkBusb3.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBCD_DVD.Name] = chkBCD_DVD.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBMicrofono.Name] = chkBMicrofono.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBAuriculares.Name] = chkBAuriculares.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBcargador.Name] = chkBcargador.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBWebcam.Name] = chkBWebcam.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBParlantes.Name] = chkBParlantes.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBTouchpad.Name] = chkBTouchpad.Value
  '     Settings["ChequeoOpcionesPersonalizado/" & chkBTeclado.Name] = chkBTeclado.Value
  '  Endif
  '  
  '  Settings.Save
  '
  Me.Close

End

 




===================
Software libre, programación libre, vida libre es la Public function Libertad()as Invendible
Proyectos: VisorRV1960,Taller2015,Tanteador
https://sourceforge.net/u/v3ctor-full/profile/
Blog: http://novatocodegambas.blogspot.com.uy/
 
v3ctor - Ver perfil del usuarioEnviar mensaje privadoVisitar sitio web del usuario 
Volver arribaPágina inferior
Responder citando   Descargar mensaje  
Mensaje Re: Optimizacion De Código De Novato A Código Inteligente!! 
 
jajaj hay un error ahí, el settings.save va después de salir del bucle for   que bruto madre mía jajajja
 




===================
Software libre, programación libre, vida libre es la Public function Libertad()as Invendible
Proyectos: VisorRV1960,Taller2015,Tanteador
https://sourceforge.net/u/v3ctor-full/profile/
Blog: http://novatocodegambas.blogspot.com.uy/
 
última edición por v3ctor el Sabado, 09 Enero 2016, 22:43; editado 1 vez 
v3ctor - Ver perfil del usuarioEnviar mensaje privadoVisitar sitio web del usuario 
Volver arribaPágina inferior
Responder citando   Descargar mensaje  
Mensaje Re: Optimizacion De Código De Novato A Código Inteligente!! 
 
Si que era grande el código.  

Citar:

...y el contraste entre un código de novato en gambas y un código de un programador normal  


Hombre, que los programadores novatos tambien son programadores normales..  
Quizás programador "formal".  Aunque no creo que algunos compañeros estén de acuerdo con la palabra "formal".  

Citar:

jajaj hay un error ahí, el settings.save vas después de salir del bucle for que bruto madre mía jajajja


Pues si, eso se coló.

La experiencia la da la practica. Si repasáramos muchos de los códigos que hicimos años atrás, veríamos que se podía haber hecho
de otra forma.

Tengo los ejemplos por meses y año y hay ejemplos de otras fechas que los voy modificando e incorporando a fechas más actuales,
dejando el anterior su carpeta de fecha antigua. Pero son cosas casuales y puntuales que se está viendo en el momento. Repasar todo los ejemplos,
de uno en uno es algo más complejo.

Por otro lado, cuando vamos haciendo muchos ejemplos, nos damos cuenta que nos repetimos una y otra vez. Mejorando claro.
O por que estamos repasando algo. Como olvidamos...

Saludos
 




===================
Gambas Básico
"No es un bug, es una característica no documentada"
 
Shell - Ver perfil del usuarioEnviar mensaje privadoVisitar sitio web del usuario 
Volver arribaPágina inferior
Mostrar mensajes anteriores:    
 
OcultarTemas parecidos
Tema Autor Foro Respuestas último mensaje
No hay nuevos mensajes Ver Código De Una Web Ayortano General 2 Viernes, 09 Abril 2010, 19:56 Ver último mensaje
Invitado
No hay nuevos mensajes Código C++ En Gambas. francopenizzotto General 2 Viernes, 28 May 2010, 19:39 Ver último mensaje
jguardon
No hay nuevos mensajes Manteniendo El Código Programas Relacione... portaro General 2 Jueves, 23 Abril 2015, 21:32 Ver último mensaje
portaro
No hay nuevos mensajes Scratch To Gambas Algun Amigo Podria Hacer... portaro General 6 Jueves, 26 Julio 2018, 07:43 Ver último mensaje
Shell
 

Publicar nuevo tema  Responder al tema  Página 1 de 1
 

Usuarios navegando en este tema: 0 registrados, 0 ocultos y 1 invitado
Usuarios registrados conectados: Ninguno


 
Lista de permisos
No puede crear mensajes
No puede responder temas
No puede editar sus mensajes
No puede borrar sus mensajes
No puede votar en encuestas
No puede adjuntar archivos
Puede descargar archivos
No puede publicar eventos en el calendario



  

 

cron