cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Newbie
Participant

Why this code cannot change story name?

With this snapshot of code:

 

 

API_StoryCmdType storyCmd;
storyCmd.action = APIStory_Rename;
storyCmd.index = storyInfo.lastStory;
storyCmd.uName[storyInfo.lastStory] = GS::uchar_t("TAS");
GSErrCode err = ACAPI_Environment(APIEnv_ChangeStorySettingsID, &storyCmd); 

 

 

I wonder why it did not change the story name without any error.

Please advise.

 

1 Solution

Accepted Solutions
Viktor Kovacs
Graphisoft
Graphisoft

Not sure what is your intention with this line:

storyCmd.uName[storyInfo.lastStory] = GS::uchar_t("TAS");

This code modifies one character in the name at the index of lastStory. That character will probably be a "T" since you convert a string to one character. Probably you would like to write something like this:

GS::UniString newName = "TAS";
GS::ucscpy (storyCmd.uName, newName.ToUStr ());

 

Go to post

1 Reply 1
Viktor Kovacs
Graphisoft
Graphisoft

Not sure what is your intention with this line:

storyCmd.uName[storyInfo.lastStory] = GS::uchar_t("TAS");

This code modifies one character in the name at the index of lastStory. That character will probably be a "T" since you convert a string to one character. Probably you would like to write something like this:

GS::UniString newName = "TAS";
GS::ucscpy (storyCmd.uName, newName.ToUStr ());

 

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!