Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Edit Memo Fields programatically
Message
De
14/07/2004 11:00:30
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
14/07/2004 10:50:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00924229
Message ID:
00924237
Vues:
8
>Hi All, I have a memo field in my report dbf. report dbf has list of all reports and then memo has different parameters for that report which i access at run time while running reports. this is just a desgin. its not done yet. but i want to do it this way since i like the idea of vfp system table uses just one memo field for different criteria than seperate field for everything.
>so for example lets say memo has following values.
>
>cPrg = 'RunReport1.prg'
>cFrx = 'RunReport1.frx'
>lEnterDates = .T.
>lSummary = .F.
>lCaption = 'Customer List'
>
>i read help file and now i know how to read any one particular line of this memo field and then convert it to string...

You can read the memo directly into a variable, in its entirety:
MyVar = MyMemo
or line by line with mline():
for i = 1 to memlines()
  ? mline(MemoField, i)
next
>... thorugh Mline and Atline functions. but my problems is when i want to update any particular line or add a new line. I mean I want to make lSummary to .T. at run time. or add one new line in that memo field run time.
>
>i couldnt find any function to update memo field.

Read the memo into a variable, do any manipulation there, and write the entire variable back into the memo with REPLACE:
replace MemoField with MyVar
> i dont know its correct but seems like i can convert whole memo to text file and then text to string , now update the string and then convert it back to text. and then finally convert text file to memo. do i have to do all this and is it reliable ? i mean does memo gets corrupted in middle sometimes?

No matter how you manipulate your variables, if you write the variable to the memo with REPLACE, you should not have corruption under normal circumstances.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform