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

VFP FoxPro to Alpha5 Questions

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

  • VFP FoxPro to Alpha5 Questions

    Hi,

    I'm a VFP programmer for 10 years now and trying to get my head around Alpha5. Any pointers and help is greatly appreciated in translating between these languages...

    1. Are the A5 .dbf tables secure and protected from changes by users connecting to it via an odbc driver outside the A5 environment like Excel? Could this type of access screw up relations, indexes and/or other things?

    2. What A5 code would I need to do the following:
    a. test if a table is open,
    vfp code: if used("Products")

    b. open the products table,
    vfp code: use "Products" in 0 shared (or exclusive)

    c. set the order by using an index,
    vfp code: set order to "ItemNum"

    d. set a filter condition,
    vfp code: set filter to Item_Num >= "25412"

    e. browse the table,
    vfp code: browse

    f. create an index on Item_Num with a name of ItemNum,
    vfp code: index on Item_Num tag ItemNum

    g. go to a record number 514,
    vfp code: go 514

    h. resize all the columns on a grid to fit the widest values for each column in the browse form programatically and/or via the ui,
    vfp code: Thisform.grdProducts.AutoFit()

    i. find the type of a variable and/or field,
    vfp code: type(fieldname/variable name)

    j. More later....

    3. How do I use a variable in a program/function like this:
    aa = date()
    ?dtoc(aa)
    (this errors out in the interactive window)

    4. Does the term "open exclusive or shared" mean anything to A5?

    5. How do I see the entire contents of a memo field on a browse?

    6. What other Foreign languages are supported?

    7. More later...

    Thanks,
    Stanley

  • #2
    Re: VFP FoxPro to Alpha5 Questions

    Hi Stanley,

    Welcome to Alpha, I know you have posted here just a few times but to get the best help here are a couple of tips.

    1: Only ask one question at a time, that way a number of threads can be just for one topic.

    2: Just ask, how to achieve what you want as a result. Most people here will not understand what and how you did it before and therefore cant make the comparison.

    Any way to answer question 3.

    aa=date()
    x=dtoc(aa)
    ?x
    = "13/06/2008"

    Hope this help a bit.
    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


    • #3
      Re: VFP FoxPro to Alpha5 Questions

      Or to make Stanley's work,

      Code:
       
      dim aa as D
      aa=date()
      ?dtoc(aa)
      = "06/13/2008"
      Along with what Keith stated....

      Its best to not try and use other db terms really--I know you are trying to get a handle on Alpha by relating to what you know...which can help at times...but many times it will just add to your confusion as you will also then be trying to DO things the same way as you have done with other tools.

      Just by going through the tutorials and the User Manual will greatly expedite your learning/transition. Many of the answers you have asked can be found fairly easy with either a search of the messageboard or the online help file...and the earlier on you learn the ins and outs of how to do these searches the faster you can grow in Alpha.

      Just another opinion or I guess I used up Keith's 2 pence here. :)
      Last edited by MikeC; 06-13-2008, 09:49 AM.
      Mike
      __________________________________________
      It is only when we forget all our learning that we begin to know.
      It's not what you look at that matters, it's what you see.
      Henry David Thoreau
      __________________________________________



      Comment


      • #4
        Re: VFP FoxPro to Alpha5 Questions

        Wow! You said (asked) a mouthful! Keith is correct. You are better off asking one Q at a time as the need arises. But since you are testing the waters (sort of), I'll try to answer your Qs.

        Originally posted by stanlyn View Post
        1. Are the A5 .dbf tables secure and protected from changes by users connecting to it via an odbc driver outside the A5 environment like Excel? Could this type of access screw up relations, indexes and/or other things?
        Sounds like a recipe for disaster if you try to modify dbf data from Excel if you also plan on using A5 in the same context.

        2. What A5 code would I need to do the following:
        a. test if a table is open,
        TABLE.ISOPEN()
        TABLE.IN_USE()

        b. open the products table,
        tbl = table.open("Products")

        c. set the order by using an index,
        tbl.index_primary_Put("ItemNum")

        d. set a filter condition,
        The traditional method is something like this:
        Code:
        query.order = ""		
        query.filter = "Item_Num >= '25412' "
        query.options = ""    
        Q = tbl.query_create()
        But A5 has a whole host of query/filter methods.
        Too many to get into here.

        e. browse the table,
        Usually you would select browse view that from a toolbar. No code needed, but you can easily code it if you like. You can create as many customized browse views as you like.

        f. create an index on Item_Num with a name of ItemNum,
        Again, you would typically define the index in a simple dialog - no coding needed. But A5 has simple functions that allow you to code the indicies if you prefer.

        g. go to a record number 514,
        You can also do this from a toolbar, or:
        tbl.fetch_goto(514)

        h. resize all the columns on a grid to fit the widest values for each column in the browse form programatically and/or via the ui,
        You can size the column width in design or view mode by dragging the column edge. I believe you can dynamically set the width w. xbasic as well. But I do not believe you can auto size the column width to the text size of the column.

        i. find the type of a variable and/or field,
        typeof() - for variable
        .type_get() - - - e.g.
        table.current().field_get([number or fieldname]).type_get()

        j. More later....
        Whatever...

        3. How do I use a variable in a program/function like this:
        aa = date()
        ?dtoc(aa)
        (this errors out in the interactive window)
        No error from I.E. when I did it:
        Code:
        aa = date()
        
        ?dtoc(aa)
        = "06/13/2008"
        4. Does the term "open exclusive or shared" mean anything to A5?
        Sure. Depends upon the context.

        tbl = table.open("Products",FILE_RO_EXCLUSIVE)
        Modes =
        FILE_RO_EXCLUSIVE
        FILE_RW_EXCLUSIVE
        FILE_RO_SHARED
        FILE_RW_SHARED
        FILE_REUSE_EXISTING
        TABLE_MODE_INFORMATIONAL

        "Shared" can refer to variable scope, etc.

        5. How do I see the entire contents of a memo field on a browse?
        Drag the row height. Can't remember if you are limited to 255 characters or if it will show the whole shebang.

        6. What other Foreign languages are supported?
        None (as far as I know).

        7. More later...
        Right.
        Peter
        AlphaBase Solutions, LLC

        [email protected]
        https://www.alphabasesolutions.com


        Comment


        • #5
          Re: VFP FoxPro to Alpha5 Questions

          Stanley, I agree with Peter's responses except for the first. No. The native DBF tables used by Alpha Five are formatted the same as Foxpro 2.6 tables. They are not secure and may be read by a host of other applications. Alpha Five includes a built in encryption capability however. If you encrypt the tables other 3rd party apps won't be able to read the tables.

          Comment


          • #6
            Re: VFP FoxPro to Alpha5 Questions

            Thanks for the detailed answers to my questions... I'm trying to grab the basics so I can test with some of my large datasets. Also, I know all the answers are in the docs, BUT it will take forever for me to get a handle on the basics because of the shear volume of docs. Most importantly, the terminology is simular in some cases and very different in others, hence the confusion... So, please bear with me...

            Sounds like a recipe for disaster if you try to modify dbf data from Excel if you also plan on using A5 in the same context
            It is a disaster waiting to happen... and I wanted to know if there were any ways to protect it like most sql databases where true authentication must be done before access is granted.

            If I understand you correctly, even if the data is encrypted, a 3rd party app can connect to and expose it to disaster... correct?

            1: Only ask one question at a time, that way a number of threads can be just for one topic.
            I see this as one thread (VFP as it relates to A5)... I started this thread with so many questions so to keep all the VFP Foxpro stuff together thereby helping the next foxpro developer. I have also noted that one question leads to another quickly and it would be more efficient for replies all in one place because the person repling to this would most likly know some foxpro.

            Quote:
            e. browse the table,

            Usually you would select browse view that from a toolbar. No code needed, but you can easily code it if you like.
            What do I type in the IE to call a generic browse up?

            Quote:
            f. create an index on Item_Num with a name of ItemNum,

            Again, you would typically define the index in a simple dialog - no coding needed. But A5 has simple functions that allow you to code the indicies if you prefer.
            What is the code to build the above index as the IE (command window) is generally faster that the mouse way. I use this type of routines in table maintenance procedures as many times it is better to delete all the indexes, do the table maintenance, and finally rebuild them from scratch via the procedure code. It also shows me what is going on behind the scenes and allows my to do whatever programatically, and learn faster.


            Thanks so much...
            Stanley

            Comment


            • #7
              Re: VFP FoxPro to Alpha5 Questions

              Stanley,

              If I understand you correctly, even if the data is encrypted, a 3rd party app can connect to and expose it to disaster... correct?
              Not sure to be honest. But I think I could open up almost any file in MS_Word, type some gibberish and save it, thus wrecking the file (I believe)?

              What do I type in the IE to call a generic browse up?
              A5_OPEN_DEFAULT_BROWSE()

              What is the code to build the above index as the IE
              Code:
              tbl = table.current()
              tbl.index_create_begin("LASTNAME", "LAST_NAME")
              tbl.index_add("FIRSTNAME", "FIRST_NAME")
              index1 = tbl.index_create_end()
              Peter
              AlphaBase Solutions, LLC

              [email protected]
              https://www.alphabasesolutions.com


              Comment


              • #8
                Re: VFP FoxPro to Alpha5 Questions

                I wanted to know if there were any ways to protect it like most sql databases where true authentication must be done before access is granted.
                I don't understand this question. Can't I grab the SQL data file with a hex editor and wreak havoc? I thought you were asking about 3rd party apps? Now it sounds like you are talking about database security within the Alpha Five environment itself. These are different things. Alpha Five includes a built in security system which can be configured to require users to log in before access (through A5) is granted. If this is not what you're asking please clarify.

                -- tom

                Comment


                • #9
                  Re: VFP FoxPro to Alpha5 Questions

                  What do I type in the IE to call a generic browse up?
                  The Alpha Five way to do this would be to choose the table/set tab of the control panel and right click the desired entry. A lot of functionality has been built for you, saving much typing. Being able to view the "default browse" or the "default form" with a mouse click is some of it. Defining indexes with the help of a genie is another.

                  Comment


                  • #10
                    Re: VFP FoxPro to Alpha5 Questions

                    Is A5 multi threaded?

                    Comment


                    • #11
                      Re: VFP FoxPro to Alpha5 Questions

                      Can an index be created using a function as its input?

                      Comment


                      • #12
                        Re: VFP FoxPro to Alpha5 Questions

                        What does "Save change in Progress" mean? I didn't make any changes, I only browsed a table, and when I close it it asks this ?

                        Comment


                        • #13
                          Re: VFP FoxPro to Alpha5 Questions

                          Originally posted by stanlyn View Post
                          Is A5 multi threaded?
                          http://support.alphasoftware.com/alp...nd_Methods.htm

                          Comment


                          • #14
                            Re: VFP FoxPro to Alpha5 Questions

                            When I issue a filter on a table and then issue the browse command, the browse does not respect the filter that was previously set. It acts as if the filter was turned off.

                            I'd like to set the index to be used, and/or add a filter, then browse the table without typing all the arguments into the browse command.

                            Comment


                            • #15
                              Re: VFP FoxPro to Alpha5 Questions

                              Originally posted by stanlyn View Post
                              Can an index be created using a function as its input?
                              Do you mean can you create an index that is more than just the value in a column, but rather a calculated value based on values in one or more columns, then yes.

                              Comment

                              Working...
                              X