
-----------------------------------
Poland13
Wed Jan 07, 2004 6:10 pm

question bout ERROR
-----------------------------------
var cardz : array 1..13 of string:= init("2,3,4,5,6,7,8,9,T,J,Q,K,A")

the error is 2 few inital values

-----------------------------------
Thuged_Out_G
Wed Jan 07, 2004 6:14 pm


-----------------------------------
try changing it to 1..12 instead of 1..13...that might help, but im not positive  :?  lol

EDIT: ignore my post, ive never used an array that way, so i was not sure....ive only used for loops to put info into my arrays  :?

-----------------------------------
JayLo
Wed Jan 07, 2004 6:15 pm


-----------------------------------
it's because you have to put each individual string item in quotes, divided by commas.

var cardz : array 1..13 of string:= init("2","3","4","5","6","7","8","9","T","J","Q","K","A") 

-----------------------------------
Tony
Wed Jan 07, 2004 6:15 pm


-----------------------------------
eh... no... you initialize cardz(1) to be that entire string. You need to use separate values... meaning
[code]
init("1","2"...."A")

-----------------------------------
Poland13
Wed Jan 07, 2004 6:16 pm


-----------------------------------
thanks alot i couldn't figure it out

-----------------------------------
Poland13
Wed Jan 07, 2004 6:24 pm


-----------------------------------
can someone help me out bit with this code its suppose to egnerate a random deck of cards ne help would be appreacated

var deck: array 1..52 of string 
var cardz: array 1..13 of string:= init("2","3","4","5","6","7","8","9","T","J","Q","K","A") 
var suit :  array 1..4 of string := init("C","D","S","H") 
for x: 1..4
for y: 1..13
deck(cardz):=cardz(1)+ suit(1)
cardz:=cardz +1
end for 
end for

-----------------------------------
shorthair
Wed Jan 07, 2004 6:28 pm


-----------------------------------
you never actually tell the program to output the cards , thats the problem

-----------------------------------
Poland13
Wed Jan 07, 2004 6:34 pm


-----------------------------------
deck(cardz):=cardz(1)+ suit(1) 

this is an error subscript of deck is wrong type
