Вверх ↑
Этот топик читают: Гость
Ответов: 11
Рейтинг: 0
#1: 2022-04-30 12:12:52 ЛС | профиль | цитата
Запускаю, выдёргиваю LAN кабель и получаю сообщение "Время ожидания операции истекло." Нужно чтобы при возобновлении интернета программа продолжила работать, а так получается- вышли через ошибку в WINDOwS.Уже замучился.Задним умом понимаю, что нужно обработать e.error. Помогите.
Make(delphi)
ver(4.05 build 186)
Add(MainForm,2953706,28,49)
{
Width=136
Height=114
}
Add(VBJScript,15304302,350,126)
{
WorkPoints=#6:doWork|
EventPoints=#5:onRes|5:error|
DataPoints=#3:tab|
Script=#19: Sub doWork(dt,idx)|33: Dim pos, URL, strResponse ,Http|66: url="https://nftgaming.global.binfra.one/v1/chain/get_table_rows"|54: Set Http = CreateObject("WinHttp.WinHttpRequest.5.1")|35: HTTP.Open "post", URL, true|63: HTTP.SetRequestHeader "Content-Types","application/json"|55: HTTP.setRequestHeader "Content-Charset", "UTF-8"|542: HTTP.Send "{"+chr(34)+"json"+chr(34)+":true"+","+chr(34)+"code"+chr(34)+":"+chr(34)+"m.federation"+chr(34)+","+chr(34)+"scope"+chr(34)+":"+chr(34)+"veles.world"+chr(34)+","+chr(34)+"table"+chr(34)+":"+chr(34)+"state3"+chr(34)+","+chr(34)+"lower_bound"+chr(34)+":"+chr(34)+chr(34)+","+chr(34)+"upper_bound"+chr(34)+":"+chr(34)+chr(34)+","+chr(34)+"index_position"+chr(34)+":1,"+chr(34)+"key_type"+chr(34)+":"+chr(34)+chr(34)+","+chr(34)+"limit"+chr(34)+":200,"+chr(34)+"reverse"+chr(34)+":false,"+chr(34)+"show_payer"+chr(34)+":false}"|45: Do While HTTP.waitForResponse(0) = False|29: sys.error "Conect error"|9: Loop|37: strResponse =Cstr(HTTP.responsetext)|25: sys.onRes strResponse|19:Set Http = Nothing |7:End Sub|
UseName=0
link(onRes,6365726:doSearch,[])
}
Add(Hub,11121818,469,210)
{
}
Add(Label,1855794,574,126)
{
Left=5
Top=40
Width=10
Height=17
Caption="0"
}
Add(BlockFind,6365726,511,126)
{
IncludeBlock=1
StartBlock="mine_bucket":""
EndBlock="T"
link(onSearch,1855794:doText,[])
}
Add(Hub,14847535,105,119)
{
InCount=3
OutCount=1
link(onEvent1,8741838:doTimer,[])
}
Add(Button,12926704,14,119)
{
Top=10
link(onClick,14847535:doEvent1,[])
}
Add(Timer,8741838,189,119)
{
Enable=1
link(onTimer,1919254:doEvent1,[])
}
Add(Hub,1919254,280,119)
{
OutCount=3
link(onEvent1,8741838:doStop,[(323,125)(323,88)(177,88)(177,132)])
link(onEvent2,15304302:doWork,[])
link(onEvent3,14847535:doEvent2,[(303,139)(303,192)(93,192)(93,132)])
}


Редактировалось 2 раз(а), последний 2022-04-30 12:29:26
карма: 0

0
Ответов: 783
Рейтинг: 168
#2: 2022-04-30 16:07:10 ЛС | профиль | цитата
Olegam писал(а):
что нужно обработать e.error. Помогите.

Попробуй

Add(MainForm,9576178,364,126)
{
Width=136
Height=114
}
Add(VBJScript,15304302,686,203)
{
WorkPoints=#6:doWork|
EventPoints=#5:onRes|5:error|
DataPoints=#3:tab|
Script=#19: Sub doWork(dt,idx)|21: On Error Resume Next|33: Dim pos, URL, strResponse ,Http|66: url="https://nftgaming.global.binfra.one/v1/chain/get_table_rows"|54: Set Http = CreateObject("WinHttp.WinHttpRequest.5.1")|35: Http.Open "post", URL, true|63: Http.SetRequestHeader "Content-Types","application/json"|55: Http.setRequestHeader "Content-Charset", "UTF-8"|542: Http.Send "{"+chr(34)+"json"+chr(34)+":true"+","+chr(34)+"code"+chr(34)+":"+chr(34)+"m.federation"+chr(34)+","+chr(34)+"scope"+chr(34)+":"+chr(34)+"veles.world"+chr(34)+","+chr(34)+"table"+chr(34)+":"+chr(34)+"state3"+chr(34)+","+chr(34)+"lower_bound"+chr(34)+":"+chr(34)+chr(34)+","+chr(34)+"upper_bound"+chr(34)+":"+chr(34)+chr(34)+","+chr(34)+"index_position"+chr(34)+":1,"+chr(34)+"key_type"+chr(34)+":"+chr(34)+chr(34)+","+chr(34)+"limit"+chr(34)+":200,"+chr(34)+"reverse"+chr(34)+":false,"+chr(34)+"show_payer"+chr(34)+":false}"|3: |42: If Not Http.WaitForResponse(5) Then|21: sys.error nil|26: Set Http = Nothing|10: Exit Sub|13: End If|0:|37: strResponse =Cstr(HTTP.responsetext)|25: sys.onRes strResponse|19:Set Http = Nothing |7:End Sub|
UseName=0
link(onRes,6365726:doSearch,[])
link(error,9390996:doEvent,[(760,216)(760,230)])
}
Add(Hub,11121818,805,287)
{
}
Add(Label,1855794,910,203)
{
Left=5
Top=40
Width=10
Height=17
Caption="0"
}
Add(BlockFind,6365726,847,203)
{
IncludeBlock=1
StartBlock="mine_bucket":""
EndBlock="T"
link(onSearch,1855794:doText,[])
}
Add(Hub,14847535,441,196)
{
InCount=3
OutCount=1
link(onEvent1,8741838:doTimer,[])
}
Add(Button,12926704,350,196)
{
Top=10
link(onClick,14847535:doEvent1,[])
}
Add(Timer,8741838,525,196)
{
Enable=1
link(onTimer,1919254:doEvent1,[])
}
Add(Hub,1919254,616,196)
{
OutCount=3
link(onEvent1,8741838:doStop,[(659,202)(659,165)(513,165)(513,209)])
link(onEvent2,15304302:doWork,[])
link(onEvent3,14847535:doEvent2,[(641,216)(641,237)(431,237)(431,209)])
}
Add(Debug,9390996,770,224)
{
LogCount=100
}

карма: 15

0
2
Сообщение
...
Прикрепленные файлы
(файлы не залиты)