Example #1
0
 /// <summary>
 /// WRITE keyword
 /// Writes a fixed string value to the device.
 /// </summary>
 /// <param name="writeManager">A WriteManager instance to use</param>
 /// <param name="iostat">A reference variable that will be set to the I/O status</param>
 /// <param name="fixedstrVar">A fixed string value to write</param>
 /// <returns>A zero value if the operation succeeds, or -1 if the operation fails</returns>
 public static int WRITE(WriteManager writeManager, ref int iostat, FixedString fixedstrVar)
 {
     if (writeManager == null) {
         throw new ArgumentNullException("writeManager");
     }
     int charsWritten = writeManager.WriteString(fixedstrVar.ToString());
     if (charsWritten == -1) {
         iostat = IOError.WriteError;
     }
     return charsWritten;
 }
Example #2
0
 /// <summary>
 /// Searches first string and returns position of second string within it, otherwise zero..
 /// </summary>
 /// <param name="s1">First string</param>
 /// <param name="s2">Second string</param>
 /// <returns>The 1 based offset of string s2 within s1</returns>
 public static int INDEX(ref string s1, ref FixedString s2)
 {
     if (s1 == null) {
         throw new ArgumentNullException("s1");
     }
     if (s2 == null) {
         throw new ArgumentNullException("s2");
     }
     return s1.IndexOf(s2.ToString(), System.StringComparison.Ordinal) + 1;
 }