Using input to call procedures or verbs with parameters
I've got 10+ inputs in my game, each effecting a different value, I do not want to create 10 verbs each handling one input. So if im inputing, 10,000,000 in various input boxes
Input 1:
ChangeStats("Agriculture",10000000)
Input 2
ChangeStats("Infrastructure",10000000)
Input 3
ChangeStats("Administration",10000000)
Having the ability to call a procedure means that differant parameters can be declared so that you can have one procedure manage all or most interface inputs. So that input could call, ChangeStats("Administration",Input)
ID:133761
Jan 20 2008, 6:25 pm (Edited on Jan 20 2008, 6:31 pm)
|
|
In response to Lummox JR
|
|
Im looking to be able to call a procedure from an input on the interface. Where I could have the input call this UpdateStats("Agriculture",Input) instead of having todo this:
proc/UpdateAgriculture(n as num) This would also allow me to handle all of the inputs from one procedure instead of having a verb for every single input space. |
In response to Strawgate
|
|
It still doesn't make sense. Why wouldn't you be able to do this now?
Lummox JR |
In response to Lummox JR
|
|
Lummox JR wrote:
It still doesn't make sense. Why wouldn't you be able to do this now? When you have an input on your interface it asks you for a default command, im asking for the ability to add constant parameters to this default command. Default Command: ChangeStats("Agriculture",Input) Where ChangeStats is a procedure and not a verb. I was under the impression that you can't directly call procedures from inputs, instead you have to call a verb, which would then call a procedure. So basically if you could call procedures from the input box the code would look like this: On interface it would look like this ChangeStats("Agriculture",Input), or maybe ChageStats "Agriculture",Input Which would then be seperated todo differant things depending on the type. Where as right now I have todo this. Currently I have todo this: Interface: Default Command: UpdateAgriculture blah/blah |
In response to Strawgate
|
|
Strawgate wrote:
Lummox JR wrote: And you can do this now. In the interface file it'd look like this:
command = "ChangeStats \"Agriculture\" "
Lummox JR |
In response to Lummox JR
|
|
No you can't, you can only call things that have been added to your verbs list.
|
In response to Nadrew
|
|
Nadrew wrote:
No you can't, you can only call things that have been added to your verbs list. Clearly in my example the assumption is that whatever he uses, it should be a verb. The point is not the command itself but the syntax. He's acting like it's impossible to put another argument in there, which is quite wrong. Lummox JR |
In response to Strawgate
|
|
Why not do this?
proc/Update(n,area) |
Lummox JR