ArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2022-11-29T09:28:50+02:00 https://brainmodular.com/forums/app.php/feed/topic/7077 2022-11-29T09:28:50+02:00 2022-11-29T09:28:50+02:00 https://brainmodular.com/forums/viewtopic.php?t=7077&p=44532#p44532 <![CDATA[Re: Use of 'variant' with getObject]]>

CODE:

var S : string;//PROCESS                                                                             PROCEDURE PROCESS();                                          BEGIN     S := GetObject ( 'patch.myfader' );  trace(S);END;

Statistics: Posted by senso — 29 Nov 2022, 08:28


]]>
2022-11-29T02:18:30+02:00 2022-11-29T02:18:30+02:00 https://brainmodular.com/forums/viewtopic.php?t=7077&p=44527#p44527 <![CDATA[Re: Use of 'variant' with getObject]]>

Statistics: Posted by woodslanding — 29 Nov 2022, 01:18


]]>
2022-11-28T22:09:15+02:00 2022-11-28T22:09:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=7077&p=44526#p44526 <![CDATA[Re: Use of 'variant' with getObject]]>
Edit: It is actually a string value. It's just always equal to '83'.

Edit: I managed to get a different string okay, (YAY!) so there's something else going on....

Statistics: Posted by woodslanding — 28 Nov 2022, 21:09


]]>
2022-11-28T21:00:52+02:00 2022-11-28T21:00:52+02:00 https://brainmodular.com/forums/viewtopic.php?t=7077&p=44525#p44525 <![CDATA[Re: Use of 'variant' with getObject]]>
I tried this:

var st: string;
var v: TVarType;

v := getObject(address);
st := varType(varString);

that's not it. It gives an assignment error (which I would include here if it was possible to select text from the script compile log window.)

but of course it can't work, there's no reference to 'v'. But V is a const in the function, so I can't put a variable there either, can I?

I tried this:
v := getObject(address);
st := VarToStr(v);

and it compiles, but I still don't get the string value out of it, just the number '83' as always. And it doesn't use varType.....

Statistics: Posted by woodslanding — 28 Nov 2022, 20:00


]]>
2022-11-28T10:13:15+02:00 2022-11-28T10:13:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=7077&p=44517#p44517 <![CDATA[Re: Use of 'variant' with getObject]]> use the function VarType(const V: Variant): TVarType;

