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

Manipulate *.colorequation-*.fontequation w/xbasic

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

    Manipulate *.colorequation-*.fontequation w/xbasic

    With regards to forms has anyone been successful with manipulating the fields fontequation and colorequation properties. They are listed in the code editor and will give the actual code listed in the properties of each field. However, I cannot seem to replace or add an expression via xbasic. Is this possible? Jack

    #2
    RE: Manipulate *.colorequation-*.fontequation w/xb

    Yes, here is a snipit from an onfetch event for a form
    the "explorer" has all these features available for drag and drop - you can change size, position, color, display text, etc. the explorer is a great learning tool.

    parentform.restrict_change=.t.
    Button13.text="Edit"
    Button13.fill.forecolor="dark yellow"
    Button13.font.size=8
    Button13.font.color="white"
    button13.refresh()

    if parentform:amount_due.value
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    [email protected]

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

    Comment


      #3
      RE: Manipulate *.colorequation-*.fontequation w/xb

      Thank you Martin, but the question did not have to do with individual properties, but rather group of properties which are evident in the colorequation and fontequation properties on the forms. These are available from the code editor but If I try to apply my own properties via xbasic on the forms onit or onfetch event, Alpha will not find my xbasic script as far as this goes. Right now I have a form with 400+ fields and each one has a color and font property. The form loads slowly using the xbasic method and although it is faster when the field properties are individually entered in each field directly from the form, I have seven of these forms and the loadup time let alone the programming time is almost suicidal

      Comment


        #4
        RE: Manipulate *.colorequation-*.fontequation w/xb

        Well, this is obviously out of my league. I looked, but couldn't find access to a color equation anywhere in the explorer.

        I will add, although this may not relate to the question, that Steve Workings talked about how you could write a script to set all of the color/font properties for a form. I think he meant that you would have a sort of loop:
        like for all form children that were class type 1, make properties 1; for all that were class 2 make properties 2.

        but this wouldn't really be an equation, where you normally say if(field 1="a","white on black", "black on white")

        but with a form with that many fields, I have great sympathy. Bill Parker has one with over 800, if that will make you feel any better.
        Cole Custom Programming - Terrell, Texas
        972 524 8714
        [email protected]

        ____________________
        "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

        Comment


          #5
          RE: Manipulate *.colorequation-*.fontequation w/xb

          I'm not sure what your objective is and I've never tried it, but it might be possible to base font and color equations on form variables and manipulate the variables.
          There can be only one.

          Comment


            #6
            RE: Manipulate *.colorequation-*.fontequation w/xb

            Jack & Stan,

            I have not used variables, but I have used a form's calculated fields to store an expression that produces the color value. Then I just place the calculated fieldname in the color expression of every field. This way I need only change the calculated field's expression to change all the field's that reference it.

            As far as Alpha 5's expression evaluation method, I would bet that it calculates the expression once (actually probably a couple of times due to it's internal methods) per record, rather than once for each reference of the field by the color expressions. This means that when you have 100's of fields, the evaluation should be much faster. Testing this should prove my point pretty quickly.

            If this is too slow, then you must parse through all fields that you want to change and then set them whenever you desire to change them to. This could be automated to a degree by parsing through a list of names or possibly having object names that all start with the same name, so you can compare them as you enumerate through the child objects

            Regards,

            Ira J. Perlow
            Computer Systems Design & Associates
            [email protected]
            Regards,

            Ira J. Perlow
            Computer Systems Design


            CSDA A5 Products
            New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
            CSDA Barcode Functions

            CSDA Code Utility
            CSDA Screen Capture


            Comment


              #7
              RE: Manipulate *.colorequation-*.fontequation w/xb

              Ira, I will try your idea with the calc fields.
              I have one form with all 400+ fields containing coding in the font eaquation properties and/or field color equation. This took me about 4 hours.

              I then created duplicate form without the coding on each field and simply coded the form in the onfetch event with an xbasic code that loops through all the fields and depending on the substr(field_namd,1,1) a5 fills in the foreground, background color as well as font attributes (all these are global variabels that are set and changed by the user-->Attempt to create small application that each user can customize somewhat)

              The problem is that although the first form loads considerably faster, it is not bast enough when there are 7 subforms all with similar coding. It takes 5 seconds to resynch. VERY SLOW AND CUMBERSOME.

              I was trying to figure a way to speed this process up without sacrificing any of the fields on the form.

              Comment


                #8
                RE: Manipulate *.colorequation-*.fontequation w/xb

                Jack,

                Nice article at learn alpha on allowing a user to set the background color. Could be adapted to your situation?
                There can be only one.

                Comment


                  #9
                  RE: Manipulate *.colorequation-*.fontequation w/xb

                  Jack,

                  While this may not help for every record, when you use Onfetch to change the values, you should compare the current values to the new values you want to set. If they are the same, then there is no reason to change them, and you are done.

                  The next point is that if an object is not visible, there is no reason to update it until it is visible. E.g. if you have a tabbed form, only those objects on the current tab need to be set. The rest can be changed if the user changes tabs in the OnTabChange event. If you the values are already correct (because the user was previously viewing the tab for the current record), then you don't have to change them either.

                  You should make your code more efficient, e.g. use LEFT(field_namd) instead of substr(field_namd,1,1).

                  Also, while I'm not sure this matters, and may vary from version to version, I believe A5 may do a refresh after any setting of a displayable property (like, color, font, etc.). So what I do is read the value 1st, and compare it to what I am setting it to. If different, then I actually set the value. This may or may not be the best way to do it for your case, but if there is more overhead for writing (even if the value does not change), then you want to attempt to minimize these changes.

                  Regards,

                  Ira J. Perlow
                  Computer Systems Design & Associates
                  [email protected]
                  Regards,

                  Ira J. Perlow
                  Computer Systems Design


                  CSDA A5 Products
                  New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                  CSDA Barcode Functions

                  CSDA Code Utility
                  CSDA Screen Capture


                  Comment


                    #10
                    RE: Manipulate *.colorequation-*.fontequation w/xb

                    thanks all. Well------ the answer really seems to lie within the mere number of fields and the total number of characters within the tables. I must say that I have tried to use (current) 9 table set for a total of 2600 fields or using 4 table set with a total of 2600 fields. Surprise, the nine table set is faster since alpha maniuplates the data internally. The application is a scheduler/planner application (fine tuning the one I have on Learnalpha.com) and I have reduced the refresh time from 5 seconds to a solid 3 seconds. I maximmized the number of characters where I could and removed unnecessary fields. Seems to have made a difference. If I did not have the heavily coded forms, alpha resynchs the forms within a blink of an eye. Quite bothersome but Interesting stuff.

                    Thanks Ira for the tip on left() verses substr() functions. I love great time saving tips. Jack

                    Comment

                    Working...
                    X