Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filling a Memo
Message
From
08/08/2000 15:16:51
 
 
To
08/08/2000 15:06:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00402429
Message ID:
00402438
Views:
9
You have a FOR loop inside a string concatenation.
Also the FOR loop itself is not valid. Use a SCAN instead to go through all records.
Store the initial value you want, then add to that value with the FOR loop.
Also, unless the editbox is not bound to data, it's usually better to go straight to the data instead of the control.
e.g., assuming editbox bound to data in "invoices.memo1"
SELECT products
lcValue = "Invoice Created " + DMY(Date()) + " " + Time() + CHR(13)
SCAN
 lcValue = lcValue + prod_id + " " + details + " was added on " + DMY(Date()) + ;
   " " + Time() + CHR(13)
ENDSCAN
REPLACE memo1 WITH lcValue IN invoices
thisform.Edit1.Refresh()
>I'm trying to write some code that will fill a memo field. I want it to look like this:
>
>Invoice created. 08Aug00 01:45:00
> FC-3456 "24yd. Fiboptic Cable" was added on 08Aug00 01:45:00
> RT-1234 "NIC 10B-T Concentrator" was added on 08Aug00 01:45:00
> ET-7890 "GYS Ethnet card" was added on 08Aug00 01:45:00
>
>I know the following code brings up errors, but from it I hope you can better understand what I'm trying to say. I'm hoping that someone will have some suggestions on how I can do this correctly.
>
>SELECT products
>local firstline
>firstline = "Invoice Created "
>Thisform.Edit1.Value = firstline + " " + DMY(Date()) + " " + Time() + ;
>CHR(13) + ;
>FOR RECORD 1 TO RECCOUNT()
> prod_id + " " + details + " was added on " + DMY(Date()) + " " + Time() + CHR(13)
>ENDFOR
>
>Rodney
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform