Solved

for cmix only

Posted on 1998-08-20
12
111 Views
Last Modified: 2010-04-30
Her is your 50 for the VB question
0
Comment
Question by:MasseyM
  • 7
  • 5
12 Comments
 
LVL 4

Accepted Solution

by:
mcix earned 80 total points
ID: 1430010
Thanks...

I will look into more code for you.
0
 
LVL 10

Author Comment

by:MasseyM
ID: 1430011
That is all I have right now...  I am going to use your code... I have manipulated it enough to fit what I wanted to.  If you want, the 200 is still open, add error checking and that stuff and you can have it...

For instance, what happens if they enter:
Mosiah 10      --> I have this one done
Mosiah         --> I have this one done
Mosiah10:3-5
Mosiah 10:4    --> I have this one done

Could they enter this?
Mosiah 10:3,7,9,...
How would I parse that?

Thanks for all your work!
0
 
LVL 4

Expert Comment

by:mcix
ID: 1430012
Are you familiar with String Tok?
0
 
LVL 10

Author Comment

by:MasseyM
ID: 1430013
no... What is that?
0
 
LVL 4

Expert Comment

by:mcix
ID: 1430014
Here is some code that will put it in an array:


    Dim mstrQueryString As String
    Dim mstrBook As String
    Dim mstrChapter As String
    Dim mstrBeginVerse As String
    Dim mstrEndVerse As String
   
    Dim mintBookEnds As Integer
    Dim mintChapterEnds As Integer
    Dim mintStartVerseEnds As Integer
    Dim mintNumberOfChapters As Integer
    Dim mintCurrentVerse As Integer
    Dim mvarQueryStrings() As Variant
   
    mstrQueryString = "Mosiah 4:15-17"
    mintBookEnds = InStr(1, mstrQueryString, " ")
    mstrBook = Left(mstrQueryString, mintBookEnds - 1)
    mintChapterEnds = InStr(1, mstrQueryString, ":")
    mstrChapter = Trim$(Mid(mstrQueryString, mintBookEnds, mintChapterEnds - mintBookEnds))
   
    mintStartVerseEnds = InStr(1, mstrQueryString, "-")
   
    mstrBeginVerse = Trim$(Mid(mstrQueryString, mintChapterEnds + 1, mintStartVerseEnds - mintChapterEnds - 1))
    mstrEndVerse = Trim$(Mid(mstrQueryString, mintStartVerseEnds + 1))
    mintNumberOfChapters = Val(mstrEndVerse) - Val(mstrBeginVerse)
   
    ReDim mvarQueryStrings(mintNumberOfChapters, 2)
   
    For mintCurrentVerse = 0 To mintNumberOfChapters
        mvarQueryStrings(mintCurrentVerse, 0) = mstrBook
        mvarQueryStrings(mintCurrentVerse, 1) = mstrChapter
        mvarQueryStrings(mintCurrentVerse, 2) = Val(mstrBeginVerse) + mintCurrentVerse
    Next mintCurrentVerse


' I will get back to you on String Tok, in a bit
0
 
LVL 4

Expert Comment

by:mcix
ID: 1430015
By the way, do you have complete control over the HTML user interface?
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 10

Author Comment

by:MasseyM
ID: 1430016
Yes.. I have total control...  However, the string will come to me in an URL...

ldsmissions.net/scriptures/script.asp?Scripture=Mosiah 10:3-5
ldsmissions.net/scriptures/script.asp?Scripture=Mosiah 10
ldsmissions.net/scriptures/script.asp?Scripture=Mosiah

that will get me the verses...  That is why I need it parsed

0
 
LVL 4

Expert Comment

by:mcix
ID: 1430017
Did that code help?
0
 
LVL 10

Author Comment

by:MasseyM
ID: 1430018
The code to getthe scripts into arrays is good, but I don't REALLY need that... What you sent before works, but I need "error checking" like I said above and more in-depth parsing of the query string...

0
 
LVL 4

Expert Comment

by:mcix
ID: 1430019
Did you get this worked out, yet?
0
 
LVL 10

Author Comment

by:MasseyM
ID: 1430020
Get what worked out? -- I have it all working right now, but there are still occasions when errors occur...

So, I need some eror code checking enabled.
0
 
LVL 4

Expert Comment

by:mcix
ID: 1430021
E-mail your code to me @ marko_justus@hotmail.com

And I will try to help...
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

746 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

12 Experts available now in Live!

Get 1:1 Help Now