Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Small words to capitals.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MysticVegeta




PostPosted: Thu Apr 07, 2005 4:50 pm   Post subject: Small words to capitals.

The word is stored in a array.

code:

var word : array 1 .. 2 of string

for s : 1 .. 2
    get word (s) : *
end for

for x : 1 .. 2
    for s : 1 .. length (word (x))
        word (x) (s) := Str.Upper (word (x) (s))
    end for
end for



Why doesnt it work, also what do i do to make it work?
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Thu Apr 07, 2005 5:01 pm   Post subject: (No subject)

The individual characters of a string are not variables, so you cannot change those individual characters. Luckily, you don't need to go through the string character by character with Str.Upper (btw, nice, I've never discovered that one before). So, just take out your s for loop.
MysticVegeta




PostPosted: Thu Apr 07, 2005 5:41 pm   Post subject: (No subject)

woah! lol that worked? and here i was.. i feel like an idiot... anyways.. w00t 1/10th of the problem done Laughing
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: