home *** CD-ROM | disk | FTP | other *** search
- EDITOR'S NOTE:
- Software designer Donald Yerxa of Autosoft, Inc (the makers of
- AutoMenu, a nifty DOS Interface shell) has sent us a UDF that
- returns a right-justified, floating dollar and comma output from
- a numeric input.
-
- Included with this FUNCTION is the demo program DEMOFLOT.PRG for
- your entertainment. The FUNCTION, 'Fldlr' actually appears at the
- bottom of this file.
-
- P.S. If you are interested in more information on AutoMenu contact
- Donald c/o Autosoft Inc., 860 Locust Street, Dubuque, Iowa 52001
- or call (319)556-7414
- -ROGER
-
-
- ********************************************************************
- *** Nantucket Clipper dBASE III Compiler User Defined ***
- *** Function for output of amounts with floating dollar sign ***
- *** and commas Demo program to illustrate use of the UDF ***
- *** ***
- ********************************************************************
- *** Filename : DEMOFLOT.PRG
- *** Programmer: D.C.Yerxa ***
- *** AutoSoft, Inc. ***
- *** 860 Locust Street ***
- *** Dubuque, Iowa 52001 ***
- *** (319)556-7414 ***
- *** ***
- *** Date: December 29, 1985 ***
- ********************************************************************
-
- CLEAR
- TEXT
-
-
- CLIPPER - User Defined Function
-
- Demonstration of Right Justified Ouput
- of an amount with
- floating dollar sign and commas
-
- Designed by:
-
- Donald C. Yerxa
- AutoSoft, Inc.
- 860 Locust Street
- Dubuque, Iowa 52001
- (319)556-7414
-
- ENDTEXT
-
- frame=CHR(201)+CHR(205)+CHR(187)+CHR(186)+CHR(188)+;
- CHR(205)+CHR(200)+CHR(186)
- @ 1,13,21,64 BOX frame
- DO Flotdol
- amt=0
- @ 17,20 SAY 'Enter an amount: '
- CLEAR GETS
- @ 17,37 GET amt PICTURE '############.##'
- READ
- stramt=STR(AMT,16,2)
-
- *** Example output to screen ***************
- temp=FLDLR(STRAMT)
- tmplen=LEN(TEMP)
- temp='Right Justified Output: '+temp
- @ 18,62-tmplen SAY REPLICATE('D',tmplen)
- @ 19,62-LEN(temp) SAY temp
- @ 20,62-tmplen SAY REPLICATE('M',tmplen)
- @ 23,27 SAY 'Press any key to quit: '
- SET CONSOLE OFF
- WAIT
- SET CONSOLE ON
- CLEAR
- QUIT
-
-
- ********************************************************************
- *** Nantucket Clipper dBASE III Compiler - User Defined Function ***
- *** for output of amounts with floating dollar sign and commas ***
- *** ***
- ********************************************************************
- *** Programmer: D.C.Yerxa ***
- *** AutoSoft, Inc. ***
- *** 860 Locust Street ***
- *** Dubuque, Iowa 52001 ***
- *** (319)556-7414 ***
- *** Date: December 29, 1985 ***
- ********************************************************************
-
- FUNCTION Fldlr
- PARAM stramt
- DO WHILE SUBSTR(stramt,1,1)=' '.OR.SUBSTR(stramt,1,1)='0'
- stramt=SUBSTR(stramt,2,LEN(stramt)-1)
- ENDDO
- IF INT(LEN(stramt)/3)=LEN(stramt)/3
- nocom=(LEN(stramt)/3)-1
- ELSE
- nocom=INT(LEN(stramt)/3)
- ENDIF
- FOR X=NOCOM TO 2 STEP -1
- stramt=SUBSTR(stramt,1,LEN(stramt)-(X*3))+','+SUBSTR(stramt,LEN(stramt) ;
- -(X*3)+1,X*3)
- NEXT
- stramt='$'+stramt
- RETURN(stramt)
- *** EOF FUNCTION Fldlr