In order for this site to work correctly, and for us to improve the site, we need to store a small file (called a cookie) on your computer.
By continuing to use this website, you agree to our cookies and privacy policy.
  
Home page Home page Home page Home page
Pixel
Pixel Header R1 C1 Pixel
Pixel Header R2 C1 Pixel
Pixel Header R3 C1 Pixel
Pixel

Reader's Clinic

Michael Tucker of Nationwide Formal Wear called recently with an interesting query. One of his users wanted to embed the current user name/account name/other variable into the RLIST heading. This turned out to have two possible solutions.

Break-On Solution

Create a symbolic in the dict of VOC called UNAME and make the formula @ANS = @USERNAME. Ensure that the length is explicitly set to 0. Then in the list statement include a construct similar to the following

:LIST USERS UNAME BREAK-ON UNAME "'B'" CO.NAME HEADING "'B'"

This will include the symbolic in the heading but not in the list statement. This solution has two problems - a separate symbolic dictionary item must be created for each value to be inserted, and it also slows down reporting.

V39 Solution

Subscribers to Volume 1 will remember that the ability to embed ?Prompts? within any TCL statement still exists in AREV. This is handled by the V39 processor. This routine may be intercepted and put to more flexible use. To try this method first back up your system!

COPY VERBS $V39 TO:$V39_RTI then create a subroutine as follows


0001         subroutine V39(FLAG)
0002            swap "?%U%?" with @USERNAME in @SENTENCE
0003            swap "?%A%?" with @ACCOUNT in @SENTENCE
0004            call V39_RTI(FLAG)
0005         return

compile it and COPY BP $V39 to(VERBS (N. The user then can then be instructed to

:LIST USERS CO.NAME HEADING "?%U%?"

replacing the ?%U%? with any other variable you wish to intercept in V39. NB to ensure that V39 is called, the RLIST sentence MUST contain ?. However the replacement V39 can swap strings other than those ? delimited if required. Note also that if the ?%U%? construct is used outside of the HEADING statement the system will expect it to be in quotes - thus the above code would need to be modified in account of this.

A powerful extension of this technique may be used when the user wishes to list against a table where codes are stored referring to another table. The user might not remember the codes (especially in the case of organisations, contacts etc) but could remember the name. In this case the replacement V39 could scan for a special keyword (?%ORG%? or such like) and call a collector window to assist the user in finding the required codes and then return these codes into @SENTENCE. Thus the user is given the freedom to create flexible RLIST enquiries which incorporate sophisticated lookup logic.

(Volume 3, Issue 3, Page 15)
Pixel
Pixel Footer R1 C1 Pixel
Pixel
Pixel
Pixel