internal void Init(Int32 size) { MemorySubCodes subcode = MemorySubCodes.CreateTEF; if (typeof(TValue) == typeof(byte)) { subcode = MemorySubCodes.Init8; } if (typeof(TValue) == typeof(Int16)) { subcode = MemorySubCodes.Init16; } if (typeof(TValue) == typeof(Int32)) { subcode = MemorySubCodes.Init32; } if (typeof(TValue) == typeof(float)) { subcode = MemorySubCodes.InitF; } var command = new Command(4, 0, 130, true); command.Append(ByteCodes.Array); command.Append(subcode); command.Append(Handle, ConstantParameterType.Value); command.Append((Int32)0, ConstantParameterType.Value); command.Append(size, ConstantParameterType.Value); command.Append((Int32)0, ConstantParameterType.Value); command.Append((byte)0, VariableScope.Global); var reply = connection.SendAndReceive(command); Error.CheckForError(reply, 130); }
private void CreateArray(Int32 size, MemorySubCodes subcode) { var command = new Command(4, 0, 130, true); command.Append(ByteCodes.Array); command.Append(subcode); command.Append(size, ConstantParameterType.Value); command.Append((byte)0, VariableScope.Global); var reply = connection.SendAndReceive(command); Error.CheckForError(reply, 130); Handle = reply.GetByte(3); }
/// <summary> /// Append a memory sub code /// </summary> /// <param name="subCode">Sub code to append</param> public void Append (MemorySubCodes subCode) { Append((sbyte) subCode, ParameterFormat.Short); }
/// <summary> /// Append a memory sub code /// </summary> /// <param name="subCode">Sub code to append</param> public void Append(MemorySubCodes subCode) { Append((sbyte)subCode, ParameterFormat.Short); }