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

Write Structure to File.

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

  • Write Structure to File.

    Hi All,

    I have A5 Doc and can print out a file structure, what I would also like to do is save it as text file.

    Is there a function to do this?
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  • #2
    Re: Write Structure to File.

    Keith, it's easy enough to save an image or pdf file from the print preview of the A5 Doc file using 3rd party tools. I don't know of a single function that can create a "text" file, but it wouldn't be that difficult to create one in xbasic.

    Comment


    • #3
      Re: Write Structure to File.

      Hi Tom,

      I'm sure it wouldn't be too difficult in xbasic if one knew which functions to work with to read the DBF structure and write to a text file. The same as A5 Doc does but not printing it as a report.
      Regards
      Keith Hubert
      Alpha Guild Member
      London.
      KHDB Management Systems
      Skype = keith.hubert


      For your day-to-day Needs, you Need an Alpha Database!

      Comment


      • #4
        Re: Write Structure to File.

        Keith

        look at

        http://support.alphasoftware.com/alp...INFO_GET().htm


        or

        http://support.alphasoftware.com/alp...NFO_DUMP().htm


        Still have to get that into a text file

        Tom Baker

        Comment


        • #5
          Re: Write Structure to File.

          Right, Tom. And the "File" functions will do that nicely.

          -- tom

          Comment


          • #6
            Re: Write Structure to File.

            Here is little code to help

            Code:
            dim tbl as p
            tbl=table.open("yourtablename")
            dim struct as c
            struct=tbl.Field_Info_Dump("n,t,W")
            tbl.close()
            'msgbox("",struct)
            dim foo as c
            dim fp as p
            dim ln1 as n =20 'this is the length of first column in text
            
            fp=file.create("c:\testingfp2.txt",FILE_RW_EXCLUSIVE) 'this would be the name of your text file
            
            for each foo in struct
            	n1=word(foo.value,1,",")
            	
            	padout=20-len(n1)
            	n1=n1+space(padout)
            	n2=word(foo.value,2,",")+space(2)
            	n3=word(foo.value,3,",")
            	select						'this allow for space for the length of the type field from 1 to 3 spaces 
            	    case len(n3)=1
            	    	n3=space(2)+n3
            	    case len(n3)=2
            	    	n3=space(1)+n3
            	    case else
            	    	n3=n3
            	end select
            	
            	
            	fp.write_line(n1+n2+n3)
            next
            Just need to format the foo.value before writing to the file to make it easier to read.

            Tom Baker

            edit:changed the coding to allow for formatting the text file structure
            Last edited by Tbaker; 09-11-2010, 01:00 PM. Reason: change the coding

            Comment


            • #7
              Re: Write Structure to File.

              Hi Tom,

              Thanks for that.

              That is just what I was looking for.
              Regards
              Keith Hubert
              Alpha Guild Member
              London.
              KHDB Management Systems
              Skype = keith.hubert


              For your day-to-day Needs, you Need an Alpha Database!

              Comment


              • #8
                Re: Write Structure to File.

                Originally posted by Keith Hubert View Post
                I have A5 Doc and can print out a file structure, what I would also like to do is save it as text file.
                The easiest way is to open up the structure dialog, highlight, copy &paste into notepad or whatever,
                Peter
                AlphaBase Solutions, LLC

                Peter@AlphaBaseSolutions.com
                https://www.alphabasesolutions.com


                Comment


                • #9
                  Re: Write Structure to File.

                  It's not an "official" page yet because I still have a lot of videos to create but take a look at the "App Basics" video on this page that shows (or will show) how each of my AIMS Grab Bag routines are used. I started building videos because some of the routines are very hard to explain adequately in writing. The output from the App Basics routine is more basic (surprise, surprise) than what A5Doc does - it isn't as fancy or as complete but it's fast, relatively easy to print, and may meet your needs.
                  Last edited by CALocklin; 09-11-2010, 02:35 PM.

                  Comment


                  • #10
                    Re: Write Structure to File.

                    Keith

                    To make it easier I wrote a function

                    Dump_tbl_structure()

                    Code:
                    FUNCTION dump_tbl_structure AS L (Tablename AS C)
                    
                    dim pt as c
                    dim tbl as p
                    dim hdr_txt as c
                    dim struct as c
                    pt=a5.Get_Path()
                    
                    hdr_txt=upper(Tablename)+"->Table Structure"+crlf()+chr_multi(45,25)+crlf()
                    
                    Tablename=pt+chr(92)+Tablename
                    txt_file=Tablename+"_tbl_structure.txt"
                    
                    tbl=table.open(Tablename)
                    
                    struct=tbl.Field_Info_Dump("n,t,W")
                    tbl.close()
                    
                    dim foo as c
                    dim fp as p
                    dim ln1 as n =20 'this is the length of first column in text
                    
                    fp=file.create(txt_file,FILE_RW_EXCLUSIVE) 'this would be the name of your text file
                    fp.write_line(hdr_txt)
                    for each foo in struct
                    	n1=word(foo.value,1,",")
                    	
                    	padout=20-len(n1)
                    	n1=n1+space(padout)
                    	n2=word(foo.value,2,",")+space(2)
                    	n3=word(foo.value,3,",")
                    	select						'this allow for space for the length of the type field from 1 to 3 spaces 
                    	    case len(n3)=1
                    	    	n3=space(2)+n3
                    	    case len(n3)=2
                    	    	n3=space(1)+n3
                    	    case else
                    	    	n3=n3
                    	end select
                    	
                    	
                    	fp.write_line(n1+n2+n3)
                    next
                    
                    END FUNCTION
                    It takes one parameter, that is the name of the table you want to send the structure to a text. I have attached a zip file with the text that you can import to your code tab and will put the dump_tbl_structure() function on the code tab of your app. It will get the path of the tablename and then break the structure down and format it to a text file in the folder of your app.

                    For instance dump_tbl_structure("ABC") will dump the table structure to a text file name ABC_tbl_structure.txt.

                    The function used tablename as its imput so you use control down arrow to get the names of the tables in the current app.

                    Tom Baker

                    Comment


                    • #11
                      Re: Write Structure to File.

                      Originally posted by Peter.Greulich View Post
                      The easiest way is to open up the structure dialog, highlight, copy &paste into notepad or whatever,
                      Peter,

                      I remember an estafette in XDialog about the structure of a table/tables.
                      You were one of the participants.
                      Can you please point us to that thread?

                      I think this is usable and easy to adopt for a txtfile

                      Ton
                      Most things are simple but unfortunately only after the first time

                      Comment


                      • #12
                        Re: Write Structure to File.

                        Originally posted by Ton Spies View Post
                        You were one of the participants.
                        Can you please point us to that thread?
                        Hi Ton,

                        Sorry, I don't remember at all.
                        Peter
                        AlphaBase Solutions, LLC

                        Peter@AlphaBaseSolutions.com
                        https://www.alphabasesolutions.com


                        Comment


                        • #13
                          Re: Write Structure to File.

                          Tom,

                          Thank you so much for that script, that was very kind of you and is very much appreciated.
                          Regards
                          Keith Hubert
                          Alpha Guild Member
                          London.
                          KHDB Management Systems
                          Skype = keith.hubert


                          For your day-to-day Needs, you Need an Alpha Database!

                          Comment


                          • #14
                            Write Structure to File for Keith

                            Originally posted by Peter.Greulich View Post
                            Hi Ton,

                            Sorry, I don't remember at all.
                            Searched for it in V9 and could not find it because its in the code archive

                            http://msgboard.alphasoftware.com/al...ad.php?t=79628

                            This thread was started by Chris Hawkes (with code from Mike Wilson, Cal Locklin, Lenny Forziati, & Andy Dibble) with improvements by Chris and Peter.


                            Something for you Keith?



                            Ton
                            Most things are simple but unfortunately only after the first time

                            Comment


                            • #15
                              Re: Write Structure to File.

                              To All:
                              here was my version
                              I added Forms and reports and sets

                              Thanks cal for your help

                              Charlie Crimmel

                              Comment

                              Working...
                              X