Skipping rows in rosters

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
Jayanta
Posts: 9
Joined: July 28th, 2021, 4:04 am

Skipping rows in rosters

Post by Jayanta »

Hi All,

I have this query of implementing skips on rows of a roster. Kindly help me achieve this scenario.

For instance, I have a roster NAME_OF_THE_HOSPITAL000. It has 5 rows and one of it's column field is SPEC.
The validation for these fields are such:
(1) if SPEC value is 1 for any row, let's say Row1, it skips to next row, that is Row2.
(2) if SPEC value is 2 for Row3 particularly, it skips to next to next row, that is Row5.

My code is as such:

Code: Select all


PROC SPEC

if SPEC = 1 then skip to next;
endif;

if SPEC(3) = 2 then skip to SPEC(5);
endif;

On entering value 1 in Row 5, it works fine and skips to next row.
However, I'm getting error on entering value 2 in Row5, that is: "Unable to skip, target item is the current item"

Image
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Skipping rows in rosters

Post by Gregory Martin »

The problem is that this code always checks the value of the third SPEC, so even when you're on fifth SPEC, if SPEC(3) is 2, you'll be trying to skip:
if SPEC(3) = 2 then skip to SPEC(5);
endif;
Do this instead:
if curocc() = 3 and SPEC = 2 then skip to SPEC(5);
endif;
Jayanta
Posts: 9
Joined: July 28th, 2021, 4:04 am

Re: Skipping rows in rosters

Post by Jayanta »

Thank you Gregory Martin,
This made my task easier. Thanks a ton. 8-) !
Post Reply