Italian Recuperare testo da pagina web.

moster67

Expert
Licensed User
Longtime User

Spinter

Active Member
Licensed User
Longtime User
Ok ci sono riuscito adesso posso estrarre da un documento di google la frase
Bisogna renderlo pubblico il Documento:

Qui il link di esempio: https://docs.google.com/document/d/18I8EDqqfaf70ERgEiStg45wldKsFQYRLAmxF26S7-Ko/edit

Nel Documento cè scritto: $Pistola$Ciao sono spinter Grazie!$Sparato$

Uso $Pistola$ e $Sparato$ ' per sapere dove icomincia e finisce la mia frase!


Sub Process_Globals
Dim hc As HttpClient
End Sub

Sub Globals
Dim aa As String
End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
If FirstTime Then
hc.Initialize("hc")
End If

Dim req As HttpRequest
req.InitializeGet("https://docs.google.com/document/d/18I8EDqqfaf70ERgEiStg45wldKsFQYRLAmxF26S7-Ko/edit")
hc.Execute(req, 1)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub


Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)

Dim resultString As String
resultString = Response.GetString("UTF8")
'Work with the result
aa=resultString

Dim cc As Int
Dim dd As Int
Dim str1 As String
cc =InStr(aa,"$Pistola$")
dd =InStr(aa,"$Sparato$")
str1=aa.SubString2(cc,dd)
aa= str1.Replace("$Pistola$","")
ToastMessageShow(aa, True)

End Sub

Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
Log("Error connecting: " & Reason & " " & StatusCode)
If Response <> Null Then
Log(Response.GetString("UTF8"))
Response.Release
End If
End Sub

Sub InStr(StrVar As String,SearchStr As String)As Long
'*** Function by RBSoft
Dim x As Long
x = StrVar.IndexOf(SearchStr)
Return x
End Sub




[/url]


Se per voi e utile a qualchepersona faccio un piccolo tutorial.
 
Last edited:
Top