Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: translating boolean values  (Read 343 times)

wattswhat

  • Newbie
  • *
  • Posts: 8
    • View Profile
translating boolean values
« on: December 15, 2022, 06:18:20 PM »
How do I translate boolean values stored in the SQL Database as 0 and 1 to something else like "Yes" or "No" or "True" or "False"?

Subst

  • Sr. Member
  • ****
  • Posts: 444
    • View Profile
Re: translating boolean values
« Reply #1 on: December 20, 2022, 06:27:18 PM »
HI!
By Script

$S{
  if ($D{table.field}==1)
     true;
  else
     false;
  }

and in your text element will be true/false

wattswhat

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: translating boolean values
« Reply #2 on: December 20, 2022, 08:32:58 PM »
Thanks!

wattswhat

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: translating boolean values
« Reply #3 on: December 20, 2022, 09:02:29 PM »
Is there documentation on Scripts?

Subst

  • Sr. Member
  • ****
  • Posts: 444
    • View Profile
Re: translating boolean values
« Reply #4 on: December 21, 2022, 08:26:22 AM »
What version of Qt you are using?

if 5.6 or later then LR using just JSengine (i.e. JS)

if 5.5 or early then LR using qtScript, thet also Ecma-262