This article can be obsolete: Actual documentation online
Special VCL functions
There aren't some VCL functions in C++ and have to be expressed differently (incomplete list):
| Delphi | C++ | Condition |
|---|---|---|
| Assigned( foo ) | foo != NULL | |
| Copy(foo, 1,3) | foo.SubString(1, 3) | for strings |
| Dec(i) | i-- | |
| Dec(i,2) | i -= 2 | |
| Delete(foo, 1,3) | foo.Delete(1, 3) | for strings |
| Dispose(foo) | delete foo | |
| Exclude(foo, bar) | foo >> bar | for sets |
| High(enum_type) | größter enum-Wert | |
| Inc(i) | i++ | |
| Inc(i,2) | i += 2 | |
| Include(foo, bar) | foo << bar | for sets |
| Length(foo) | foo.Length ( ) | for strings |
| Low(enum_type) | kleinster enum-Wert | |
| New(p) | p = new type_of_p | only works, if p is an identifier |
| Pos(foo, bar) | bar.Pos ( foo ); | for strings |
| PAnsiChar(foo) | foo.c_str() | for strings |
| PAnsiChar(foo) | char(foo) | else |
| SetLength(foo, bar) | foo.SetLength ( bar ); | for strings |