I have the following program, and when i run it, it prints the lines from the array on separate lines instead of in the same print field. How can i get them to print within the same row of my column?
bbscores.txt is outputted in my next post.
'Program: BBtotals
'Programmer: Karl Schuttler
'Date: April 4, 2008
DECLARE SUB B000InputData ()
DECLARE SUB B010PlayerTotals ()
DECLARE SUB B020GameTotals ()
CLS
CONST intPlayers = 10
CONST intGames = 3
DIM SHARED sngScores(intPlayers, intGames) AS SINGLE
CALL B000InputData
CALL B010PlayerTotals
CALL B020GameTotals
END
SUB B000InputData
DIM intPlayerCount AS INTEGER
DIM intGameCount AS INTEGER
OPEN "bbscores.txt" FOR INPUT AS #1
intPlayerCount = 1
DO WHILE intPlayerCount <= intPlayers
intGameCount = 1
DO WHILE intGameCount <= intGames
INPUT #1, sngScores(intPlayerCount, intGameCount)
intGameCount = intGameCount + 1
LOOP
intPlayerCount = intPlayerCount + 1
LOOP
CLOSE #1
END SUB
SUB B010PlayerTotals
DIM intPlayerCount AS INTEGER
DIM intGameCount AS INTEGER
DIM sngPlayerTotal AS SINGLE
PRINT , "Game", "Game", "Game", "Player"
PRINT , "1", "2", "3", "Ave"
PRINT
intPlayerCount = 1
DO WHILE intPlayerCount <= intPlayers
PRINT "player"; intPlayerCount,
sngPlayerTotal = 0
intGameCount = 1
DO WHILE intGameCount <= intGames
PRINT sngScores(intPlayerCount, intGameCount)
sngPlayerTotal = sngPlayerTotal + sngScores(intPlayerCount, intGameCount)
intGameCount = intGameCount + 1
LOOP
sngPlayerTotal = sngPlayerTotal / intGames
PRINT sngPlayerTotal;
intPlayerCount = intPlayerCount + 1
LOOP
END SUB
SUB B020GameTotals
DIM intGameCount AS INTEGER
DIM intPlayerCount AS INTEGER
DIM sngGameTotal AS SINGLE
PRINT
PRINT "Game Total",
intGameCount = 1
DO WHILE intGameCount <= intGames
sngGameTotal = 0
intPlayerCount = 1
DO WHILE intPlayerCount <= intPlayers
sngGameTotal = sngGameTotal + sngScores(intPlayerCount, intGameCount)
intPlayerCount = intPlayerCount + 1
LOOP
PRINT USING " ###"; sngGameTotal;
intGameCount = intGameCount + 1
LOOP
END SUB
Printing array problem
Re: Printing array problem
Put a semi-colon at the end ofrexykik wrote:How can i get them to print within the same row of my column?
PRINT sngScores(intPlayerCount, intGameCount)
Like this
PRINT sngScores(intPlayerCount, intGameCount);
Right?
Mac
You there?
Any chance you will thank me or ask for further info?
Let's not be an Ephemeralus
Mac
Let's not be an Ephemeralus
Mac