Trust ID PBCEX logo 300x102

Truncate database fields to just show part of it

6 years 6 months ago
Sergio Agostinho
Administrator
Administrator
Posts: 508
More
Topic Author
Truncate database fields to just show part of it #3522
Question from a CardExchange 6 user:
"I am trying to truncate a middle name so it only displays the first character plus a period. I believe I can use the functions SetLength but I cannot get the syntax correct. Please help."

Solution:
1 - On the card design you need to create 3 variables:
  • First Name
  • Middle Name
  • Last Name
2 - Create a text object to show the card holder's name with the modification desired. On this text object add the expression below (by double clicking on it)
[First Name] [Copy(<MIddle Name>,1,1)]. [Last Name]

3 - Save and close the card design.

4 - Now on the card mappings map each variable created above to the database fields for first, middle and last name.

With best regards
Sergio Agostinho
5 years 4 months ago
Robo
Fresh Boarder
Fresh Boarder
Posts: 2
More
Truncate database fields to just show part of it #4932
I have a similar problem. Is there a download manual which outlines the syntax and shows some examples of functions?
5 years 4 months ago
Rutger Koperdraad
Platinum Boarder
Platinum Boarder
Posts: 1566
More
Truncate database fields to just show part of it #4933
Hello Robo,

Since CardExchange version 7 the scripting language used in the designer is Python 2.7, which is fully documented on internet, see docs.python.org/2.7/ . The Python implementation allows for accessing .NET functions as well, see ironpython.net/ .

regards,
Rutger.

Rutger Koperdraad
Senior Software Engineer

"A reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. All progress, therefore, depends on the unreasonable man." (Bernard Shaw)
×

Notice

The forum is in read only mode.