Improper use of typedef

I cannot use path evaluator with GetValue.

This is the situation:

I got an error, on this line:

ERROR: E2108 Improper use of typedef ‘TJSONObject’

How to use path evaluator correctly?

1 Answer 1

The tokens field is an Array, not an Object. So you need to request a TJSONArray from GetValue () instead of a TJSONObject .

But, more importantly, the type you request from GetValue () needs to be a pointer type since you are requesting a JSON class type, and not a built-in type like an int or String . Since you are requesting a TJSONObject instead of a TJSONObject* , that is why you are getting the error.

Also, GetValue () returns the value portion of a Pair, not the Pair itself. So you need to assign the returned pointer to a TJSONArray* variable ( jpa is a TJSONPair* instead).

In Unit1.h
private:

Now in Unit1.cpp im trying to do simple thing:

Getting these errors:
[C++ Error] Unit1.cpp(172): E2108 Improper use of typedef ‘TForm1::gydytojas’
Unit1.cpp(170): parsing: void _fastcall TForm1::Button18Click(TObject *)

    3 Contributors

  • forum6 Replies 1,505 Views 8 Hours Discussion Span
  • commentLatest Post 11 Years Ago by En1ro

Recommended Answers

vardas is an array of 25 Strings. So if you want to keep it that way, you need to use
something like:

All 6 Replies

gydytojas is a struct, but you use it like an object. The problem is the same as if you tried to say int.value = 5; , and the fix is to define a variable of gydytojas to work with. 🙂

Читайте также:  Ростелеком антенна не работает

gydytojas is a struct, but you use it like an object. The problem is the same as if you tried to say int.value = 5; , and the fix is to define a variable of gydytojas to work with. 🙂

Oh, so you mean i should define another variable to gydytojas, for example i got : gydytojas gydmas[100]; As if i do so, i get an error:

[C++ Error] Unit1.cpp(169): E2277 Lvalue required
Unit1.cpp(168): parsing: void _fastcall TForm1::Button18Click(TObject *)

And i had changed in struct of gydytojas from String vardas, to AnsiString vardas.