Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-08-2007, 10:14 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Editing params

Would it be possible for this feature to be added:

PHP Code:
this.doActionTest(5.66"heya!");
function 
onActionTest(int(moneyValue), string.substring(2))
  echo(
temp.moneyValue SPC temp.string); 
Would return

PHP Code:
6 ya
I think it'd be usefull although it could cause problems... :[
Reply With Quote
  #2  
Old 04-08-2007, 10:35 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Would be nice. And useful in some cases.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #3  
Old 04-08-2007, 01:14 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
You could produce those outputs in the function itself...
Reply With Quote
  #4  
Old 04-08-2007, 02:56 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Twinny View Post
You could produce those outputs in the function itself...
What is your point?
Reply With Quote
  #5  
Old 04-08-2007, 03:50 PM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
PHP Code:
this.doActionTest(5.66"heya!");
function 
onActionTest(moneyValuestring)
  echo (
inttemp.moneyValue SPC temp.string.substring(2) ); 
You can't put functions inside the parameters: They are more like a declaration of variables than anything else. Making functions act within the parameters is completely non-conformist and actually goes further to impair the concept of general coding in higher-level languages.

Put it this way: You can't act on the variables themselves because they do not have a name (yet). If anything, the result of that would be the variable name being the outcome of the function itself.
Reply With Quote
  #6  
Old 04-08-2007, 03:54 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Novo View Post
PHP Code:
this.doActionTest(5.66"heya!");
function 
onActionTest(moneyValuestring)
  echo (
inttemp.moneyValue SPC temp.string.substring(2) ); 
You can't put functions inside the parameters: They are more like a declaration of variables than anything else. Making functions act within the parameters is completely non-conformist and actually goes further to impair the concept of general coding in higher-level languages.

Put it this way: You can't act on the variables themselves because they do not have a name (yet). If anything, the result of that would be the variable name being the outcome of the function itself.
You're right. Thanks
Reply With Quote
  #7  
Old 04-12-2007, 01:50 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Sometimes it is better to use more script lines when it improves the readibility of the script. So it would be better to write moneyValue = int(moneyValue); in the next line instead of adding some hacky way of manipulating it directly in the function header. In some programming languages you can define conditions for the input variables, although it is probably more easy to write those checks at the beginnig of the function.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.