View Full Version : [HELP] Post Generator
hiradsabaghian
10-10-2009, 02:52 PM
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:
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.
IdeasVacuum
10-10-2009, 08:21 PM
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);
hiradsabaghian
10-11-2009, 05:31 PM
Thanks in advance my friend. I'll give it a try asap. BTW what does \r\n\r\n stand for?
IdeasVacuum
10-11-2009, 05:44 PM
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.
hiradsabaghian
10-20-2009, 10:12 AM
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?
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);
Scriptonite
10-20-2009, 12:23 PM
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:
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);
hiradsabaghian
10-20-2009, 08:28 PM
Should be:
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
hiradsabaghian
10-28-2009, 10:52 PM
I wrote the codes (http://pastebay.com/pastebay.php?dl=64546).
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.
Scriptonite
10-28-2009, 11:33 PM
Use On Key to track activity in the text object. Use a variable for each one.
--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.
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.