Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 03 FEB 2009 01:59:19PM Paul wrote:

Ok, so as y'all know in the January news letter there was a nice tip showing you 1 way of using "Exec_Rlist", so being curious I searches every possible place on this site looking for more info on "Exec_Rlist" which was very unsuccessful, so I'm hoping I can accomplish my end result with this post:

r=Exec_Rlist(Cmd,"EXECUTE",type,dFlag)

1) Is the RLIST command the only thing I can pass into CMD parameter, if not what else? I tried using SELECT but got nothing…

2) I'm going to assume the second parameters allows more than just "EXECUTE" otherwise it would not be an option, what else can I pass in the second parameter?

3) Tip code used Type=OI' what other types are there and what do they do?

4) What is the reason for the debugFlag, I tried running this with and without and the end result was the same?

Any ways to get a full documentation on this?

Thanks in Advance

Paul


At 03 FEB 2009 02:32PM Paul wrote:

Sorry, 1 more question…

5) How do I keep the results from have a header for each single record selected? currently I get:

:blank

:Header1…… Header2…..

:data1 Data2

:blank

:1

:Header1…… Header2…..

:data1 Data2

:blank

:blank

:1

etc…

Any way to control how results are returned???, more like this:

:Header1…… Header2…..

:data1 Data2

:data1 Data2

:data1 Data2

:data1 Data2

:data1 Data2

etc…

Would be great…

Paul


At 06 FEB 2009 10:59AM Bryan Shumsky wrote:

Hi, Paul. EXEC_RLIST was originally written as a support routine for the CTO character interface, and so some of its features apply specifically to that environment. Some of the behaviours you are seeing are "relics" of that as well.

] 1) Is the RLIST command the only thing I can pass into CMD parameter, if not what else? I tried using SELECT but got nothing…

An RLIST statement is the most practical thing you can send in. I believe you can send in a SELECT statement as well, and that should generate an active select list.

] 2) I'm going to assume the second parameters allows more than just "EXECUTE" otherwise it would not be an option, what else can I pass in the second parameter?

The second parameter can be "TEXT", "TAB", "HTML", "EDT", "XML", "EXECUTE", "EXTRACT", or "SELECT". "TEXT" returns the result as an @FM delimited list, with each field containing a row of text. "TAB" is similar, but each row is cr/lf delimited instead. "HTML" and "XML" return the output with HTML and XML delimiters, respectively. "EDT" returns the data, without headings, as multivalued output (each column is a separate value, each row is @FM delimited). "EXTRACT" returns each column @FM delimited, with \B9\ as the row delimiter. "SELECT" can be used in conjunction with a SELECT statement to generate an active list (though its use is somewhat redundant since you can pass a SELECT statement using the "EXECUTE" parameter as well).

] 3) Tip code used Type=OI' what other types are there and what do they do?

As I mentioned initially, this was originally designed for use in the CTO environment. Since many users of CTO come from other multivalue platforms, each with their own slightly-different syntax, we allow CTO to take on various "flavors" depending on the user's preferences. The "type" parameter indicates the "flavor" of statement that we intend to support. Since the RLIST commands you are passing in will be using OpenInsight syntax, "OI" is the only appropriate choice there.

] 4) What is the reason for the debugFlag, I tried running this with and without and the end result was the same?

The debug flag is the same "debugFlag" mentioned in the online help for RList. If set, instead of actually returning a result, your call to EXEC_RLIST will generate a record in SYSOBJ called RLIST_OUT. You can examine this record to see what OI would do "behind the scenes" to execute your request.

Hope that helps!

- Bryan "The Tease" Shumsky

Revelation Software


At 06 FEB 2009 11:11AM Bryan Shumsky wrote:

Hi, Paul. Quoting from my own previous post:

EXEC_RLIST was originally written as a support routine for the CTO character interface, and so some of its features apply specifically to that environment. Some of the behaviours you are seeing are "relics" of that as well.

Unfortunately, the grouping of the results as you see them are one of those "relics". EXEC_RLIST has a concept of how big a "page" of output it should generate, and - since it doesn't know the "page size" in OI by default - it's returning the results as though its got a very very tiny output page.

To change this behaviour, you have to set some system variables to define the output width and output height before you call EXEC_RLIST. The Output Width controls where and whether the output will "wrap", and the Output Height controls where and whether a "page break" will occur, at which point your heading and column headings will be repeated. Set the system variable @CRTWIDE to your desired output width (for example, 80 or 132), and @CRTHIGH to your desired output height (for example, 60 or - to prevent any "pagination" of the results - some high number, such as 9999). So your code would look something like this:

