• Print

Author Topic: COMMON SHARED problem I think  (Read 119 times)

Clippy

  • Hero Member
  • *****
  • Posts: 16446
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
COMMON SHARED problem I think
« on: February 19, 2013, 12:15:14 AM »
This code creates a Subscript out of range error later in the program when a SUB is called. Qbasic runs fine:
Code: [Select]
DIM bsij(12, 12), sij(12, 12), eij(12, 12)
DIM gij(12, 12), beij(12, 12)
COMMON SHARED bsij(), sij(), eij()
COMMON SHARED gij(), beij()

This fixes it:
Code: [Select]
DIM SHARED bsij(12, 12), sij(12, 12), eij(12, 12)
DIM SHARED gij(12, 12), beij(12, 12)
COMMON SHARED bsij(), sij(), eij()
COMMON SHARED gij(), beij()

And yes I realize it doesn't need both...  ;)
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

  • Print