User Profile

Collapse

Profile Sidebar

Collapse
Esmeralda
Esmeralda
Last Activity: Oct 27 '08, 03:43 PM
Joined: Feb 19 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Esmeralda
    started a topic C# new and override
    in .NET

    C# new and override

    I am pretty new to C# (and anything really other than web languages). I am trying to understand two keywords in C# dealing with polymorphism. Can you please tell me if the following is correct?

    New keyword – just states that there is a method in the child class with the same name as one in the base class, prevents an error. Hides the child method from the parent method.
    Override keyword - Child method that actually overrides...
    See more | Go to post

  • Thank you. I found that the below works great for my purpose.

    [code=cfm]
    <cfif #ID# NEQ #chkChanged#>
    Changed
    <cfelse>
    Unchanged
    </cfif>
    [/code]
    With most of everything else above. So I can basically compare to see if the lists are the exact same using "valuelist" to turn the query into a comma separated list without a loop.
    See more | Go to post

    Leave a comment:


  • As a temporary fix, I turned the array into a list. I then am checking the list length to see if there are any changes. The only problem is if they select and then de-select the same amount.

    Code:
    <cfif IsDefined('form.chkChanged')>	
       <cfset ID=quotedvalueList(qry.ID)>
      <cfset chkChanged=#form.chkChanged#>
      <cfif #ListLen(ID)# NEQ #ListLen(chkChanged)#>
            changed
    ...
    See more | Go to post

    Leave a comment:


  • I guess I really want to know if there is a way to compare a list to a list, or a list to an array. Looping over just gives me the last value of the field. All I want to know is if anything has changed. Not exactly what has changed.
    See more | Go to post

    Leave a comment:


  • Looping through list and comparing to database field problem

    My situation:
    I have a dynamic form with checkboxes. The checkboxes are submitted and added to a database. They are a list.

    I want to compare the list with what is currently listed in the database. If there is anything new or removed, I want to know with a variable that says changed.

    Basically:
    Checkboxes = 1,2,3
    Database rows and fields are:
    row | field
    1 | 2
    2| 3

    I want...
    See more | Go to post
    Last edited by acoder; Apr 2 '12, 10:57 AM.

  • Thank you again. I ended up using regEx and the search() function.
    Code:
    var contnum = new RegExp('/,?' + contID[i].value + ',?/');
    if(dispCA.join().search(contnum)>=0)
    {
    It seems to work okay...
    See more | Go to post

    Leave a comment:


  • I hadn't thought of using regex, but that may work as a great possiblity, thanks :) .

    What I'm actually trying to do is look for a number within an array. The number is dynamically set as is the array. Indexof was working correctly, but then I realized my error.

    Here is a snippet:
    Code:
     var dispCA = new Array(<cfoutput query="getCA">#id#<cfif getCA.currentRow LT getCA.recordCount>,</cfif></cfoutput>);
    ...
    See more | Go to post

    Leave a comment:


  • Search for a number in a string or in an array

    What would be the best way to search for a number within a string or an array in javascript? I'm currently using indexof - but if I am searching for 1, would it also return true if the number ends up being 11 or 111?
    See more | Go to post
No activity results to display
Show More
Working...