Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

for- loop

Status
Not open for further replies.

ajp18

Programmer
Joined
Jun 13, 2003
Messages
57
Location
US
hi,

I am getting True as a value of the following formula instead of numeric value;

Formula:

numbervar i:=1;
for i := 1 to count({?EmpNos}) step 1 do
(
{?EmpNos}
);

Thanks
 
I am sorry I made a mistake in the formula;
Formula:

numbervar i:=1;
for i := 1 to count({?EmpNos}) step 1 do
(
{?EmpNos}
);



Any suggestions?
 
What are the results you want to get? If you want to display a series of numbers, then try this:

whileprintingrecords;
numbervar i:=1;
stringvar display;

for i := 1 to count({?EmpNos}) step 1 do
(
display := display + totext({?Empnos},0,"") + ", "
);
left(display,len(display)-2);

If you want to display just one instance, try:

whileprintingrecords;
numbervar i:=1;

for i := 1 to count({?EmpNos}) step 1 do
(
{?Empnos}
);
{?Empnos}[2];

Plug in the number of the array instance you want to display instead of the "2."

P.S. You can display in your posts (without it disappearing and changing the text to italics) by unchecking "Process TGML" in the "Step 2 Options" section before submitting.

-LB
 
thank you very much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top