Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2009
    Posts
    6

    [HELP] Post Generator

    Hey guys I am creating a project that contains post generator for a vB forum.
    I have a few problems I wanted to ask u guys about and gain some information.
    Its like this:
    I have 2 rich text objects, writable and called Object 1 and Object 2.
    I have another rich text object, read only called Object 3.
    Then I have a generate button.
    In object 1 you write the title and object 2 description. Object 3 gives u an ordered categorized vB Forum text.
    In generate button I have:
    Code:
    result = RichText.GetText("object 1", true);
    result2 = RichText.GetText("object 1", true);
    RichText.SetText("Object 3", result, true);
    when i press generate button in only adds text from object 1 in object 3 and immediately replaces it with text from object 2.

    I have two problems:
    1. how can I combine "result" with vb codes like below to show in object 3
    2. how can I show both text from object 1 and object 2 without replacing each other.
    This link is all i found thats shows a vb post generator:
    http://www.handheldusers.com/forum/postgen.php
    I will appreciate it if u help me.

  2. #2
    Join Date
    Apr 2006
    Posts
    127
    If you study your code carefully, you will see that result and result2 are (incorrectly) from the same Object 1

    You probably want to concatenate the two strings in this way:

    result3 = result .. "\r\n\r\n" .. result2

    If you wish to combine vb codes with result3, the principle is the same:

    result3 = result3 .. "\r\n\r\n My VB code 1" .. "\r\n\r\n My VB code 2"

    RichText.SetText("Object 3", result3, true);

  3. #3
    Join Date
    Oct 2009
    Posts
    6
    Thanks in advance my friend. I'll give it a try asap. BTW what does \r\n\r\n stand for?

  4. #4
    Join Date
    Apr 2006
    Posts
    127
    They are carriage return + new line. Without them, all the text will be one long single line. Use \r\n to display text as multiple lines.

  5. #5
    Join Date
    Oct 2009
    Posts
    6

    ?

    Quote Originally Posted by IdeasVacuum View Post
    If you study your code carefully, you will see that result and result2 are (incorrectly) from the same Object 1

    You probably want to concatenate the two strings in this way:

    result3 = result .. "\r\n\r\n" .. result2

    If you wish to combine vb codes with result3, the principle is the same:

    result3 = result3 .. "\r\n\r\n My VB code 1" .. "\r\n\r\n My VB code 2"

    RichText.SetText("Object 3", result3, true);
    I corrected what you told me to. But when I press the generate button. It only shows result not result1 is there a way I can command to add result1 at the end of result with some codes between them?

    This is my code. whats wrong?
    Code:
    result = RichText.GetText("Title", true); 
    result1 = RichText.GetText("Pri Screenshot", true);
    result3 = result .. "\r\n\r\n" .. result1
    result3 = result3 .. "\r\n\r\n My VB code 1" .. "\r\n\r\n My VB code 2"
    RichText.SetText("post", result3, true);

  6. #6
    Join Date
    Oct 2009
    Location
    127.0.0.1
    Posts
    279
    result = RichText.GetText("Title", true);
    result1 = RichText.GetText("Pri Screenshot", true);
    result3 = result .. "\r\n\r\n" .. result1
    result3 = result3 .. "\r\n\r\n My VB code 1" .. "\r\n\r\n My VB code 2"
    RichText.SetText("post", result3, true);
    Should be:
    Code:
     
    result = RichText.GetText("Title", false); 
    result1 = RichText.GetText("Pri Screenshot", false);
    result3 = result .. "\r\n\r\n" .. result1
    result3 = result3 .. "\r\n\r\n My VB code 1" .. "\r\n\r\n My VB code 2"
    RichText.SetText("post", result3, false);
    There are 10 types of people in the world: those who understand binary, and those who don't.

  7. #7
    Join Date
    Oct 2009
    Posts
    6
    Quote Originally Posted by Scriptonite View Post
    Should be:
    Code:
     
    result = RichText.GetText("Title", false); 
    result1 = RichText.GetText("Pri Screenshot", false);
    result3 = result .. "\r\n\r\n" .. result1
    result3 = result3 .. "\r\n\r\n My VB code 1" .. "\r\n\r\n My VB code 2"
    RichText.SetText("post", result3, false);
    thanks dude. that worked. thanks a lot

  8. #8
    Join Date
    Oct 2009
    Posts
    6

    Help

    I wrote the codes.
    I have a problem I need to fix. All the RichText objects have written text inside them thats shows what hey are for. For ex. "Pri Screenshot" has "Primary Screenshot Address" written inside. I need to know how I can write a code that commands "resultn" to ignore objects that their text haven't been changed? In fact haven't been touched by user.

    Looking forward to your replies.
    Thanks in advance, Hirad.
    Last edited by hiradsabaghian; 10-28-2009 at 09:58 PM.

  9. #9
    Join Date
    Oct 2009
    Location
    127.0.0.1
    Posts
    279
    Use On Key to track activity in the text object. Use a variable for each one.

    Code:
    --On Show of page
    a=1
    
    -- On Key of text object 
    a=5
    
    
    --Your function
    if a == 1 
    then 
    --Text is the same
    else
    --Text has changed
    end
    Make sure you use a different variable for each text box.
    There are 10 types of people in the world: those who understand binary, and those who don't.

Posting Permissions

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