• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

ASP - Question about some code

I just need this small portion defined - I know it has to do with the position of the value in the field "TYP" but could use a little more of a clear definition.

            typ1 = left(rsData.Fields("TYP"), 1)
            typ2 = mid(rsData.Fields("TYP"), 2, 1)
            typ3 = right(rsData.Fields("TYP"), 1)


Thanks!
0
JohnMac328
Asked:
JohnMac328
  • 2
  • 2
1 Solution
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
what are the results you're looking for?
0
 
JohnMac328Author Commented:
This code was sent to another company since they are taking over the department.  I just need to explain what it is doing - here is an example of a value in the typ field

30D
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
ok, easy enough:

'-- sets typ1 variable to the first charactor in rsData.Fields("TYP")
typ1 = left(rsData.Fields("TYP"), 1)            

'-- sets typ2 variable to the 2nd charactor in rsData.Fields("TYP"), it uses the MID function, which requires a starting point in the string and length of how many charactors you want to parse out. since the starting value is 2, it would start at the 2nd charactor and then length would be 1 (the 3rd parameter)
typ2 = mid(rsData.Fields("TYP"), 2, 1)

'-- sets typ3 variable to the last charactor in rsData.Fields("TYP")
typ3 = right(rsData.Fields("TYP"), 1)
0
 
JohnMac328Author Commented:
Great thanks
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now