Alternative to Mirror a variable in a "Roster'' in another roster

Discussions about CSEntry
Post Reply
Yass
Posts: 103
Joined: November 11th, 2017, 1:26 am

Alternative to Mirror a variable in a "Roster'' in another roster

Post by Yass »

Dear Cspro,

Since you cannot mirror a variable in a roster in another roster, pls what is the easy way out CSPRO Team, if i want to bring a field from a roster to another.
For instance in section 1 I have a variable name "NoDrinks", i want to mirror "NoDrinks" with its line "ID" in section Section 2.

Help needed asap!!!

Thanks
khurshid.arshad
Posts: 618
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Alternative to Mirror a variable in a "Roster'' in another roster

Post by khurshid.arshad »

Dear Yass;

Please see attached example. I hope it works for your.
Best.
a.
You do not have the required permissions to view the files attached to this post.
josh
Posts: 2403
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Alternative to Mirror a variable in a "Roster'' in another roster

Post by josh »

@Khurshad's solution is good although I would use preproc instead of onfocus in R2_PID.
Yass
Posts: 103
Joined: November 11th, 2017, 1:26 am

Re: Alternative to Mirror a variable in a "Roster'' in another roster

Post by Yass »

Thanks Khurshad and Josh!!

Khurshad , let me add this scenario for ur assistance , am having a challenge in addressing as well, from what you helped me to do to bring "NoDrinks" in section 2. I have section 3, that I have this question MonHoursLate, in section 3 that is answered for both "Drinks" and "NoDrinks". I will like to bring members that respond "NoDrinks" and "MonHourslate" in section 4 with their IDs same as section 1, 2, 3 and in 4. Help boss
khurshid.arshad
Posts: 618
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Alternative to Mirror a variable in a "Roster'' in another roster

Post by khurshid.arshad »

Please use this syntax for section 3 and i will share the syntax for section 4 shortly.

Code: Select all

{You can do in two different ways}

{First Option

	Preproc
		getpid = curocc();
		seekR1 =seek(R1_PID , @getpid);
		if seekR1>0 then
			$=R1_PID(seekR1);
		else
			endgroup;
		endif;
}

{Second Option}

Preproc

	If curocc() > count(R1_PID) then
		endgroup;
	else
		$=curocc();
	endif;
Yass
Posts: 103
Joined: November 11th, 2017, 1:26 am

Re: Alternative to Mirror a variable in a "Roster'' in another roster

Post by Yass »

Thanks and waiting!!
khurshid.arshad
Posts: 618
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Alternative to Mirror a variable in a "Roster'' in another roster

Post by khurshid.arshad »

Dear Yass;
Sorry for the delayed response. Please see attached application. Please let me know if it works.

I will request to Josh and Martin that if we can improve syntax in the attached example.

Best.
a.
You do not have the required permissions to view the files attached to this post.
Post Reply