× 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.



Chris:

I never had much success trying to change text colors so I can't help
on that issue.  Maybe someone else can point us in the right direction.

Regarding the built-in function help, your idea got me thinking...

I put together the following macro (and at the same time, figured out how to 
manipulate the help system).  

To reassign the F1 key use the command:
'SET ACTION.F1 MACRO BIF_HELP'
and be sure to save the macro as BIF_HELP.LX.

I'm running WDSC v4, I don't think the macro would work with earlier versions.

What the macro does is to check if there is a BIF on the current line.  If
yes, run help for the BIF, otherwise run the standard RPGLE help function.

I hope you find this useful....

John



/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*                                                                           */
/*  PGM NAME      -  bif_help.lx                                             */
/*  PROGRAM TITLE -  Built-in function help                                  */
/*  DATE WRITTEN  -  02/01/03                                                */
/*  AUTHOR        -  John Larimer                                            */
/*  NARRATIVE     -  Launches help for a built-in function located on the    */
/*                   current line.                                           */
/*                                                                           */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*                                                                           */
/*  MODIFIED  LOG #  PGMR  DESCRIPTION                                       */
/*  --------  -----  ----  ------------------------------------------------  */
/*  02/01/03         JKL   Original Version                                  */
/*  -----------------------------------------------------------------------  */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
code = ''

'extract content'
text = translate(content)

bif_start = pos('%',text)

