Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Placing cursor in editboxes
Message
 
À
29/08/2005 22:18:39
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01044974
Message ID:
01045011
Vues:
26
I tried this Hilmar.it is highlighting first error correctly but not the next ones.
as you'll see am storing len of chars in form level property as parsing thru text.

can you tell where my logic going wrong?? Thanks
m.lcString=This.parent.Beditbox1.Value	&& get error text

WITH THISFORM
	IF EMPTY(.pn_errorline) THEN 
		.pn_errorline	=	1   && line no to start
	         .pn_errorline2	=	0
	ENDIF 

	*--now go thru log and place pointer on error.
	FOR lncnt= .pn_errorline TO ALINES(laArray,lcString)
		m.lnerrNumber	=	VAL(ALLTRIM(Getword(ALLTRIM(SUBSTR(laArray[lncnt],AT(' ',laArray[lncnt])+1)),1))) && read each line
		.pn_errorline2	=	.pn_errorline2+LEN(laArray[lncnt])
		
		IF m.lnerrNumber > 0	&& we found an error
			.pn_errorline	=	m.lncnt + 1		&& this is where we start from next time
			*--now place cursor
			This.parent.Beditbox1.SetFocus
			This.parent.Beditbox1.SelStart	=	 .pn_errorline2 &&m.lncnt
			This.parent.Beditbox1.SelLength	=	LEN(laArray[lncnt])
			m.lbfound	=	.T.
			EXIT 
		ENDIF && IF m.lnerrNumber
	ENDFOR

	IF EMPTY(lbfound)
		MESSAGEBOX("Finished searching for ERROR(s)!",0+64,"Error Log")
		.pn_errorline	=	0	&& ready to search again.
		.pn_errorline2	=	0
		This.Caption	=	"\<Find error in log"
	ENDIF 
ENDWITH 
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform