SNAX/CNM Manual

SAMPLE PROGRAM: SENDING AND RECEIVING NMVT RUS
Tag := Tag + 1d;
Call Writeread(Out^File^Number,Nm^Frame,Write^Cnt,
Read^Cnt,,Tag);
! check the reply and its embedded SNA response
Call Awaitio(Out^File^Number,,Read^Cnt,Temp^Tag);
If <> Then
Begin
! Handle Error
End;
If Read^Cnt Then
Begin
! Check what it is - may be an NMVT request or reply
End
Else
Begin
! It's O.K., SNA response was sent and there
! was no SNA request to be passed to the
! application
End;
! Obtain^Line^Statistics (and reset counters)
Cs^Frame.Vr^Indicator := 0;
Cs^Frame.Connect^Id := Save^Connect^Id;
Cs^Frame.Comp^Func.
0:7
:= 3; !component cs
Cs^Frame.Comp^Func.
8:15
:= Cs^Verb^Statistics;
Cs^Frame.Line^Cs^Name ':=' ["$SNALUP "];
Cs^Frame.Pu^Cs^Name ':=' [" "];
Cs^Frame.Object := Pi^Line;
Cs^Frame.Cs^Data^Words := 1; !do Reset
Write^Cnt := (34 + 2);
Read^Cnt := (34 + 2) + Line^Sts^Length;
Tag := Tag + 1d;
Call Writeread(Out^File^Number,Cs^Frame,Write^Cnt,
Read^Cnt,,Tag);
!check the file-system/CNM reply
Call Awaitio(Out^File^Number,,Read^Cnt,Temp^Tag);
If <> Then
Begin
! Handle Error
End;
If Cs^Frame.Vr^Indicator.
8:15
= 1 Then
Begin
! Handle Negative Reply
End;
If Cs^Frame.Comp^Func.
8:15
<> Cs^Reply^Statistics Then
Begin
! Handle Error
End;
B-7