4D text interpolation
4D text interpolation
For text string building I am very fond of php’s interpolate feature:
| 1234 | # my variable
$name
=
"Joe Bob"
;
# my command
$my_sentence
=
"Hello {$name}!"
;
|
| — | — |
In 4D the same can be accomplished with text objects.
`have a table [Table]full_name
` this is the typed string for the text
` notice the "<" and ">" enclosing the field reference
vt_object:="Hello <[Table]full_name>!"
` outputs "Hello Joe Bob!" assuming that was what was loaded in the record
Author’s Note
Initial md
Generated using https://github.com/jsr6720/wordpress-html-scraper-to-md
Original Wordpress categories: [‘4D’]
Original Wordpress tags: “4D”, “4d text object”, “interpolate”, “tip”
Original Wordpress comments: None
Significant revisions
tags: 2011, wordpress, txcowboycoder, 4D, wish-list, string-interpolation
- May 6th, 2024 Converted to jekyll markdown format and copied to personal site
- Mar 11th, 2011 Originally published on txcowboycoder wordpress site