Welcome
Welcome to <strong>SpreadCE / Spread32</strong>.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Tutorial

Post your comments, questions, bug reports and feature requests here.

Tutorial

Postby Gerd » Fri Jan 25, 2008 7:09 am

Hi all,

i search a tutorial for Spread CE, to learn first steps, special to program macros. Has anyone an idea or a link?

Best regards
Gerd
Gerd
 
Posts: 5
Joined: Fri Jan 25, 2008 6:56 am

Postby stephenbye » Sun Jan 27, 2008 6:02 pm

Hello Gerd,
There are details and examples in the help text file that is supplied with the program.
For general information, see the section headed "Macros".
For detailed information, see the "Macro control functions" and "Macro command functions" sections in the "Functions" section.
If you need a macro to do a particular task then please let me know and I will try to help you with it.
stephenbye
Site Admin
 
Posts: 305
Joined: Sun Aug 12, 2007 11:56 pm

Postby Gerd » Mon Jan 28, 2008 6:52 pm

Hi Stephen,
thanks for your answer. At first, SpreadCE is a great program and the help file is very good!

Yes, i have look for the examples in the help text file and the example macros works properly.

Sorry for my bad english, i will try to explain my task:
I need stock data to analysis the moves. i have a ascii-file(s) with follow datas:
25/01/08,11:00,6884.16000,7002.19000,6884.16000,6988.67000,0
25/01/08,11:15,6988.35000,7000.07000,6975.46000,6994.15000,0
25/01/08,11:30,6993.82000,6995.19000,6952.88000,6962.17000,0
...

In VBA its simple to load the data from the file, in SpreadCE my first trial:
=DÖFFNEN("DataFile";2) DataFile in Mainmemory, My Documents - ok?
=DLESEN.ZEILE(1) File-Nr. 1?
... and now? how assign the data to the sheet?
...
=DSCHLIESSEN(1)
=RÜCKSPRUNG()

If it is easier for you, i can install the english version of SpreadCE and we talk about english programm code.
Greetings
Gerd
life is chaos, enjoy it
Gerd
 
Posts: 5
Joined: Fri Jan 25, 2008 6:56 am

Postby stephenbye » Mon Jan 28, 2008 9:55 pm

This should do it:

=OPEN.DIALOG("My data files,*.csv",,"Choose a file") Prompt the user for a file name
=IF(A1=FALSE,RETURN()) Quit if they didn't select one
=ECHO(FALSE) Turn off screen updating
=OPEN(A1,,,2) Open the file using Comma as separator
=SELECT.LAST.CELL() Go to the last cell
=COPY(!A1:ACTIVE.CELL()) Copy everything from A1 to here
=FILE.CLOSE() Close the file
=SELECT(!B5) Go to our cell at Sheet1!B5
=PASTE() Paste the data that we copied
=RETURN() Finished

In German:

=DATEI.ÖFFNEN("My data files,*.csv",,"Choose a file") Prompt the user for a file name
=WENN(A1=FALSCH,RÜCKSPRUNG()) Quit if they didn't select one
=ECHO(FALSCH) Turn off screen updating
=ÖFFNEN(A1,,,2) Open the file using Comma as separator
=LETZTE.ZELLE.AUSWÄHLEN() Go to the last cell
=KOPIEREN(!A1:AKTIVE.ZELLE()) Copy everything from A1 to here
=DATEI.SCHLIESSEN() Close the file
=AUSWÄHLEN(!B5) Go to our cell at Sheet1!B5
=EINFÜGEN() Paste the data that we copied
=RÜCKSPRUNG() Finished

I will send you the example file by e-mail.
stephenbye
Site Admin
 
Posts: 305
Joined: Sun Aug 12, 2007 11:56 pm

Postby Gerd » Fri Feb 01, 2008 8:26 am

Hi Stephen,

thanks for your help! SpreadCE source code is very fast and effectively.
Nice Feature in SpreadCE is that cell reference in macrosheet are relative!

Please give me help to follow:
In VBA a nice funktion ist: variable=worksheet("sheet1").cells(i,j)
So its possible to make relativ cell reference with counters for column, row.
Is there in SpreadCE the same funktion?

To define variable is the function ARGUMENT([Namen]; [Typ]; [Bezug]) right?
Can i store in this variable counter/cell refernce to use it as relative cell reference?
By the way, argument value have not to store in macrosheet ... right?

Best regards
Gerd
life is chaos, enjoy it
Gerd
 
Posts: 5
Joined: Fri Jan 25, 2008 6:56 am

Postby stephenbye » Sun Feb 03, 2008 2:15 pm

Hello Gerd,

1) You can use the OFFSET worksheet function (BEREICH.VERSCHIEBEN in the German version), for example
=OFFSET(Sheet1!A1,row,column)

2) The ARGUMENT function is for storing parameters that are passed into user-defined functions. If you just need to define a variable then you can use the SET.NAME function (NAMEN.ZUWEISEN in the German version), or you can use the cells on the macro sheet to store values using the SET.VALUE function (WERT.FESTLEGEN in the German version). If you want to process a range of cells, you can use the FOR.CELL function (FÜR.ZELLE in the German version).
stephenbye
Site Admin
 
Posts: 305
Joined: Sun Aug 12, 2007 11:56 pm

Postby Gerd » Mon Feb 04, 2008 6:58 am

Hi Stephen,

i see, i have to learn much about source code in SpreadCE. I will try it.

Thanks for your help!
Gerd
life is chaos, enjoy it
Gerd
 
Posts: 5
Joined: Fri Jan 25, 2008 6:56 am


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests

cron
suspicion-preferred