[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

OleVariant conversion

Posted on 2002-03-20
4
Medium Priority
?
217 Views
Last Modified: 2010-04-05
hello
im using an activex,on method returns a multi-dimentional array (2X2) as an ole variant

How can i use it?
[should i typecast it to variant (using VarCast()..)?]
how do i access elemnts in the array?

Thanx
Tomer
0
Comment
Question by:tomer_engel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
Stuart_Johnson earned 300 total points
ID: 6884392
Hi Tomer,


procedure FinishedActiveX(V: OleVariant);
var
  Dimensions, Elements: Integer;
  Value: String;
begin
  if VarType(V) <> (VarArray + VarVariant) then
    begin
      ShowMessage('Passed variant is not a variant array');
      Exit;
    end;
  {Dimensions tell you how many dimensions you have in the array - not elements

    DIM1  DIM2  DIM3
    ELE1  ELE1  ELE1
    ELE2  ELE2  ELE2
    ELE3  ELE3  ELE3
}

  Dimensions := VarArrayDimCount(V);

  {To find out how many elements you have in the last  dimension, use this}

  Elements := VarArrayHighBound(V, Dimensions);

  {You can then access each element in the array using:}
  Value := V[Dimension, Elements];
  {Assuming that the passed data is a string - you can check using the VarType function}
end;

For more information on Variants, check the help file.  Search for VarArrayCreate, then click on Variant Support Routines (in the D5 help file anyway).

Please feel free to ask more questions!

Cheers,

Stu
0
 
LVL 1

Author Comment

by:tomer_engel
ID: 6886291
hey stu,thanx
let me get back to you in few says

Tomer
0
 

Expert Comment

by:CleanupPing
ID: 9343240
tomer_engel:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 9356076
Hi Tomer,

Just out of curiosity, how come you only awarded my answer 'B' grading?  Did it not help?

Stuart.
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question