09-15-2011 06:28 AM
As I'm a DIAdem script beginner, I've created a script using the recorder mode, but need to add additional channels to be subracted and to avoid the line becoming to long, want to continue the command on the next line.
Can't seem to find anything referring to multiline syntax in the DIAdem script help - searched the web and found that normal vbscript uses '&_ ' but doesn't seem to work.
Anybody help ?
09-15-2011 07:19 AM
09-15-2011 07:58 AM
Tried it and get the warning 'unterminated string constant' after I try running the code, the script screen shows a red squiggle after the _ character in the line code.
Must be doing something else wrong, but note I have to add another 120 channels to this sum ! (I realise there will be a much easier way using some sort of FOR NEXT loop), but I'm just a beginner !
here's the code
ChnCalculate("Ch(""Load Comparison"")=Ch(""Alt Amps"")-(Ch(""Main A"")_
+ch(""Starter A"")+Ch(""DF_1_FUEL_SENS1""))") '... FormulaTxt
09-16-2011 03:16 AM
You want to spread a string on multiple line than you have to close the string, add a closing ", add a & to concat the two strings and a starting " in the new line.
ChnCalculate("Ch(""Load Comparison"")=Ch(""Alt Amps"")-(Ch(""Main A"")" & _
"+ch(""Starter A"")+Ch(""DF_1_FUEL_SENS1""))") '... FormulaTxt
Conclusion: You have to split the string into two parts, concat them and then you can use the _ to put them on two lines.