Alpha Video Training
Results 1 to 4 of 4

Thread: Array to string

  1. #1
    Member
    Real Name
    Jon P Moody
    Join Date
    Nov 2016
    Posts
    150

    Default Array to string

    This should be really simple, but it has me flummoxed.

    How can I get the contents of an array into a string?

    In the interactive I can just use ?arr[1] and the result I need is displayed, but I just can't get this into a string or list...

    Code:
    ?arr[1]
    = Childs_First_Name = "Jon"
    Childs_Surname = "Moody"
    Class = "class"
    Contract_Accept = "I have read and agree to the contract with customers"
    Date_Of_Birth_DD_MM_YYYY_ = "13/07/2019"
    Has_your_child_got_any_medical_conditions_dietary_requirements_or_security_issues_that_we_need_to_be_aware_of_ = "No"
    Is_The_Booking_For_Today_If_YES_Call_or_Text__ = "No"
    Mon_22nd_July = "All Day: 7.30pm - 6.00pm"
    School = "school"
    Send = "click"
    Tues_23rd_July = "School Day: 8.30am - 3.30pm"
    Wed_24th_July = "All Day: 7.30pm - 6.00pm, Trip: 3-11: Kilburn Park Cost £2.00"
    Year = "year"
    Last edited by armasoft; 07-16-2019 at 10:51 AM. Reason: remove phone #

  2. #2
    Member
    Real Name
    Jon P Moody
    Join Date
    Nov 2016
    Posts
    150

    Default Re: Array to string

    Found a solution via the A5V11 built-in help, which pointed me towards JSON. Solution is

    Code:
    myvar=json_generate(arr[1])

  3. #3
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,579

    Default Re: Array to string

    <array>.dump_properties()
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  4. #4
    Member
    Real Name
    Jon P Moody
    Join Date
    Nov 2016
    Posts
    150

    Default Re: Array to string

    Quote Originally Posted by Al Buchholz View Post
    <array>.dump_properties()
    Code:
    arr.dump_properties()
    ERROR: An unhandled exception (c0000005) was generated.
    Don't know if it's me, Alpha or Microsoft, but someone isn't playing ball. The json.generate does what I want and I can tidy up the results if needed.

Similar Threads

  1. Filtering a list using an array or comma-delimited string
    By Cameron.Smith in forum Mobile & Browser Applications
    Replies: 16
    Last Post: 04-19-2019, 03:24 PM
  2. Array Question -will a multi-dimension array solve my problem?
    By djldc in forum Alpha Five Version 10 - Desktop Applications
    Replies: 11
    Last Post: 08-08-2011, 09:23 PM
  3. String to Array
    By David Boomer in forum Alpha Five Version 10 - Desktop Applications
    Replies: 8
    Last Post: 05-24-2011, 01:46 PM
  4. Having trbl/w string array crlf()?
    By L. McIntosh in forum Alpha Five Version 5
    Replies: 10
    Last Post: 11-22-2004, 04:49 AM
  5. String into an array
    By scottly in forum Alpha Five Version 5
    Replies: 4
    Last Post: 01-06-2004, 05:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •