Solved

ASP - Question about some code

Posted on 2013-12-05
4
279 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
Comment Utility
what are the results you're looking for?
0
 

Author Comment

by:JohnMac328
Comment Utility
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
Comment Utility
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
Comment Utility
Great thanks
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Read about why website design really matters in today's demanding market.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

744 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