Announcement

Collapse
No announcement yet.

Shared Virtual Array

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

  • G Grant
    replied
    I have tried the SHARE command as

    SHARE SCRN()

    What am I doing wrong ?
    Change SHARE to SHARED


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

    Leave a comment:


  • Michael Mattias
    replied
    You are sharing the array correctly; however, you cannot access PB VIRTUAL arrays using pointers, PEEK or POKE. The only way to access elements of a virtual array is to use the array name and a subscript.

    But since your array is only 16000 bytes, there's no reason it can't be a regular array; although for your code example, there's no reason to use an array rather than a fixed or dynamic string.

    MCM


    ------------------
    Michael Mattias
    Racine WI USA
    [email protected]

    Leave a comment:


  • Steve Bouffe
    started a topic Shared Virtual Array

    Shared Virtual Array

    How do I share a virtual array with a SUB ?

    Dim Virtual SCRN(1) AS String * 8000

    SUB SCRNSAVE

    IF BIT(pbvScrnCard,0) THEN Addr& = &hB000 ELSE Addr& = &hB800
    DEF SEG = Addr&
    SaveBytes% = pbvScrnRows * pbvScrnCols * 2
    SCRN(1)=PEEK$(0,SAVEBYTES%)
    DEF SEG

    END SUB

    I have tried the SHARE command as

    SHARE SCRN()

    What am I doing wrong ?
Working...
X