[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

379.0. "Special field name ["0"]" by MELKOR::RUDDY (Home is where overhead is) Tue Mar 31 1992 20:37

    Help ...
    
    I've got a weird situation ... Almost as good as #user:H
    
    My student has got a file, which has two keys. The alternate key
    will allow duplicates.
    
    Let's say that there are 4 records with the same duplicate key value,
    "A"
      
    The code to access the records one right after the other doesn't work
    right. 
    
    DATASET:ALT.%NEXT[""] 
    
    Will get the first record with alternate value A, the second time this is
    accessed will return the second record with "A". The third call will
    return the second record with "A" and all subsequent calls will only
    return the second record. 
    
    But this student was trying all kinds of things and tried a DSR that
    looked like this.
    
    DATASET:ALT.%NEXT["0"] ... AND IT WORKS!
    
    {twilight zone music} I don't understand it. 
      
    Can anyone explain it? His concern is that this is exactly what he
    wants and is this supposed to work like this, or isn't it.
    
    Thanks,
    
    Mia Ruddy
    Santa Clara Training Center 
     
      
    
    
    
     
T.RTitleUserPersonal
Name
DateLines
379.1Try .%SEQ_NEXTSHALOT::WARFORDRichard Warford @OPA DTN 393-7495Wed Apr 01 1992 04:5314
    I don't know why this would work, but I would suspect what he really
    wants to use is .%SEQ_NEXT instead of .%NEXT.
    
    .%NEXT returns the next record from the key specified in the DSR.
    .%SEQ_NEXT returns the next record from the CURRENT pointer in the file.
    
    
    I would suspect that what he is seeing is a 'bug' in ALL-IN-1. Failing
    to find the key specified "0", the record position didn't get changed,
    and then the next record was read. So it behaved like .%SEQ_NEXT.
    If this is the case, then if/when the bug got fixed, his code would
    break. Using .%SEQ_NEXT would give a higher future compatibility!
    
    Rick
379.2More clairification on .SEQ_NEXTMELKOR::RUDDYHome is where overhead isWed Apr 01 1992 20:2913
    Rick,
    
    Thanks for the info, but could I get some clarification on .%SEQ_NEXT.
    
    I must have misunderstood the documentation. But from what I understand
    won't seq_next give me the next sequential record in order of the
    primary key. What I want is the record in seq order of a duplicate primary
    key.
    
    If so then that solves my problem, but could you explain .SEQ_NEXT a
    little more for me, I'd appreciate it.
    
    Mia