Results 1 to 13 of 13
  1. #1


    Member Since
    Jun 08, 2013
    Location
    Būr said,Egypt
    Posts
    158
    Specs:
    MacBook Pro (i5)
    need help from a programmer
    how do i write Vbcrlf (It's from visual basic) at coaca?

    vbcrlf put texts under each other

  2. #2

    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,652
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 6S, iPod Nano 7th GeniPad 3
    For logging using "NSLog", the newline, carriage return is added for you automatically..

    The vbCrLf command basically adds a Carriage Return, and Line Feed..

    What are you trying to do?
    --
    Regards
    ...Ashwin



    Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.

  3. #3


    Member Since
    Jun 08, 2013
    Location
    Būr said,Egypt
    Posts
    158
    Specs:
    MacBook Pro (i5)
    i want to write"Hey" then press button then it shows,then write "What's up?" and press button,then i get this
    ----------
    hey
    what's up?
    ----------

  4. #4

    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,652
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 6S, iPod Nano 7th GeniPad 3
    So you are trying to do a command line program in Cocoa?
    --
    Regards
    ...Ashwin



    Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.

  5. #5


    Member Since
    Jun 08, 2013
    Location
    Būr said,Egypt
    Posts
    158
    Specs:
    MacBook Pro (i5)
    i don't know what do you mean but if you know something about visual basic tell me what does VBCRLF equal in cocoa

  6. #6

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    A carriage return is accomplished by using \r and a line break is \n.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  7. #7


    Member Since
    Jun 08, 2013
    Location
    Būr said,Egypt
    Posts
    158
    Specs:
    MacBook Pro (i5)
    okay i tried to write "\n" but it gave me choices on of them was Nsstring/Nstring. so it's not purely \n xD.could you write an exist code for me?

  8. #8

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    You put \r and \n within the confines of your string. So, a string might look like the following:
    Code:
    NSString *myString = @"My String\n";
    That would produce:
    Code:
    My String
    <new line>
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  9. #9


    Member Since
    Jun 08, 2013
    Location
    Būr said,Egypt
    Posts
    158
    Specs:
    MacBook Pro (i5)
    Quote Originally Posted by vansmith View Post
    You put \r and \n within the confines of your string. So, a string might look like the following:
    Code:
    NSString *myString = @"My String\n";
    That would produce:
    Code:
    My String
    <new line>
    thanks a lot. you helped me a lot. you are the first guy who gave me the right answer for my questions xD

  10. #10


    Member Since
    Jun 08, 2013
    Location
    Būr said,Egypt
    Posts
    158
    Specs:
    MacBook Pro (i5)
    well,rigth now i'm stuck xD . i want to connect to commands with each other :S
    i want to say ( X + _"Something" .stringvalue; so how is it?

  11. #11

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    Can you reword that? I'm not sure I understand what you're trying to do.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  12. #12

    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,652
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 6S, iPod Nano 7th GeniPad 3
    To concatenate two strings, you have a couple of options. One is to use to use a NSMutableString, and the other is to string with the NSString, but create a new one..

    So for example..
    Code:
    NSString *first = @"Hello ";
    NSString *second = @"World";
    
    NSString *result = @"";
    result = [result stringByAppendingString:first];
    result = [result stringByAppendingString:second];
    The NSString result now contains "Hello World" in it..

    The second option is
    Code:
    NSString *second = @"World";
    NSMutableString *result = @"Hello ";
    
    result = [result appendString:first];
    The NSMutableString result now contains "Hello World".

    You might want to read up on Mutable and Immutable objects and see the pros and cons about using one over the other..
    --
    Regards
    ...Ashwin



    Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.

  13. #13


    Member Since
    Jun 08, 2013
    Location
    Būr said,Egypt
    Posts
    158
    Specs:
    MacBook Pro (i5)
    Quote Originally Posted by vansmith View Post
    You put \r and \n within the confines of your string. So, a string might look like the following:
    Code:
    NSString *myString = @"My String\n";
    That would produce:
    Code:
    My String
    <new line>
    that's what i wanted but no exactly, i wanna variable instead of constants

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. need help from a programmer
    By Yodda_Hunter in forum Other Hardware and Peripherals
    Replies: 0
    Last Post: 07-20-2013, 04:34 PM
  2. PC programmer needs your help!
    By dragokatzov in forum Switcher Hangout
    Replies: 3
    Last Post: 09-30-2012, 09:49 AM
  3. LF programmer
    By Esfruga in forum iOS Development
    Replies: 0
    Last Post: 07-20-2011, 08:55 PM
  4. Looking for a programmer
    By barchuta73 in forum Schweb's Lounge
    Replies: 0
    Last Post: 11-10-2006, 06:17 PM
  5. An Idea for a Programmer
    By Conehead778 in forum OS X - Apps and Games
    Replies: 4
    Last Post: 02-19-2006, 04:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •