Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving a variable to a .txt file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01093487
Message ID:
01093539
Vues:
23
>How would I take the contents of an editbox and transform it to your text...endtext scheme? The user will type alot of text into this editbox.
Try
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


	**************************************************
*-- Form:         form1 (c:\hon_bnt_win\bnt_hon_kasa\form1.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   02/03/06 10:45:03 PM
*
DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT edit1 AS editbox WITH ;
		Height = 189, ;
		Left = 14, ;
		Top = 23, ;
		Width = 347, ;
		Name = "Edit1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 216, ;
		Left = 112, ;
		Height = 27, ;
		Width = 150, ;
		Caption = "Save text in file", ;
		Name = "Command1"


	PROCEDURE command1.Click
		CLEAR
		TEXT TO m.myvar TEXTMERGE NOSHOW
		<<ThisForm.Edit1.Value>>
		ENDTEXT
		m.myfile = PUTFILE([Save as],[],[txt])
		IF NOT EMPTY(m.myfile)
		   STRTOFILE(m.myvar,m.myfile)
		ELSE
		   MESSAGEBOX([No file])
		ENDIF
		Thisform.Edit1.SetFocus()
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform