Android Question BigNumbers not handling big numbers

Discussion in 'Android Questions' started by Roger Daley, Jan 29, 2015.

  1. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Hi All,

    Another query on the use of BigNumbers. In HEX if I try to use more than 5 hex digits the system crashes.
    IE I can get the NOT function on ABCDE to work but get an error for NOT ABCDEF.

    Code:
    Dim R1 As  String
    Dim Result as Double
    R1 = ABCDEF
    Sub NOTFUNCTION
            BIGBit.Initialize(R1)
            BIGBit = BIGBit.Not
            Result = BIGBit   
    End Sub
    ERROR.jpg

    I have read on the forum references to "The Demo" for BigNumbers but can't find it. Can anyone point me to this, it may help.

    Any help on what I am doing wrong would be greatly appreciated.

    Regards Roger
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    What is ABCDEF?
     
  3. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Erel

    A six digit hexidecimal number. Sorry, I should have used 0xABCDEF notation.
    Any hex number greater than 5 digits causes the problem.

    Regards Roger
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Please post the exact code you are running and the error message.

    It is a mistake to call Initialize with a number instead of string. I don't see in the documentation that it supports hex strings.
     
  5. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Thanks Erel,

    Project attached minus some non-relevant code to reduce size for upload.
    BigNumber NOT operation at line1286.
    The error is shown in the JPG in the original post.

    As you will see the "Sub Operation" contains the code for handing HEX strings, R1 by default is a string.
    Everything was working OK using Bit.Not Etc except for the limitation of a being a signed 4 byte integer.

    I would appreciate you expert eye having a look.

    Regards Roger
     

    Attached Files:

    • BNP.zip
      File size:
      479.8 KB
      Views:
      54
  6. Erel

    Erel Administrator Staff Member Licensed User

    Nice UI. What are the steps to reproduce it?
     
  7. Roger Daley

    Roger Daley Well-Known Member Licensed User


    Thanks for the complement. I am a bit unsure of the question but this is what I do.

    In Microsoft word for the Base of the calculator:
    New document, save as xxxx.DOC. xxx.DOCX doesn't handle graphics and objects very well on the same page.
    Insert shape [rectangle]
    Right click and Format Picture.
    Select "picture or texture fill". [I selected Marble]
    "Copy" from Word Home tab and paste in to Gimp [or Photoshop]
    Use photo editor to size, colour, opacity etc.

    Buttons and components of the Calculator Screen were done in similar manner. From there it is just a matter of positioning everything using the designer as you can see in the project.
    I think this answers your question, if I misinterpreted it or you need more detail let me know.

    Note: In case you are wondering I have done the Screen in parts to overcome some sizing problems. I found gluing bits together left edge to right edge etc solved most problems.

    As an extra, today I added a feature to allow the user to modify the appearance of the calculator. [same method that I used in BrownPaper ].
    A Configulator user in Prague [the guy who alerted me to the issue of the NOT function] commented that he liked the appearance of REALCALC.
    By storing 5 small graphics files in the phones DownLoad folder Configulator has the appearance below.
    ConfigRealCalc.jpg

    Once I sort out the NOT, AND, OR Etc issue I'll post the updated code on the forum.


    Regards Roger
     
    ellpopeb4a likes this.
  8. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Erel,

    Logic functions sorted, I wrote subs from scratch, they seem to work OK.
    Source code posted on forum as new post.

    Regards Roger
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice