No se en que version del sis. operativo estes por que creo que de la V5R2 ya se puede hacer, yo por lo pronto utilizo esta funcion y la utilizo asi
D*---------------------------------------------------------------*
D* Prototipos
D*---------------------------------------------------------------*
D #CtoN PR 30P 9
D PR_Char 32 VALUE
//
varnum = #cton(varchar);
//
espero te sirva
Saludos
Gerardo Santillana
IT Department
Delphi Mechatronic Systems
Phone USA (956) 554 5832
Phone MX 01868 8128163 x.5832
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Nelson Brizuela
Sent: Thursday, June 02, 2005 5:44 PM
To: [email protected]
Subject: Formato free
Hola foro;
Conocen alg�n truquito para convertir un campo alfab�tico a num�rico en
formato free?
Salu2. Nelson
__________________________________________________
Forum.HELP400 es un servicio m�s de NEWS/400.
� Publicaciones Help400, S.L. - Todos los derechos reservados
http://www.help400.es
_____________________________________________________
Para darte de baja visita la siguente URL:
http://coyote.combios.es/mailman/listinfo/forum.help400
****************************************************************************************
Note: The information contained in this message may be privileged and
confidential and thus protected from disclosure. If the reader of this message
is not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby notified that
any dissemination, distribution or copying of this communication is strictly
prohibited. If you have received this communication in error, please notify us
immediately by replying to the message and deleting it from your computer.
Thank you.
**************************************************************************************** *//////////////////////////////////////////////////////////////*
* (#CtoN) Convert Character to Numeric *
* *
* Use: #CtoN(Character_Representation_of_Number) *
* *
*//////////////////////////////////////////////////////////////*
P #CtoN B EXPORT
*--------------------------------------------------------------*
D #CtoN PI 30P 9
D Char 32 VALUE
*
D DS
D Char1 1
D Num1 1 0 OVERLAY(Char1) INZ
*
D Num S 30P 9
D WrkNum S 30P 0
D Sign S 1 0 INZ(1)
D DecPos S 3 0
D Decimal S 1 INZ('N')
D i S 4 0
D j S 4 0
*--------------------------------------------------------------*
C eval Char = %triml(Char)
C ' ' CHECKR Char j 99
*
C if (not *IN99)
C eval j = %size(Char)
C endif
*
C 1 do j i
C eval Char1 = %subst(Char:i:1)
*
C select
C when (Char1 = '-')
C eval Sign = -1
C when (Char1 = '.')
C eval Decimal = 'Y'
C when (Char1 >= '0') and (Char1 <= '9')
C eval WrkNum = (WrkNum * 10 + Num1)
*
C if (Decimal = 'Y')
C eval DecPos = (DecPos + 1)
C endif
*
C endsl
*
C enddo
*
C eval(h) Num = (WrkNum * Sign / (10 ** DecPos))
C RETURN Num
*--------------------------------------------------------------*
C *PSSR BEGSR
C RETURN 0
C ENDSR
*--------------------------------------------------------------*
P #CtoN E
*//////////////////////////////////////////////////////////////*
