04-13-2023 08:53 AM
I don't understand what's happening in this line of code. I cannot find "discharge_data" anywhere else in any of the files of this project.
Fmt (&file_string[0], "%s<%s\\discharge_data\\%sdis.txt", path, serial_number);
04-14-2023 01:22 AM
This line of code is formatting a string that is composed of four parts: path, the constant \\discharge_data\\ , serial_number and ending with 'dis.txt'.
So the author of this code line obviously wanted to save data to a file xxxdis.txt in the subdirectory ...\discharge_data
More on the Fmt command can be found, e.g., here
05-12-2023 12:47 PM
Thanks Wolfgang, your response provided enough of a clue that I discovered that the discharge_data folder did not exist. But the linked information did not explain to ME how the formatted string gets spliced together. It certainly did not help me decipher this.
Fmt (function_string, "%s<%s[w5]\042%s[w7]\042", "FUNC ", "VOLT:DC");
That is supposed to be a command to an HP6653A power supply. I can't find FUNC anywhere in the power supply manual. How would this command look?
05-12-2023 06:46 PM
@Jim_Marihew wrote:
Thanks Wolfgang, your response provided enough of a clue that I discovered that the discharge_data folder did not exist. But the linked information did not explain to ME how the formatted string gets spliced together. It certainly did not help me decipher this.
Fmt (function_string, "%s<%s[w5]\042%s[w7]\042", "FUNC ", "VOLT:DC");
The Fmt() functions certainly have a fairly long explanation of the various formatting string options.
This basically takes the first 5 characters from the first parameter, add an ASCI character with octal value 42 (the double quote), then takes 7 characters from the second parameter and adds another octal value 42.
So the result is <FUNC "VOLT:DC"> (without the brackets)
05-15-2023 09:39 AM
Well, that makes a little more sense. I was thinking decimal 42 (*). The VOLT:DC part makes sense, but neither FUNC nor FUNCTION appears anywhere in the commands list. I hate inherited code! Thanks Rolf.