Got work experience in 2 weeks and need to learn coldfusion fast...

Discussion in 'Programming' started by <%xasp%>, Apr 28, 2007.

  1. #1
    I have got work experience in 2 weeks and need to learn coldfusion as quickly as possible, I am an expert with asp (does that help!!!???).

    Anyone know any online quick start topics

    Thanks
     
    <%xasp%>, Apr 28, 2007 IP
  2. datropics

    datropics Peon

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #2
    ColdFusion is tag-based, which means that most of what you will do is in a tag:

    Assignment
    <cfset x = y>

    Looping
    <cfloop from="1" to="10" index="i">
    ...
    ...
    ...
    </cfloop>

    Most everything is <cf.....

    Here's a good place to get syntatical, function, and tag information: http://livedocs.adobe.com/coldfusion/7/

    Hope this helps

    daTropics

    HOWEVER

    It is VERY easy to make a muck of things. I HIGHLY recommend that you get help from someone who knows CF. I say that because a lot of businesses turn down CF because they don't understand the power of CF (especially now this latest version).

    I don't mind offering my services to you. I'm a certified developer by Adobe. I'm sure the others here on this forum won't mind helping you out either.

    So go ahead, ask questions, describe your projects, let us know where you are so we can help.

    daTropics
     
    datropics, Apr 28, 2007 IP
  3. <%xasp%>

    <%xasp%> Guest

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks Datropics,

    I downloaded a cheat sheet from dreamincode.net, looks not too bad but we will see...
     
    <%xasp%>, Apr 29, 2007 IP
  4. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You might also pick up a copy of CFWACK (ColdFusion Web Application Construction Kit). Its a good book for both beginners and experienced coders switching from another language. I had to learn CF on a job once, so a friend gave me their copy. Like you I had programming experience with other languages, but CFWACK helped get me up to speed.
     
    cfStarlight, Apr 29, 2007 IP
  5. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    daTropics,

    I completely agree. Here is a great example. It had me rolling on the floor when I read it ;-)

    http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:51085
     
    cfStarlight, Apr 29, 2007 IP
  6. WillBMX

    WillBMX Guest

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Another good book would be an O'Relly book on Coldfusion.

    Coldfusion takes practice, your not going to get it just by reading thought. You have to be dedicated.

    I wouldn't worry too much though. It took me two weeks to learn Coldfusion (at that time it was Coldfusion 6 and Fusebox 3), and had to built my own application.

    Once you learn it, it is really fun....
     
    WillBMX, May 1, 2007 IP
  7. datropics

    datropics Peon

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #7
    cfStarlight - WOW!!!!!

    that certainly is amazing - wow...WOW - WOW!!!

    Indeed ColdFusion is fun, and it is intuitive to a point - and also it is easy to cause things to go wrong.

    Here's to ColdFusion!
     
    datropics, May 1, 2007 IP
  8. drewbe121212

    drewbe121212 Well-Known Member

    Messages:
    733
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    125
    #8
    I am in the same boat as you :) I have just started a job and Cold Fusion is the programming language that I have to learn over the next few weeks. I have a very proficient background in PHP, but unfrotunately Cold Fusion looks rather strange in comparison. It is the same, but different, you know?
     
    drewbe121212, May 2, 2007 IP
  9. WillBMX

    WillBMX Guest

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    PHP != Coldfusion...


    I don't hate PHP, but I don't like it either....


    Coldfusion FTW
     
    WillBMX, May 2, 2007 IP
  10. drewbe121212

    drewbe121212 Well-Known Member

    Messages:
    733
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    125
    #10
    lol. If I had the choice I would be PHP all the way over Cold Fusion, but unfortunately its the hospital's choice not mine! :) I probably like PHP more due to have been working with it for the past 6 or so. I dont have to worry about looking up functions and how things react. Oh well, could always use another language under the belt :)
     
    drewbe121212, May 2, 2007 IP
  11. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Yes. O'Reilly books are very good on average. Except Head Rush Ajax. It was dreadful. Now I stick to the In A Nutshell series. Very good.
     
    cfStarlight, May 2, 2007 IP
  12. <%xasp%>

    <%xasp%> Guest

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I know Ajax, I was using it before it was called ajax (which was early 1995 I think) and yes it is like playing 7 games of chess at once but great fun...

    One thing I am having trouble with is session variables.

    I have put the following in the _mmserverscripts/application.cfm

    <cfapplication name="GetLeadApp"
    sessionmanagement="Yes"
    sessiontimeout=#CreateTimeSpan(0,0,45,0)#>

    and the following in index.cfm


    <a href="index.cfm?attatch=1234567890987654321">Check it!</a><p>

    <CFIF #ParameterExists(attatch)#>

    <cfoutput>#attatch# and #session.GetLeadApp#</cfoutput>

    </CFIF>

    <cfset session.GetLeadApp = "this_is_a_test">

    When you enter the page there are no ParameterExists so no error but when I click the href link there are ParameterExists and I get the error:

    Element GETLEADAPP is undefined in SESSION.

    Any ideas!

    Oh and the other thing was returning database results in pages...

    Thanks
     
    <%xasp%>, May 4, 2007 IP
  13. IsRoss()

    IsRoss() Peon

    Messages:
    116
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #13
    You should always lock session or application variables before assigning or changing them.

    <cflock>
    <cfset session.GetLeadApp = "this_is_a_test">
    </cflock>

    Give that a try & see if it helps.

    What version of CF are you using?
     
    IsRoss(), May 4, 2007 IP
  14. <%xasp%>

    <%xasp%> Guest

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Changed it to:

    <cflock timeout="2">
    <cfset session.GetLeadApp = "this_is_a_test">
    </cflock>

    still the same error:

    Element GETLEADAPP is undefined in SESSION.

    The version I am using is MX 7
     
    <%xasp%>, May 4, 2007 IP
  15. IsRoss()

    IsRoss() Peon

    Messages:
    116
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #15
    oops - it should be <cflock type="exclusive" scope="session" timeout="30>

    Sorry, not enough coffee this AM.

    Have you tried dumping your session variables to see if any are getting set?

    <cfdump var="#session#">
     
    IsRoss(), May 4, 2007 IP
  16. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #16
    <%xasp%>,

    I know you already know all of these concepts .. but a few comments :)

    1. For MX 7 they recommend using an Application.cfc instead of Application.cfm

    2. ParameterExists is deprecated. Use IsDefined() or StructKeyExists

    3. Its good to get into the habit of scoping all of your variables for clarity. URL variables can be scoped by using the url prefix: URL.yourVariable

    4. Like IsRoss() I often err on the side of caution, but as of MX 6 (I think) you only have to lock session variables to prevent race conditions. In earlier versions you had to use locking to prevent other problems. But its no longer required unless you need to prevent race. But locking is a whole 'nother topic.

    Here is an example using an Application.cfc file.
    http://livedocs.adobe.com/coldfusion/7/htmldocs/00001117.htm
    http://livedocs.adobe.com/coldfusion/7/htmldocs/00001191.htm


    
    <!--- Application.cfc --->
    <cfcomponent>
    	<!--- THIS refers to the Application.cfc settings --->
    	<cfset THIS.name = "GetLeadApp" />
    	<cfset THIS.SessionManagement = true />
    	<cfset THIS.SessionTimeout = CreateTimeSpan(0,0,45,0) />
    
    	<!--- whenever a new session starts, create a session variable named "GetLeadApp" --->
    	<cffunction name="onSessionStart">
    		<cfparam name="session.GetLeadApp" default="this_is_a_test" />
    	</cffunction>
    	
    </cfcomponent>
    
    <!--- index.cfm --->
    <a href="index.cfm?attatch=1234567890987654321">Check it!</a><p>
    
    <cfif IsDefined("URL.attatch")>
    	<cfoutput>#attatch# and #session.GetLeadApp#</cfoutput>
    </cfif>
    
    <cfset session.GetLeadApp = "This is a NEW test from the index page">
    
    Code (markup):
     
    cfStarlight, May 4, 2007 IP
  17. IsRoss()

    IsRoss() Peon

    Messages:
    116
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Yes, that is why I was asking about the version. Application.cfc is a CF coder's dream come true.
     
    IsRoss(), May 4, 2007 IP
  18. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #18
    It's great. Much better than anything in previous versions IMO.

    Aside from the comments above, the orginal code did work for me as long as I first viewed index.cfm without an "attatch" parameter.

    http://localhost/_mmserverscripts/index.cfm

    And not ...

    http://localhost/_mmserverscripts/index.cfm?attatch=1234567890987654321

    The only potential problem I see is the ParameterExists() syntax. IIRC, ParameterExists() follows the same rules as IsDefined(). You must put the variable name in quotes. And should not use any pound signs around the variable name. This prevents ColdFusion from attempting to evaluate the variable before the ParameterExists() test is performed - which might cause an error.

    <cfif ParameterExists("Scope.VariableName")>... </cfif>
    .. or ...
    <cfif ParameterExists("URL.attatch")>... </cfif>
     
    cfStarlight, May 4, 2007 IP
  19. <%xasp%>

    <%xasp%> Guest

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Hi,

    Thanks for the help guys but it is not working for me the original or the Code sample that you supplied cfStarlight which I put into Application.cfc and index.cfm, poped them into the same folder and deleted the folder _mmserverscripts...

    Still getting:

    Element GETLEADAPP is undefined in SESSION.

    Enable Session Variables is checked in the Administration/Memory Variables

    I'm sure the answer is really easy but where am I going wrong?

    Thanks
     
    <%xasp%>, May 4, 2007 IP
  20. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #20
    > and deleted the folder _mmserverscripts...
    So what's the exact path of Application.cfc and index.cfm files now?

    Example:
    c:\CfusionMX7\wwwroot\Application.cfc
    c:\CfusionMX7\wwwroot\index.cfm
     
    cfStarlight, May 4, 2007 IP