|
| probably self evident to every one but me |
 |
Thu, 11 Oct 2007 17:12:34 -040 |
Looking at the demo project. There are lots of .sma under the main
demo.sma.
I don't get how that is accomplished.
I have a Project
jdk.smj
in has jdk.sma
I want to pull out the
function makemenu(f)
end function
and put that into file
menu.sma
At some point a had it working but I don't remember what exactly I did.
I fooled around with settings and include and with using line
include "menu.sma"
before the
function main() line.
But I don't know what I did and I'm looking at the documentation and I
see the process being described technically but I can't seem to get to
step by step directions that I can understand.
Even when I stumbled up on it like a blind chicken getting a kernel of
corn, I had trouble debugging so that it would follow along from the
main window (jdk.sma) into the menu.sma when makemenu(f) was called.
My thinking here is that I'll have
primary file with
function main()
end function
and then a .sma files for the
menus
forms
functions
etc.
|
| Post Reply
|
| Re: probably self evident to every one but me |
 |
Fri, 12 Oct 2007 09:15:12 -040 |
Can I get a step by step. I'm a dabbler.
I open IDE
File > New Project
Let's say I call it
"StepByStep"
and it is in
"C:\Simpol\"
(by the way I'm an also having to change .smu to .sma, is there a
setting for that)
So now I have the following:
An empty StepByStep.sma
In which I'll have
function main()
end function
I want to create an .sma in which I'll write the menu/menus functions.
WHAT DO I DO? I'm a dummy.
|
| Post Reply
|
| Re: probably self evident to every one but me |
 |
Fri, 12 Oct 2007 15:16:19 +080 |
"Kromkowski" <kromkowski@verizon.net> wrote in message
news:fem3j7$20u$1@ipx22096.ipxserver.de...
> Looking at the demo project. There are lots of .sma under the main
> demo.sma.
>
> I don't get how that is accomplished.
> I have a Project
> jdk.smj
> in has jdk.sma
> I want to pull out the
> function makemenu(f)
> end function
> and put that into file
> menu.sma
> At some point a had it working but I don't remember what exactly I did.
> I fooled around with settings and include and with using line
> include "menu.sma"
If menu.sma is in the same dir as jdk.sma, ie projects\jdk\jdk, this should
work.
Otherwise you have to include the path to the file in your include statement
or add the dir containing the file to "project/settings/include and
libraries/include folders"
> My thinking here is that I'll have
> primary file with
> function main()
> end function
> and then a .sma files for the
> menus
> forms
> functions
> etc.
Good thinking. Some of it can be put into separate libs or modules eg
progress meters and other stuff that you might want to use in other
projects, and linked in the project settings dialog to include them in the
compiled smp. Modules/libs can also be left unlinked and loaded when the
program is running using !loadmodule() (at present it has a bug that
destroys any object variable content in the calling function).
"export" must
be present in the linked or loaded function's definition or it won't be seen
in the "parent" prog smp.
|
| Post Reply
|
| Re: probably self evident to every one but me |
 |
Sun, 14 Oct 2007 12:14:01 +080 |
"Kromkowski" <kromkowski@verizon.net> wrote in message
news:fens02$n2h$1@ipx22096.ipxserver.de...
> Can I get a step by step. I'm a dabbler.
>
> I open IDE
> File > New Project
> Let's say I call it "StepByStep" and it is in
> "C:\Simpol\"
> (by the way I'm an also having to change .smu to .sma, is there a setting
> for that)
It is easy to miss the obvious I guess. Have a look at tools/options in the
ide.
> So now I have the following:
> An empty StepByStep.sma In which I'll have
> function main()
> end function
>
> I want to create an .sma in which I'll write the menu/menus functions.
>
> WHAT DO I DO? I'm a dummy.
I gather you have enough intelligence, reading and comprehension skills to
qualify as a lawyer - somewhat smarter than a dummy. You have also stated
that you point out deficiencies in a "gadfly" manner that you
rationalise to
yourself by saying everyone needs this ie. stimulation by irritation. I
trust that this question is not posed in that manner as I would rather
devote time to more pleasurable pursuits not necessitating insect repellant.
In answer:
Left click the file menu and select "new" at the top of the menu
When the new file window appears
Left click the file menu and select "Save As"
Type in "menus" or the name of your choice for the file, select save
as
".sma"
In the Save dialog listbox there will be a "bin" and
"StepByStep" dir
Doubleclick the "StepByStep" dir so that your file will be saved in
that dir
click Save.
Bring the StepByStep.sma to the front and type at the top of the screen
before any other non-commented code.
include "menus.sma"
Similarly for any other .sma files you create
The included files should appear in the
Note that if any .sma files consisting of constant definitions are included,
they should have their include line at the top of the include list. ie
include "myconstants.sma"
include "menus.sma"
otherwise the compiler may find "myconstants.sma" after it has found
constants in your code hence causing a build error.
Save StepByStep.sma and the "menus.sma" should appear in the project
view
panel tree.
If you have an .sma file that you want to include in many projects for
whatever reason- create a dir and call it "includes" or whatever takes
your
fancy. Put your common file in that dir. Go to project/settings and the
"Includes and libraries" tab and click the "add" button to
the right of the
"include folders" text. Select your includes dir and click ok/ok.
add a line in your includes list in StepByStep.sma for that file as above.
Create a function for your menu in "menus.sma"
Hope that clears rather than muddying things, John
|
| Post Reply
|
| Re: probably self evident to every one but me |
 |
Mon, 15 Oct 2007 16:45:20 -040 |
Thank you for your response:
> Left click the file menu and select "new" at the top of the menu
> When the new file window appears
> Left click the file menu and select "Save As"
> Type in "menus" or the name of your choice for the file, select
save as
> ".sma"
This part I understood.
> In the Save dialog listbox there will be a "bin" and
"StepByStep" dir
> Doubleclick the "StepByStep" dir so that your file will be saved
in that dir
> click Save.
Above is what got me turned around, the part about what directory to put
the "secondary" .sma in. I must have stumbled by accident once in
putting it in the right directory and figuring out to put the inculde
line in. But I couldn't remember exactly how in future examples.
> Bring the StepByStep.sma to the front and type at the top of the screen
> before any other non-commented code.
> include "menus.sma"
This part I figured out mostly by intuition.
> Similarly for any other .sma files you create
> The included files should appear in the
> Note that if any .sma files consisting of constant definitions are
included,
> they should have their include line at the top of the include list. ie
> include "myconstants.sma"
> include "menus.sma"
> otherwise the compiler may find "myconstants.sma" after it has
found
> constants in your code hence causing a build error.
Above is a good tip, that might otherwise gone unnoticed.
> Save StepByStep.sma and the "menus.sma" should appear in the
project view
> panel tree.
As to this part, below:
> If you have an .sma file that you want to include in many projects for
> whatever reason- create a dir and call it "includes" or whatever
takes your
> fancy. Put your common file in that dir. Go to project/settings and the
> "Includes and libraries" tab and click the "add" button
to the right of the
> "include folders" text. Select your includes dir and click
ok/ok.
> add a line in your includes list in StepByStep.sma for that file as above.
When you do it this way, do you have to put the full directory in the
include statement?
E.g.
If I add C:\Simpol\Includes\ folders from settings.
Does my include line say
include "menus.sma"
or
include "C:\Simpol\Includes\menus.sma"
Alternatively, if I use the full directory name, do I still have to
"include folders" from settings?
> Create a function for your menu in "menus.sma"
> Hope that clears rather than muddying things, John
This was much appreciated.
|
| Post Reply
|
|
|
|
|
|
|
|
|
|