Solved

ASP - Question about some code

Posted on 2013-12-05
4
280 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 32

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 32

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

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now