Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dot prompt emulator ?
Message
 
 
À
30/04/2001 09:34:25
Mike Mattos
Nationwide Computers
Mississauga, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00501480
Message ID:
00501488
Vues:
14
>is there a simple dot prompt or command window emulator in the download area ?
>
>Or can anyone recommend one ?

Here is the code generated by the class browser from my Command Window Form:
DEFINE CLASS frmcmdwindow AS form1


	Top = 0
	Left = 0
	Height = 237
	Width = 468
	DoCreate = .T.
	Caption = "Command Window"
	Name = "frmCmdWindow"
	DIMENSION acommands[1]


	ADD OBJECT lstcommand AS listbox WITH ;
		RowSourceType = 5, ;
		RowSource = "ThisForm.aCommands", ;
		Height = 188, ;
		Left = 11, ;
		TabIndex = 3, ;
		Top = 10, ;
		Width = 447, ;
		Name = "lstCommand"


	ADD OBJECT lblcommand AS label WITH ;
		Caption = "Command", ;
		Left = 9, ;
		Top = 208, ;
		Width = 61, ;
		TabIndex = 1, ;
		Name = "lblCommand"


	ADD OBJECT txtcommand AS textbox WITH ;
		Height = 22, ;
		Left = 74, ;
		TabIndex = 2, ;
		Top = 206, ;
		Width = 384, ;
		Name = "txtCommand"


	PROCEDURE Init
		Dimension This.aCommands(1)
		This.aCommands(1) = space(200)
	ENDPROC


	PROCEDURE lstcommand.InteractiveChange
		DoDefault()
		ThisForm.txtCommand.Value = This.Value
	ENDPROC


	PROCEDURE lstcommand.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		if nKeyCode = 13
			with ThisForm.txtCommand
				.SetFocus()
				.LostFocus()
			endwith
			return
		endif
		DoDefault()
	ENDPROC


	PROCEDURE txtcommand.Refresh
		This.Value = ThisForm.lstCommand.Value
	ENDPROC


	PROCEDURE txtcommand.LostFocus
		local lcValue
		lcValue = alltrim(Transform(This.Value))
		if empty(lcValue)
			DoDefault()
			return
		endif
		if upper(This.Value) = "EXIT"
			ThisForm.QueryUnload()
			NoDefault
			Return
		endif
		local lnLength, lnRetVal
		lnLength = alen(ThisForm.aCommands, 1)
		lnRetVal = ascan(ThisForm.aCommands, lcValue)
		if lnRetVal = 0
			Dimension ThisForm.aCommands(lnLength + 1)
			ThisForm.aCommands(lnLength) = lcValue
			ThisForm.aCommands(lnLength + 1) = space(200)
			lnLength = lnLength + 1
		endif
		if inlist(left(lcValue, 1), "?", "@", "*")
			activate screen
			if left(lcValue, 1) = "*"
				lcValue = substr(lcValue, 2)
			endif
		endif
		&lcValue
		This.Value = space(200)
		with ThisForm.lstCommand
			.Requery()
			.Value = space(200)
		endwith
		This.SetFocus()
		NoDefault
		Return
	ENDPROC


	PROCEDURE txtcommand.Error
		LPARAMETERS nError, cMethod, nLine
		wait window nowait "Error"
	ENDPROC


ENDDEFINE
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform