Microsoft KB Archive/107610: Difference between revisions
From BetaArchive Wiki
m (Text replacement - """ to """) |
m (Text replacement - "<" to "<") |
||
Line 39: | Line 39: | ||
STORE 1 TO Mcount | STORE 1 TO Mcount | ||
STORE SPACE(1) TO NewString | STORE SPACE(1) TO NewString | ||
DO WHILE Mcount | DO WHILE Mcount <= Mlen | ||
NewString = NewString + SUBSTR(TheString,Mcount,1) + " " | NewString = NewString + SUBSTR(TheString,Mcount,1) + " " | ||
Mcount = Mcount + 1 | Mcount = Mcount + 1 |
Latest revision as of 15:08, 20 July 2020
User-Defined Function to Expand a StringID: Q107610 The information in this article applies to:
SUMMARYThe user-defined function (UDF) below inserts a space between each character of the passed variable by using a substring function inside a DO loop. MORE INFORMATIONCreate a program file with the following code: CLEAR SET TALK OFF SET CURSOR OFF Title = "SEE IT GROW" NewTitle = EXPAND(TITLE) @ 10,10 SAY NewTitle RETURN ****************************************************************** * Function..: EXPAND * Notes.....: This function inserts blanks after each character in * a string. * * Parameters: TheString - The expression to convert. * ****************************************************************** FUNCTION Expand PARAMETER TheString STORE LEN(TheString) TO Mlen STORE 1 TO Mcount STORE SPACE(1) TO NewString DO WHILE Mcount <= Mlen NewString = NewString + SUBSTR(TheString,Mcount,1) + " " Mcount = Mcount + 1 ENDDO RETURN (LTRIM(NewString)) Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a 2.50b string KBCategory: kbprg kbcode KBSubcategory: FxprgGeneral |
Last Reviewed: June 27, 1995 |