
-----------------------------------
Artimes
Mon Jun 06, 2005 5:41 pm

Array subscript out of range...
-----------------------------------
I'm making a poker card game, and I'm trying to make my own card system... So far it's ok (there are most likely better ways to do it than how I am). I have a variable called handPlayers, which is a 2D array. The first demension of the array is 1..total number of players, which represents that player, the other demension is 1..2, which holds the value of the their first and second card. But I keep getting the error "Array subscript is out of range" when ever I try to give a value to handPlayers (1,2) or (2,2) or (1,3) I get that error. However (1,1) works... ?!

This is only a basic outline of my program... The error occurs in the porc "dealCards"


var handPlayer : array 1 .. 1, 1 .. 1 of int
var deck : array 1 .. 13, 1 .. 4 of int
var temp : array 1 .. 3 of int
var players : int
var suite : string

proc gameSettings
    loop
        Draw.Cls
        put "Number of players (2..5): " ..
        get players
        exit when (players >= 2) and (players = 2) and (cn 