cfml

Scope of var and variables

半城伤御伤魂 提交于 2020-01-24 06:16:29
问题 If I have a function like <cfscript> function say(what) { var a = what; variables.b = what; return what; } </cfscript> I thought the scope of a was variables , but dumping variables returns just b . What is the scope of a? 回答1: Declaring a variable using the var keyword puts it into the local scope, not the variables scope. 回答2: This really is a comment, but it is way too long. Consider the following code <cfscript> function doMath() { var a = 1; local.b = 2; return a + local.b; } </cfscript>

Get newly inserted record ID in CFScript

戏子无情 提交于 2020-01-14 19:21:09
问题 I have some code that inserts a record into the log along with the request information. Once the request is sent and a response is sent back I update the record with the response info. Is there a way to get the ID of the newly inserted record so I can reference that and update it once I receive the response? I know using CF tags you can use SET NO COUNT but it doesn't seem to work in CFScript. Seems like nothing is returned in an INSERT statement. query = new query(); query.name =

FW/1 App Calling onApplicationStart on Every Request

被刻印的时光 ゝ 提交于 2020-01-04 15:51:23
问题 I have a FW/1 app on Railo 4.2.2/Apache and for some reason it's calling onApplicationStart on every request. I can tell it's not any reinit code - put in a callStackGet() dump in setupApplication and can see that the root call is onApplicationStart (not via any init hook). Are there any known bugs in Railo that would cause this? I've double checked the application timeout (1 day) and the FW/1 setting - it's turned off - so there should be no reason the app would be losing application scope

cfspreadsheet alphanumeric values ending in d

让人想犯罪 __ 提交于 2020-01-03 08:59:50
问题 <cfscript> Workbook = Spreadsheetnew("Workbook"); SpreadSheetSetCellValue(WorkBook, "4D", 1, 1); // displayed 4 SpreadSheetSetCellValue(WorkBook, "4C", 1, 2); // displayed 4C SpreadSheetSetCellValue(WorkBook, "4E", 1, 3); // displayed 4E SpreadSheetSetCellValue(WorkBook, "5C", 1, 4); // displayed 5C SpreadSheetSetCellValue(WorkBook, "5D", 1, 5); // displayed 5 SpreadSheetSetCellValue(WorkBook, "4d", 1, 6); // displayed 4 MYfile = "d:\dw\dwtest\dan\abc.xls"; </cfscript> <cfspreadsheet action=

cfspreadsheet alphanumeric values ending in d

依然范特西╮ 提交于 2020-01-03 08:59:12
问题 <cfscript> Workbook = Spreadsheetnew("Workbook"); SpreadSheetSetCellValue(WorkBook, "4D", 1, 1); // displayed 4 SpreadSheetSetCellValue(WorkBook, "4C", 1, 2); // displayed 4C SpreadSheetSetCellValue(WorkBook, "4E", 1, 3); // displayed 4E SpreadSheetSetCellValue(WorkBook, "5C", 1, 4); // displayed 5C SpreadSheetSetCellValue(WorkBook, "5D", 1, 5); // displayed 5 SpreadSheetSetCellValue(WorkBook, "4d", 1, 6); // displayed 4 MYfile = "d:\dw\dwtest\dan\abc.xls"; </cfscript> <cfspreadsheet action=

How do I generate an OpenOffice Draw document?

半世苍凉 提交于 2020-01-03 08:32:19
问题 I want to create a flowchart in OpenOffice Draw. Since there's a lot of steps to show (and may change in future) but I can extract the data, I want to automate the creation with the following steps: Create a new ODG document with specified page settings. Insert flow chart shapes with specified properties. Connect those things with arrows. Ideally, auto-organise things into sensible positions. I don't want to spend hours reading about some "UNO" thing - I just want code examples that I can

Iteration through url request collection variables by dynamic evaluation

我与影子孤独终老i 提交于 2019-12-25 04:14:33
问题 What i am trying todo in coldfusion cfscript is iterate through a request collection of variables and do some evaluation, which i can do easily in PHP, but am running into issue translating to coldfusion cfscript, because it seems i cannot build a dynamic if statement PHP for ( $i=0 ; $i<count($aColumns) ; $i++ ) { if ( $_GET['bSearchable_'.$i] == "true" && $_GET['sSearch_'.$i] != '' ) { //If there was no where clause if ( $sWhere == "" ) { $sWhere = "WHERE "; } else { $sWhere .= " AND "; } I

Can you Convert Stripe Java Code into CFscript

眉间皱痕 提交于 2019-12-25 01:44:17
问题 The code below is how to impletment stripe payment API, I was wondering if I just convert it to CFscript and call my normal variable will it work? // Set your secret key: remember to change this to your live secret key in production // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_aHhoYVOnsayNSIleB1ETUCSq00vUOS9YVQ"; Map<String, Object> params = new HashMap<String, Object>(); ArrayList<String> paymentMethodTypes = new ArrayList<>();

CFML and Exchange - CFexchange tags have stopped working

爷,独闯天下 提交于 2019-12-24 11:27:08
问题 I need a little hand holding to convert my CFML cfexchange tags to the EWS API. I'm using CF 9.0.1 and need to add mail/calendar items to a hosted Exchange server. I get the following error: Error: Could not log in to the Exchange server. ________________________________________ connection="exchangeConn" server="EXVMBX016-5.exch016.msoutlookonline.net" username="exch016\j_ttt" mailboxname="j@ttt.com" password="[removed]" Protocol="http" port="80" formbasedauthentication="TRUE"

Curl call to ColdFusion - Instagram

岁酱吖の 提交于 2019-12-24 08:49:27
问题 I'm not experienced with cURL at all, but from what I can gather, it's equivalent to cfhttp. I want to work with the Instagram API and authenticate a user. Their example uses cURL. curl \-F 'client_id=CLIENT-ID' \ -F 'client_secret=CLIENT-SECRET' \ -F 'grant_type=authorization_code' \ -F 'redirect_uri=YOUR-REDIRECT-URI' \ -F 'code=CODE' \https://api.instagram.com/oauth/access_token Would I be correct in thinking the CF version would be: <cfhttp url="https://api.instagram.com/oauth/access