Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The beauty that is lost with the beautify
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00611595
Message ID:
00611646
Views:
22
This message has been marked as a message which has helped to the initial question of the thread.
>Hi Gérald;
>
>
>>I suppose the parser see the word DEFINE as a procedure (DEFINE CLASS)
>>and start a new indentation block...
>
>Yes, that's right. Is there any option that stops this behavior ?
>
>Tks
>
>Claudio

You probably search for a more direct solution but...

The following code will probably take care of the problem.

CTRL+A your code
CTRL+C to clipboard
Run the following code
CTRL+P back in place
*not tested!
nlines=ALINES(lCodeArray,_CLIPTEXT)
_CLIPTEXT=""
FOR i = 2 to nLines  && start with 2 to avoid trouble with lCodeArray[i-1]
	IF lCodeArray[i]="DEFINE" AND !lCodeArray[i]="DEFINE CLASS"
		*take the same number of tabs - chr(9) - of the prev line
		nTabs=OCCURS(CHR(9),lCodeArray[i-1])
		IF nTabs > 0
			lCodeArray[i]=REPLICATE(CHR(9),nTabs)+lCodeArray[i]
		ENDIF
	ENDIF
	_CLIPTEXT=_CLIPTEXT+lCodeArray[i]+ CHR(13)
ENDFOR
HTH :-)
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform