VERY basic string problem

i have the following code:

const
Sizes:array[0..10] of string=('Junior,Small,Medium,Large',
'Junior,Adult','Junior,Adult','Junior,Adult');

apparently my number of elements differs from my declaration. can anyone help me by telling me how many elements i have and what i should put in my declaration? i thought i had it right... :(

Comments

  • [b][red]This message was edited by the iDaZe at 2002-3-29 14:10:48[/red][/b][hr]
    : i have the following code:
    :
    : const
    : Sizes:array[0..10] of string=('Junior,Small,Medium,Large',
    : 'Junior,Adult','Junior,Adult','Junior,Adult');
    :
    : apparently my number of elements differs from my declaration. can anyone help me by telling me how many elements i have and what i should put in my declaration? i thought i had it right... :(
    :

    You have 4 elements:

    'Junior, Small, Medium, Large',
    'Junior, Adult',
    'Junior, Adult',
    'Junior, Adult'

    See, you only have 4 sets of ', so only 4 strings

    'Junior',
    'Small',
    'Medium',
    'Large',
    'Junior',
    'Adult',
    'Junior',
    'Adult',
    'Junior',
    'Adult'

    That are 10 strings, each one between it's own set of '

    Style tip:
    You might want to add some spaces behind each comma, put each element on a new line, etc ... Just to make your code more readable, you'll catch errors easier that way

    btw, [0..10] declares an array of 11 elements, [0..9] is for 10
  • First time poster, long time lurker! I want to start out by saying thanks to everyone in this forum for all the content and sharing
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories