Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 08 OCT 2001 08:52:40PM Jim Dierking wrote:

***Trying to create a multivalue symbolic field routine to default

to a multivalue field in a window. When F2 key is pressed the default

values are erratic. Would like the code to return the proper values

to the respective fields irrespective of the position of the cursor.

I guess the question would be… How do you perform a multivalue xlate

and return the values in the right positions to a multivalue data field.

] ANS=';CNT='
] CNT=FIELDCOUNT(@RECORD,@VM) ;*supply_nos  in CUSTOMS FILE
] FOR I=1 TO CNT
]      EL=@RECORD
] ANS=XLATE( "SUPPLIES" , EL , "DUTY" , "X" )
] BEGIN CASE
] CASE ANS=0"
] ANS=FREE"
] CASE ANS="
] @ANS=FREE"
] CASE ANS ] "0"
] ANS=ANS /// 100
] END CASE
] NEXT I
] TRANSFER ANS TO @ANS
TIA for the help,

Jim


At 08 OCT 2001 10:03PM Curt Putnam wrote:

If you are going to return multiple values to a window field, you have to update the MV count in the window_common array. I'm sure the Sprezzatura folks will shortly be forthcoming with a more complete answer.


At 10 OCT 2001 10:07AM [url=http://www.sprezzatura.com" onMouseOver=window.status=Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:

Answer depends on the context really. For windows and R/LIST, the system is smart enought to use @MV or WC_MV% to determine the correct position and return it.

For example, suppose you have a simple symbolic:

@Ans=XLate( "PRODUCTS", @Record, ProdDesc$, "X")

In a window you will find the results are not what you expect. However, if you think about this, it makes some sense. The window will attempt to display the multi-value for each line displayed on the window. So, if your MV field has 5 lines showing, each line will calculate the symbolic.

For example, suppose you have a 5 line MV painted and you have entered in 2 product codes. What will happen is on the first line, the system will calulate the symbolic. The results will be two descriptions, say S/Web~S/List (where ~ is an @VM). Window, seeing the @VM, will place the information on sucessive lines. When the window processes the second code, the answer will again be S/Web~S/List and will place this following the original answer, so you'll have the information repeating until the depth of the symbolic MV filed is filled.

Now, supposing we change our code to

@Ans=XLate( "PRODUCTS", @Record, ProdDesc$, "X")

This will display properly, since the @MV will limit the answer to only the current line.

R/List also respects the @MV variable.

A generic program, on the other hand, does not use @MV since it's not applicable in context. Generally, @MV would be 0 or null which would then return back the entire field.

In your code, you should remove the

[b]For I...[/b]

loop and just set

[b]EL=@RECORD&lt38,@MV&gt[/b]

Also, this could just be a typo, but you to be having the ANS variable do double duty, since it will be refeshed on each loop.

The Sprezzatura Group

World Leaders in all things RevSoft


At 10 OCT 2001 03:26PM Don Miller - C3 Inc. wrote:

Sprezz's answer is quite right. What I do to allow for a symbolic to function both in and out of context is:

IF @MV THEN

@ANS=XLATE("somefile",@RECORD,FIELD_NO,"X")

END ELSE

@ANS=XLATE("somefile",@RECORD,FIELD_NO,"X")

END

This will work in both screens and reports. The only time where R/LIST doesn't respect @MV is in exploding, multi-value sorts. The code generator does not set @MV to VALUE_NO so the extract process is exceedingly slow for the symbolic. It does the whole field and then extracts it in the code:

READNEXT @ID,VALUE_NO

FOO={DICT_CALL} * returns an MV-field but does the whole symbolic every time

S.FOO=FOO ;* extract the single value

HTH

Don Miller

C3 Inc.

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/2b1aa544d7a2027085256ae00004d28b.txt
  • Last modified: 2024/01/04 21:00
  • by 127.0.0.1