My whole outlook on converting scripts from one language to another is to
look the front end and get an idea of what the application's purpose is and
try to figure out exactly what the application is doing, then look at the
backend and confirm your front end finding. Take notes! Then rewrite your
new application in the way that you think that it should be written keeping
in mind that you need to have the same end result as the old script. Or you
could even make improvements!

I think translating the scripts directly from one language to another will
usually result in an application that was written poorly. Languages work
differently than another. I think the important thing is that the end
results are the same.

Paul Alkema
AlkemaDesigns.com

-----Original Message-----
From: Glyn Jackson [mailto:[email protected]] 
Sent: Monday, March 29, 2010 9:39 AM
To: cf-talk
Subject: Re: reverse engineer PHP to CF


cool final is below...

<cfparam name="reportName" default="" />    
<cfset reportFile = expandPath("/Powerbase") & "/" & reportName & "." &
reportID & "_sql" /> 
 
 <cfswitch expression="#op#"> 
  <cfcase value="load"> 
       <cffile action="READ" file="#reportFile#" variable="ff" />     
           <cfoutput>#ff#</cfoutput> 
  </cfcase> 
  
  <cfcase value="save">  
        <cfoutput>  
        <cfdump var="#form#">
     <cfset qry = #form.queryToSave# />     
         <cffile action="WRITE" file="#reportFile#" output="#qry#"
nameconflict="OVERWRITE" />     
         <cfoutput>#reportName#</cfoutput> saved ... 
 </cfoutput> 
  </cfcase> 
  
  <cfcase value="list"> 
  
   <cfdirectory action="LIST" directory="#expandPath('/Powerbase')#"
name="files" />         
   <cfoutput>     
   <ul class="treeview" id="treeview_#reportID#">         
   <li class="list">Saved sql files             
         <ul>                 
                <cfloop query="files">                     
                  <cfif right(name, 4) is "_sql">                         
                  <li class="item">#listFirst(name, ".")#</li>

                  </cfif>               
             </cfloop>            
         </ul>         
         </li>   
         </ul>     
        </cfoutput> 
  </cfcase> 
 
 
 
   
    <cfdefaultcase> 
    </cfdefaultcase> 
 </cfswitch> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332413
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to