Como Justificar completo impresion campo memo

HMG en Español

Moderator: Rathinagiri

Post Reply
gabrieloq
Posts: 46
Joined: Thu Jan 24, 2013 9:45 pm
Location: Bucaramanga

Como Justificar completo impresion campo memo

Post by gabrieloq »

Hola a todos, les agradeceria si me pueden ayudar necesito imprimir varios campos memos pero el problema es que deben justificarse tanto a la izquierda como a la derecha.
asi lo estoy haciendo pero sin justificar

cVar := strtran( Formulas->Detalle, ";", ' ')

if len( cVar ) > 0
nLinx := MLCOUNT( cVar, 130 )
for nLin := 1 to nLinx
cImpr := MEMOLINE( cVar, 130, nLin )
nLinea += 3
@ nLinea, 12 PRINT cImpr FONT "Arial" SIZE 7
next
nLinea += 8
endif
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Como Justificar completo impresion campo memo

Post by Pablo César »

Hola Gabriel,

Para conseguir un resultado más rápido y menos dificil. Debes utilizar fuentes monospace, es decir fuentes que tengan el mismo tamaño en cada caracter.

Si te fijas en el código del STRU, en la funcion MyAlert verás otros llamados que arreglan el texto: FixText y Split. Fijate si te sirve, pero tienen que ser en "Courier New", ok ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Jairo Maia
Posts: 53
Joined: Sun Jul 17, 2011 1:47 pm
Location: Campinas - SP - Brazil

Re: Como Justificar completo impresion campo memo

Post by Jairo Maia »

(Bing translator)
Hola Gabriel,

Ver si eso también te da una idea:

Code: Select all

cVar := StrTran( Formulas->Detalle, ";", ' ')

If Len( cVar ) > 0
 nLinx := MlCount( cVar, 130 )
 For nLin := 1 to nLinx
  cImpr := MemoLine( cVar, 130, nLin )
  cImpr := JustMemo( cImpr )
  nLinea += 3
  @ nLinea, 12 PRINT cImpr FONT "Arial" SIZE 7 
 Next 
 nLinea += 8 
EndIf

Function JustMemo( cLine )
 Local cSpace := Space( 1 )
 Local nLenLine := Len( cLine )

 If Right( Trim( cLine ), 1 ) != "." .And. At( " ", Trim( cLine ) ) > 0

  cLine := Trim( cLine )

  While ( nLenLine - Len( cLine ) > 0 )
   nRepeat := ( nLenLine - Len( cLine ) )
   If ( nRepeat > 0 )
    cLine := StrTran( cLine, cSpace, cSpace + cSpace, 1, nRepeat )
   EndIf
  EndDo

 EndIf

Return cLine
gabrieloq
Posts: 46
Joined: Thu Jan 24, 2013 9:45 pm
Location: Bucaramanga

Como Justificar completo impresion campo memo

Post by gabrieloq »

Gracias Jairo era lo que estaba necesitando, le agradezco su colaboracion eres un mago.
Post Reply