Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- component {
- variables.privateVar = "";
- public void function Init(){
- }
- public void function testThis(struct myStruct = {}){
- if(structKeyExists(myStruct,"fruit")){
- myStruct.fruit = "banana";
- }
- else if(structKeyExists(myStruct,"animal")){
- myStruct.animal = "tiger";
- }
- }
- }
- //invocation
- <cfscript>
- test = new Test();
- myStruct = {fruit = ""};
- test.testThis(myStruct);
- //myStruct.fruit = banana
- writedump(myStruct);
- myStruct = {animal = ""};
- test.testThis(myStruct);
- //myStruct.fruit = banana
- writedump(myStruct);
- </cfscript>
Add Comment
Please, Sign In to add comment