Announcement

Collapse
No announcement yet.

Run Time Error using string pointers

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

  • K Peel
    Guest replied
    Hi,

    PBDLL Date: 08.10.1997 (DD.MM.YYYY)
    Using windows 98 it produces a page fault GPF.



    -------------
    Kev G Peel
    KGP Software
    Bridgwater, UK.
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Joe Speroni
    replied
    My PBDLL.EXE is dated 7/01/99 201,014 bytes in length.

    Leave a comment:


  • Eric Pearson
    replied
    The original test program runs repeatedly without errors on my NT4 SP3 system. But it produces an Invalid Page Fault the first time it is run on Windows 98.

    -- Eric


    -------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>

    Leave a comment:


  • Cecil Williams
    Guest replied
    Lance,

    I compliled Joe's program in PB/DLL6. Works just fine as you said. I am
    using NT4.0 sp6.

    Cecil

    Leave a comment:


  • Jim Padgett
    replied
    I get the problem with my PC at work NT SP4 IBM 300XL 128 Meg Ram.
    I am running Iomega Parrallel port drivers. I sometimes think they cause
    some memory errors. ( I usually get them when the drives are being read
    by explorer.
    The error on the first program is
    The instruction at 0x00000005 referenced memory at 0x00000005.
    The memory could not be read.
    I don't get this on the second program.
    I am running PBDll 6.0.



    [This message has been edited by Jim Padgett (edited January 31, 2000).]

    Leave a comment:


  • Semen Matusovski
    replied
    I saw Lance message and decided to test Joe' information (Win98SE, PB/DLL-6).
    I started from IDE first time and saw correct data in Msgbox.
    Started the second time - GPF. Third time - PC simply had hanged.
    I rebooted system and repeat experiment. Approximately the same.

    Clear, that happends something not controlled and these statements destroy a memory.

    Lance, perhaps, you tested under Win2000 ?

    PS. I saw Jim's message. I have IDE Iomega Zip and special driver for electronic keys (LPT)

    [This message has been edited by Semen Matusovski (edited January 31, 2000).]

    Leave a comment:


  • Lance Edmonds
    replied
    I cannot duplicate Joe's problem with either PB/DLL 5.0 nor PB/DLL 6.0.

    Joe, what version of PB/DLL are you using, and what is the date of your PBDLL.EXE file?



    -------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Chuck de Young
    replied
    Move the dimension for the pointer and it works, go figure.

    Code:
    $Compile Exe
    Option Explicit
    Function PbMain() As Long
    Dim X As String
    Dim I As Long
    Dim xPtr(1 To 4) As String Ptr
    Dim R(1 To 4) As String
    
    R(1) = " String I. "
    R(2) = " String II. "
    R(3) = " String III. "
    R(4) = " String IV. "
    
    For I = 1 To 4
      xPtr(i) = VarPtr(R(i))
    Next
    
    For I = 1 To 4
      X = X & @xPtr(i) & "|"
    Next
    MsgBox X
    End Function
    Curious, I hate it when that happens.

    Chuck

    Leave a comment:


  • Joe Speroni
    started a topic Run Time Error using string pointers

    Run Time Error using string pointers

    While playing with pointers, I constructed the following program,
    more or less from HELP files, that appears to be correct. When
    executed without the MSGBOX statement it terminates without a
    problem. No error occurs. When the MSGBOX line is retained, it
    seems to provide the correct answer (evidence the program is
    correct?), but when the MSGBOX button is clicked a memory
    violation error occurs. Is this a compiler bug, or is the
    program's use of pointers incorrect.

    My PC is a PII system using Windows NT4.0+SP6.
    ------------------------------------------------------------------
    $COMPILE EXE
    FUNCTION PBMAIN() AS LONG
    DIM R(1:4) AS STRING
    R(1)=" String I. ":R(2)=" String II. "
    R(3)=" String III. ":R(4)=" String IV. "

    DIM xptr(1:4) AS STRING PTR
    FOR i&=1 TO 4:xptr(i&)=VARPTR(R(i&)):NEXT

    FOR i&=1 TO 4:x$=x$+@xptr(i&)+"|":NEXT
    MSGBOX x$ ' without this statement no memory access error occurs
    END FUNCTION
Working...
X
😀
🥰
🤢
😎
😡
👍
👎