-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1425 from MitrahSoft/Added_a_examples_21-03-2024
Added a examples for lucee docs
- Loading branch information
Showing
3 changed files
with
39 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
```luceescript+trycf | ||
myString="Hello World"; | ||
closure=function(val){ | ||
return (val & 'a') | ||
} | ||
writeDump(StringMap(myString,closure)); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
```luceescript+trycf | ||
// Struct | ||
Struct = {}; | ||
Struct[1] = "lucee"; | ||
jsVar = serializeJson(Struct); | ||
resStruct = ToScript(struct, "jsVar"); | ||
writeDump(resStruct); | ||
// Array | ||
Array = []; | ||
Array[1] = "lucee"; | ||
jsVar = serializeJson(Array); | ||
resArr = ToScript(Array, "jsVar"); | ||
writeDump(resArr); | ||
```lucee+trycf | ||
<cfoutput> | ||
<cfset myArray=ArrayNew(1)> | ||
<cfloop index="i" from="1" to="4"> | ||
<cfset myArray[i]="This is array element" & i> | ||
</cfloop> | ||
<b>The output of ToScript(myArray, "jsVar")</b><br> | ||
#ToScript(myArray, "jsVar")#<br> | ||
<b>In a JavaScript script, convert thisString Variable to JavaScript | ||
and output the resulting variable:</b><br> | ||
<script type="text/javascript" language="JavaScript"> | ||
var #ToScript(myArray, "jsVar")#; | ||
for (i in jsVar) { | ||
document.write("jsVar in JavaScript is: " + jsVar[i] + "<br>"); | ||
} | ||
</script> | ||
</cfoutput> | ||
// Query | ||
Query = queryNew( "name,age", "varchar,numeric", {name = "Susi", age = 20 } ); | ||
resQry = ToScript(Query, "Query"); | ||
writeDump(resQry); | ||
// String | ||
Str = "test"; | ||
resStr = ToScript(Str, "Str"); | ||
writeDump(resStr); | ||
// Number | ||
number = 10; | ||
resNum = ToScript(number, "number"); | ||
writeDump(resNum); | ||
``` |
5 changes: 5 additions & 0 deletions
5
docs/03.reference/05.objects/image/setantialiasing/_examples.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
```luceescript+trycf | ||
imgObj = imageNew("",150,150,"rgb","149c82"); | ||
imgObj.setAntialiasing('off'); | ||
cfimage(action="writeToBrowser", source=imgObj); | ||
``` |