Answer Thedata not yelling all selected columns

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
PeterG
Posts: 168
Joined: Sat Jun 29, 2013 7:56 pm

Answer Thedata not yelling all selected columns

Post by PeterG »

Hy Guys
My apologies for the spelling above it was meant to be "yielding all selected columns"
I am toying with converting database cursor into an array.
This is the code i want to put in an Answer dialog.
answer theDataA["DELEGATEIOD"] && theDataA["FIRSTNAME"] && theDataA["SURNAME"]
but it does not show the DelegateOID field which is part of the selection.
Kindly see the images attached.
Grid.png
Screen Shot 2017-12-25 at 09.48.01.png
There must be something I am doing wrong
Would appreciate any pointers

Many thanks
Peter G
Ajm
Posts: 19
Joined: Tue Mar 04, 2014 7:21 pm

Re: Answer Thedata not yelling all selected columns

Post by Ajm »

In the code snippet you have DELEGATEIOD and not DELEGATEOID.
Regards

Andy
DB Integration Limited
PeterG
Posts: 168
Joined: Sat Jun 29, 2013 7:56 pm

Re: Answer Thedata not yelling all selected columns

Post by PeterG »

Hi Andy
This is what to little sleep does.
Embarrassed :?

Many Thanks
Peter G
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Answer Thedata not yelling all selected columns

Post by bogs »

gagsoft wrote: Mon Dec 25, 2017 4:59 pmEmbarrassed
I wouldn't be, that happens to everyone. Merry Christmas all :D
Image
Ajm
Posts: 19
Joined: Tue Mar 04, 2014 7:21 pm

Re: Answer Thedata not yelling all selected columns

Post by Ajm »

Happens to us all. Merry Christmas.
Regards

Andy
DB Integration Limited
PeterG
Posts: 168
Joined: Sat Jun 29, 2013 7:56 pm

Re: Answer Thedata not yelling all selected columns

Post by PeterG »

Thanks guys for all your patience with my ignorance....

Many Thanks
Peter G
quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Answer Thedata not yelling all selected columns

Post by quailcreek »

We haven't seen the rest of your code but here's a little function that should do the conversion you want.

Code: Select all

function turnRecordsIntoArray pData
  local tHeaders,theKey
  
  put "DELEGATEOID" & tab & "INITIALS"  & tab & "FIRSTNAME" & tab & "SURNAME" into tHeaders 
  --   replace "xmlerr, can't find element" with "" in theData
  set the itemDelimiter to tab 
  repeat with x = 1 to the number of lines in pData
    repeat with y = 1 to the number of items in tHeaders 
      put item y of line x of pData into theKey[x][item y of tHeaders] 
    end repeat 
  end repeat 
  set the itemDelimiter to comma
  return theKey
end turnRecordsIntoArray 
Tom
MacBook Pro OS Mojave 10.14
PeterG
Posts: 168
Joined: Sat Jun 29, 2013 7:56 pm

Re: Answer Thedata not yelling all selected columns

Post by PeterG »

Thank you Tom and the rest of the guys for the feedback.

Many Thanks
Peter G
Post Reply