Math Eqn

  1. 7 weeks ago

    How to handle 50,000 characters in a string variable for calculating mathematical expressions. I tried with the string builder, in the string builder the value is stored and I was unable to retrieve all the characters using Get as string() method. How to retrieve all the characters using the variable. Pls, anyone help me to solve this.

    It was working with 4000 characters but unable to retrieve the highest characters

  2. Jean-Yves P

    Dec 8 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    please post the part of your code that doesn't work as expected.

  3. Dim total As Double
    Dim result as String
    dim sb as new Chilkat.StringBuilder
    Dim success As Boolean

    result =ReplaceAll(expected,"LinZcom",LinZcom)
    result =ReplaceAll(result,"RotYext",RotYext)
    result =ReplaceAll(result,"CAirBag",CAirBag)
    result =ReplaceAll(result,"KBDistn",KBDistn)
    result =ReplaceAll(result,"ShellTk",ShellTk)
    result =ReplaceAll(result,"ZAcceSF",ZAcceSF)
    result =ReplaceAll(result,"SeatFri",SeatFri)
    result =ReplaceAll(result,"SBPTtim",SBPTtim)

    success = sb.Append(result)

    Dim myEval As New ExpressionEvaluator

    dim ParseStatus As Boolean = myEval.Parse(sb.GetAsString())

    if ParseStatus then
    myEval.Eval
    TextArea1.Text="result: "+str(myEval.Result)+EndOfLine
    Else
    End If

    /////

    In the Parse method, I was not able to calculate it.

    The final output i got is NAN(IND)

  4. Jean-Yves P

    Dec 8 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    why do you use a Chilkat.StringBuilder for sb and not a simple xojo String ?

  5. yes because I am storing the string value in String builder using the append method and then I will retrieve the value as sb.get asString().. because in a simple string it is not calculating it, so only I am using string builder for 50000 characters.

  6. Jean-Yves P

    Dec 8 Pre-Release Testers, Xojo Pro Europe (France, Besançon)
    Edited 7 weeks ago
    Public Sub Append(extends byref astring as String, toAppendText as String)
      '---------------------------------------------------------------------------------
      ' appends the toAppendText string at the end of aString
      '---------------------------------------------------------------------------------
      
      astring = astring + toAppendText
      
    End Sub

    then you can use sb as a simple string.
    may be your problem is in stringbuilder that doesn't handle 50000 chars ?

  7. After applying this method in xojo I am facing this issue "The extends modifier cannot be used on a class method" So pls help me to solve this I am the beginner in xojo.

  8. Jean-Yves P

    Dec 9 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    the "Append" method must be in a module with global access, not in a class.

  9. 6 weeks ago

    Hello Sir I tried with your points I am facing the same error again, I created a variable using Dim statement, In that variable how to call the append method, Sir Please help me to solve this Can you provide few examples about Append method because it will be easier to fix it, Pls help it..

or Sign Up to reply!