Skip to content

Commit 34970fc

Browse files
authored
Merge pull request #1558 from MitrahSoft/Update_descriptions_examples
Updated the getPropertyString() description and added examples
2 parents a4d0c7c + ab6cee5 commit 34970fc

4 files changed

Lines changed: 32 additions & 1 deletion

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
```lucee
2+
// Define the path to your properties file
3+
path = expandPath("/path/to/your/test.properties");
4+
5+
// Read all properties from the file using UTF-8 encoding
6+
properties = getPropertyFile(path, "UTF-8");
7+
8+
// Output all properties as a struct
9+
writeDump(properties);
10+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
```lucee
2+
// Define the path to your properties file
3+
path = expandPath("/path/to/your/test.properties");
4+
5+
// Retrieve the value of the 'lucee' property using UTF-8 encoding
6+
propertyValue = getPropertyString(path, "lucee", "UTF-8");
7+
8+
// Output the property value
9+
writeDump(propertyValue);
10+
```

docs/03.reference/01.functions/getpropertystring/function.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ categories:
88
- files
99
---
1010

11-
Sets the value of a property entry in a properties file.
11+
Gets the value of a property entry from a properties file.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
```lucee
2+
// Define the path to your properties file
3+
path = expandPath("/path/to/your/test.properties");
4+
5+
// Set the value of the 'lucee' property to '8888' using UTF-8 encoding
6+
setPropertyString(path, "lucee", "8888", "UTF-8");
7+
8+
// Read back the property to verify it was set
9+
propertyValue = getPropertyString(path, "lucee", "UTF-8");
10+
writeOutput("lucee property value: " & propertyValue);
11+
```

0 commit comments

Comments
 (0)