What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » including files

including files
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: including files
[OFF TOPIC]

Don't use those PHP converted functions you find on that webpage to do script programming for Plus! (or Windows in general) just like that and without the knowledge of what those functions exactly do and for what they are meant.


PHP is meant for web development. JScript (and JavaScript) can also be used for web development, but are also used for Windows command line scripting. Windows scripting is different than scripting for the web since the script is not based upon a html page. So you don't have the same objects at your disposal. For example, in a web script you would output your data to html, obviously in command line scripting there is no html/web page to output to. So stuff like window.location.href don't even exist in command line scripting (there is no browser window and thus no URL location).

Furthermore, the functions you'll find on that website are converted to JavaScript. This is not entirly the same as JScript. Plus! scripting uses JScript, not JavaScript and thus some things (although not that much) are different.


---------------------------

If, in the Plus! scripting documentation, it is stated that function X::Y does something, then Y is a property or a method of the object X.

So you call that function like X.Y

And if there is another function which states Y::Z, then you call that function like X.Y.Z.

What the type of the return value of that function is, is stated in the 'syntax' between square brackets in front of the function name. The same with parameters for that function.

This is a general way in describing functions in programming language documentation so that everybody, no matter what language they come from, can understand it without confusion.

It's true that some descriptions can use some examples, but for things like the MsgPlus::LoadScriptFile function an example wouldn't show anything new or more than what is already said in the description. It's just a function with 1 parameter.

eg:

MsgPlus::LoadScriptFile
[boolean] LoadScriptFile(
    [string] ScriptFile
);

Means you call it like this:
    var retValue = MsgPlus.LoadScriptFile("subdirectory\\scriptfile.js");
or simply:
    MsgPlus.LoadScriptFile("subdirectory\\scriptfile");
    if you don't need to know the return value.

"subdirectory\\scriptfile.js" is obviously a string (see [string] in syntax)
reValue is a boolean (see [boolean] in syntax) and thus will be either True or False according to the success of the function.


---------------------------

An enumeration ([enum]) is just a collection of constants. It means that the parameter in question can only contain predefined values. These values make up the enumeration.

eg:

OnEvent_MenuClicked
OnEvent_MenuClicked(
    [string] MenuItemId,
    [enum] Location,
    [object] OriginWnd
);

From this you know that the function is an event. Events are functions which are automatically called when a certain thing happens. The parameters are filled in by Plus! and thus returned to your function. So this works in the opposite way as with functions like MsgPlus::LoadScriptFile where you need to fill in the parameters to send to the function.

The second parameter named 'Location' is an enumeration. Which means it will only return certain values (for what values, see the documentation). In the newer versions of Plus! you can also use the constant names of these variables instead of the numerical values themselfs to check on:

OnEvent_MenuClicked (sMenuItemId, eLocation, oOriginWnd) {
    Debug.Trace("Menu with ID: " + sMenuItemId + " has been clicked");
    // using the name of the constant:
    If (eLocation === MENULOC_CONTACTLIST) {
        Debug.Trace("This happened in the contactlist");
    }
    // or, using the numerical value:
    If (eLocation === 2) {
        Debug.Trace("This happened in a chat window");
    }
}



[/OFF TOPIC]

This post was edited on 05-08-2008 at 04:51 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
05-08-2008 04:37 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
including files - by Zeelia on 05-07-2008 at 11:14 PM
RE: including files - by CookieRevised on 05-08-2008 at 11:52 AM
RE: including files - by Zeelia on 05-08-2008 at 03:42 PM
RE: including files - by CookieRevised on 05-08-2008 at 04:37 PM
RE: including files - by Zeelia on 05-08-2008 at 05:30 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On