Highlighted

Question about ListMap

LEGEND ,
Jan 22, 2020

Copy link to clipboard

Copied

Hello, all,

 

Just a quick question about ListMap.  According to the Adobe Help page, ListMap "Iterates over every entry of the list and calls the closure function to work on the item of the list."

 

I'm curious, though, if break will break out of the iteration. If ListMap is just a shortcut to a loop, then break would break out of that loop.  But if ListMap is something else, then maybe break won't work?

 

Just curious.

 

V/r,

 

^ _ ^

Adobe Community Professional
Correct answer by BKBK | Adobe Community Professional

Hi WolfShade,

When the documentation says, "Iterates over every entry of the list and calls the closure function to work on the item of the list", it indeed means ListMap will loop through the list. However, the implementation of ListMap doesn't offer any opportunity to include a break. 

Including break within the closure won't work for the map as a whole. That is because the map is designed to iterate over every entry of the list.

TOPICS
Advanced techniques, Asynchronous, Builder, cfchart, Cffiddle, Connector, Database access, Documentation, Event gateways, Flash integration, Getting started, Monitoring, Reporting, Security, Server administration

Views

407

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Question about ListMap

LEGEND ,
Jan 22, 2020

Copy link to clipboard

Copied

Hello, all,

 

Just a quick question about ListMap.  According to the Adobe Help page, ListMap "Iterates over every entry of the list and calls the closure function to work on the item of the list."

 

I'm curious, though, if break will break out of the iteration. If ListMap is just a shortcut to a loop, then break would break out of that loop.  But if ListMap is something else, then maybe break won't work?

 

Just curious.

 

V/r,

 

^ _ ^

Adobe Community Professional
Correct answer by BKBK | Adobe Community Professional

Hi WolfShade,

When the documentation says, "Iterates over every entry of the list and calls the closure function to work on the item of the list", it indeed means ListMap will loop through the list. However, the implementation of ListMap doesn't offer any opportunity to include a break. 

Including break within the closure won't work for the map as a whole. That is because the map is designed to iterate over every entry of the list.

TOPICS
Advanced techniques, Asynchronous, Builder, cfchart, Cffiddle, Connector, Database access, Documentation, Event gateways, Flash integration, Getting started, Monitoring, Reporting, Security, Server administration

Views

408

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 22, 2020 0
Adobe Community Professional ,
Jun 14, 2020

Copy link to clipboard

Copied

Hi WolfShade,

When the documentation says, "Iterates over every entry of the list and calls the closure function to work on the item of the list", it indeed means ListMap will loop through the list. However, the implementation of ListMap doesn't offer any opportunity to include a break. 

Including break within the closure won't work for the map as a whole. That is because the map is designed to iterate over every entry of the list.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 14, 2020 0
LEGEND ,
Jun 15, 2020

Copy link to clipboard

Copied

AH!  I was wondering why break wouldn't work in ListMap, I'm assuming same for ArrayMap.

 

Thank you for the explanation.

 

V/r,

 

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 15, 2020 0