Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unexpected array results
#1
Ok sorry, one last dumb question. I tryed playing around getting an array of single character strings. Here is my code ..

Code:
dim shared blah(0 to 2,0 to 2) as string * 1

blah(0,0) = "1"

print "[",blah(0,0),"]"

I would think the output of that would be simply "[1]", but instead I get
Code:
[              1              ]
Can anyone tell me why this is happeneing?

-gunder
p.s. Sorry, I know this is a dumb question but I've been playing with it for a couple hours and I can't figure out why it's doing it.
gunder
"I have a perfect body, but it's in the trunk and starting to smell."
Reply
#2
Ok, there is nothing wrong with your array.

Its with your print statement.

Your using ',' to separate your strings, in QB or FB this makes the print statement print 15 spaces per ',' To not have all those spaces, use a ';' instead of a ',' :wink:

Here try this:

Code:
print "[";blah(0,0);"]"
i]"But...it was so beautifully done"[/i]
Reply
#3
Hehe, I swear I'm not always this dumb. I've just been skimming over the tutorials since I know a lot of the stuff already. Guess I need to sit down and read them word for word again. Thanks for the help!

-gunder
gunder
"I have a perfect body, but it's in the trunk and starting to smell."
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)