Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replace only one line in a memofield
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Database:
MS SQL Server
Divers
Thread ID:
01028840
Message ID:
01028844
Vues:
10
Has stated, you have to replace the whole content of the memo, but the following will allow you the change a specific word, in a specific line of a memo field.
Private nCount,lcstr
lcstr = ''
Create Cursor mycursor (comments m)
Insert Into mycursor (comments) Values ('There are many ways to get data from a specific line in a memofield.'+Chr(13)+ 'But are there any commands or functions to replace a specific line with a new characterstring, or do I have to replace the whole memofield?')
Modify Memo comments
nCount = Alines(myArray,comments)
For i = 1 To nCount
	If i = 2
		lcstr2=Strtran(myArray[i],'characterstring','character string')
		lcstr = lcstr+Chr(13)+lcstr2
	Else
		If i = 1
			lcstr = lcstr+myArray[i]
		Else
			lcstr = lcstr+Chr(13)+myArray[i]
		Endif
	Endif
Endfor
Select mycursor
Replace comments With lcstr
Modify Memo comments
>Hallo!
>There are many ways to get data from a specific line in a memofield. But are there any commands or functions to replace a specific line with a new characterstring, or do I have to replace the whole memofield?
>If I want to replace the contens of line 67, can I do that without touching the other lines?
>
>Thankyou
>/Kjell
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform