getting planmaker selections into BasicMaker

Post bug reports and suggestions for PlanMaker 2008 for Windows.

Moderator: SoftMaker Team

LanceGary
Posts: 105
Joined: Sun Dec 09, 2007 9:55 pm

getting planmaker selections into BasicMaker

Postby LanceGary » Sat Feb 14, 2009 10:29 pm

Nothing makes me feel older "objects" in programming. I grew up in the days of Fortran and BASIC. Anyway, here's my question (probably I'm being a bit lazy). (I could not find much on "selections" in the Basicmaker manual - most probably I'm missing something).

Suppose one had data in PlanMaker and had selected the data:

Subject Salary PhDyrs pubs sex citations
1 18000 1 2 0 1
2 19961 2 4 0 0
3 19828 5 5 1 1
4 17030 7 12 1 0
5 19925 10 5 0 0
6 19041 4 9 0 1
7 27132 3 3 1 0
8 27268 8 1 0 1
9 32483 4 8 0 0
10 27029 16 12 1 4
11 25362 15 9 0 0
12 28463 19 4 0 3
13 32931 8 8 0 5
14 28270 14 11 0 0
15 38362 28 21 0 3


Now one wants to get this data into BasicMaker and do things to it, and then return the results to Planmaker. I know one has to start with these instructions:

dim pm as object
set pm = createObject("PlanMaker.Application")
pm.Application.Visible = True


In Excel one would use code like:

dim r as integer, rMax as integer
rMax = selection.rows.count

dim dataArray as variant
dataArray = Selection.Value

etc, but this doesn't seem to work in BasicMaker.

If someone could give me an example of how to read a selection of data into BasicMaker and perhaps how to put the results back into PlanMaker I would be greateful.

Thanks

Lance

sven-l
SoftMaker Team
SoftMaker Team
Posts: 6015
Joined: Wed Apr 09, 2008 7:26 am
Location: Nuremberg
Contact:

Re: getting planmaker selections into BasicMaker

Postby sven-l » Mon Feb 16, 2009 10:40 am

Hello,

here is the answer from our developers:

---

sub main
Set pm = CreateObject("PlanMaker.Application")
pm.Application.Visible = True
pm.Activate

'number of rows and columns in selection
msgbox "rows=" + pm.ActiveSheet.selection.rows.count
msgbox "cols=" + pm.ActiveSheet.selection.columns.count

' first value of selected area
msgbox "value=" + pm.ActiveSheet.selection(1,1).value
end sub

---
Sven Leßmann
SoftMaker Software GmbH

LanceGary
Posts: 105
Joined: Sun Dec 09, 2007 9:55 pm

Re: getting planmaker selections into BasicMaker

Postby LanceGary » Mon Feb 16, 2009 2:02 pm

sven-l wrote:Hello,

here is the answer from our developers:

---

sub main
Set pm = CreateObject("PlanMaker.Application")
pm.Application.Visible = True
pm.Activate

'number of rows and columns in selection
msgbox "rows=" + pm.ActiveSheet.selection.rows.count
msgbox "cols=" + pm.ActiveSheet.selection.columns.count

' first value of selected area
msgbox "value=" + pm.ActiveSheet.selection(1,1).value
end sub

---



Thanks! That's very helpful. Much appreciated.

Lance


Return to “PlanMaker 2008 for Windows”

Who is online

Users browsing this forum: No registered users and 1 guest