× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Fri, 2004-09-24 at 07:32, Ewart Desouza wrote:
> 
> 
> Hello Joel !
> 
> I would like to create a command using the quslfld_getFieldNameList()
> procedure or the RNBQUSLFLD service program to display the fields of a file
> on the screen so that I could cut & paste them in my RPG program using SQL.
> How should I go about it ??
> 
> Sorry if this is a trivial question but I don't see the input parameters in
> quslfld_getFieldNameList() and I don't see any documentation on the service
> program RNBQUSLFLD.

The documentation for RNBQUSLFLD is on the website at:

http://www.rpgnext.com/docs/rnbquslfld/

> I'm pasting the code which I am testing to no success.
> 
> Thanks & best regards
> Ewart
> 
> H DFTACTGRP(*NO)
>  /copy rpgnextlib/qrpglesrc,cp_hspecs
>  /copy rpgnextlib/qrpglesrc,cp_longprs
>  /copy rpgnextlib/qrpglesrc,cp_uslfld
> 
> D fldlst          S          32000a   varying
> D count           S              5s 0
> D dspstr          S             30a
> 
> C     *entry        plist
> C                   parm                    prfile           10
> C                   parm                    prlibrary        10
> 
>  *---> The idea is to retreive the field list of the file entered
>        through the parameter and display 30 characters at a time on screen

OK, the first thing you have to do is initialize the service prgoram to
reference this file:

   C                                     callp        
quslfld_initialize( prfile:prlibrary)

Now the rest of the procedures in the service program will refer to the
file passed in.

> C                   eval      fldlst = quslfld_getFieldNameList()

The return string is comma delimited, so you need to parse it out to
retrieve the field names.  The easiest way to do this is with the
"getTokens()" procedure.  Add these D-Specs first:

   d fieldArray      s            100a   dim(999) varying
   d fieldCount      s             10i 0 inz

Then call the procedure to populate the arrays:

   C                                     eval           fieldCount =
getTokens( fieldList :      
                                                                                
         %addr( fieldArray ) : ',' )

> C                   eval      count  = 1

Now try a FOR loop instead to process the list of fields:

   C                                     For             count=1 to
fieldCount ;
   C                                     eval           dspstr =
fieldArray( count )
> C     dspstr        Dsply
   C                                     EndFor
> C                   Eval      *INLR = *On


Let me know if this helps,

Joel
http://www.rpgnext.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.