Results 1 to 13 of 13

Thread: Please need a little help(changeing text cases))

  1. #1
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default Please need a little help(changeing text cases))

    How do I do this below

    Simba Code:
    text := Upper('text');
    writeln(text);

    and would print out this: 'Text'

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Simba Code:
    Writeln('The UpText is: ' + GetUpText);
    Should do it I think!]

    OOPS ROFL! NEVER MIND!


    Try UpperCase instead of Upper

  3. #3
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Simba Code:
    Writeln('The UpText is: ' + GetUpText);
    Should do it I think!]

    OOPS ROFL! NEVER MIND!


    Try UpperCase instead of Upper
    UpperCase changes all the letters to uppercase I'm just trying to change the first letter.

  4. #4
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Simba Code:
    program new;
    {$I SRL/SRL.Simba}

    Function FLU(str: String): String;
    begin
      Str[1]:= UpperCase(Str[1])[1]
      Result:= Str;
    end;

    begin
      Flu('dfsgs');
    end.
    I am Ggzz..
    Hackintosher

  5. #5
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Isn't there a Capitalize function? I could swear we had one.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  6. #6
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    ok I see

    Simba Code:
    program new;
    var
      text: string;

    begin
      text := 'hello';
      writeln(Capitalize(text));

    end.
    Last edited by bud_wis_er_420; 01-04-2012 at 12:57 AM.

  7. #7
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    what am I doing wrong here?
    [Error] (11:30): Type mismatch at line 10
    Compiling failed.


    Simba Code:
    program new;
    var
      text,Captext,Lowertext,Alltext: TStringArray;
      next: integer;
    begin


      text :=  ['hello', 'bot', 'sup']

      Captext := Capitalize(text);
      Lowertext := Lowercase(text);
      Alltext := Captext + Lowertext
      For next := 0 to high(Alltext) do
      begin
        writeln(Alltext[next]));
      end;
    end.
    Last edited by bud_wis_er_420; 01-04-2012 at 01:18 AM.

  8. #8
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Need to do Capitalize(text[x]), and the same for the others.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  9. #9
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    I need to loop it though, huh?

  10. #10
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Yup
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  11. #11
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    This what I came up with, but it's not working.


    ok this what I have now but it still not working
    Simba Code:
    program new;
    var
      text,Captext,Lowertext,Alltext: TStringArray;
      next: integer;
    begin


      text :=  ['hello', 'bot', 'sup']
      SetLength(Captext, high(text));
      for next := 0 to high(text) do
        Captext[next] := Capitalize(text[next]);

      //Lowertext := Lowercase(text);
      //Alltext := Captext + Lowertext
      for next := 0 to high(Captext) do
      begin
      writeln(Captext[next]);
      end;
    end.
    Last edited by bud_wis_er_420; 01-04-2012 at 01:31 AM.

  12. #12
    Join Date
    Mar 2007
    Location
    USA
    Posts
    1,433
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by bud_wis_er_420 View Post
    This what I came up with, but it's not working.


    ok this what I have now but it still not working
    Code:
    program new;
    var
      text,Captext,Lowertext,Alltext: TStringArray;
      next: integer;
    begin
    
    
      text :=  ['hello', 'bot', 'sup']
      SetLength(Captext, length(text)); 
      for next := 0 to high(text) do
        Captext[next] := Capitalize(text[next]);
    
      //Lowertext := Lowercase(text);
      //Alltext := Captext + Lowertext
      for next := 0 to high(Captext) do
      begin
      writeln(Captext[next]);
      end;
    end.
    See bolded.

    EDIT: Just realized I left part of the previous code there, my bad.
    Last edited by Silent; 01-04-2012 at 07:32 AM. Reason: fixed code.
    I'm Silent SPY
    Secret project: 0%
    Need help? Send me a PM

  13. #13
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    Thx

Thread Information

Users Browsing this Thread

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

Posting Permissions

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