[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

837.0. "How to know which field you are on with /PRE?" by FAILTE::LAAHS (An accumulation of Celts) Tue Jun 09 1992 18:06

    In a field /PRE qualifier I want to use the field name to look up
    another database.
    
    My problem is that OA$FIELD_NAME is not set until after the /PRE
    qualifier has been executed and therefore is always pointing to the
    previous field.
    
    Any suggestions? I've played around with using OA$FLD_STAY inside the
    /PRE etc but no joy.
    
    Thanks,
    Kevin
T.RTitleUserPersonal
Name
DateLines
837.1/PRE="SCRIPT script"HYTIDE::CREAMEREARS to you, mate!!Tue Jun 09 1992 18:3312
    
    Kevin,
    
    What if the /PRE called a script-script which would be executed
    as soon as the cursor landed on the field (after OA$FIELD_NAME
    is set) and before the user has the chance to enter data?
    
    It may not be elegant, but it should get the job done...  ;')
    
    HTH,
    
    Jack
837.2Or am I missing something here?SCOTTC::MARSHALLPearl-white, but slightly shop-soiledTue Jun 09 1992 18:4719
Hi,

This may seem a bit obvious, but:

    ;;fieldx;;

    /pre="GET 'Field name is: fieldx'"

    ;;fieldy;;

    /pre="GET 'Field name is: fieldy'"

ie: you always know by the physical context of the /PRE what the field name is,
so can't you just use the name literally?

(If the /PRE calls a XOP to do the work, you could always load a symbol with the
field name prior to doing the XOP, etc...)

Scott
837.3A V3.0 possibility...CESARE::EIJSAll in 1 PieceTue Jun 09 1992 18:5451
    
    Kevin,
    
    Some 'stupid' questions:
    
    - ALL-IN-1 V2.* or V3.0?
    - The field will be accessed by arrow keys only?
    - You know the name of the field in front and after?
    
    If in V3.0, the OA$FORM_INFO data set gives you some help in deciding
    what the name of the field is:
    
      ;;PREV_FIELD;;
    
      /PRE="GET #PREV_FIELD = #POST_FIELD = ''"
      /POST="GET #PREV_FIELD = OA$FIELD_NAME"
    
      ;;FIELD;;
    
      /PRE='GET #FIELD = #DONE = "" \
       GET OA$FUNCTION="FOR OA$FORM_INFO:" OA$FORM_NAME " DO 
       IFEXIT \\
       GET #FIELD_SAV = #FIELD \\  
       GET #FIELD = .FIELD_NAME \\
       .IF #DONE THEN OA$FLD_EXIT \\
       IFEXIT \\
       .IF #PREV_FIELD NES "" THEN
         GET #DONE = 1 \\
       .IF #POST_FIELD NES "" THEN
         GET #FIELD = #FIELD_SAV \\\\
         OA$FLD_EXIT \
      OA$FLD_STAY \
      .
      and then #FIELD contains the name of the field... 
    
      ;;POST_FIELD;;
    
      /PRE="GET #PREV_FIELD = #POST_FIELD = ''"
      /POST="GET #POST_FIELD = OA$FIELD_NAME"
    
    etc.
    
    Now this is a V3.0 hack. I'm sure a simpler solution must be around.
    
    HTH, 
    
    	Simon
    
    PS You see Andrew, now that we've won the UEFA cup (Ajax Amsterdam) and
    a Dutch guy made sure BArcelona won the Europe Cup, I'm getting more
    creative all the time ;-) ;-)
837.4Colisions all the time...CESARE::EIJSAll in 1 PieceTue Jun 09 1992 18:5810
    
    Happens when your writing notes interactively. Takes some time and
    other beat you.
    
    .2 Is the whack on the side of my head. Makes even thinking of a
    solution like in .3 superfluous. 
    
    Ciao,
    
    	Simon
837.5Little syntax problemCESARE::EIJSAll in 1 PieceTue Jun 09 1992 19:0313
    
    ...and then even forgetting a '"':
    
    >       .IF #POST_FIELD NES "" THEN
    >         GET #FIELD = #FIELD_SAV \\\\
    >         OA$FLD_EXIT" \
    
    Ciao,
    
    	Simon
    
    
    PS No, no one-man note here, although it might look like
837.6So there is a problem with OA$FIELD_NAME and /pre?FAILTE::LAAHSAn accumulation of CeltsThu Jun 11 1992 11:5811
    Thanks for the replies.
    
    They indicate that there is indeed a problem in using OA$FIELD_NAME in
    a /PRE.
    
    All the replies are workarounds to my particular problem but it's
    unfortunate that I cannot use OA$FIELD_NAME since this would be the
    most elegant solution to my particular problem.
    
    Thanks,
    Kevin