Steema TeeBI with C++Builder - teechart

I'm trying to use Steema TeeBI Business Intelligence framework with Embarcadero C++Builder in RADStudio 10.2.2.
Converting the Delphi example in this page:
http://teechart.net/docs/teebi/tutorials/Using-the-API/
when I try to translate this line:
Customers['CustomerID'].Int32Data[0] := 1;
into this line
Customers["CustomerID"]->Int32Data[0] = 1; // Error
I encounter this error:
E2034 Cannot convert 'char const[11]' to 'int'
But this works:
Customers->operator[]("CustomerID")->Int32Data[0] = 1; // OK
Can somebody reproduce this situation and fix this bug in Steema?
Thank you.

Related

What is the meaning of this code line?? and What is the solution for the error?? I have this issue in Sniper Simulator version 7.2

What is the meaning of this code line?? and What is the solution for the error?? I have this issue in Sniper Simulator version 7.2 with Pin 3.5 on Linux Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux. My gcc version is 8.3.0
Besides This is not my codes...
The code is:
IALARM* ALARM_MANAGER::GenAddress(){
string hex = "0x";
BOOL ctxt = _control_chain->NeedContext();
if (_alarm_value.compare(0, 2, hex) == 0){
//this is a raw address
return new ALARM_ADDRESS(_alarm_value,_tid,_count,ctxt,this);
}
if (_alarm_value.find("+",0) == string::npos){
//this is a symbol
return new ALARM_SYMBOL(_alarm_value,_tid,_count,ctxt,this);
}
else{
vector<string> tokens;
PARSER::SplitArgs("+",_alarm_value,tokens);
return new ALARM_IMAGE(tokens[0],tokens[1],_tid,_count,ctxt,this);
}
The error is:
alarm_manager.cpp:137:67: error: ‘new’ of type ‘CONTROLLER::ALARM_SYMBOL’ with extended alignment 64 [-Werror=aligned-new=]
return new ALARM_SYMBOL(_alarm_value,_tid,_count,ctxt,this);
^
alarm_manager.cpp:157:64: note: uses ‘void* operator new(size_t)’, which does not have an alignment parameter
alarm_manager.cpp:157:64: note: use ‘-faligned-new’ to enable C++17 over-aligned new support
As Kamil said it gets solved by adding -faligned-new to the relative makefile.
use ‘-faligned-new’ to enable C++17 over-aligned new support

Why there is no autocomplete from Intellisens?

Trying a C++ example with VS 2017 and Unreal I saw in the video once the instructor type ->GetF the intellisense appear but with me it does not so why is that ? I am getting also a red line error under the word GetWorld() "pointer to incomplete class type is not allowed" but the code compile fine !!
void UOpenDoor::BeginPlay()
{
Super::BeginPlay();
ActorThatOpen = GetWorld()->GetFirstPlayerController()->GetPawn();
}

TypeScript compiler error: Expected ';' or ']'

This is a node project in VS 2013 with TypeScript tools and Web Essential installed (but no Resharper). I'm in process converting my javascript to typescript, and it seems to go well. However, I got a lot of errors in the Error List like
Error 1 Expected ';' C:\Azure\public\js\prototypes.ts 6 11
Error 2 Expected ',' or ']' C:\Azure\public\js\prototypes.ts 7 13
Error 3 Expected ';' C:\Azure\public\js\prototypes.ts 7 22
Error 4 Expected ',' C:\Azure\public\js\prototypes.ts 13 30
Error 5 Expected '{' C:\Azure\public\js\prototypes.ts 13 40
Error 6 Expected ';' C:\Azure\public\js\prototypes.ts 13 49
Here is the first few lines of prototypes.js:
/// <reference path="../../typings/moment/moment.d.ts" />
'use strict';
//-------------------------------------------------
// Math
//-------------------------------------------------
interface Math {
lg(value: number): number;
roundUp(value: number, digits: number): number;
roundDown(value: number, digits: number): number;
}
if (!Math.lg) {
Math.lg = function (value: number) : number {
return Math.log(value) / Math.LN10;
};
}
if (!Math.roundUp) {
Math.roundUp = function (value, digits) {
var factor = Math.pow(10, Math.floor(Math.lg(Math.abs(value))) - digits || 0);
return Math.ceil(value / factor) * factor;
};
}
if (!Math.roundDown) {
Math.roundDown = function (value, digits) {
var factor = Math.pow(10, Math.floor(Math.lg(Math.abs(value))) - digits || 1);
return Math.floor(value / factor) * factor;
};
}
Strange thing is that, even with those errors in the Error list, build succeeded and the app seems to be running fine. I also tried to uninstall WebEssential and TypeScript tools and then reinstall them, but no difference.
What is it complaining about?
UPDATE:
When I saw 1.5Beta, I immediately installed it. To my disappointment, I got more errors. Then, I decided to rollback to 1.4. But even worse...now when I open the same project it complains
Your project file uses a different version of the TypeScript
compiler and tools than is currently installed on this machine. No
compiler was found at C:\Program Files (x86)\Microsoft
SDKs\TypeScript\1.4\1.4\tsc.exe. You may be able to fix this problem
by changing the <TypeScriptToolsVersion> element in your project
file.
I don't know why the path has an extra \1.4 now. Also, I can't find <TypeScriptToolsVersion> element in my project file. I searched everywhere (including registry), and couldn't find anywhere having a path like \1.4\1.4. It's becoming my TypeScript nightmare now.
even with those errors in the Error list, build succeeded and the app seems to be running fine.
TypeScript will not block a .js emit/build in the presence of type errors. This is to make it easier for you to migrate js code to ts.
That said, the code you posted also works fine:

Pebble C TupletCString compile error

I have an issue compiling my pebble watchapp. I am trying to send strings to the Pebbl eJS script on the phone lihe this:
Tuplet password_tuple = TupletCString(PASSWORD_KEY, password_str);
Tuplet email_tuple = TupletCString(EMAIL_KEY, email_str);
The compiler error is: (they both error out like this, this is just one of the lines of output below)
./src/app_test.c:84:25: error: the address of 'email_str' will always evaluate as 'true' [-Werror=address]
email_str and password_str are defined at the top of the program, like this:
static char email_str[30];
static char password_str[30];
#define PASSWORD_PKEY (int32_t)21
#define EMAIL_PKEY (int32_t)20
Does anyone notice anything wrong with this?
#ismail-badawi answer is very correct.
Pebble now recommends that you use dict_write_cstring.
dict_write_cstring(&iter, SOME_STRING_KEY, string);
Well it's certainly not obvious, but it turns out it's because TupletCString is a macro, and it'll expand to an expression that contains email_str ? strlen(email_str) + 1 : 0 as a subexpression, and this is what causes the error, because email_str can't be null and so the comparison isn't doing anything.
I found this thread on the Pebble forums with an explanation. The suggested fix is to define your own macro that doesn't have a conditional, e.g.
#define MyTupletCString(_key, _cstring) \
((const Tuplet) { .type = TUPLE_CSTRING, .key = _key, .cstring = { .data = _cstring, .length = strlen(_cstring) + 1 }})

How can I concatenate multiple variables in my MVC3 Razor code?

I have some razor code and I am having a problem with getting the syntax working. The code is as follows:
else
{
#(x.RowKey.Substring(0, 2).TrimStart('0') + "." + x.RowKey.Substring(2, 2).TrimStart('0').PadLeft(1, '0')) - #Html.Raw(x.Title)<br>
}
This is giving me the following error:
Compiler Error Message: CS1002: ; expected
When you start your #(x.RowKey...., Razor still thinks that it's still in C# mode, not HTML mode (to use the totally non-technical terms). Nick Bork's suggestion about wrapping that stuff in the <text> tags gets the page back into HTML mode so you can go back to using your normal Razor syntax.
Try this:
else
{
var st = x.RowKey.Substring(0, 2).TrimStart('0') + "." + x.RowKey.Substring(2, 2).TrimStart('0').PadLeft(1, '0'));
#st - #Html.Raw(x.Title)<br/>
}

Resources