CODE:

  type TVarType = Word;  {------------------------------------------------------------  The variant types are described in the following table:   varEmpty  The variant is Unassigned.    varNull  The variant is Null.    varAny  Represents a Variant that can hold any value.    varSmallint  16-bit signed integer (type Smallint in Delphi, short in C++).    varInteger  32-bit signed integer (type Integer in Delphi, int in C++).    varSingle  Single-precision floating-point value (type Single in Delphi, float in C++).    varDouble  Double-precision floating-point value (type double).    varCurrency  Currency floating-point value (type Currency).    varDate  Date and time value (type TDateTime).    varOleStr  Reference to a dynamically allocated UNICODE string.    varDispatch  Reference to an Automation object (an IDispatch interface pointer).    varError  Operating system error code.    varBoolean  16-bit Boolean (type WordBool).    varVariant  Indicates another variant.    varUnknown  Reference to an unknown object (an IInterface or IUnknown interface pointer).    varShortInt  8-bit signed integer (type ShortInt in Delphi or signed char in C++).    varByte  A Byte.    varWord  Unsigned 16-bit value (Word).    varLongWord  Unsigned 32-bit value (type LongWord in Delphi or unsigned long in C++).    varInt64  64-bit signed integer (Int64 in Delphi or __int64 in C++).    varStrArg  COM-compatible string.    varString  Reference to a dynamically allocated string (not COM-compatible).    varArray  Indicates a Variant array.    varByRef  Indicates that the variant contains a reference as opposed to a value.    varTypeMask  Indicates the type of each array element.   -----------------------------------------------------------------}  type HResult = Integer;  {-----------------------------------------------------------------  // possible values of HRESULT  S_OK = 0                    // No error. In some APIs, S_OK indicates a successful operation with a return value of True.   S_FALSE = $00000001        // No error, but the operation did not produce a useful result. In some APIs, S_FALSE indicates a successful operation with a return value of False.    E_NOINTERFACE = $80004002 // Interface not supported.   E_UNEXPECTED = $8000FFFF  // Catastrophic failure.   E_NOTIMPL = $80004001     // Operation not implemented.   -----------------------------------------------------------------}  Type TVariantRelationship = (vrEqual, vrLessThan, vrGreaterThan, vrNotEqual);  function VarType(const V: Variant): TVarType;  function VarAsType(const V: Variant; aVarType: TVarType): Variant;  function VarIsByRef(const V: Variant): EvalBool;  function VarIsEmpty(const V: Variant): EvalBool;  function VarIsNull(const V: Variant): EvalBool;  function VarIsClear(const V: Variant): EvalBool;  function VarIsError(const V: Variant; out AResult: HRESULT): EvalBool;  function VarAsError(AResult: HRESULT): Variant;  function VarIsCustom(const V: Variant): EvalBool;  function VarIsOrdinal(const V: Variant): EvalBool;  function VarIsFloat(const V: Variant): EvalBool;  function VarIsNumeric(const V: Variant): EvalBool;  function VarIsStr(const V: Variant): EvalBool;  function VarIsArray(const A: Variant; AResolveByRef: EvalBool = True): EvalBool;  function VarToStr(const V: Variant): string;  function VarToStrDef(const V: Variant; ADefault: string): string;  function VarToWideStr(const V: Variant): WideString;  function VarToWideStrDef(const V: Variant; ADefault: WideString): WideString;  function VarToUnicodeStr(const V: Variant): UnicodeString;  function VarToUnicodeStrDef(const V: Variant; ADefault: UnicodeString): UnicodeString;  function VarToDateTime(const V: Variant): TDateTime;  function VarFromDateTime(DateTime: TDateTime): Variant;  function VarInRange(const AValue, AMin, AMax: Variant): EvalBool;  function VarEnsureRange(const AValue, AMin, AMax: Variant): Variant;  function VarSameValue(const A, B: Variant): EvalBool;  function VarCompareValue(const A, B: Variant): TVariantRelationship;  function VarTypeIsValidArrayType(aVarType: TVarType): EvalBool;  function VarTypeIsValidElementType(aVarType: TVarType): EvalBool;  function VarArrayCreate(Bounds: array of SizeInt; aVarType: TVarType): Variant;  function VarArrayOf(Values: array of Variant): Variant;  procedure VarArrayRedim(var A: Variant; HighBound: SizeInt);  function VarArrayAsPSafeArray(const A: Variant): Pointer;  procedure VarCopyNoInd(var Dest: Variant; const Source: Variant);  function VarArrayDimCount(const A: Variant): SizeInt;  function VarArrayLowBound(const A: Variant; Dim: SizeInt): SizeInt;  function VarArrayHighBound(const A: Variant; Dim: SizeInt): SizeInt;  function VarArrayLock(const A: Variant): Pointer;  procedure VarArrayUnlock(const A: Variant);  function VarArrayRef(const A: Variant): Variant;  function VarArrayGet(const A: Variant; Indices: array of Int32): Variant;  procedure VarArraySet(var A: Variant; const Value: Variant; Indices: array of Int32);

Statistics: Posted by senso — 28 Nov 2022, 09:13


]]>
2022-11-28T00:57:46+02:00 2022-11-28T00:57:46+02:00 https://brainmodular.com/forums/viewtopic.php?t=7077&p=44515#p44515 <![CDATA[Use of 'variant' with getObject]]> Statistics: Posted by woodslanding — 27 Nov 2022, 23:57


]]>
BrainModular BrainModular Users Forum 2022-11-29T09:28:50+02:00 https://brainmodular.com/forums/app.php/feed/topic/7077 2022-11-29T09:28:50+02:00 2022-11-29T09:28:50+02:00 https://brainmodular.com/forums/viewtopic.php?t=7077&p=44532#p44532 <![CDATA[Re: Use of 'variant' with getObject]]>

CODE:

var S : string;//PROCESS                                                                             PROCEDURE PROCESS();                                          BEGIN     S := GetObject ( 'patch.myfader' );  trace(S);END;

Statistics: Posted by senso — 29 Nov 2022, 08:28


]]>
2022-11-29T02:18:30+02:00 2022-11-29T02:18:30+02:00 https://brainmodular.com/forums/viewtopic.php?t=7077&p=44527#p44527 <![CDATA[Re: Use of 'variant' with getObject]]>

Statistics: Posted by woodslanding — 29 Nov 2022, 01:18


]]>
2022-11-28T22:09:15+02:00 2022-11-28T22:09:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=7077&p=44526#p44526 <![CDATA[Re: Use of 'variant' with getObject]]>
Edit: It is actually a string value. It's just always equal to '83'.

Edit: I managed to get a different string okay, (YAY!) so there's something else going on....

Statistics: Posted by woodslanding — 28 Nov 2022, 21:09


]]>
2022-11-28T21:00:52+02:00 2022-11-28T21:00:52+02:00 https://brainmodular.com/forums/viewtopic.php?t=7077&p=44525#p44525 <![CDATA[Re: Use of 'variant' with getObject]]>
I tried this:

var st: string;
var v: TVarType;

v := getObject(address);
st := varType(varString);

that's not it. It gives an assignment error (which I would include here if it was possible to select text from the script compile log window.)

but of course it can't work, there's no reference to 'v'. But V is a const in the function, so I can't put a variable there either, can I?

I tried this:
v := getObject(address);
st := VarToStr(v);

and it compiles, but I still don't get the string value out of it, just the number '83' as always. And it doesn't use varType.....

Statistics: Posted by woodslanding — 28 Nov 2022, 20:00


]]>
2022-11-28T10:13:15+02:00 2022-11-28T10:13:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=7077&p=44517#p44517 <![CDATA[Re: Use of 'variant' with getObject]]> use the function VarType(const V: Variant): TVarType;

