Creating Help Text using MS-WORD and transferring it into LANSA for the AS/400

Date:Archived
Product/Release:LANSA for the AS/400
Abstract:It is possible to create help text using MS-WORD and then transfer this help text into LANSA for the AS/400 on the AS/400.
Submitted By:LANSA Technical Support
  1. Using MS Word create help text (up to 77 characters wide) then save the help text document with type Text Only (Eg WORDHELP.TXT)
  2. Use shared folders to get the file across to the AS/400 (Eg WORDHELP)
  3. * Create a physical file (no DDS) with a record length of 77 (Eg CRTPF FILE(WORDHLP) RCDLEN(77) TEXT('Help Text from MS Word')
  4. Copy from the folder to a new PF(Eg CPYFRMPCD FROMFLR(WORDHELP) TOFILE(WORDHLP) ROMDOC(WORDHELP.TXT))
  5. * Display the file to check that everything is OK so far
  6. * Go into the LANSA partition that is being used
  7. * Create a file that is maintained by OTHER
  8. * Load this OTHER File
  9. * Make the File operational
  10. * Create a Process (Eg WORDHELP)
  11. * Create a Function (Eg WORDHLP) that looks similar to the following RDML
  12. * Compile the Function
  13. Execute the Function
* ******** Beginning of RDML commands **********   
                       
DEF_LIST    NAME(#WKHLPL) FIELDS((#WORDHLP)) TYPE(*WORKING) 
SELECT      FIELDS((#WORDHLP)) FROM_FILE(WORDHLP) 
 ADD_ENTRY TO_LIST(#WKHLPL)
ENDSELECT 
USE         BUILTIN(PUT_HELP) WITH_ARGS(?????? ''' ''' 'DF' #WKHLPL  
            ) TO_GET(#RETCOD) 
IF          COND('#RETCOD = OK') 
 MESSAGE    MSGTXT('Help text successfully added to field ??????') 
ELSE 
 MESSAGE    MSGTXT('ERROR *** Help text addition NOT successful') 
ENDIF 
* ********* End of RDML commands **********  

The ?????? represents the field name that will be used. Of course a REQUEST could be added and a variable put in here.

This example replaces all the helptext for a field but with a little extra work it could be made more flexible; some possibilities include:

  1. Adding help text
  2. Putting in $$NOAUTO,
  3. Editing the help text that is there and the help text from MS Word if you like.

* means that this step only has to be done once. So, once you have set up the method it is much easier to do the second and subsequent times. PS Even automate it a little!