![]() |
Variants und Arrays
Hallo,
ich bekomme von einer dll ein Array in Form eines Variants. Im PDF zur dll ist das so beschrieben für VB GetBarcodeReturn the barcode if detected. To use GetBarcode, the barcode reading functionality needs to be enabled by BarcodeInit method.
Code:
Wie setz ich das in Delphi um?
Function GetBarcode () As Variant
Dim aa As Variant BarCodeReturn = v.GetBarcode List1.Clear VarType (BarCodeReturn) If UBound(BarCodeReturn) >= LBound(BarCodeReturn) Then For f = LBound(BarCodeReturn) To UBound(BarCodeReturn) List1.AddItem BarCodeReturn(f, 0) 'BarCodeString List1.AddItem BarCodeReturn(f, 1) 'BarCode Type List1.AddItem BarCodeReturn(f, 2) 'BarCode Orientation. List1.AddItem BarCodeReturn(f, 3) 'BarCode Location Next f End If was ich bisher versucht habe ist leider misslungen und zu Variants hab ich nichts brauchbares im Netz/Forum gefunden. bisheriger Code (nur das wesentliche, rest rausgeschmissen wegen Übersicht)
Delphi-Quellcode:
Wenn ich die Größe des Array auslesen will und das Ergebnis in ein Memo schreibe bekomme ich nur Low=0 und High=0 oder Low=0 und High=-1
var aa:variant;
.. aa:=video.GetBarcode; if varisarray(aa) then begin if VarArrayHighBound(aa, 1)>VarArrayLowBound(aa, 1) then for I := VarArrayLowBound(aa, 1) to VarArrayHighBound(aa, 1) do begin label12.Caption:=vararrayget(aa,i);
Delphi-Quellcode:
memo1.Lines.Add(inttostr(VarArrayLowBound(aa, 1)));
memo1.Lines.Add(inttostr(VarArrayHighBound(aa, 1))); |
AW: Variants und Arrays
*push*
immer noch aktuell, keiner eine Idee? |
AW: Variants und Arrays
Probier mal VarArrayLock/VarArrayUnlock. Damit sollte/könnte das gehen...
|
AW: Variants und Arrays
Ist das auch ein zwei-/mehrdimensionalas Array?
Delphi-Quellcode:
und die 1. Ebene/Dimension wird bestimmt 0 sein.
VarArrayLowBound(DasArray, DieEbene)
|
AW: Variants und Arrays
Zitat:
das stimmt schon, gerade extra nochmal in der Hilfe nachgeguckt. Zitat:
|
AW: Variants und Arrays
Zitat:
|
AW: Variants und Arrays
|
AW: Variants und Arrays
Den Link kannte ich noch nicht ich seh mir das mal an, dankeschön.
Meld mich dann bei Fragen / oder bei Lösung des Problems wieder. Gruß Matthias |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:00 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz