Watch, Follow, &
Connect with Us

Welcome, Guest
Guest Settings
Help

Thread: "Copymemory" Error, Please help



Permlink Replies: 1 - Last Post: Jun 12, 2017 10:55 PM Last Post By: Peter Below
ju jae kuk

Posts: 1
Registered: 8/7/11
"Copymemory" Error, Please help
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 12, 2017 9:37 PM
I want to save the data to "Series1" and copy it to "ar1".

There
   ar1: array of single;
  
Begin
  
   SetLength (ar1, Series1.YValues.Count);

   Copymemory (ar1, @ Series1.YValue [0], Series1.YValues.Count * sizeof (single));
End;

I get an error like below.
[Dcc32 Error] frmBUfu.pas (1042): E2036 Variable required
Peter Below

Posts: 1,104
Registered: 12/16/99
Re: "Copymemory" Error, Please help
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 12, 2017 10:55 PM   in response to: ju jae kuk in response to: ju jae kuk
ju jae kuk wrote:

I want to save the data to "Series1" and copy it to "ar1".

There
   ar1: array of single;
  
Begin
  
   SetLength (ar1, Series1.YValues.Count);

   Copymemory (ar1, @ Series1.YValue [0], Series1.YValues.Count *
sizeof (single)); End;

I get an error like below.
[Dcc32 Error] frmBUfu.pas (1042): E2036 Variable required

Series1.YValue is not an array, it is an indexed property. You cannot
take the address of a property since it may not have one, e.g. since it
is implemented with getter and setter functions.

In your case you have to do the copy one element at a time in a for
loop.

--
Peter Below
TeamB
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02