Bug in Panorama LOOKUP

I guess my point is, every time I use “select”, I always follow it with if info(“empty”) even when testing. It’s just automatic.

I’ve put together a proposal for a new statement, looprecords. This proposed statement would loop from the top to the bottom of a database, stopping at each selected record. This is a common operation, so simplifying it would be nice. Here is how this statement would be used.

looprecords
    ... do something with/to this record
endloop

The proposed looprecords statement would also automatically handle empty selections correctly. Under the hood, the code above would work the same as if you used this code in the current version of Panorama (either 6 or X).

if info("empty")=false()
    firstrecord
    loop
        ... do something with/to this record
        downrecord
    until info("stopped")
endif

I’ve done some preliminary investigation and I think implementing this statement will not be too difficult. Here is a link to the proposal in BitBucket.

I think this is the crux of the argument - the data sheet display is just cosmetic.

For what it’s worth, every system I’ve written works through forms and the user doesn’t even know there’s a data sheet.

This is what I do also, and it got me to thinking – could this be easier?

I’ve now added a new statement to Panorama X – ifselect. This combines if, select and info(“empty”) all into one. Here’s an example:

ifselect Customer = "John Smith"
    field Status
    formulafill "Cancelled"
else
    message "Not found"
endif

Nothing you couldn’t do before, but I think it’s a bit cleaner and easier than using info(“empty”). This will be in the next release of Panorama X – it’s already done and working.

1 Like

I will definitely make use of this, if we migrate to PanX in the future. Thanks.

Nice touch

Like so many good things in life, you wonder why you didn’t do it years ago. A great move Jim.

As soon as I thought of the idea I immediately decided to go for it. It would have been quite a bit of work to add this to Panorama 6. It was a little bit more work to add it to Panorama X than I initially thought it would be, but still, it only took a couple of hours to do.