Mike Yearwood
Toronto, Ontario, Canada
Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
>thanks mike. a couple of questions.
>
>don't think you finished your first line there. let me know what you meant on that line. thanks.
No prob. I was going to say using a parameter object you can handled more than 27 parameters. I put it in another line.
>
>2nd, you stated:
>"When you want to use the individual values, you pass the entire object, not the individual values."
>i didn't think of that. so:
>
>1. you add properties to an object and store values to them so you can return the values to the calling function.
You can do that if you need multiple return values. I usually return from the function/procedure a success/fail. I'm suggesting you always send parameter objects to functions.
>2. if you need to use these values again in another function (say "myfunction") you pass that object such as: myfunction(objectname)
Yes
>3. within myfunction, you reference the variables as "objectname.property".
Yes
>
>What I had been doing was creating another variable to store "objectname.property" and then pass that to myfunction. If that's not what you would do, maybe that's what's causing me to work a bit harder here.
I would only send the object, and not another variable. They both point to the same actual object, so it's a little redundant.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement