PDA

Click to See Complete Forum and Search --> : retrieving only certain values


raj2000
Jun 22nd, 2000, 02:59 PM
With the following code, I only wish to retrieve certain values from the reStr variable.

How can I do this?




<% @Language = "VBScript" %>
<% Response.buffer = true %>

<%
Dim Msg
Dim Lat
Dim Lon
Dim Map


Msg = Maps & "," & Lon &"," & Lat


' Lat=Request.QueryString("Lat")
' Lon=Request.QueryString("Lon")
' Map=Request.QueryString("Map")

Map = "OS2000.map"

userid="1"

Lat = "50.867748"
Lon = "-001.733554"



Dim finalm

Set finalm = Server.CreateObject("DLLCall.Geomanconv")

RetStr=finalm.GEOMANCODE(Lat,Lon,Map)



Dim RetStr ' a variable to hold the original string value
Dim arrWork1 ' a variable to hold the split array of pairs
Dim arrWork2 ' a variable to hold the split array of name/value
Dim i ' a loop counter


' All the contents are in a string called RetStr
' The following code was added for testing purposes


' retStr = "Res=Map=OS2000.Map, MapO=2, Lat1=50.708286, " & _
' "Lat2=50.798220, " & vbcrlf & _
' "Lat3=50.797615, Lat4=50.707683, Lon1=-001.575082, " & _
' "Lon2=-001.574267, " & vbcrlf & _
' "Lon3=-001.432362, Lon4=-001.433449 , Page=7, XCur=14, " & _
' "YCur=45, Col= H, " & vbcrlf & _
' "Row= 5 , Page=12, XCur=14, YCur=45, Col= G, Row= 7"


' next, remove all of the carriage returns and line feeds


RetStr = Replace(RetStr, vbCrfl, "")


'split the string into an array at each comma

arrWork1 = Split(RetStr, ",")
For i = LBound(arrWork1) to UBound(arrWork1)


' split the current pair into name and value
' at the first equals sign...

arrWork2 = Split(arrWork1(i), "=", 2)
Response.Write "Name is [" & _
Trim(arrWork2(LBound(arrWork2))) & "]"
Response.Write ", Value is [" & _
Trim(arrWork2(UBound(arrWork2))) & "]<BR>"
Erase arrWork2 ' clear the array
Next
Erase arrWork1 ' clear the array



%>



<%

'Sending the values to the gisdispatcher asp routine '


<%
Dim Gis
Set Gis = Server.CreateObject("Gisdispatcher.Application")
Test = gis.gisdispatcher()



%>




<!-- <%="Res="&RetStr%> -->