Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

For statement - string

$
0
0

@afp wrote:

I have a variable that is a string called tone_id, and I am trying to make a for statement when a value of ‘joy’ then draw this circle (the values come from a json file). Can anybody tell me what I’m doing wrong?

string tone_id;

//-----

std::string tone_id = result["sentences_tone"][sentence_id]["tones"][sentence_id]["tone_id"].asString();

void ofApp::draw(){

for (string tone_id = “joy” ; tone_id <100; tone_id++) {
ofSetColor(29, 100, 90);
ofDrawCircle(300, 600, 90);
}

I am trying to get or “collect” all the data from this json file that has the value of “joy”:

{
“document_tone”: {
“tones”: [
{
“score”: 0.515079,
“tone_id”: “joy”,
“tone_name”: “Joy”
}

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles