Solved

ASP - Question about some code

Posted on 2013-12-05
4
282 Views
Last Modified: 2013-12-05
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
Comment
Question by:JohnMac328
  • 2
  • 2
4 Comments
 
LVL 33

Expert Comment

by:Big Monty
ID: 39698981
what are the results you're looking for?
0
 

Author Comment

by:JohnMac328
ID: 39698992
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
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39699012
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
 

Author Closing Comment

by:JohnMac328
ID: 39699014
Great thanks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question