NetTalk Central

Author Topic: How do I get the first character in gsv?  (Read 3335 times)

johanco123

  • Full Member
  • ***
  • Posts: 245
    • View Profile
    • Email
How do I get the first character in gsv?
« on: August 01, 2014, 04:24:15 AM »
Hi Bruce

How can I get the first character of a value in a field

say the value is 'Payment' and I just want the 'P'
like in windows it work as   sp:description[1]

I want the same result in p_web.gsv('sp:description') to display the 'P'

Kind regards
Johan

johanco123

  • Full Member
  • ***
  • Posts: 245
    • View Profile
    • Email
Re: How do I get the first character in gsv?
« Reply #1 on: August 01, 2014, 04:31:02 AM »
I use the following

sub(p_web.gsv('sp:description'),1,1))

tanks

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: How do I get the first character in gsv?
« Reply #2 on: August 01, 2014, 08:26:51 AM »
Hi Johan

Try to move the session var to a local var first and then slice it

Johan




Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How do I get the first character in gsv?
« Reply #3 on: August 01, 2014, 10:18:06 PM »
>> Try to move the session var to a local var first and then slice it

why? sub works just fine.

Cheers
Bruce