Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 5 Jahren, 4 Monaten
Letzter Beitrag:
vor 5 Jahren, 4 Monaten
Beteiligte Autoren:
Al, Arie, Randall

Lpad for WebDev... Complete for Rpad

Startbeitrag von Randall am 05.03.2013 19:02

Is there something that serves the purpose of SQL lpad in WebDev? Complete appears to serve the purpose of rpad.

Many thanks to those who reply...

Antworten:

Hello Randall

You have to roll your own using repeat stringstring()


PROCEDURE LeftJustify(LJFldName="",LJString = " ",LJLength=0)
//LJFldName = field to left justify
//LJString = characters to use in right padding
//LJLength = length of the finished strin
//Assume that incoming is NOT Trimmed
LSpace is int = LJLength - Length(NoSpace(LJFldName))
LNewFld is string = ""
IF LSpace > 0
LNewFld = NoSpace(LJFldName) + RepeatString(LJString,LSpace)
ELSE
LNewFld = NoSpace(LJFldName)
END
RESULT LNewFld



PROCEDURE RightJustify(RJFldName="",RJString = " ",RJLength=0)
//RJFldName = field to right justify
//RJString = characters to use in left padding
//RJLength = length of the finished string
//Assume that incoming is NOT Trimmed
LSpace is int = RJLength - Length(NoSpace(RJFldName))
LNewFld is string = ""
IF LSpace > 0
LNewFld = RepeatString(RJString,LSpace) +NoSpace(RJFldName)
ELSE
LNewFld = NoSpace(RJFldName)
END
RESULT LNewFld

Regards
Al




von Al - am 05.03.2013 20:55
Hi Al,

you must be one of those guy who wrote a tools.pas or utils.c or usefullthings.lib in about every language you (have) use(d) :spos:

von Arie - am 05.03.2013 21:12
Hello Arie

You are right :-)
The first things I wrote in Windev were all the missing functions that I was used to in Foxpro.

Regards
Al

von Al - am 05.03.2013 21:39
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.