if bif_start > 0 then do
  bif_text = substr(text, bif_start)
  bif_end = verify(bif_text,upper,,2)
  bif_text = substr(bif_text,1,bif_end - 1)

  select
    when bif_text = '%ABS' then /* Absolute Value of Expression */
    code = 'BBABS'
    when bif_text = '%ADDR' then /*  Get Address of Variable */
    code = 'BBADDR'
    when bif_text = '%ALLOC' then  /*  Allocate Storage */
    code = 'BBALLOC'
    when bif_text = '%BITAND' then /*  Bitwise AND Operation */
    code = 'BBAND'
    when bif_text = '%BITNOT' then /*  Invert Bits */
    code = 'BBNOT'
    when bif_text = '%BITOR' then /*  Bitwise OR Operation */
    code = 'BBOR'
    when bif_text = '%BITXOR' then /*  Bitwise Exclusive-OR Operation */
    code = 'BBXOR'
    when bif_text = '%CHAR' then /*  Convert to Character Data */
    code = 'BBCHAR'
    when bif_text = '%CHECK' then /*  Check Characters */
    code = 'BBCHK'
    when bif_text = '%CHECKR' then /*  Check Reverse */
    code = 'BBCHKR'
    when bif_text = '%DATE' then /*  Convert to Date */
    code = 'BBDATE'
    when bif_text = '%DAYS' then /*  Number of Days */
    code = 'BBDAY'
    when bif_text = '%DEC' then /*  Convert to Packed Decimal Format */
    code = 'BBDEC'
    when bif_text = '%DECH' then /*  Convert to Packed Decimal Format with Half 
Adjust */
    code = 'BBDECH'
    when bif_text = '%DECPOS' then /*  Get Number of Decimal Positions */
    code = 'BBDECP'
    when bif_text = '%DIFF' then /*  Difference Between Two Date, Time, or 
Timestamp Values */
    code = 'BBDIF'
    when bif_text = '%DIV' then /*  Return Integer Portion of Quotient */
    code = 'BBDIV'
    when bif_text = '%EDITC' then /*  Edit Value Using an Editcode */
    code = 'BBEDITC'
    when bif_text = '%EDITFLT' then /*  Convert to Float External 
Representation */
    code = 'BBEDITF'
    when bif_text = '%EDITW' then /*  Edit Value Using an Editword */
    code = 'BBEDITW'
    when bif_text = '%ELEM' then /*  Get Number of Elements */
    code = 'BBELEM'
    when bif_text = '%EOF' then /*  Return End or Beginning of File Condition */
    code = 'BBEOF'
    when bif_text = '%EQUAL' then /*  Return Exact Match Condition */
    code = 'BBEQUAL'
    when bif_text = '%ERROR' then /*  Return Error Condition */
    code = 'BBERROR'
    when bif_text = '%FIELDS' then /*  Fields to update */
    code = 'BBFIELDS'
    when bif_text = '%FLOAT' then /*  Convert to Floating Format */
    code = 'BBFLOAT'
    when bif_text = '%FOUND' then /*  Return Found Condition */
    code = 'BBFOUND'
    when bif_text = '%GRAPH' then /*  Convert to Graphic Value */
    code = 'BBGRAPH'
    when bif_text = '%HOURS' then /*  Number of Hours */
    code = 'BBHOU'
    when bif_text = '%INT' then /*  Convert to Integer Format */
    code = 'BBINT'
    when bif_text = '%INTH' then /*  Convert to Integer Format with Half Adjust 
*/
    code = 'BBINTH'
    when bif_text = '%KDS' then /*  Search Arguments in Data Structure */
    code = 'BBKDS'
    when bif_text = '%LEN' then /*  Get or Set Length */
    code = 'BBLEN'
    when bif_text = '%LOOKUP' then /*  Look Up an Array Element */
    code = 'BBLOO'
    when bif_text = '%LOOKUPLT' then /*  Look Up an Array Element */
    code = 'BBLOO'
    when bif_text = '%LOOKUPLE' then /*  Look Up an Array Element */
    code = 'BBLOO'
    when bif_text = '%LOOKUPGT' then /*  Look Up an Array Element */
    code = 'BBLOO'
    when bif_text = '%LOOKUPGE' then /*  Look Up an Array Element */
    code = 'BBLOO'
    when bif_text = '%MINUTES' then /*  Number of Minutes */
    code = 'BBMIN'
    when bif_text = '%MONTHS' then /*  Number of Months */
    code = 'BBMON'
    when bif_text = '%MSECONDS' then /*  Number of Microseconds */
    code = 'BBMSEC'
    when bif_text = '%NULLIND' then /*  Query or Set Null Indicator */
    code = 'BBNULL'
    when bif_text = '%OCCUR' then /*  Set/Get Occurrence of a Data Structure */
    code = 'BBOCCUR'
    when bif_text = '%OPEN' then /*  Return File Open Condition */
    code = 'BBOPEN'
    when bif_text = '%PADDR' then /*  Get Procedure Address */
    code = 'BBPADDR'
    when bif_text = '%PARMS' then /*  Return Number of Parameters */
    code = 'BBPARM'
    when bif_text = '%REALLOC' then /*  Reallocate Storage */
    code = 'BBREALL'
    when bif_text = '%REM' then /*  Return Integer Remainder */
    code = 'BBREM'
    when bif_text = '%REPLACE' then /*  Replace Character String */
    code = 'BBREPL'
    when bif_text = '%SCAN' then /*  Scan for Characters */
    code = 'BBSCAN'
    when bif_text = '%SECONDS' then /*  Number of Seconds */
    code = 'BBSEC'
    when bif_text = '%SHTDN' then /*  Shut Down */
    code = 'BBSHUT'
    when bif_text = '%SIZE' then /*  Get Size in Bytes */
    code = 'BBSIZE'
    when bif_text = '%SQRT' then /*  Square Root of Expression */
    code = 'BBSQRT'
    when bif_text = '%STATUS' then /*  Return File or Program Status */
    code = 'BBSTAT'
    when bif_text = '%STR' then /*  Get or Store Null-Terminated String */
    code = 'BBSTR'
    when bif_text = '%SUBDT' then /*  Extract a Portion of a Date, Time, or 
Timestamp */
    code = 'BBSUBD'
    when bif_text = '%SUBST' then /*  Get Substring */
    code = 'BBSUBS9'
    when bif_text = '%THIS' then /*  Return Class Instance for Native Method */
    code = 'BBTHIS'
    when bif_text = '%TIME' then /*  Convert to Time */
    code = 'BBTIME'
    when bif_text = '%TIMESTAMP' then /*  Convert to Timestamp */
    code = 'BBTMST'
    when bif_text = '%TLOOKUP' then /*  Look Up a Table Element */
    code = 'BBTLOO'
    when bif_text = '%TLOOKUPLT' then /*  Look Up a Table Element */
    code = 'BBTLOO'
    when bif_text = '%TLOOKUPLE' then /*  Look Up a Table Element */
    code = 'BBTLOO'
    when bif_text = '%TLOOKUPGT' then /*  Look Up a Table Element */
    code = 'BBTLOO'
    when bif_text = '%TLOOKUPGE' then /*  Look Up a Table Element */
    code = 'BBTLOO'
    when bif_text = '%TRIM' then /*  Trim Blanks at Edges */
    code = 'BBTRIM'
    when bif_text = '%TRIML' then /*  Trim Leading Blanks */
    code = 'BBTRIML'
    when bif_text = '%TRIMR' then /*  Trim Trailing Blanks */
    code = 'BBTRIMR'
    when bif_text = '%UCS2' then /*  Convert to UCS-2 Value */
    code = 'BBUCS2'
    when bif_text = '%UNS' then /*  Convert to Unsigned Format */
    code = 'BBUNS'
    when bif_text = '%UNSH' then /*  Convert to Unsigned Format with Half 
Adjust */
    code = 'BBUNSH'
    when bif_text = '%XFOOT' then /*  Sum Array Expression Elements */
    code = 'BBXFOOT'
    when bif_text = '%XLATE' then /*  Translate */
    code = 'BBXLAT'
    when bif_text = '%YEARS' then /*  Number of Years */
    code = 'BBYEAR'
  otherwise
  NOP
  end /* select */
end

if code <> '' then 'code { 3 EVFRILSH.IDM' code
else 'ILEPAR HELP'

exit /* end program */





As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2024 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.