Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Comment/Uncomment Menu Options
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Divers
Thread ID:
01293366
Message ID:
01294307
Vues:
26
Hi Rick,

There's a programmatic way to comment/uncomment but it requires FoxTolls.fll
FUNCTION VsStyleComment
LOCAL lnKey, lnWhandle

lnKey = INKEY(.5,"HM")
lnWhandle = _WonTop()

DO CASE
CASE lnKey = 3  && Ctrl-C
	= _EdComment(lnWhandle, 1)
CASE lnKey = 21  && Ctrl-U
	= _EdComment(lnWhandle, -1)
ENDCASE

ENDFUNC

FUNCTION _WonTop
SET LIBRARY TO FoxTools ADDITIVE
RETURN = _WonTop()
ENDFUNC
>
>Now I feel a bit dim for not thinking of the obvious <g>... Actually I never used the key combination like that either instead of the shortcut menu (too much thought in that I guess).
>
>What I really wanted to do was hook up the Visual Studio commenting scheme which is Ctrl-K-C and Ctrl-K-U... OKL doesn't directly work for that however the following seems to do the trick (in a startup program):
>
>
>ON KEY LABEL CTRL+K do VsStyleComment in PROGRAM()
>
>FUNCTION VsStyleComment
>
>lnKey = INKEY(.5,"HM")
>IF lnKey = 3  && Ctrl-C
>	KEYBOARD "{ALT+o}m"
>ENDIF
>IF lnKey = 21  && Ctrl-U
>	KEYBOARD "{ALT+o}n"
>ENDIF
>
>ENDFUNC
>
>
>Now my 'comment reflex' is satisfied <g>...
>
>Thanks,
>
>+++ Rick ---
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform