Macro

Posted: 2017-01-19 in Macro

Q:
My goal is to create a function to clear column data (‘old value’ and ‘new value’) from any array based on array name.
A:
you could pass the array name and macro substitute it where necessary.

Code:
public arr1(5,3)
arr1(1,1) = 'txtName'
arr1(1,2) = 'test'
arr1(1,3) = 'testing'
? arr1

proc myproc
    para myarray
    &myarray(1,2) = .f.
    &myarray(1,3) = .f.
    ? arr1
endproc

do myproc with "arr1"

Q:
what does the ‘&’ sign just before the (field(i)) do? (? &(field(i)))
A:
The “&” character indicates a macro substitution:
http://www.lianja.com/doc/index.php/%26



Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s