Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
new Sync methods
#6
Hi Willa

> Sorry I seem to have missed your question, so my reply is a bit slower than usual.
Comparing the support offered for other products, the support you provide for AntView is lightning fast. Bravo Wila !

>NavigateWithWebResourceRequestSync
NavigateWithWebResourceRequestSync gives me the opportunity to clean-up my code by removing a lot of timers and the functions they call, asynchronously.
I use AntView activex control, in dBase 2019, to send electronic invoices (xml string) and now this can be done with only 3 lines of code (the server response is a json string).

form.AntView1.nativeObject.NavigateWithWebResourceRequestSync( uri, "POST", xmlString, "Content-Type: application/xml" )
rJsonString = new string()
form.AntViewDocument1.RequestCurrentTextSync( rJsonString )

Very, very simple. Thanks you.

>RunAnonymousFunctionSync
In another project, I use RunAnonymousFunctionSync as often as possible, but I failed when the function had to call another custom function that is defined in the same string.
Example:
// jsString
(p1, p2) => {
a = customFunction1( p1 ) ;
b = customFunction2( p2 ) ;
return a + b ;
}

function customFunction1(x) {
return x ;
}

function customFunction2(y) {
return y ;
}

AntView activex control integrates very well with dBase 2019, parameters can be passed easily
//dbase code, {myVar1, myVar2} is a literal array (1 dimension , 2 elements )
vRet = new string()
form.AntViewDocument1.RunAnonymousFunctionSync(anyIntValue, {myVar1, myVar2}, jsString, vRet)

If there is no additional function declaration in the jsString, the execution succeeds, otherwise it fails.
For these situations I use:
form.AntView1.nativeObject.ExecuteScript(jsString)
// jsString
p1 = "value of myVar1";
p2 = "value of myVar2";
a = customFunction1( p1 ) ;
b = customFunction2( p2 ) ;

function customFunction1(x) {
return x ;
}

function customFunction2(y) {
return y ;
}

That's why I would like there to be a SYNC variant of the ExecuteScript method.

Thanks you
Vasile
Reply


Messages In This Thread
new Sync methods - by Vasile - 2023-02-17, 13:30:26
RE: new Sync methods - by wila - 2023-02-21, 12:08:32
RE: new Sync methods - by Bernard Mouille - 2023-02-21, 16:24:11
RE: new Sync methods - by wila - 2023-02-21, 16:33:44
RE: new Sync methods - by Bernard Mouille - 2023-02-21, 18:09:19
RE: new Sync methods - by Vasile - 2023-02-22, 08:11:03
RE: new Sync methods - by wila - 2023-02-23, 12:35:48

Forum Jump:


Users browsing this thread: 2 Guest(s)