Joined: 08 Aug 2012
Online Status: Offline
Posts: 36
Topic: Formula Help. Posted: 29 Aug 2012 at 8:23am
hey can someone help me, this formula is breaking and i cant quite figure out why. It is saying that "a boolean is required here" at the first "Else if" statement.
WhileReadingRecords;
local numbervar total;
local numbervar i:=1;
local stringvar result;
if {ClassSchedule1.CourseId}=1 then
(
Global stringvar array TD;
Global stringvar array TDName;
total := count(TD);
for i:=1 to total do
(
result := result & td & tdname & chr(13)
)
)
else if {ClassSchedule1.CourseId}=2 then
(
Global stringvar array CC1;
Global stringvar array CC1Name;
result:="CC1"
)
else if {ClassSchedule1.CourseId}=3 then
(
Global stringvar array CC2;
Global stringvar array CC2Name;
result:="CC2"
);
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 29 Aug 2012 at 11:25am
I believe you need a semicolon after the for statement.
WhileReadingRecords;
local numbervar total;
local numbervar i:=1;
local stringvar result;
if {ClassSchedule1.CourseId}=1 then
(
Global stringvar array TD;
Global stringvar array TDName;
total := count(TD);
for i:=1 to total do
(
result := result & td & tdname & chr(13)
)
; )
else if {ClassSchedule1.CourseId}=2 then
(
Global stringvar array CC1;
Global stringvar array CC1Name;
result:="CC1"
)
else if {ClassSchedule1.CourseId}=3 then
(
Global stringvar array CC2;
Global stringvar array CC2Name;
result:="CC2"
);
result
If statements and for loops are a nuisance in Crystal syntax. Basic syntax (for me) is easier to follow.
Joined: 08 Aug 2012
Online Status: Offline
Posts: 36
Posted: 30 Aug 2012 at 2:47am
so i found a work around- Though maybe someone smarter than me can explain why it works exactly, vs. just my uderstanding of "it was looking for a result that id couldnt find in the for statement"
if {ClassSchedule1.CourseId}=1 then
(
Global stringvar array TD;
Global stringvar array TDName;
total := count(TD);
Result:="Total Waiting: " & Totext(Count(td) -1,0) & chr(13);
for i:=1 to total do
(
if not(td="") then
result := result & td & " - " & tdname & chr(13)
);
""
)
else if {ClassSc....
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum