Downrecord glitch?

There seem to be a problem with the downrecord command in programming since the recent update. I have a formula that creates an array of records, to then process their data, and it was jumping to every second record. I thought something had gone wrong with the programme, even though I hadn’t changed it. However, then I wrote a quick simple ‘downrecord’ programme with the appropriate records selected, and a fixed number of times specified, and it still jumped every second record.

Works fine for me.

I’ve reported something similar in three past, but I don’t have time to find it now. For me as I remember it was the arrow keys misbehaving in a similar way and my solution had to do with some other form not being open…

Bill Conable

This symptom occurs when you have both the Data Sheet and a View-as-List form open at the same time. Close one or the other and it will work properly.

Michele - that might also be the cause of your unexpected list action at:

Thank you. Problem solved. Is there a code to close all but the active window that I could put at the beginning of the procedure to make sure this doesn’t occur?

Thanks Michael,
Unless it was coincidence, which seems unlikely, this has fixed my text list problem as well.

This is what I use:

;  Close unwanted windows in the newly-opened database and save window changes

local jdElement
let jdCurrentWindow = info("windowname") 
let jdOpenWindows = arraystrip(arrayfilter(info(“windows”),cr(),{?(import() = jdCurrentWindow,"",import())}),cr())

if jdOpenWindows > ""
    looparray jdOpenWindows,cr(),jdElement
        window jdElement

Here is a slight variation on Michael’s solution that only closes windows belonging to the active database leaving the window that was active when executed still open.

local openWindows, dbName
looparray openWindows, cr(), element, index
    if element beginswith dbName+":"
        window element

Gary’s code is certainly better if you wish to keep one or more other databases open.

One aspect of my code is that, if you want to leave one or more other windows open in the active database, you can change this:

let jdOpenWindows = arraystrip(arrayfilter(info(“windows”),cr(),{?(import() = jdCurrentWindow,"",import())}),cr())

to this

let jdOpenWindows = arraystrip(arrayfilter(info(“windows”),cr(),{?(import() = jdCurrentWindow or import() = "My other window","",import())}),cr())

I think you can achieve the same result with Gary’s code by following this line of code:


with this one:

openWindows=arraydeletevalue(openWindows,"My other window",cr())

but I haven’t tested that.

Thanks to both of you.