Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 02-03-2015
CM6ISG CM6ISG is offline
Registrado
NULL
 
Registrado: feb 2015
Posts: 4
Poder: 0
CM6ISG Va por buen camino
Hola Necesito ayuda con Cortar Cadenas en Delphi 7

Saludos: Gracias por acudir en mi ayudad, hice la simulación y todo perfecto, exactamente eso es lo que necesito hacer. Pero cuando fui a implementarlo entre las propiedades y funciones del ComPort que tengo no encuentro (Output_CportLib), la versión que tengo es ComPort Library ver. 2.64, estoy usado Delphi 7, Windows 7 Professional x32
Use ComPort1.ReadStr, que la que he probado y me funciona,
A la hora de compilar me da el siguiente error

Project Catsimulado.exe raised exception class EStringListError with message ‘List index out bounds (1)’. Process stopped. Use Step or run to continue.
no logro determinar donde esta el error.

Código Delphi [-]
unit simulacion;      
 interface       uses     Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,     Dialogs, StdCtrls, CPort;
type   
  TForm1 = class(TForm)  
 Memo1: TMemo;
 Edit1: TEdit;
 Edit2: TEdit;
 Edit3: TEdit;
 Edit4: TEdit;
 Edit5: TEdit;  
 Edit6: TEdit;
 Label1: TLabel; 
 Label2: TLabel;
 Label3: TLabel;
 Label4: TLabel; 
 Label5: TLabel;
 Label6: TLabel; 
 Label7: TLabel;
 Button1: TButton; 
 ComPort1: TComPort;

  procedure ComPort1RxChar(Sender: TObject; Count: Integer);
  private       { Private declarations }     
  public       { Public declarations } 
  end;    

 var     
 Form1: TForm1;      
 implementation
   {$R *.dfm} 
 procedure TForm1.ComPort1RxChar(Sender: TObject; Count: Integer);

 var      
StrList: TStringList;
Power, Qsl, Modo, FTX, FTR, Str : String;   

    begin
   ComPort1.ReadStr(Str, Count);
   StrList := TStringList.Create;  
   ExtractStrings(['#'], [], PChar(Str), StrList);   
   
   Power := StrList[0];      
   Qsl := StrList[1]; 
   Modo := StrList[2];  
   FTX := Copy(StrList[3],3,Length(StrList[3]));  
   FTR := Copy(StrList[4],3,Length(StrList[4]));      
   Memo1.Text := Str;
   Edit1.Text := Str;
   Edit2.Text := Power;   
   Edit3.Text := Qsl;   
   Edit4.Text := Modo;    
   Edit5.Text := FTX;  
   Edit6.Text := FTR;    
   StrList.Free;  
   end;   
end.

Gracias colega por tu respuesta, tan rápido.
Imágenes Adjuntas
Tipo de Archivo: jpg Error.JPG (23,3 KB, 4 visitas)

Última edición por CM6ISG fecha: 02-03-2015 a las 06:15:22. Razón: Arreglando etiquetas
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

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
como puedo cortar un string? avrils Varios 2 07-03-2011 22:24:12
¿Como puedo cortar el form show? silvana Varios 1 05-08-2008 15:30:29
Cortar cadenas por la derecha VRO Varios 4 22-09-2004 16:30:38
Como cortar filtrado miguelb Varios 4 28-11-2003 17:02:57
como cortar texto de un edit superhopi Impresión 1 10-06-2003 13:03:03


La franja horaria es GMT +2. Ahora son las 00:22:45.


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