Shoutbox

Creating "public" char[] - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: Creating "public" char[] (/showthread.php?tid=12340)

Creating "public" char[] by TWDman on 07-05-2003 at 08:40 PM

Sorry, I don't know how to call it for C++, but in VB it's called a "public" variable. What I would like to do is putting the Value of CommandArg into a Char[] @ "Providing new commands" and then get the value of the Char[] @ the Notify part. I'm making a kind of "Topic" plug-in like in IRC:


        /xSetTopic "Is MsgPlus! a great add-on???"

        TWDman changes topic to 'Is MsgPlus! great add-on???'

Ive done this already. The hardest part:

       /xGetTopic

      Topic is 'Is MsgPlus! a great add-on???!'


Patchou (or somebody else) tell me, is this possible??


RE: Creating "public" char[] by Choli on 07-05-2003 at 10:30 PM

If I understood well, you need to declare a variable to store some text and would like that variable to be public, don't you?

Well, that in C/C++ is called a global variable and you have to define it outside any function. The syntax is the same as if it was a local variable:

code:
char topic[2048];


If you put that outside any function, you'll get a variable called topic accessible from all the functions that you have declared in the same file.

I hope I've answered your question :)