lcPropGetChar Home

Used to read characters of the text value retrieved with the function lcPropGetStr2 .

 int lcPropGetChar (
   int iChar
 );

Parameters
iChar
  Index of character in a property string.

Return Value

  A value of character. Zero means end of string.

Remarks

  Used to implement function PropGetStr in the file Litecad.cs
public static string PropGetStr(IntPtr hObject, int idProp)
{
  int nChars, i, ch;
  char[] Buf;
  nChars = Lcad.PropGetStr2(hObject, idProp);
  if (nChars > 0)
  {
    Buf = new char[nChars];
    for (i=0; i<nChars; ++i)
    {
      ch = Lcad.PropGetChar(i);
      Buf[i] = Convert.ToChar(ch);
    }
    return new string(Buf);
  }
  return "";
}
Used to implement function PropGetStr in the file Litecad.vb
Function PropGetStr (ByVal hObject As IntPtr, ByVal idProp As Integer) As String
  Dim Buf() As Char
  Dim nChars As Integer
  Dim ch As Integer

  nChars = Lcad.PropGetStr2(hObject, idProp)
  If nChars > 0 Then
    Buf = New Char(nChars) {}
    nChars = nChars - 1
    For i As Integer = 0 To nChars
      ch = Lcad.PropGetChar(i)
      Buf(i) = ChrW(ch)
    Next
    Return New String(Buf)
  End If
  Return ""
End Function

See Also

  Access Objects Properties