Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Customizing Intellisense
Message
De
20/02/2002 00:45:41
Lutz Scheffler (En ligne)
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00621837
Message ID:
00622360
Vues:
26
>I wish I had
>
>
>WITH ...
>
>   IF CONDITION
>
>   ELSE
>
>   ENDIF
>
>ENDWITH ...
>
>
>TIA
>
>
>Alonso

Alonso

this is the code I use for IF .. ENDIF. Indention of one space is hard coded in the
<<lcLeft>> ~
statement. (I do always one space intendation so there is no need to me to do a more glabal approach with TAB and so on).
It could be easaly changed for WITH..ENDWITH.
PARAMETERS;
 toFoxCode

LOCAL;
 lcLine,;
 lcLeft,;
 lnLeft,;
 lnRight,;
 lnOr,;
 lnAnd,;
 lcMyVar

toFoxCode.ValueType = "V"

lcLine  = LTRIM(toFoxCode.FullLine)
lcLeft  = STRTRAN(toFoxCode.FullLine,lcLine,'')
lnLeft  = AT(' ',lcLine)
lnRight = RAT(' ',lcLine)
lcLine  = ALLTRIM(SUBSTR(lcLine,lnLeft+1,lnRight-lnLeft-1))
lnOr    = ATC(' or ',lcLine)
lnAnd   = ATC(' and ',lcLine)
DO CASE
 CASE lnOr+lnAnd=0
 CASE lnOr=0
  lcLine = LEFT(lcLine,lnAnd)+' ...'
 CASE lnAnd=0
  lcLine = LEFT(lcLine,lnOr)+' ...'
 OTHERWISE
  lcLine = LEFT(lcLine,MIN(lnAnd,lnOr))+' ...'
ENDCASE
DO WHILE LEN(lcLine)>30 AND ','$lcLine
 lcLine = LEFT(lcLine,RAT(',',lcLine)-1)+'...'
ENDDO &&LEN(lcLine)>30 ...
DO WHILE LEN(lcLine)>30 AND ')'$lcLine
 lcLine = LEFT(lcLine,RAT(')',lcLine)-1)+'...'
ENDDO &&LEN(lcLine)>30 ...
DO WHILE LEN(lcLine)>30 AND '('$lcLine
 lcLine = LEFT(lcLine,RAT('(',lcLine)-1)+'...'
ENDDO &&LEN(lcLine)>30 ...
DO WHILE LEN(lcLine)>30 AND ' '$lcLine
 lcLine = LEFT(lcLine,RAT(' ',lcLine)-1)+'...'
ENDDO &&LEN(lcLine)>30 ...
IF LEN(lcLine)>30 THEN
 lcLine = LEFT(lcLine,30)+'...'
ENDIF &&LEN(lcLine)>30
lcLine  = '&'+'&'+lcLine

TEXT TO lcMyVar TEXTMERGE NOSHOW
THEN
<<lcLeft>> ~
<<lcLeft>>ELSE <<lcline>>

<<lcLeft>>ENDIF <<lcline>>
ENDTEXT

RETURN lcMyVar
I use a function named th( to start this.

This means in intellisense is an function named th defined wich points to the script beyond.

This will work
* the line I enter:
" IF condition th("
*the result:
 IF conditon THEN
  
 ELSE &&conditon

 ENDIF &&conditon
*cursor in the line between IF and ELSE one space intended.
*leading intendation will be maintained
HTH

Agnes

BTW
Please read UT Help-> Rules of conduct-> Non political message
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform