third_party_content:community:commentary:forums_nonworks:4c4362f955abe032852568a3005cdf90

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 15 MAR 2000 12:54:25PM reggie, rcrosby@tnc.org wrote:

Two questions!

1. I know that the '?' creates a prompt with a message, are there any other commands like these to be used inside a VOC

2. I would like to 'trap' that information in question 1 and assign

 it to a variable and use the variable inside the VOC, any       suggestions as to how.

Thanks


At 15 MAR 2000 01:58PM Don Miller - C3 Inc. wrote:

One of the ways to do this is to write a "Shell" around the TCL command which parses the data ahead of actual execution of the TCL line. This is non-trivial but can be done. Essentially it looks a bit like this:

The VOC SENTENCE WOULD LOOK LIKE:

TCL

        IF NEXTWORDLEN(NEXTWORD)-1,1=?' THEN
             PROMPT:= ':NEXTWORD
        END ELSE
           PROMPT:= ':NEXTWORD
        END
     NEXT J
     VAR=
     CALL MSG(PROMPT,'RCE',VAR,'')  ;* THIS WILL ASSIGN VAR
     IF LEN(VAR) THEN NEWSENT:=QUOTE(VAR):' '
 END ELSE
     NEWSENT:=WORD:' '
 END

NEXT I

PERFORM NEWSENT

RETURN

* OR SOMETHING LIKE THAT *

HTH

Don Miller

C3 Inc.


At 15 MAR 2000 02:50PM Steve Smith wrote:

A TCL command running a series of programs in a voc record looks like this:

TCL

routine1

routine2

routine3

You could use a common variable to store the details you require.

*Compile and catalog the following source as routine1

subroutine routine1

common /stuff/ mystuff@

call msg('Enter something','RC',mystuff@,mystuff@)

*Compile and catalog the following source as routine2

subroutine routine2

common /stuff/ mystuff@

call msg('you typed ':mystuff@,,,'')

* create a voc record called voc3

TCL

routine1

list 10 voc

routine2

* now from TCL run voc3 - the variable is retained across statements

* you could also return your common variable from a dict.voc * symbolic, making it accessible in TCL selections etc.

Hope this helps,

Steve


At 15 MAR 2000 03:27PM [url=http://www.sprezzatura.com" onMouseOver=window.status=Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:

This from REVMEDIA FKB…

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

     subroutine V39(FLAG)
        swap "?%U%?" with @USERNAME in @SENTENCE
        swap "?%A%?" with @ACCOUNT in @SENTENCE
        call V39_RTI(FLAG)
     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 ?. Howeverthe 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)

The Sprezzatura Group

World Leaders in all things RevSoft

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/4c4362f955abe032852568a3005cdf90.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1