REPORT Y9030004. "Release 3.1G, 4.5A ************************************************************************ * Copyright (c) 1999 by CT-Team, 33415 Verl, http://www.ct-software.com * * You can use or modify this report for your own work as long * as you don't try to sell or republish it. * In no event will the author be liable for indirect, special, * Incidental, or consequental damages (if any) arising out of * the use of this report. * ************************************************************************ BREAK-POINT. *//////////////////////////////////////////////////////////////////////* MOVE: ' Find out the string length in a fast way' TO SY-TITLE. * STRLEN is not very quick *//////////////////////////////////////////////////////////////////////* ************************************************************************ *************** Paramter declaration ********************** * PARAMETERS: P_STRING(120) DEFAULT ' here is an abitrary string ...... ' LOWER CASE. ************************************************************************ * *//////////////////////////////////////////////////////////////////////* ************* Main Section ******************* *//////////////////////////////////////////////////////////////////////* * PERFORM STRINGLAENGE. * *//////////////////////////////////////////////////////////////////////* ************* Subroutines ******************* *//////////////////////////////////////////////////////////////////////* * ************************************************************************ * How long is the string ? ************************************************************************ FORM STRINGLAENGE. * BREAK-POINT 111. ULINE. SKIP 1. WRITE: /5 'Step 1: Simple determination of string length.' COLOR 5. ULINE. SKIP 1. *....................................................................... * IF P_STRING CP '*# '. ENDIF. " SY-FDPOS is set * ||| * |||----> ' ' = only blanks up to end of line * ||-----> # = character for blanks * |------> * = any character *....................................................................... WRITE: /1 'String:', P_STRING COLOR 4. WRITE: /1 'String length:', SY-FDPOS COLOR 6. * ENDFORM. ************************************************************************ ************************************************************************ ******************* END OF PROGRAM *************************************