@CRTWIDE=80

@CRTHIGH=60

RSLT=EXEC_RLIST(RLISTCMD, "EXECUTE", "OI", 0)

Hope that helps,

- Bryan Shumsky

Revelation Software


At 06 FEB 2009 11:32AM Bryan Shumsky wrote:

A clarification: my description of the results from the various types of things you can pass in as the 2nd parameter ("TEXT", "TAB", etc.) was incorrect if you do set the @CRTWIDE/@CRTHIGH variables. So here's the full, complete (I hope) description:

- "TEXT" returns each row delimited with cr/lf, with spaces used between each column, and with @fm delimiting multiple pages of results. Column and page headings are displayed on each page;

- "TAB" is similar, but the entire output is considered a single "page". The column heading is displayed at the start, but no page headings are displayed;

- "HTML" returns the output as HTML, with the page headings as heading elements, and the column headings and rows of data as one or more tables;

- "XML" returns the output with XML delimiters. No pagination or page headings are displayed, but the "column headings" are used in the XML elements;

- "EDT" returns the data, without column headings, page headings, or any pagination, as multivalued output (each column is a separate value, each row is @FM delimited).

- "EXTRACT" returns each column @FM delimited, with \B9\ as the row delimiter. No pagination, column headings, or page headings are returned;

- "SELECT" can be used in conjunction with a SELECT statement to generate an active list (though its use is somewhat redundant since you can pass a SELECT statement using the "EXECUTE" parameter as well).

Hope that clarifies things!

- Bryan Shumsky

Revelation Software


At 06 FEB 2009 11:59AM Paul wrote:

Bryan,

Thanks a lot for the response; after making the original posting I decided to play around with-it a little more and by looking at the footer of the OBJECT code I had figured out that I could use the following options on the second parameter "TEXT", "TAB", "HTML", "EDT", "XML", "EXECUTE", "EXTRACT" with "EDT" being my favorite so far…

But I've been having issues with the following "TEXT", "TAB", "HTML" & "XML" they all return the following error:

SYS1000: Error Loading Program "RLIST_XXXX_CALLBACK with XXXX being the TEXT, TAB, HTML & XML…

Looking at my SYSOBJ I only see the following RLIST Callbacks

RLIST_CALLBACK

RLIST_EDT_CALLBACK

RLIST_EXECUTE_CALLBACK

RLIST_EXTRACT_CALLBACK

Does this mean I'm missing these programs? If so, how do I go about getting them? We are currently on 8.03…

Let me know?

Once again Thanks a lot of the responses; very helpful…

Paul


At 06 FEB 2009 02:47PM Bob Carten wrote:

Paul

I built a library of rlist callback functions for internal projects, I never released them as part of the RTI code base. I've posted them at the links shown below. Treat these as examples rather than finished code - each of them can be improved. The biggest flaw is with the handling of multivalues. Rlist spits out one line per multivalue, none of these routines put them back together.

Rlist_Callback_Example

Sample Code[/url]

This is the calling program, written so you can pass in a series of selects with a final list statement.

Rlist_html_Callback

Needs to be updated to use css formatting / javascript so each page is a div, set the visible property of the current page

Sample Code

Rlist_csv_Callback

Sample Code

Very useful for creating exports to use with word mail merge.

rlist_tab_callback

Sample Code

Very useful for creating code which you can programmtically paste into excel

Rlist_EDT_Callback

Sample Code

Return fm/vm delimited text, perfect for stuffing into an edit table

Rlist_view example

Sample Code

Uses the EDT callback to get a sort of read-only datatable view. Put a timer event on the window and you can implement a workflow application using a table of rlist statements.

print_edittable

[url=http://docs.google.com/Doc?id=dhh9ztnx_48g2q7pbcq]Sample Code

Helper for the Rlist_View window

HTH

Bob

edited to add edt callback, remove excess html.


At 06 FEB 2009 04:01PM Paul wrote:

Bob,

Thanks very much… This is some good stuff… And I totally understand the whole unfinished code part… Normally tools like these are always a work in progress… No matter how much functionality they offer…

I will play around with this and make the appropriate changes as needed…

Once again… Thanks for the good examples…

Paul

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/d555a70fafef38cb8525755200684ebf.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1