Some of the Prode Physical Properties (PPP) routines don't operate as I would prefer they operate. Thus, I have created new Mathcad routines to my liking. One operation that I have changed is the stream copy operation.
The good and bad about StrCopy
The StrCopy routine copies all information about the stream. That includes the VLE model specifications, which is good. The bad thing is that StrCopy also copies the name of the stream, so the "to" stream ends up with the same name as the "from" stream. I often use the copy routine to re-initialize an existing stream which already has a name. Thus, I want to copy everything except the name.
A personal preference
The PPP version of the stream copy function (StrCopy or mc_StrCopy in Mathcad) uses arguments in the reverse order that I would expect. It's arguments are (to,from) with respect to stream number. I prefer (from,to): some people may prefer the StrCopy order.
The figure below shows my new copy command.
The "res" variable has a value of 0 if a mc_xxx routine fails and 1 if it succeeds. In the above routine, I output that variable, in this case a two element vector. In many routines, I don't output the "res" variables because there are more important results. For the copy routine, the real results are in the PPP stream archive. All PPP routines need a result so those that don't produce a result, such as a temperature or a name, produce this Boolean result. If the fourth line in the program above were written as "mc_StrCopy(to,from)" without the "res.0 <-", then the mc_StrCopy routine would not execute.
The Prode dll
When I created the prode dll file, I could have changed the order of the streams in the argument list for mc_StrCopy. However, I didn't because I wanted people that have used PPP to be able to easily use the Mathcad version. There were only a couple of routines that required a change in argument list.