i'm surprised this script works in pro, because the second Go to Portal is the row it is going to which is whatever number $recnum is at the time. The +4 is only added for the one line above. I will give you an example of what your script does. Also note If you don's set $recnum then it will be 0
Goto portal Row [....;$recnum+4] will always go to record 4 because 0+4 is alway 4. Adding 4 to a variable here will make it local only to only this line.
Goto protal Row [....;$recnum] will then go to record 0 because $recnum is still 0
Script should be something like
Goto portal Row[Select;Last]
Goto portal row [select;no dialog;$middle]
sorry, should have made myself clearer...
these lines are at the end of a script that sorts a set of records (approx 300) in a table which is displayed in a nine-row portal, then tests each one against a foreign key, then sets the local variable $recnum to the RecordNumber of that record within that set,
so going to that $recnum within the portal would default to displaying that record at the bottom of the portal, but to make life slightly easier, I added a step to set the portal row to four records beyond the one I want, then back to the one I want - the portal doesn't re-scroll, and the record I want is now centre of the portal display ...
I did a test on Filemaker Pro 12 with two scripts. One script goes to portal row 10 then goes to portal row 6, and the second script just goes to portal row 6. The first script does nothing different than the second script, No matter which script I run I end up on record 6 and it is the first Item in the portal. I can't duplicate what you descrip happens on Pro. I get the same results on pro and Go.
screen shot is basic part of script.... $recnum depends entirely on the position of the record in the sorted set
After further testing Pro and Go work the same for me, which works sometime. The go portal row + 4 doesn't always work. I think a case statement based on the number of records and the record selected, will determine which record to go to in the first go to portal row will fix the issue.
hi - i tried a suggestion that you posted - which curiously came into my email but isn't visible in the thread here... (?)
about going to last row, then back to the one you want - works on FMP (sets record to first row) but not Go...
starting to give up :(
your post said "I got this working on pro and go. Instead of go to portal row recnum+4, i used go to portal row first, then goto portal row recnum."
I removed that post because it didn't always work either, after further testing. Your recnum+4 work most of the time, but not all the time. I will do more testing when I have time. I ran out of time this morning.
Take a look at this sample. With larger number of files, I started having problem with go. Inserted Refresh Window in between go to portal row and seem to have fixed.