Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #14  
Antiguo 27-08-2010
Avatar de julyus
julyus julyus is offline
Miembro
 
Registrado: jul 2006
Ubicación: IN TO PLACES COLOMBIA AND EE.UU
Posts: 121
Poder: 18
julyus Va por buen camino
Talking segunda pregunta

eficsa gracias por tu explicacion me ayudo mucho el tema y un poco de ver codigo basico

ahora tengo otra pregunta cree dentro de esta funcion que retorna un array tipo variant otro array para irle asignando unos valores en los campos
mi pregunta es el array ListArray es igual de tipo variant no se si debo crearlo asi
i:interger
i = 0;
....
ListArray[i] := valor;
i := i +1

para ir incrementado la posicion que solo tiene un valor

ver parte del código

Código Delphi [-]
function TFMListenerService.GetEventCodeArray(cIOElement : TIOElement): TArrayList;
var
i:integer;
ADOSP : TADOStoredProc;
Conn: Iconnection;
sVehicleId, iCompanyId : string;
Factor, AccelDecel, iCurrSpeed : double;
ListArray : TArrayList; //para ir acumulando  listado array que de sebe regresar de la funcion
begin

  //rrecorrido de eventos
  //try
     if (cIOElement.ElementEvent.iEventIOId = 0) then  //No hay evento significativo
      begin

        // Se verifica Conexion Desconexion
         if cIOElement.ElementValue(66) >= 6000 then
         begin
             ListArray[i] := 24;//System Connect.

         end
         else
         Begin
             ListArray[i] := 25; //System Disconnect.

         end;
        //----------------------------------------------------------------------

        //Se verifica si hay evento de Boton de Panico

        if cIOElement.ElementValue(1) =1 then
        begin
            ListArray[i] := 31 // Alert Button

        end;
        //----------------------------------------------------------------------


        //Se debe verificar si el vehiculo está encendido.
        if cIOElement.ElementValue(10) >= 2000 then

        begin
          if cIOElement.ElementValue(240) = 0 then //Si no está en movimiento
            ListArray[i] := 3 //Time Passed
          else
            ListArray[i] := 4; //Distance Passed
         end;
         //----------------------------------------------------------------------

         //iCurrSpeed := cIOElement.ElementEvent.aElements[0];
         //----------------------------------------------------------------------
         //
         try
         Conn := ConnPool.GetConnection;
         //ejecuto el storeprocedure
         ADOSP.Connection := Conn.Connection; // paso el string de conexion
         ADOSP.ProcedureName := 'GetOverRpm'; // pongo el nombre del SP que voy a utilizar
         ADOSP.Parameters.Refresh; // creo los parametros que espera el SP
         ADOSP.Parameters.ParamByName('@CompanyId').Value  := iCompanyId;
         ADOSP.Parameters.ParamByName('@CarNumber').Value  := sVehicleId;
         ADOSP.Parameters.ParamByName('@Factor').Value  := Factor;
         ADOSP.Parameters.ParamByName('@EventType').Direction := pdInputOutput;
         ADOSP.Parameters.ParamByName('@EventCode').Direction :=  pdInputOutput;
         ADOSP.Open;
         factor:= pdInputOutput[0];

         finally
         ADOSP.Close;
         ADOSP.Free;
         end;
        //asigno a el arreglo

        if cIOElement.ElementValue(11) = 0 then //Si no está en movimiento
         begin
           ListArray[i] := 21 //OverRpm

          //----------------------------------------------------------------------
         end;
       Result:= ListArray;
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Cosulta de BDF no regresa nada eduardo_2009 Tablas planas 3 21-08-2007 15:00:49
??que regresa un query?? david duarte Tablas planas 5 22-05-2006 17:04:53
Funcion SUM me regresa una cadena paty_rlopez Firebird e Interbase 6 18-04-2006 15:13:10
SQLClientDataSet no regresa lo esperado EITB OOP 2 27-09-2004 18:45:25
Como devuelvo un Arreglo en Función Prophoenix Varios 1 30-05-2003 19:40:58


La franja horaria es GMT +2. Ahora son las 22:37:53.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi