Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Align fiels in text string
Message
De
15/11/2021 06:43:15
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Align fiels in text string
Divers
Thread ID:
01682722
Message ID:
01682722
Vues:
57
Hello comunity,

I want to concatenate a string with a numeric field turned to a string, but I need to align the numeric values ​​to my right.
For that I fixed a length for my string field of 30 characters and then I add my numeric field transformed into a string.
However, I can't get the numerical values ​​to be all right-aligned.
Parameters iduvaltsql
lcRetval = ''

Select PRRE
Scan

	TEXT to msel textmerge noshow pretext 7
		select REM , ERE, CR from prre where prre.ere > 0  and prre.prstamp = '<<Alltrim(iduvaltsql)>>'
		And prre.prrestamp = '<<Alltrim(prre.prrestamp)>>'
	ENDTEXT

	If u_sqlexec(msel,[CrsREM])
		Select CrsREM
		If CrsREM.ERE > 0 And Not Inlist( CrsREM.CR,21,26)
text to lcTextRem textmerge noshow
<<PADL(CrsREM.REM,30)>><<PADL(astr(Transform(CrsREM.ERE,'999999999.99')),19,' ' )>>
endtext

 			lcRetval = lcRetval + lcTextRem + Chr(13)		Else
			If CrsREM.ERE > 0 And  Inlist( CrsREM.CR,21,26)
text to lcTextRem textmerge noshow
<<PADL(CrsREM.REM,30)>><<PADL(astr(Transform(CrsREM.ERE,'999999999.99')),19,' ')>>
endtext
 				lcRetval = lcRetval + lcTextRem + '  (*)' + Chr(13)
			
			Endif
		Endif
	Else
		msg(msel)
	Endif
Endscan

Return lcRetval
Any suggestions to solve it?
Note: see image

Many thanks,
Best regards,
Luis
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform