View Single Post
Old 09-01-2020, 07:52 AM   #6
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 161
Default

Quote:
Originally Posted by Florian.S View Post
both variables "MarkerName" and "MarkerNr" are overwritten and both have the same value/string. I don't get why this is happening.

Is there a easier way to get the value(name) of a marker than doing it char by char?
I think the problem is caused by the lines
Code:
MarkerName = oscparm_val_str; 
...and...
MarkerNr = oscparm_val_str;
where what the code should be doing is using strcpy() rather than an equals = assigment where the = assignment doesn't work for EEL2 strings (except for their initial declaration i.e. first creation).

The code currently overwrites the handle that identifies the string so you don't see the intended output.

This post https://forum.cockos.com/showpost.ph...&postcount=113 may be helpful for the intended string handling along with other items in the thread

Also this editor https://forum.cockos.com/showthread.php?t=142641 will help by using Notepad++ and an EEL2 template to edit the code and especially to keep track of and matching the block start and end brackets like );

To be sure of the code's execution as you develop
1) use a printf freely on every line to make sure key variable and strings have the expected values. This builds confidence and can be commented out when no longer needed.

2) develop difficult or untried or learning code in the @init block to make it easier to see in action and to test or debug, and then move it to @oscmsg when it is OK, to then use varying input data.

Last edited by goldenarpharazon; 09-01-2020 at 08:45 AM. Reason: Made the thread links clearer
goldenarpharazon is offline   Reply With Quote