Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Equivalent VBA Excel code

  1. #11
    Member
    Join Date
    Oct 2007
    Location
    Enschede
    Age
    65
    Posts
    57
    Rep Power
    23

    Re: Equivalent VBA Excel code

    Hello Eros and Roberto,

    I followed your discussion and imho I would not implement Office dependent issues such as COM_ExcelSetCells(). COM, yes but if the user knows the object model of the programs such as Word or Excel the user must reference the right object, method or property. If you use COM_ExcelSetCells() strategie you must implement the whole object model.

    I would create a more abstract way of calling the object made available via COM, just as you do now.

    I do not know how thinBasic is build internally but if you can use a dotted like construction without making it an object oriented language would be a bennefit.

    Just like

    [code=vb]dim pWdAppl as P
    dim pWdDocs as P
    dim pWActDoc as P

    pWdAppl = ole.create("word.application")
    pWdDocs = pWdAppl.documents
    pWdActDoc = pWdDocs.Add()
    pWdActDoc.name = "mydoctwo"[/code]

    In this example the names of the objects and properties are exact the same as used in the COM object that is called. It doesn't have to be part of thinbasic. You can map them 1:1 to the COM object. If you make a mistake the property or object is not found. Methods can be handled as functions() such as the Add() method. Properties just as they are and handle collections like array's.

    [code=vb]pWdActDoc = pWDocs(2)[/code]

    It is just an idea.
    Kind regards<br /><br />Marcel

  2. #12
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: Equivalent VBA Excel code

    Marcel,

    your suggestion is exactly what we would like to implement. We do not want to rebuild any COM model but let thinBasic engine understand what user wants using a dot notation. I suggested to have a new variable type called OBJCT because the first element in the dotted notation must be a pointer to a COM interface. Having a DWORD to store such a pointer will not let engine understand that script is dealing with a COM interface already referenced.

    Currently the biggest problem is that COM module is a separated module developed in C while thinBasic core engine is written is Power Basic so we need to understand what is better to do.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #13
    Member
    Join Date
    Oct 2007
    Location
    Enschede
    Age
    65
    Posts
    57
    Rep Power
    23

    Re: Equivalent VBA Excel code

    Hello Eros,

    That is indeed a difficult decision. I know nothing about PowerBasic but when it has to deal with COM I would probable do it in C.

    -----------
    Added: probable
    Kind regards<br /><br />Marcel

Page 2 of 2 FirstFirst 12

Similar Threads

  1. MS Excel as 3D engine :D
    By ErosOlmi in forum Development
    Replies: 3
    Last Post: 13-03-2008, 01:09

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •