Crestron SIMPL+ Spécifications Page 45

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 60
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 44
Crestron SIMPL+
Software
DIGITAL_INPUT readCompactFlashCard;
DIGITAL_INPUT writeCompactFlashCard;
INTEGER myInt;
LONG_INTEGER myLongInt;
STRING myStr[50];
PUSH writeCompactFlashCard
{
SIGNED_INTEGER nFileHandle;
INTEGER nNumBytes;
StartFileOperations()
nFileHandle = FileOpen( "\\CF0\\MyFile.txt",
_O_WRONLY | _O_CREAT );
if( nFileHandle >= 0 )
{
nNumBytes = WriteInteger( nFileHandle, myInt );
nNumBytes = WriteLongInteger( nFileHandle, myLongInt );
nNumBytes = WriteString( nFileHandle, myStr );
FileClose( nFileHandle );
}
EndFileOperations();
}
PUSH readCompactFlashCard
{
SIGNED_INTEGER nFileHandle;
INTEGER nNumBytes;
StartFileOperations()
nFileHandle = FileOpen( "\\CF0\\MyFile.txt", _O_CREAT );
if( nFileHandle >= 0 )
{
nNumBytes = ReadInteger( nFileHandle, myInt );
nNumBytes = ReadLongInteger( nFileHandle, myLongInt );
nNumBytes = ReadString( nFileHandle, myStr );
FileClose( nFileHandle );
}
EndFileOperations();
}
The functions, ReadStructure and WriteStructure, automate the reading and writing
of the individual fields within the structure. These functions do not return the
number of bytes read or written. Instead, both functions have an additional argument
that will contain the number of bytes read or written after the function call executes.
The following example demonstrates this:
DIGITAL_INPUT readCompactFlashCard;
DIGITAL_INPUT writeCompactFlashCard;
STRUCTURE myStruct
{
INTEGER myInt;
LONG_INTEGER myLongInt;
STRING myStr[50];
Programming Guide – DOC. 5789A SIMPL+
41
Vue de la page 44
1 2 ... 40 41 42 43 44 45 46 47 48 49 50 ... 59 60

Commentaires sur ces manuels

Pas de commentaire