foundeo / cfdocs

Repository for the cfdocs.org site.
https://cfdocs.org/
Other
184 stars 344 forks source link

each #1671

Closed Grudwo closed 1 month ago

Grudwo commented 1 month ago

Thank you - yes, each is not a function, just a member function in ACF. Loving this code, which treats the query results as a struct.

q = queryExecute(sql,stt,{datasource:"MyDataFiles"}) q.each(function(item,i){ // item is the row data, i is the index. })CFDocs

pfreitag commented 1 month ago

The each() function in lucee is different from the member function. In Lucee you can do this:

each(myStruct, myFunc);

In ACF they have structEach and we document that one under: https://cfdocs.org/structeach

maybe we should add structEach and arrayEach to the related here. Feel free to make that change if you'd like to.

Grudwo commented 1 month ago

Thank you Pete! Ah, I need to read up on how to modify CFDocs itself, but love your suggestion to add 'related' with links to StructEach and ArrayEach.

David AdamsSoftware Engineer, Web Engineering (Marketing Technology) *CommonSpirit Health* | Virginia Mason Franciscan HealthCommonSpirit.org https://www.commonspirit.org/ | vmfh.org https://www.vmfh.org/ | vmmc.org https://www.vmfh.org/ | (206) 515-5912

On Thu, Oct 3, 2024 at 9:01 AM Pete Freitag @.***> wrote:

USE CAUTION - EXTERNAL EMAIL

The each() function in lucee is different from the member function. In Lucee you can do this:

each(myStruct, myFunc);

In ACF they have structEach and we document that one under: https://cfdocs.org/structeach https://urldefense.com/v3/__https://cfdocs.org/structeach__;!!CqLityr3mSQ!BFWDo_vaLZIfcYt3rMiqWWjVPF9gBWjmYHEWv_vC7mvxembQs-mVcmc94vbVZQK2m-7FDoXJL3yFgMOkeRbnhxQgT8fxwh0$

maybe we should add structEach and arrayEach to the related here. Feel free to make that change if you'd like to.

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/foundeo/cfdocs/issues/1671*issuecomment-2391784897__;Iw!!CqLityr3mSQ!BFWDo_vaLZIfcYt3rMiqWWjVPF9gBWjmYHEWv_vC7mvxembQs-mVcmc94vbVZQK2m-7FDoXJL3yFgMOkeRbnhxQg7yjUnt4$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/ANPSA7HY6WFPBSHJTMO4JTLZZVS5JAVCNFSM6AAAAABPITBWQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJRG44DIOBZG4__;!!CqLityr3mSQ!BFWDo_vaLZIfcYt3rMiqWWjVPF9gBWjmYHEWv_vC7mvxembQs-mVcmc94vbVZQK2m-7FDoXJL3yFgMOkeRbnhxQgqrLb2WE$ . You are receiving this because you authored the thread.Message ID: @.***>

Caution: This email is both proprietary and confidential, and not intended for transmission to (or receipt by) any unauthorized person(s). If you believe that you have received this email in error, do not read any attachments. Instead, kindly reply to the sender stating that you have received the message in error. Then destroy it and any attachments. Thank you.

pfreitag commented 1 month ago

you would just add it to the related array here: https://github.com/foundeo/cfdocs/blob/master/data/en/each.json#L6 should probably add queryEach as well as structEach and arrayEach