For loop range

Hi,

I want to run a for loop for a range of values and for that I am using “Enumerable.Range(startPage,pageCount)”. It works best if my range starts from 1 but I want to also run it when start page value is more than 1. Even if the value for start page is more than 1 the loop starts from 1. IS there any way I can achieve what I want?

@prasath17

This portion of the question is not clear…Could you please brief it with some example @rameezimtiaz ?

@prasath17 it means if i want to start my range from page 50 how can I achieve this?

@rameezimtiaz
not really clear the question. Maybe these samples can help:
grafik

Also have a look here for paging / segmenting (Done on a datatable, but similar in the logic)

This 50 is conditional right? Like you are looking for some text is available on that page, so you like to start from 50 till end of the page??? if yes, Then you still need to sweep each page from 1-50 and then if text found on 50 you can break loop and create a new from 50 as shown by @ppr - but this may/may not be effective.

That’s why I have requested for the exact requirement…like do you like to split the pages/delete the pages etc etc…

1 Like

yes. it could be any value. and its also stored in a variable.

@prasath17 @ppr Please check screenshot. instead of 0 in the expression i want a variable and it should always start search from that page number which is stored in the variable.

@rameezimtiaz - but unless you run through all the pages and find the #s you don’t know those page #s right? So once you run through all the pages took the pages #s to the variable , simply replace the 0 with your page # variable.

I tried replacing it but no matter what start value I give its always starts from 1

@rameezimtiaz - that is strange…look at ppr screenshot he has added 50 to 100 and printed it…so I guess you variable may be 1 first time . Please print the variable value before passing.

@prasath17 i have tried every combination possible. Check screenshot below with the expression “Enumerable.Range(startPage, pageCount).Skip(49).ToArray”. It ended 1st iteration on page 49 and started next again from page 1 instead of page 49.

image

tried with "Enumerable.Range(startPage, pageCount).ToArray” as well. Same screenshot for this as well

secondly is there any way I can get the text in bold from the below text?

Return to Contents

Street Improvements

Ocotillo Road – Greenfield to Higley Project #: ST0540

Project Description:
Design and construction of Ocotillo Road from approximately ¼ mile east of Greenfield Road to Higley Road to
minor arterial standards. The project includes crossings over the Queen Creek Wash, East Maricopa Floodway,
Roosevelt Water Conservation District Canal and Chandler Heights Basin. The project includes the relocation of
69kV power lines and access into the proposed Gilbert Regional Park.

Project Information:
• Costs shown in prior years are for completion of an alignment study in FY 2009
to coordinate the alignment with Flood Control District projects
• Maintenance costs will be determined once final design is completed. Ongoing
maintenance costs will be a consideration in selection of the project design
• Project is necessary for growth/development and therefore is eligible for
System Development Fee funding

Financial Information:
Expenses: (1,000s) Total Prior FY 2021 FY 2022 FY 2023 FY 2024 FY 2025 Years 6- Beyond
Years 10 10 Yrs
Professional Services $ 6,104 299 5,805 - - - - - -
Construction Mgmt $ 4,316 33 4,283 - - - - - -
Land/ROW $ 2,325 - 2,325 - - - - - -
Construction $ 53,774 - - 53,774 - - - - -
Equipment & Furniture $ - - - - - - - - -

Total Expenses $ 66,519 $ 332 $ 12,413 $ 53,774 $ - $ - $ - $ - $ -

Sources: (1,000s)

2007 GO Bonds 08 $ 246 246 - - - - - - -
2022 Potential Street Bond $ 50,701 - - 50,701 - - - - -
CIP O/S Revolving Fund $ 375 86 289 - - - - - -
Roads SDF $ 15,197 - 12,124 3,073 - - - - -

Total Sources $ 66,519 $ 332 $ 12,413 $ 53,774 $ - $ - $ - $ - $ -

Operation and Maintenance Impact: (1,000s)

Personnel - - - - -
Contractual Services - - - - -
Supplies - - - - -
Utilities - - - - -
Insurance - - - - -

Total O&M Impact $ - $ - $ - $ - $ -

Total Revenue $ - $ - $ - $ - $ -

49

@rameezimtiaz - i think I can see whats going on here …

Say if text XYZ found on page 10…this page 10 you have to pass it to the read pdf on the range section and set thr index or counter accordingly.

Please try this way.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.