CODE:

  type TVarType = Word;  {------------------------------------------------------------  The variant types are described in the following table:   varEmpty  The variant is Unassigned.    varNull  The variant is Null.    varAny  Represents a Variant that can hold any value.    varSmallint  16-bit signed integer (type Smallint in Delphi, short in C++).    varInteger  32-bit signed integer (type Integer in Delphi, int in C++).    varSingle  Single-precision floating-point value (type Single in Delphi, float in C++).    varDouble  Double-precision floating-point value (type double).    varCurrency  Currency floating-point value (type Currency).    varDate  Date and time value (type TDateTime).    varOleStr  Reference to a dynamically allocated UNICODE string.    varDispatch  Reference to an Automation object (an IDispatch interface pointer).    varError  Operating system error code.    varBoolean  16-bit Boolean (type WordBool).    varVariant  Indicates another variant.    varUnknown  Reference to an unknown object (an IInterface or IUnknown interface pointer).    varShortInt  8-bit signed integer (type ShortInt in Delphi or signed char in C++).    varByte  A Byte.    varWord  Unsigned 16-bit value (Word).    varLongWord  Unsigned 32-bit value (type LongWord in Delphi or unsigned long in C++).    varInt64  64-bit signed integer (Int64 in Delphi or __int64 in C++).    varStrArg  COM-compatible string.    varString  Reference to a dynamically allocated string (not COM-compatible).    varArray  Indicates a Variant array.    varByRef  Indicates that the variant contains a reference as opposed to a value.    varTypeMask  Indicates the type of each array element.   -----------------------------------------------------------------}  type HResult = Integer;  {-----------------------------------------------------------------  // possible values of HRESULT  S_OK = 0                    // No error. In some APIs, S_OK indicates a successful operation with a return value of True.   S_FALSE = $00000001        // No error, but the operation did not produce a useful result. In some APIs, S_FALSE indicates a successful operation with a return value of False.    E_NOINTERFACE = $80004002 // Interface not supported.   E_UNEXPECTED = $8000FFFF  // Catastrophic failure.   E_NOTIMPL = $80004001     // Operation not implemented.   -----------------------------------------------------------------}  Type TVariantRelationship = (vrEqual, vrLessThan, vrGreaterThan, vrNotEqual);  function VarType(const V: Variant): TVarType;  function VarAsType(const V: Variant; aVarType: TVarType): Variant;  function VarIsByRef(const V: Variant): EvalBool;  function VarIsEmpty(const V: Variant): EvalBool;  function VarIsNull(const V: Variant): EvalBool;  function VarIsClear(const V: Variant): EvalBool;  function VarIsError(const V: Variant; out AResult: HRESULT): EvalBool;  function VarAsError(AResult: HRESULT): Variant;  function VarIsCustom(const V: Variant): EvalBool;  function VarIsOrdinal(const V: Variant): EvalBool;  function VarIsFloat(const V: Variant): EvalBool;  function VarIsNumeric(const V: Variant): EvalBool;  function VarIsStr(const V: Variant): EvalBool;  function VarIsArray(const A: Variant; AResolveByRef: EvalBool = True): EvalBool;  function VarToStr(const V: Variant): string;  function VarToStrDef(const V: Variant; ADefault: string): string;  function VarToWideStr(const V: Variant): WideString;  function VarToWideStrDef(const V: Variant; ADefault: WideString): WideString;  function VarToUnicodeStr(const V: Variant): UnicodeString;  function VarToUnicodeStrDef(const V: Variant; ADefault: UnicodeString): UnicodeString;  function VarToDateTime(const V: Variant): TDateTime;  function VarFromDateTime(DateTime: TDateTime): Variant;  function VarInRange(const AValue, AMin, AMax: Variant): EvalBool;  function VarEnsureRange(const AValue, AMin, AMax: Variant): Variant;  function VarSameValue(const A, B: Variant): EvalBool;  function VarCompareValue(const A, B: Variant): TVariantRelationship;  function VarTypeIsValidArrayType(aVarType: TVarType): EvalBool;  function VarTypeIsValidElementType(aVarType: TVarType): EvalBool;  function VarArrayCreate(Bounds: array of SizeInt; aVarType: TVarType): Variant;  function VarArrayOf(Values: array of Variant): Variant;  procedure VarArrayRedim(var A: Variant; HighBound: SizeInt);  function VarArrayAsPSafeArray(const A: Variant): Pointer;  procedure VarCopyNoInd(var Dest: Variant; const Source: Variant);  function VarArrayDimCount(const A: Variant): SizeInt;  function VarArrayLowBound(const A: Variant; Dim: SizeInt): SizeInt;  function VarArrayHighBound(const A: Variant; Dim: SizeInt): SizeInt;  function VarArrayLock(const A: Variant): Pointer;  procedure VarArrayUnlock(const A: Variant);  function VarArrayRef(const A: Variant): Variant;  function VarArrayGet(const A: Variant; Indices: array of Int32): Variant;  procedure VarArraySet(var A: Variant; const Value: Variant; Indices: array of Int32);

Statistics: Posted by senso — 28 Nov 2022, 09:13


]]>
2022-11-28T00:57:46+02:00 2022-11-28T00:57:46+02:00 https://brainmodular.com/forums/viewtopic.php?t=7077&p=44515#p44515 <![CDATA[Use of 'variant' with getObject]]> Statistics: Posted by woodslanding — 27 Nov 2022, 23:57


]]>