view-as editor in array

melmckee72

New Member
Question:

I've defined an input variable using the view-as editor command and set it to an extent of 20.

def variable mcampnotes as char view-as editor size 50 by 4 extent 20 no-undo.

I've got a loop going through multiple times creating records, and when I get to the prompt-for statement for this variable I get the following error message:

"Invalid use of variable subscript on non-fill-in widget."

Is there a work around to this? My code looks like this:

DO p = 1 to mpqty:
Display "Campaign #" mcampnum[p] skip
"Panel Description" mpdsc[p] skip
"Product Code" mpprd[p] skip
"Rate Code" mprte[p] skip
"Vendor" mpvendor[p] skip
"Output Shipment Method" mpoutput[p] skip
"Inkjet Message" mpinkjet[p] skip
"Select from which Wave?" mpwave[p] skip
with fram mpd no-labels no-box width 200.
prompt-for mcampnum[p] mpdsc[p] mpprd[p] mprte[p] mpvendor[p] mpoutput[p]
mpinkjet[p] mpwave[p] with fram mpd.
assign mcampnum[p] = input fram mpd mcampnum[p]
mpdsc[p] = input fram mpd mpdsc[p]
mpprd[p] = input fram mpd mpprd[p]
mprte[p] = input fram mpd mprte[p]
mpvendor[p] = input fram mpd mpvendor[p]
mpoutput[p] = input fram mpd mpoutput[p]
mpinkjet[p] = input fram mpd mpinkjet[p]
mpwave[p] = input fram mpd mpwave[p].
prompt-for "Special Campaign Notes" mcampnotes[p] with fram mpd no-labels.
create fout2.
assign f2proj = mproj f2panel = p f2camp = mcampnum[p]
f2pdsc = mpdsc[p] f2pprd = mpprd[p]
f2prte = mprte[p] f2pvendor = mpvendor[p] f2poutput = mpoutput[p]
f2pinkjet = mpinkjet[p] f2pwave = mpwave[p]
f2keyline = "Acct#/" + mpprd[p] + "/" + mprte[p] + "/[key]".
display fout2 with 1 column side-labels WITH FRAM D.
HIDE FRAM D.
end.
for each fout2 no-lock break by f2panel:
if first-of (f2panel) then display f2proj f2camp f2panel
f2pdsc format "X(20)" f2pprd f2prte f2pwave with fram pdata down.
end.


Thanks in advance.
 
As you've discovered, VIEW-AS and arrays are mutually exclusive.

What you need to do is use a non-array variable instead, and then assign your array variable to this value at each iteration of the loop:

def var myEd as character no-undo. view-as editor size 50 by 4 extent 20.

do p = 1 to 4:
assign myEd = "".
display myEd with frame mpd no-labels.
prompt-for "Special Campaign Notes" myEd with fram mpd.
assign mcampnotes[p] = input frame mpd myEd.
end.
 
Top