Search the Community
Showing results for tags 'sprintf'.
-
Hello there! Can anyone please explain me in detail what is "sprintf" and what is the use of that ? Also tell that why we use "%d" in the vex ? for example: s@name = sprintf("debris_f%d_%d", Frame, @ptnum); - Now what is the meaning of adding %d in this ? I tried to gather information from everywhere but not able to understand the basic usage of that. Anyone's help will be great for me. Thanks!
-
Trying to access a dynamically generated parameter from my control node and eventually put it into an array. I just do not understand why using the path variable is any different from just reading the string directly. here it is in text form btw int maxi = 2; for(int i = 1; i < maxi; i++){ string path = sprintf("../control/parm%g", i); s@path = path; //works^ float param = `chs("../control/parm1")`; f@param = param; //works^ float value = `chs(path)`; f@value = value; //doesnt work^ } Edit : Ive added a simple project file vex calling.hiplc Edit2: Okay I figured It out, I need to get rid of the back quotes encasing the chf() in order for it to work properly. This probably has to do with me copying the parameter and pasting relative reference in order to get the syntax.