Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Child_Enum() to find text value of objects

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Child_Enum() to find text value of objects

    I would like to return the text value of all the text objects on my application's forms. I found this example by Selwyn. However; it returns all the properties. I've referenced the help files but I really didn't find it very helpful.

    what I'm looking for is something along the lines of: Fullname_lbl.Text = "Name:"

    I believe this is possible, I just need to get the line "txt2 = f.Child_Enum("r;o=t=v") right.

    Code:
    dim formList as c
    formList = a5.Form_Enum(2)
    formList = sortsubstr(formlist,crlf())
    
    'FOR demonstration purporses, limit to first 5 forms
    formList = word(formList,1,crlf(),8)
    
    
    dim txt as c = ""
    dim txt2 as c = ""
    for each fm in formList
    
    dim f as p
    f = form.load(fm.value)
    
    on error resume next
    txt2 = ""
    
    'Use the .child_enum() method to list all of the child objects, their properties and each property value.
    
    'txt2 = f.Child_Enum("p;r;o=f=v")
    txt2 = f.Child_Enum("r;o=t=v")
    'txt2 = f.Child_Enum("r;f=field")
    
    txt = txt + crlf(2) + "Form name: " + fm.value + crlf() + replicate("-",100) + crlf(3)
    txt = txt + txt2 + crlf()
    
    f.close()
    next
    
    
    showvar(txt)
    Alpha 5 Version 11
    AA Build 2999, Build 4269, Current Build
    DBF's and MySql
    Desktop, Web on the Desktop and WEB

    Ron Anusiewicz

    #2
    Re: Child_Enum() to find text value of objects

    Try this:
    Code:
    dim formList as c
    formList = a5.Form_Enum(2)
    formList = sortsubstr(formlist,crlf())
    formList = word(formList,1,crlf(),5) [COLOR="#FF0000"]Incidentally, you say limit to 5 but you are asking for 8 ![/COLOR]
    dim txt as c = ""
    dim f as p
    dim f.txt2 as c = ""
    for each fm in formList
    f = form.load(fm.value)
    on error resume next
    txt2 = f.Child_Enum("f=text")
    txt = txt + crlf(2) + "Form name: " + fm.value + crlf() + replicate("-",100) + crlf(3)
    txt = txt + txt2 + crlf()
    f.close()
    next
    showvar(txt)

    Comment


      #3
      Re: Child_Enum() to find text value of objects

      Thank you G.

      I'm moving forward. This is what I'm getting now:

      Form name: MainMenu
      ----------------------------------------------------------------------------------------------------
      CONTROL_TEXT1
      CONTROL_TEXT3
      CONTROL_TEXT4
      CONTROL_TEXT5


      And this is what I would like to get:

      Form name: MainMenu
      ----------------------------------------------------------------------------------------------------
      CONTROL_TEXT1=��
      CONTROL_TEXT3=�Tomorrow�
      CONTROL_TEXT4=�Start Here�
      CONTROL_TEXT5=�Help�


      Sorry, the flags for child_enum() in help, they just don't make any sense to me.

      Mycurrent code:

      Code:
      'get a sorted list of forms in the workspace
      dim formList as c
      formList = sortsubstr(a5.form_enum(2),crlf() )
      
      'count the number of forms and create a list
      dim Form_Cnt as N
      Form_Cnt = w_count(formList,crlf())
      formList = word(formList,1,crlf(),Form_Cnt)
      
      dim txt as c = ""
      dim f as p
      dim f.txt2 as c = ""
      
      for each fm in formList
      	f = form.load(fm.value)
      	on error resume next
      	txt2 = f.Child_Enum("f=text")
      	txt = txt + crlf(2) + "Form name: " + fm.value + crlf() + replicate("-",100) + crlf()
      	txt = txt + txt2 + crlf()
      	f.close()
      next
      
      showvar(txt)
      Alpha 5 Version 11
      AA Build 2999, Build 4269, Current Build
      DBF's and MySql
      Desktop, Web on the Desktop and WEB

      Ron Anusiewicz

      Comment


        #4
        Re: Child_Enum() to find text value of objects

        Code:
        dim formList as c
        formList = a5.Form_Enum(2)
        formList = sortsubstr(formlist,crlf())
        formList = word(formList,1,crlf(),1)
        dim txt as c = ""
        dim f as p
        dim f.txt2 as c = ""
        for each fm in formList
        f = form.load(fm.value)
        on error resume next
        txt2 = f.Child_Enum("o=t=v;f=text")
        txt = txt + crlf(2) + "Form name: " + fm.value + crlf() + replicate("-",100) + crlf(3)
        txt = txt + txt2 + crlf()
        f.close()
        next
        showvar(txt)
        You could use "for..next" later to change from:
        text:text_name
        to text1=text_name or any other format you want..

        Comment


          #5
          Re: Child_Enum() to find text value of objects

          I tried: txt2 = f.Child_Enum("o=t=v;f=text")

          Now I get:

          Form name: MainMenu
          ----------------------------------------------------------------------------------------
          text=;Control_text1
          text=;Control_text3
          text=;Control_text4
          text=;Control_text5


          What does "o=t=v" mean? Where did that come from? I don't see that in the help file.
          Alpha 5 Version 11
          AA Build 2999, Build 4269, Current Build
          DBF's and MySql
          Desktop, Web on the Desktop and WEB

          Ron Anusiewicz

          Comment


            #6
            Re: Child_Enum() to find text value of objects

            Try this.

            Code:
            'get a sorted list of forms in the workspace
            dim formList as c
            formList = sortsubstr(a5.form_enum(2),crlf() )
            
            'count the number of forms and create a list
            dim Form_Cnt as N
            Form_Cnt = w_count(formList,crlf())
            formList = word(formList,1,crlf(),Form_Cnt)
            
            dim txt as c = ""
            dim f as p
            dim f.txt2 as c = ""
            for each fm in formList
            	f = form.load(fm.value)
            	on error resume next
            	txt2 = f.Child_Enum("e=this.object.name+space(1)+'='+space(1)+this.text","text")
            	txt = txt + crlf(2) + "Form name: " + fm.value +crlf() + replicate("-",100) + crlf()
            	txt = txt + txt2 + crlf()
            	f.close()
            next
            
            showvar(txt)
            The output may be easier to digest if you add

            txt2 = sortsubstr(txt2,crlf())

            after the
            txt2 = f.Child_Enum("e=this.object.name+space(1)+'='+space(1)+this.text","text")
            There can be only one.

            Comment


              #7
              Re: Child_Enum() to find text value of objects

              Are you looking for something like this?
              Code:
              formList = sortsubstr(formlist,crlf())
              formList = word(formList,1,crlf(),1)
              dim txt as c = ""
              dim f as p
              dim f.txt2 as c = ""
              dim x as n 
              dim cnt as n	
              for each fm in formList
              f = form.load(fm.value)
              on error resume next
              txt2 = f.Child_Enum("f=text")
              cnt=*count(txt2)
              for each foo in txt2
              	x=x+1
              	foo="Text Object #"+x+" "+foo
              	next
              txt = txt + crlf(2) + "Form name: " + fm.value + crlf() + replicate("-",100) + crlf(3)
              txt = txt + txt2 + crlf()
              next
              f.close()
              showvar(txt)

              Comment


                #8
                Re: Child_Enum() to find text value of objects

                Perfect Stan,

                I just changed this line:

                txt2 = f.Child_Enum("e=this.object.name+space(1)+'='+space(1)+quote(this.text)","text")

                to put the text in quotes.

                Thank you very much.

                Ron
                Alpha 5 Version 11
                AA Build 2999, Build 4269, Current Build
                DBF's and MySql
                Desktop, Web on the Desktop and WEB

                Ron Anusiewicz

                Comment


                  #9
                  Re: Child_Enum() to find text value of objects

                  Hmmm..........
                  I thought you wanted to get "text value of all the text objects"..
                  Or do you want all objects?

                  Comment


                    #10
                    Re: Child_Enum() to find text value of objects

                    Nice touch Stan, txt2 = sortsubstr(txt2,crlf())

                    G, thank you for your effort. In the end, what Stan gave me was what I was really looking for. I figured that if I could figure our how to get the value of the text objects, I'd be able to figure out the rest on my own.

                    You know; crawl, walk, run.

                    Sincerely,

                    Ron
                    Alpha 5 Version 11
                    AA Build 2999, Build 4269, Current Build
                    DBF's and MySql
                    Desktop, Web on the Desktop and WEB

                    Ron Anusiewicz

                    Comment


                      #11
                      Re: Child_Enum() to find text value of objects

                      Well now... If you tried that last script I posted, you would have skipped crawl and walk.. It gives you only the text objects, in the format you want..
                      BTW, when copy/paste the last script, I mistakenly did not copy the first 2 lines:
                      dim formList as c
                      formList = a5.Form_Enum(2)

                      Comment


                        #12
                        Re: Child_Enum() to find text value of objects

                        Thank you G.,

                        I apologize for calling you G. as I don't know your first name.

                        This output portion below is exactly what I'm looking for. Stan's code after a minor change gave me this results. I probably didn't explain myself clearly enough, sorry.


                        BUTTON1 = "Contacts"
                        BUTTON2 = "Close"
                        BUTTON3 = "Appointments"
                        BUTTON4 = "Send Mail"
                        BUTTON5 = "Reminders"
                        BUTTON6 = "Appointment Calendar"
                        CONTROL_BUTTON4 = "Reports"
                        CONTROL_TEXT1 = "Run in Full Screen Mode"
                        CONTROL_TEXT3 = "Tomorrow"
                        CONTROL_TEXT4 = "Start Here"
                        CONTROL_TEXT5 = "Help"


                        Your code gives me this:

                        Text Object #66 CONTROL_TEXT1
                        Text Object #67 CONTROL_TEXT3
                        Text Object #68 CONTROL_TEXT4
                        Text Object #69 CONTROL_TEXT5

                        While I like what you did, it's not what I want.

                        But, thank you very much for your effort. I sincerely appreciate all of your contributions to this board.

                        Ron
                        Alpha 5 Version 11
                        AA Build 2999, Build 4269, Current Build
                        DBF's and MySql
                        Desktop, Web on the Desktop and WEB

                        Ron Anusiewicz

                        Comment


                          #13
                          Re: Child_Enum() to find text value of objects

                          After 2 incidences of identity theft..I am gun shy..G will suffice.

                          I thought you wanted the name of the object. Evidently you want the name and the text.

                          Comment

                          Working...
                          X