cfarguments wrong order

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default cfarguments wrong order

    this is what i am doing...

    when i email myself i get this:
    struct
    AAA1 3
    AAB2 1
    AAC3 2
    Whats up with that???



    -- call to the webservice --
    <cfset args = structNew()>
    <cfset args.A = 2>
    <cfset args.B = 1>
    <cfset args.c = 3>
    <cfinvoke
    webservice="http://webservice.xxxxxxx.ca/nick.cfc?wsdl"
    method="wsBrowseClass"
    returnvariable="aObjectArray"
    username="wand"
    password="wand057" argumentcollection="#args#">
    </cfinvoke>


    -- web service --
    <cffunction name="wsBrowseClass" access="remote" returntype="array"
    output="No">
    <cfargument name="aaa1" required="Yes">
    <cfargument name="aab2" required="Yes">
    <cfargument name="aac3" required="Yes">
    <cfmail to="nick@xxxxxxx.ca" from="jamie@xxxxxx.ca" subject="arguments"
    type="HTML"><cfdump var="#arguments#"></cfmail>
    <cfset class_list = ArrayNew(1)>

    <cfreturn class_list>

    </cffunction>

    ultrafresh Guest

  2. Similar Questions and Discussions

    1. Tab Order always greyed out, need to redefine order but can't
      I had a check box but then i had to delete it and change it to a text field. now my tab order is all out of whack and I can't seem to set the tab...
    2. #39542 [NEW]: Search order for include/require wrong in get_include_path
      From: snowy at corporatezoo dot com Operating system: Windows XP PHP version: 5.2.0 PHP Bug Type: Scripting Engine problem...
    3. why wont my to_number work to order my data am I doingit wrong?
      This is how I have been trying to do it. select tsk.taskname as task, To_Number( DECODE ( is_number ( substr(tsk.taskname,Instr(tsk.taskname,...
    4. Table of contents - wrong order
      Vicky, I'm having _exactly_ the same problem you are describing, and it's quite icomprehensible to me. Not that that is any comfort to you! But I...
    5. Making a PDF from multiple files -- Acrobat gets them in wrong order
      Whenever I make a PDF from multiple files using the command in Acrobat 6.0.1, Acrobat puts them the wrong order. When I select the group of files...
  3. #2

    Default Re: cfarguments wrong order

    try this
    <cfset args = structNew()>
    <cfset args.AAA1 = 2>
    <cfset args.AAB2 = 1>
    <cfset args.AAC3 = 3>

    basky Guest

  4. #3

    Default Re: cfarguments wrong order

    Cold Fusion Structures are not Ordered as you would a array, you
    cannot expect results in a top to bottom orderand expect to use them
    in the same order fashion.

    You might want to try building your argument list in a structure
    nested inside an array where the array contains the structure items in
    the desired order and then the structure contains the additional items
    (e.g. name/value pairs)

    On Tue, 17 May 2005 16:14:48 +0000 (UTC), "ultrafresh"
    <webforumsuser@macromedia.com> wrote:
    >this is what i am doing...
    >
    > when i email myself i get this:
    > struct
    > AAA1 3
    > AAB2 1
    > AAC3 2
    > Whats up with that???
    >
    >
    >
    > -- call to the webservice --
    > <cfset args = structNew()>
    > <cfset args.A = 2>
    > <cfset args.B = 1>
    > <cfset args.c = 3>
    > <cfinvoke
    > webservice="http://webservice.xxxxxxx.ca/nick.cfc?wsdl"
    > method="wsBrowseClass"
    > returnvariable="aObjectArray"
    > username="wand"
    > password="wand057" argumentcollection="#args#">
    > </cfinvoke>
    >
    >
    > -- web service --
    > <cffunction name="wsBrowseClass" access="remote" returntype="array"
    >output="No">
    > <cfargument name="aaa1" required="Yes">
    > <cfargument name="aab2" required="Yes">
    > <cfargument name="aac3" required="Yes">
    > <cfmail to="nick@xxxxxxx.ca" from="jamie@xxxxxx.ca" subject="arguments"
    >type="HTML"><cfdump var="#arguments#"></cfmail>
    > <cfset class_list = ArrayNew(1)>
    >
    > <cfreturn class_list>
    >
    > </cffunction>
    Ro Guest

  5. #4

    Default Re: cfarguments wrong order

    had them named the same at one point....

    I don't think it matters what you call them on either side... inside the
    function the parameters are assigned values in the order that they are received
    and are encapsulated within the function... the name of the varialbe used to
    pass into the function is irrelevant.

    funny thing is when i only pass in 3 parms it is essentially reversed order
    which is crap but atleast predictable... when i tried passing in 4 parms in a
    weird order

    so if I pass in 3 parms like 1,2,3 i get 3,2,1 but if I pass in 4 parms like
    1,2,3,4 I get 3,4,2,1

    Isn't that nutty!?!?!?!/


    ultrafresh Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139