Hi,
The ActiveX API provides a method GetSymbolInfo, which returns address and size for an input symbol name.
But I also need the data type, and I don't see any API feature to get this info.
I am using TSA tables in my embedded application, so I would expect the data type information to be available to the host.
Do you confirm this feature is missing?
Regards,
Luca
解決済! 解決策の投稿を見る。
Hello Luca,
you should be able to use GetSymbolInfo on the array symbol to retrieve its byte-wise size. Then you can use GetSymbolInfo on the array[0] symbol to retrieve a size of one element. Dividing the two should give you a count.
Regards,
Michal
Hi Michal,
If I may add to the backlog, it would be good to also get the length info for arrays through the API. When I generate FreeMASTER variables from an array symbol using the Windows app, it knows the length of arrays and it can generate as many variables as the number of array elements.
Just getting the length info and the start address via API would enable me to script something similar.
Regards,
Luca
Hello Luca,
you should be able to use GetSymbolInfo on the array symbol to retrieve its byte-wise size. Then you can use GetSymbolInfo on the array[0] symbol to retrieve a size of one element. Dividing the two should give you a count.
Regards,
Michal
Ok understood, that is the trick. Thanks!
Hello Luca,
I confirm this is not possible with the current version, the GetSymbolInfo only returns address and size of the symbol or it evaluates a complex expression similarly as the Variable definition dialog does. Note that this evaluation may access multiple symbols (e.g. there can be a mix of symbol names and multiple sizeof(x) and valueof(z) operators). This is why it is not just one symbol whose name we would return.
But I agree that in most of the cases, you are just interested in a simple symbol name lookup and in this case, returning the type name is a good idea. Added to backlog for 3.2.2 (also for GetAddressInfo).
Thanks,
Michal