You are not logged in.
Pages: 1
Hello sorry I know its old thread - and I am completely new to Lazarus etc. so I am not even sure this thread is observed, anyhow I seem to have similar issue, the project compiles and starts fine, when I try to use it I get the an error "No variant method call dispatch." any idea where I start debugging it? Also, how can I debug it and see what source file and line the error comes from?
Thanks a lot!!
Offline
Thanks for the response! it's fpc 3.2.2.
I have seen an answer to similar issue on the following thread -
https://synopse.info/forum/viewtopic.ph … 187#p38187
But I cannot find a similar value conversion in my code to match the answer to the above thread.
Regretfully it's company code so I am not sure I can share it, but I will ask if I can.
I wish there was a simple way to print the source code line that throws this error but I guess it's not possible from the answers here ....
Offline
Hi! I managed to narrow down the line that causes the error -
jItem:=jItems._(numRow);
Any ideas? maybe need to cast to integer?
/////
In the debugger it shows the following -
000000010009B1F9 488B0598621900 mov rax,[rip+$00196298]
I added breakpoint and the jItems seems to be populated with 5 elements
Last edited by udihamudi (2022-09-20 14:02:51)
Offline
This is due to a bug in FPC RTL, IIRC.
It did not allow a single character name for late-binding.
Try to upgrade to a newer FPC, or use _Safe() instead - which is both faster and safer.
Offline
Thanks!
When I use it I get the following -
jItem := _Safe(jItems._(numRow));
olirestutils.pas(192,14) Error: Incompatible types: got "PDocVariantData" expected "Variant"
Any ideas...
Offline
Hi,
Sorry it keeps giving me same error, "No variant method call dispatch". Here is the code before this line, that works just fine. I also put breakpoint and I am getting data back, I see I have data for row 0 ( I get only one row) -
jData:=_Json(response);
if (jData._Count=0) or (jData.Name(0)<>'result') then
exit;
jItems:=jData.result;
jItem := _Safe(jItems)^.Values[0]; // this line still throw the error
Thanks!
Offline
NVM I think it passed this line now the error is for different line... thanks!!
Offline
Ok got it to work, thanks!!!
Another quick unrelated question, I must have clicked the wrong checkbox somewhere the form now takes the full screen and I cannot resize it or close it, any idea what I can do to revert to normal window?
Thanks!
Offline
The window that the application runs now takes the full screen and I cannot resize, close etc.
Last edited by udihamudi (2022-09-20 17:53:57)
Offline
Pages: 1