Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old October 31st, 2003, 10:16 AM
fletchsod's Avatar
fletchsod fletchsod is offline
I lov C in AIX/Linux, hate C++
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Location: Jacksonville, Florida
Posts: 1,497 fletchsod User rank is Corporal (100 - 500 Reputation Level)fletchsod User rank is Corporal (100 - 500 Reputation Level)fletchsod User rank is Corporal (100 - 500 Reputation Level)fletchsod User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Week 2 Days 16 h 56 m 32 sec
Reputation Power: 8
Compile error with substring()

I'm a little puzzled by the compile error in visual basic 6.0, it said 'invalid qualifier' when i use the method, substring(x,x). I noticed that visual basic doesn't recognize the substring, so what is the supported function where I can take a partical string out of the full string???

Thanks....

Reply With Quote
  #2  
Old October 31st, 2003, 11:03 AM
fletchsod's Avatar
fletchsod fletchsod is offline
I lov C in AIX/Linux, hate C++
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Location: Jacksonville, Florida
Posts: 1,497 fletchsod User rank is Corporal (100 - 500 Reputation Level)fletchsod User rank is Corporal (100 - 500 Reputation Level)fletchsod User rank is Corporal (100 - 500 Reputation Level)fletchsod User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Week 2 Days 16 h 56 m 32 sec
Reputation Power: 8
Alright, found out that I would need to use Mid() instead. Rigth now I'm still getting the compile error with 'invalid qualifier'. So, what did I do wrong with the script??

--snip--
Private Function CBC_XML_BreakUp(ByVal strCBC_Response As String, strResponse_XML As String, strResponse_HTML As String)
Dim i As Integer
Dim iCBC_Response_Len As Integer
Dim iXML_Start As String
Dim iXML_End As String
Dim iHTML_Start As String
Dim iHTML_End As String

iCBC_Response_Len = Len(strCBC_Response)
iXML_Start = "Null!"
iXML_End = "Null!"
iHTML_Start = "Null!"
iHTML_End = "Null!"

'//This loop work only for [XML[XML[HTML]]], not [XML[XML][HTML]]...
'//If the 'Options' variable in the Query URL string is altered to receive [XML[XML][HTML]] then this loop is invalid and a new loop script is needed...
For i = 0 To iCBC_Response_Len
If strCBC_Response.Mid(i, 9) = "<![CDATA[" Then
If iXML_Start = "Null!" Then
' iXML_Start = str((i + 9))
Else
' iHTML_Start = str(i + 9)
End If
End If

If strCBC_Response.Mid(i, 3) = "]]>" Then
If iHTML_End = "Null!" Then
' iHTML_End = str(i)
Else
' iXML_End = str(i)
End If
End If
Next

'//This few lines of codes loop work only for [XML[XML[HTML]]], not [XML[XML][HTML]]...
'//If the 'Options' variable in the Query URL string is altered to receive [XML[XML][HTML]] then this loop is invalid and a new loop script is needed...
' strResponse_HTML = strCBC_Response.Mid(iHTML_Start, iHTML_End)
' strResponse_XML = strCBC_Response.substring(iXML_Start, (iHTML_Start - 9)) + strCBC_Response.substring((iHTML_End + 3), iXML_End)
End Function
--snip--

Reply With Quote
  #3  
Old October 31st, 2003, 11:47 AM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,171 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 1 m 37 sec
Reputation Power: 110
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
Are you using VB 6 ? if you are then the following should look like this

Code:
'//This loop work only for [XML[XML[HTML]]], not [XML[XML][HTML]]... 
'//If the 'Options' variable in the Query URL string is altered to receive [XML[XML][HTML]] then this loop is invalid and a new loop script is needed... 
For i = 0 To iCBC_Response_Len 
' THIS IS YOUR VERSION
'If strCBC_Response.Mid(i, 9) = "<![CDATA[" Then 
'If iXML_Start = "Null!" Then 

'IT SHOULD LOOK LIKE THIS
If mid(strCBC_Response,i,9) = "<![CDATA[" Then
if iXML_Start = "Null!" Then
' iXML_Start = str((i + 9)) 
Else 
' iHTML_Start = str(i + 9) 
End If 
End If 
__________________
Fisherman

"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein

Reply With Quote
  #4  
Old October 31st, 2003, 02:36 PM
fletchsod's Avatar
fletchsod fletchsod is offline
I lov C in AIX/Linux, hate C++
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Location: Jacksonville, Florida
Posts: 1,497 fletchsod User rank is Corporal (100 - 500 Reputation Level)fletchsod User rank is Corporal (100 - 500 Reputation Level)fletchsod User rank is Corporal (100 - 500 Reputation Level)fletchsod User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Week 2 Days 16 h 56 m 32 sec
Reputation Power: 8
..

That does help to fix the problem. Thanks... I get a different error, this time a call error. It had me puzzled, the employee told me that in visual basic, the loop start with one, not with zero as is usually done in C++, PHP, JavaScript, C, etc... So, that fix the other problem. Now it is working great....

Scott

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Compile error with substring()


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway