Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default Add to Structure

    I'm a structures newbie. I need to know how to
    1) Determine if a structure already exists
    2) If not, create it. If yes, add to it.

    I've got this much working (see code). I'm trying to use a structure to keep
    track of people I've notified during today's session.


    <cfset Notified=StructNew()>
    <cfset Notified.AuthorID=#SendMail#>
    <cfset Notified.AuthorName=#Form.AuthorName#>

    <!--- shows on page --->
    <cfif IsDefined("URL.SendMail")IS "Yes">
    <p><cfoutput><font color="RED"><strong>You just sent email notification to
    #Notified.AuthorName#.</strong></font></cfoutput></p>
    </cfif>

    H3ath0r Guest

  2. Similar Questions and Discussions

    1. Class::Struct - want to access structure within structure
      I want to access a structure within a structure. Below is what I had in mind. Please help. #!/perl/bin/perl use Class::Struct; struct Step...
    2. Complex Structure
      Hey guys, I've created a reservation app that checks multiple dates against a calendar and if the dates are available inserts them into a table....
    3. W3D structure...
      Hi My big problem is that I have some deformations that are already defined by vertices index, and their moves... But these deformations are...
    4. what is this data structure?
      Hi, I don't know how to work with this data structure: my @array = ((a => 'appple'), (b => 'tree'), (c => 'chair')); when I do:
    5. Invoice Structure?
      Hi Group Just trying to get some thoughts on the best / efficient way to handle this type of invoicing or some ways you may have handled this. ...
  3. #2

    Default Re: Add to Structure

    if (isDefined("notified")){
    // code
    }
    else{
    notified = structnew();
    // more stuff
    }
    Dan Bracuk Guest

  4. #3

    Default Re: Add to Structure

    Excellent, excellent... but what IS the code to add to a new structure. I only know how to create a new one, not to append. I've not had good luck following examples.
    THANKS!
    H3ath0r Guest

  5. #4

    Default Re: Add to Structure

    "but what IS the code to add to a new structure. I only know how to create a
    new one, not to append."

    Assuming the existing structure is named myStructure:

    <cfset myStructure.newValue = "blahblah">

    I'm kinda curious though, where is this pre-existing structure? pre-existing
    from what? are you storing it in the Application context? or Session context?
    because if not, it only exists for one request. After that request is done, the
    structure is gone.

    Kronin555 Guest

  6. #5

    Default Re: Add to Structure

    A good question... I'm going to store it as a session variable, that is once I figure out this basic code and get it working.

    H3ath0r 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