Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing characters under CHR(33)
Message
 
 
To
28/04/2002 12:28:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00650140
Message ID:
00650149
Views:
27
This message has been marked as the solution to the initial question of the thread.
If the first line includes only TAB's and spaces than
IF Empty(Mline(lcMemo,1))
  lcMemo = SUBSTR( lcMemo, _MLINE + 2)
ENDIF
Otherwise
llGoodFirstLine = .F.
lcLine1 = Mline(lcMemo,1)
FOR i=1 TO LEN(lcLine1)
  IF Substr(lcLine1,i,1) > SPACE(1)
    llGoodFirstLine = .T.
    EXIT
  ENDIF
ENDFOR
IF NOT llGoodFirstLine
  lcMemo = SUBSTR( lcMemo, _MLINE + 2)
ENDIF	
or
lcBadChars = Chr(0)+Chr(1)+Chr(2)+Chr(3)+Chr(4)+Chr(5)+Chr(6)+Chr(7)+Chr(8)+;
	Chr(9)+Chr(10)+Chr(11)+Chr(12)+Chr(13)+Chr(14)+Chr(15)+Chr(16)+;
	Chr(17)+Chr(18)+Chr(19)+Chr(20)+Chr(21)+Chr(22)+Chr(23)+Chr(24)+;
	Chr(25)+Chr(26)+Chr(27)+Chr(28)+Chr(29)+Chr(30)+Chr(31)+Chr(32)
IF Empty( Chrtran(Mline(lcMemo,1), lcBadChars, ""))
  lcMemo = SUBSTR( lcMemo, _MLINE + 2)
ENDIF	
>I need a programming logic to remove any line on top of a memo field which may contains only characters under CHR(33) followed by a carriage return.
>
>So, for example, if the first line is:
>
>
>(space)
>Text starts here
>
>
>Then, the first line should be removed.
>
>If I have:
>
>
>  IF condition
>     Text starts here
>
>
>Then, the first line should not be removed as before the carriage return on that line, we have some characters greater than CHR(32).
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform