View Single Post
  #1  
Old 06-20-2001, 06:34 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
New Script features!

Ok, If any of you know JavaScript ud understand this..

You know how functions() are called like that. Well if you didnt already know this. fuctions can contain objects!!!! Yes its true people.. But this is disabled in Graal I was hoping stefan could ad this...
'
Simple Explanation
NPC Code:

function funcName(argument1,argument2,etc)
{ statements; }



and then

NPC Code:

funcName(value1,value2,ect)



============================

MoreBiggernier Explanation

Ok. Well Function Arguments or Objects are like when you put an argument into a command. For example..

message text;

text is the 1 argument in that commandline

Now Functions are made to take in objects and spit out results...

Example..
NPC Code:

cut_out_token_one(Call me Cool)



And the function

NPC Code:

function cut_out_token_one(message) {
tokenize #o(message); /*Im using #o cuz of strings. in
javaScript strings are set with "" not setstring.*/
for(i=0;i<tokenscount;i++;) {
if (i!=1) {
setstring result,#T(#s(result) #t(i));
}
}
return;
}



So it would return in the string
result

and have the value = Call Cool;

I hope that explains function aguments or objects ^^;

Adn calling then for you information...

A function waits in the wings until it is called onto the stage. You call a function simply by specifying its name followed by a parenthetical list of arguments, if any:


clearPage();
cut_out_token_one(Call me Cool);
Functions which return a result should be called from within an expression:


total=raiseP(2,8);
if (raiseP(tax,2)<100) ...


__________________

subliminal message: 1+1=3

Last edited by Falcor; 06-20-2001 at 09:59 AM..
Reply With Quote