-1
\$\begingroup\$

The value "V_Output" is the string of letters that I wish to capitalize the initial of. The following code is run in the step event.

V_InitL=string_char_at(V_Output,1)
V_InitL_Cap=string_upper(V_InitL)

string_delete(V_Output,0,1)
string_insert(V_InitL_Cap,V_Output,1)

The resultant output as is produced in the draw event shows the original, un-capitalized version.

The following debug changes produce no detectable effect:

V_InitL=string_char_at(V_Output,1)
V_InitL_Cap=string_upper(V_InitL)

string_delete(V_Output,0,1)
string_insert("DEBUG",V_Output,1)

Why is this happening? What should I do to fix it?

\$\endgroup\$
0
\$\begingroup\$

The following code fixed the problem:

V_InitL=string_char_at(V_Output,1)
V_InitL_Cap=string_upper(V_InitL)

V_Output=string_delete(V_Output,1,1)
V_Output=string_insert(V_InitL_Cap,V_Output,1)

As it turns out the effect of the last two functions can only be acquired if the variable has its value reassigned to the output of the functions (by adding "V_Output=" in front)

Also, to delete single character, the index must be that of the target character.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.