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

Expression always true??

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

    Expression always true??

    The following expression (on the form's OnActivate event, works as if it's true all the time. It's as if the Else or the .f. part has no effect. It works well in v4.5 When I click the ligthening bold to run it, it says there os no such field as SESSION_INFO->PDINFULL. Oh yes there is cause I copied and pasted it to the expression. The field rule default is .f.

    Any idea why it only half works?

    Thanks,

    kenn


    this.resynch()

    if SESSION_INFO2->PDINFULL then
    :EditCamper2:Checkbox18.fill.forecolor ="Dark Green"
    :EditCamper2:Checkbox18.font.bold = .t.
    :EditCamper2:Checkbox18.font.name = "Arial"
    :EditCamper2:Checkbox18.font.size = 14
    :EditCamper2:Checkbox18.font.color = "Yellow"
    else
    :EditCamper2:Checkbox18.fill.forecolor = "White"
    :EditCamper2:Checkbox18.font.bold = .f.
    :EditCamper2:Checkbox18.font.name = "Times New Roman"
    :EditCamper2:Checkbox18.font.size = 8
    end if
    :EditCamper2:Checkbox18.refresh()
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

    #2
    RE: Expression always true??

    Hello Ken,

    >>The following expression (on the form's OnActivate event, works as if it's true all the time. It's as if the Else or the .f. part has no effect. It works well in v4.5 When I click the ligthening bold to run it, it says there os no such field as SESSION_INFO->PDINFULL. PDINFULL' value. Is this a value on the form? Or is it in the table only ? Are you putting a filter or query on the form ? It might be possible that you are reading the 'first' record in the record order, then via filter or script, jumping to another record where the value maybe different. This probably is not the issue as you say it works fine with v4.x

    I'd probably try an explicit reference, such as getting a table or form pointer, then referencing the field.

    Good luck,
    Jim

    Comment


      #3
      RE: Expression always true??

      Jim,

      Session_Info2 is a table and PDINFULL is a logical field (Checkbox). If the box is checked (True) then the font size and color change, if not checked, then the font and color stay the same.

      Should be simple enough, eh??

      I tried adding the form name....

      Session_Info2->Editcamper2.pdinfull

      but no go. Did I miss the syntax?

      kenn
      TYVM :) kenn

      Knowing what you can achieve will not become reality until you imagine and explore.

      Comment


        #4
        RE: Expression always true??

        Hi Ken,

        I've run across similar problems. The PDINFULL needs to have an "F" or .F. in the field. Just leaving unchecked does not put the .F. in the field. You need to create a field rule to use a simple default expression to put the "F" in the field. Then it should work.

        As a test go into the table in browse mode and put some F's in the field, then open the form and test the results.

        Dan
        Dan

        Dan Blank builds Databases
        Skype: danblank

        Comment


          #5
          RE: Expression always true??

          I have the field rule set for a simple default expression of .f. I checked both boxes for setting the value.

          This was working in v4.5 wihtout setting the simple default expression.

          See my post "Font Equation Doesn't Work?".

          I think it's more than the expression, etc.

          Thanks,

          kenn
          TYVM :) kenn

          Knowing what you can achieve will not become reality until you imagine and explore.

          Comment


            #6
            RE: Expression always true??

            Ken,

            Instead of an absolute reference to the name of your table:

            Code:
            if SESSION_INFO2->PDINFULL then
            I'd favor using an object pointer to the table, to eliminate potential conflict with alias names assigned automatically by Alpha.

            Something like this:

            Code:
            tbl = table.current(slot number for your table)
            if tbl.pdinfull then

            Or

            I'd use the value in the field display object directly from the form.

            (assuming PDINFULLOBJECT is the name of the object on your form)

            Code:
            if this:PDINFULLOBJECT.value = .t. then
            where 'this' refers to the form.


            Since the rest of your script manipulates the table through the objects on the form, I'd favor the second approach outlined above. I do not mix code which manipulates the table directly, with code which manipulates the object through a form. This is my preference, you may feel differently, and I wouldn't argue with you.

            -- tom

            Comment


              #7
              RE: Expression always true??

              Hi Tom,

              I've already tried your first approach and will try your second approach later today. Anytime you suggest code, I'm all ears (well, eyes) I won't disagree with something that works.

              Thanks,

              kenn
              TYVM :) kenn

              Knowing what you can achieve will not become reality until you imagine and explore.

              Comment


                #8
                RE: Expression always true??

                Tom,

                I tried the following as the first line in teh script:

                if this:CHECKBOX18.value = .t. then

                if EditCamper2:CHECKBOX18.value = .t. then

                Where CHECKBOX18 is the object name for the field PDINFULL. Neither one worked. Absolutely no effect whatsoever. For convenience, here's the script:

                if EditCamper2:CHECKBOX18.value = .t. then
                :EditCamper2:Checkbox18.fill.forecolor ="Dark Green"
                :EditCamper2:Checkbox18.font.bold = .t.
                ':EditCamper2:Checkbox18.font.italics = .t.
                :EditCamper2:Checkbox18.font.name = "Arial"
                :EditCamper2:Checkbox18.font.size = 14
                :EditCamper2:Checkbox18.font.color = "Dark Blue"
                else
                :EditCamper2:Checkbox18.fill.forecolor = "White"
                :EditCamper2:Checkbox18.font.bold = .f.
                ':EditCamper2:Checkbox18.font.italics = .f.
                :EditCamper2:Checkbox18.font.name = "Times New Roman"
                :EditCamper2:Checkbox18.font.size = 8
                end if
                :EditCamper2:Checkbox18.refresh()


                Thanks,

                kenn
                TYVM :) kenn

                Knowing what you can achieve will not become reality until you imagine and explore.

                Comment


                  #9
                  RE: Expression always true??

                  Hello Ken,

                  I went and tested this and I think you've ran into a bug. Referencing the form, I will get a logical true value when the field is true OR null. I only get a logical false value if the field is explicitly false. I will send this up to Selwyn.

                  In the meantime it is easy (and IMHO better) to reference the table directly. Use this syntax:

                  if table.current().PDINFULL then

                  etc.

                  Jim

                  Comment

                  Working...
                  X