Announcement

Collapse
No announcement yet.

LEN("123") gives GPF

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

  • Tom Hanlin
    replied
    There's nothing wrong with the statement as such. This is a compiler
    error which will be fixed in the next update.

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Leave a comment:


  • Semen Matusovski
    replied
    It looks that PB forgot to prevent such statements.
    If VarPtr("12345") and StrPtr("12345") are not allowed, why Len("12345") should be allowed ?

    When you simply use $a = "..." the string is stored, if there is no reference to it.
    It looks that here is the "same" case, because

    Code:
       #Compile Exe
       Function PbMain
          Dim sTest As String
          sTest = "12345"
          MsgBox Str$(Len("12345"))
       End Function
    works.


    ------------------
    E-MAIL: [email protected]

    Leave a comment:


  • Kev Peel
    replied

    Thats weird, I get a return value of 0 in the MsgBox but no GPF !?!?



    ------------------
    Kev G Peel
    KGP Software, Bridgwater, UK.
    www.go.to/kgpsoftware

    Leave a comment:


  • Don Dickinson
    replied
    I can reproduce this as well. The following GPF's for me:

    Code:
    #dim all
    #compile exe
    function pbmain
       msgbox str$(len("12345"))
    end function
    putting #register none at the top has no effect.

    interestingly enough, the following does not gpf:

    Code:
    #compile exe
    function pbmain
       Dim sTest as String
       sTest = "something"
       msgbox str$(len("12345"))
    end function
    Finally, replacing str$ with format$ has no effect. format$ gpf's too.

    Best Regards,
    Don


    ------------------

    Leave a comment:


  • Josef Lindinger
    started a topic LEN("123") gives GPF

    LEN("123") gives GPF

    Hi,

    why does the following code gives a GPF:
    Code:
    MSGBOX STR$(LEN("12345"))
    Very strange, i think


    ------------------

    mailto:[email protected][email protected]</A> www.selisoft.com
Working...
X