Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   Problema con el caracter ' (https://www.clubdelphi.com/foros/showthread.php?t=61257)

Sr.Scorpion 31-10-2008 18:20:31

Problema con el caracter '
 
Hola

Tengo el siguiente problema tengo un reporte en donde tengo q procesar la duracion y se me puede mostrar de la siguiente forma 00:00'17 ó 00:00:17 tengo la siguiente condicion

Código Delphi [-]
 If (Copy(Cad,Pos(':',Cad) + 3,1) = ':') or (Copy(Cad,Pos(':',Cad) + 3,1) = ''') Then

por supuesto q me da error.... en la ultima condicion... alquien se sabe el equivalente en hexadecimal o lo q sea para sustituir el caracter '

Saludos

StartKill 31-10-2008 18:25:15

Holas

Original del Sr. Scorpion
Cita:

If (Copy(Cad,Pos(':',Cad) + 3,1) = ':') or (Copy(Cad,Pos(':',Cad) + 3,1) = ''') Then

por supuesto q me da error.... en la ultima condicion... alquien se sabe el equivalente en hexadecimal o lo q sea para sustituir el caracter '
If (Copy(Cad,Pos(':',Cad) + 3,1) = ':') or (Copy(Cad,Pos(':',Cad) + 3,1) = char(39)) Then

Your friend

StartKill
Lima-Perú

DarkMan 31-10-2008 18:39:20

Mirando la ayuda de delphi:
Cita:

A character string, also called a string literal or string constant, consists of a quoted string, a control string, or a combination of quoted and control strings. Separators can occur only within quoted strings.
A quoted string is a sequence of up to 255 characters from the extended ASCII character set, written on one line and enclosed by apostrophes. A quoted string with nothing between the apostrophes is a null string. Two sequential apostrophes in a quoted string denote a single character, namely an apostrophe. For example,
'BORLAND' { BORLAND }
'You''ll see' { You'll see }
'''' { ' }
'' { null string }
' ' { a space }
A control string is a sequence of one or more control characters, each of which consists of the # symbol followed by an unsigned integer constant from 0 to 255 (decimal or hexadecimal) and denotes the corresponding ASCII character. The...
Sería de esta forma:
Código Delphi [-]
If (Copy(Cad,Pos(':',Cad) + 3,1) = ':') or (Copy(Cad,Pos(':',Cad) + 3,1) = '''') Then

Sr.Scorpion 31-10-2008 18:57:19

Todo resuelto... muchas gracias


La franja horaria es GMT +2. Ahora son las 18:35:35.

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