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

invert(str(xx)) vs str(invert(xx))

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

    invert(str(xx)) vs str(invert(xx))

    Hi all,
    I have a field invoiceno which is number 7.0
    In A4 the expression "invert(str(invoiceno,7,0))" converted the numeric field to string and inverted the order of the field.
    In A5 the same string returns ascii characters.(not useful)
    If I change it to str(invert(InvoiceNo),7,0) it changes the numeric value to a negative value and then converts it to string, but gives a valid answer.
    Is this odd or am I odd (don't answer that)
    Anyway this doesn't seem to work correctly. There is actually more to the expression but it doesn't effect the results here.
    Does anyone know what I am doing wrong here?

    Thanks
    Russ

    #2
    RE: invert(str(xx)) vs str(invert(xx))

    Russ, context is critical. Both expressions should work fine if used to specify an order for your form or report. Neither will work fine if used to specify a calculated value for a field. Actually both work, but the resulting display is meaningless hieroglyphics (sp?). Are you trying to define a calculated field, or are you trying to establish a specific display order for a form or report?

    Comment


      #3
      RE: invert(str(xx)) vs str(invert(xx))

      ... and while I'm at it permit me to pick a small bone.

      Why use a numeric type for the invoice number field? Many would recommend that you use a character type for such things...


      -- tom

      Comment


        #4
        RE: invert(str(xx)) vs str(invert(xx))

        Hi Tom,
        the expression is an order expression for a lookup. You are right, even though it returns heiroglyphics (sp)is appears to work, alpha creats the same thing when it is done by the program itself.
        As far as the invoice number being numeric, this is pretty much historical, I could change it but never saw the need, we've been doing it this way since A4v2 (and before that in CYMA and before that in whatever was before that). I do understand that there are some advantages to character for a field like this but then I'd have to go back and change a bunch of old stuff, yikes!! I've got enough to do (actually too much, but who doesn't?)
        Maybe I'll bite the bullet and change it at some point, but then I'd probably start redesigning the whole app and make a lot of work for myself.

        Russ

        Comment


          #5
          RE: invert(str(xx)) vs str(invert(xx))

          Tom,

          I believe Ira had a post once referring to the "characters" appearing in the evaluation box when inverting, combining multiple data types, etc.

          I thought I remembered it being referred to as some sort of binary representation, but that doesn't seem right.
          There can be only one.

          Comment


            #6
            RE: invert(str(xx)) vs str(invert(xx))

            The hieroglyphics (sp?) come from Alpha's attempt to display characters that have odd decimal ascii equivalents. I think the invert() function returns the mathematic complement of the specified value, though I'd be hard pressed to explain what that means!

            Comment


              #7
              RE: invert(str(xx)) vs str(invert(xx))

              Tom,
              I think it means nothing.
              invert(123.12) = -123.12
              invert(123.13) = -123.13
              -123.13 comes before -123.12 thus the descending order.

              The invert is advertised as nothing but a way to sort values in a descending manner. I think I read something about a5v5 doing more with inverted values in the way of allowing the user to do finds by entering in the actual value rather than the hieroglyphics.
              John

              Comment


                #8
                RE: invert(str(xx)) vs str(invert(xx))

                John,

                No fair. You picked the easy one!

                From the interactive editor:

                ?invert(123.56)
                = -123.560000

                ?invert("abc")
                = "���"

                ?invert("Cone, Tom")
                = "�����߫��"

                ?invert({05/02/2001})
                = {26/06/-114}

                ?invert(cdate(date()))
                = "��������"


                The mathematic complement must be the value which when added to the initial value totals zero. It's easy to understand for numeric values. It's when Alpha Five starts inverting strings that it gets very hard to see...

                -- tom

                Comment


                  #9
                  RE: invert(str(xx)) vs str(invert(xx))

                  Tom,

                  The invert() function just takes the one's complement of the binary of each ASCII character.

                  This means that if you had the letter "A" which is 01000001 binary (41 hex or 65 decimal), to get the one's complement, just change the 1's to zeros and zero's to 1's. This yields a 10111110 binary (BE hex or 190). If you wanted to do the equivalent in decimal arithemetic just subtract the Ascii decimal value 65 from 255.

                  255-65=190

                  Now take the new value and convert it back to a character in the font by using chr(190).

                  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: invert(str(xx)) vs str(invert(xx))

                    Thanks Ira. As I indicated above I'd be hard pressed to explain how it works!

                    Comment


                      #11
                      RE: invert(str(xx)) vs str(invert(xx))

                      Tom,
                      I agree!

                      One of the first "rules" I learned when I first started programming xBase in the mid eighties was:

                      "If you're not going to do arithmetic with it make it a character field!"

                      I think that's still good advice!

                      Ray

                      Comment

                      Working...
                      X