Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Align fiels in text string
Message
From
15/11/2021 06:43:15
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Align fiels in text string
Miscellaneous
Thread ID:
01682722
Message ID:
01682722
Views:
56
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
Next
Reply
Map
View

Click here to load this message in the networking platform