SoftMaker.com

English-Language Support
It is currently Wed Aug 27, 2014 11:59 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Feb 14, 2009 10:29 pm 
Offline

Joined: Sun Dec 09, 2007 9:55 pm
Posts: 96
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


Top
 Profile  
 
PostPosted: Mon Feb 16, 2009 10:40 am 
Offline
SoftMaker Team
SoftMaker Team

Joined: Wed Apr 09, 2008 7:26 am
Posts: 5303
Location: Nuremberg
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


Top
 Profile  
 
PostPosted: Mon Feb 16, 2009 2:02 pm 
Offline

Joined: Sun Dec 09, 2007 9:55 pm
Posts: 96
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group