[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

4025.0. "Putting form field values into BLP" by ANGLIN::HARRISA (Touring the world for apple struedl) Thu Mar 24 1994 19:24

    ALL-IN-1 v3.0-1, OPENVMS 5.5-2
    
    i'm trying to merge a .DAT file into a .BLP and am not doing to well. i
    have an entry form (GREG1.FRM) with 2 fields...
    
    ;;.TYPE;;
    
    ENTRY /MODE=UPDATE /KEY=REQUESTOR
    
    ;;.FILE;;
    
    APPL$DISK:[ALLIN1]GREG.DAT,REQUESTOR
    
    ;;REQUESTOR;;
    
    /PUT_SAVE= #REQUESTOR
    
    ;;EMP_NUMBER;;
    
    /PUT_SAVE = #EMP_NUMBER
    
    i have a .BLP  (GREG!.BLP) with the following:
    
    <&BOLD>REQUESTOR:<&CLEAR><&TAB 02><REQUESTOR> <->
    <&TAB 10><&BOLD>EMPLOYEE NUMBER:<&CLEAR><EMP_NUMBER>
    
    when i try to do:
    
    	<MERGE GREG1.BLP,GREG.LIS,[ALLIN1]GREG.DAT
    
    the GREG.LIS file is created but all it contains is:
    
    REQUESTOR:  EMPLOYEE NUMBER:
    
    REQUESTOR:  EMPLOYEE NUMBER:
    
    what i want is to have the values from the 2 fields put into the .BLP.
    what am i doing wrong?
    
    	Ann
T.RTitleUserPersonal
Name
DateLines
4025.1Tutorial in the A1 Prog. GUIDE is good practiceGANTRY::HULLDigital Consulting [Delivery]/MotownThu Mar 24 1994 20:0145
>    <&BOLD>REQUESTOR:<&CLEAR><&TAB 02><REQUESTOR> <->
>    <&TAB 10><&BOLD>EMPLOYEE NUMBER:<&CLEAR><EMP_NUMBER>
    
>    when i try to do:
    
>    	<MERGE GREG1.BLP,GREG.LIS,[ALLIN1]GREG.DAT

you don't use the datafile here ---^, it's referenced in the BLP; see
below.  Merge should just read  <MERGE GREG1.BLP, GREG.LIS
    
>    the GREG.LIS file is created but all it contains is:
    
>    REQUESTOR:  EMPLOYEE NUMBER:
    
    
Ann - you aren't specifying enough info for the BLP to retrieve the data.
The template file (.BLP) needs to be able to resolve the full Data Set
Reference (DSR) when it does the merge.

So, using your example, you need:

    <&BOLD>REQUESTOR:<&CLEAR><&TAB 02><GREG1.REQUESTOR["key value"]> <->
    <&TAB 10><&BOLD>EMPLOYEE NUMBER:<&CLEAR><GREG1.EMP_NUMBER["key value"]>

your entry form, GREG1, is the Data set. GREG1 has the datafile definition
in it's .FILE named data area. For just 2 fields like this, full DSR calls
are okay.  For getting lots of fields in a record from 1 dataset, the
better way is to OPEN the set, get all the fields, and then CLOSE the set,
like this:

    <GET GREG1.%OPEN["key value"]><->
    <&BOLD>REQUESTOR:<&CLEAR><&TAB 02><.REQUESTOR> <->

     notice the 'dot' in the ref's-----^ 

    <&TAB 10><&BOLD>EMPLOYEE NUMBER:<&CLEAR><.EMP_NUMBER>
    <GET .%CLOSE>

All these examples are retrieving just 1 record's info for 1 keyfield value.
There are other techniques for doing this same stuff in a loop for all
records. Look at the named data, scripts and forms used in the DIR PER
option in A1 on the Index option for the X_PRINT (Brief), etc.

	Al

4025.2ok, but....ANGLIN::HARRISATouring the world for apple struedlFri Mar 25 1994 16:3317
    THANKS al!!!
    
    I've got this working for 1 record in the .DAT file. now to get it
    working for multiple records. what i have is a DO script (GREG1.SCP)
    
    FOR GREG1 WITH .REQUESTOR NES "" DO -
            GET #KEY = .REQUESTOR do -
     \\GET OA$FUNCTION = " MERGE " 'GREG1.BLP, GREG1.LIS'
    
    this will create a .LIS file for each entry in GREG.DAT. what i want is
    1 GREG1.LIS for the ENTIRE .DAT file.
    
    thanks in advance for any help...
    		
    		Ann
    
    
4025.3ANGLIN::HARRISATouring the world for apple struedlFri Mar 25 1994 16:4810
    i think i figured it out....
    
    if i user a .BLP with :
    
    <&oa for greg1 with .requestor nes "" <->
     do merge_line <.requestor:30> <.emp_number>>
    
    i get what i want!  if anyone has a better way....
    
    	ann
4025.4Following A1 standard code in DIR PERGANTRY::HULLDigital Consulting [Delivery]/MotownFri Mar 25 1994 18:5447
Standard templates SELECTIONLIST1.BLP and SELECTIONLIST.BLP  (for 1 record or
many recs) in OA$BLP: show the (more complex) code used in the DIR PER Index
for printing. 

<MERGE SELECTIONLIST,SELLIST.SEL    just takes your selections, and creates a 
flat text file of the key values, 1 key per line (SELLIST.SEL).

One of the params you can pass on the MERGE line is the list of key values to 
process:

syntax:  MERGE  template, outfile [, keylist, headerfile]

so make a KEYLIST.BLP like this:

<for greg1 do get oa$function = "get oa$merge_line = '" .%key "'">

and run it using  <MERGE  KEYLIST, SELLIST.SEL

then process the real merge using the SELLIST file as the list of all keys:

<MERGE GREG1.BLP, GREG1.LIS, SELLIST.SEL, HEADERS.BLP


Put it all together in a script and off you go.  As an example, here's my 
generic A1 application script that feeds the list of SELected records from an 
Index form to a Print action for those records.  The SELLIST.SEL file is 
produced in the Index's Named Data, but works just like the above example.

! APPL_PRINT_BRIEF.SCP

!       This script prints a brief description of the records contained in
! the current index.
.LABEL START
!DISPLAY "Creating directory listing of selected records . . ."
        GET OA$DISPLAY=OA$_DIR_CREDIRLST\force
        GET #SELFILE="APPLLIST.SEL"
        .IF OA$DIR:"*.*".%WHOLE[#SELFILE] == "" THEN .GOTO NO_SEL
        MERGE APPLBRIEF.BLP,APPLBRIEF.LIS,APPLLIST.SEL,APPLHDRB.BLP
        GET #PRINT_FILE="APPLBRIEF.LIS"
        GET #PRINT_DSAB="ASCII"\DO WPPRINT
        .EXIT

.LABEL NO_SEL
!DISPLAY "You must do an Index to create the selection of records to print"
        GET OA$DISPLAY=OA$_DIR_NOINDAVA