Syntax If on Occurrences Variable

Discussions about CSEntry
khurshid.arshad
Posts: 572
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Syntax If on Occurrences Variable

Post by khurshid.arshad »

Dear Langitluna

Based on what i have understood, please see syntax.

Code: Select all

PROC GLOBAL
	numeric FlagRow;

PROC QQ_FF

PROC FQ1
	If curocc()=1 and $=4 then
		FlagRow=1;
		skip to FQ1(10);
	else
	endif;

	if Curocc()=10 and FlagRow =1 then

		move to FQ1(FlagRow);
	else
	endif;
arshad.
langitluna
Posts: 32
Joined: December 4th, 2016, 10:57 pm

Re: Syntax If on Occurrences Variable

Post by langitluna »

Thanks arshad.

I tried but its not work. sorry for my ignorance.

For Example:
FQX Rooster: have values to entry does not in order: 1,4,3,6
if value 4 then skip to FQO. FQO is string alpha. Then after FQO entered, then back to FQX to continue others value, but after value 4.

Would you please see PQPROJECT1.zip

The next question for logic on variable E2A E2B and E2C that depend on FQY rooster.
E2A : IF FQY(1) = 1
E2B : IF FQY(2) = 1 OR IF FQY(3) = 1
E2C : IF FQY(4) = 1

I tried to use this logic but does not work:
on E2A Preproc if FQY(1)=0 then skip to E2B; else skip to E2C ..

Please see PQPROJECT1.zip

Please help me. Thank you very much
Attachments
pqproj1.PNG
pqproj1.PNG (24.33 KiB) Viewed 5176 times
PQPROJECT1.zip
(3.44 KiB) Downloaded 276 times
langitluna
Posts: 32
Joined: December 4th, 2016, 10:57 pm

Re: Syntax If on Occurrences Variable

Post by langitluna »

I tried only put logic on E2A and E2B, as below.
Does it correct ? Please advice. Thanks

Code: Select all

PROC E2A

if FQY(2)=1 then
if FQY(3)=1 then
if FQY(4)=1 then
 skip to FINISH;
else skip to E2C;endif;
else skip to E2B;endif;
else skip to E2B;endif;

PROC E2B

if FQY(4)=1 then
 skip to FINISH;
khurshid.arshad
Posts: 572
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Syntax If on Occurrences Variable

Post by khurshid.arshad »

Answer for first question:

Code: Select all

PROC PQPROJECT_QUEST
Preproc
FlagRow=0;

Code: Select all

	If Flagrow>0 then
	else
		If $=4 then
			FlagRow=curocc();
			skip to FQO;
		else
		endif;
	endif;

Code: Select all


PROC FQO


Preproc

	if $<>"" then

		skip to E2A;
	else
	endif;

Postproc

	If Flagrow >0 then
		if $ = "" then errmsg("Others. Please specify.");
			reenter;
		else
			move to FQX(FlagRow);
		endif;
	else
	endif;
langitluna
Posts: 32
Joined: December 4th, 2016, 10:57 pm

Re: Syntax If on Occurrences Variable

Post by langitluna »

Thanks arshad. You are so kind.
very appreciate.
langitluna
Posts: 32
Joined: December 4th, 2016, 10:57 pm

Re: Syntax If on Occurrences Variable

Post by langitluna »

Dear Arshad

The logic is working fine. Can I just skip to FQX(3) after FQO rather than on last position on FQX?
Ss, If value I must enter on FQX are: 1,4,3,6 then :
After 4 (that: if FQX=4 then skip to FQO), then type specified on FQO, then back to FQX. Your logic would skip to FQX(2) which is the last position.
Could it possible to skip to FQX(), but after 4 . on this example on FQX(3). Then I just continue TO ENTRY 3 and 6. Please see the screenshot.

Thanks Arshad
Attachments
pqproj_afterFQO.PNG
pqproj_afterFQO.PNG (13.66 KiB) Viewed 5165 times
khurshid.arshad
Posts: 572
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Syntax If on Occurrences Variable

Post by khurshid.arshad »

Dear Langitluna

I hope it works. Please see syntax under "PROC FQX".

Code: Select all

PROC GLOBAL
Numeric Flagrow,i =0;

PROC PQPROJECT_FF
PROC PQPROJECT_QUEST

Preproc
	FlagRow=0;

PROC FQX
onfocus
	If Flagrow>0 then
		i=1;
		while i<=6 do
			if curocc(PQPROJECT_REC)>=1 and $=4 then
			i=curocc(PQPROJECT_REC);
				move to FQX(1+i);
			else
				i=inc(i);
			endif;

		enddo;

	else
	endif;
Postproc
	If Flagrow>0 then
	else
		If $=4 then
			FlagRow=curocc();
			Move to FQO;
		else
		endif;
	endif;


PROC FQO

Preproc
	if $<>"" then
		skip to E2A;
	else
	endif;
Postproc
	If Flagrow >0 then
		if $ = "" then errmsg("Others. Please specify.");
			reenter;
		else
			move to FQX(FlagRow);
		endif;
	else
	endif;
a.
Post Reply