Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
Pages: 1
Hello! Could someone please provide some examples of how to use addsourcecode plugit?
In a form of OpenSpace3D project file.
I try to make it print Hello World from Scol manual when attached to a button click but nothing happens..(
My programming background is HiAsm and MQL4, PHP, JavaScript.
Offline
Something like this (played a lot changing format - no result):
fun printHello (string)=
_fooS strcat "Hello " string
;;
fun test ()=
_showconsole;
printHello "Scol Community !";
0;;
And setting "test" as name of main function.
And a logic / links like this:
My programming background is HiAsm and MQL4, PHP, JavaScript.
Offline
Plugit log window gives this when I click button to run code:
> Event : Scene.Button inst.LeftClick with param : NIL
> Action : Scene.addsourcecode inst.Run with param : NIL and reply param : NIL
And pop up this window with some errors:
https://www.screencast.com/t/0eBFgpa8k10
If I close it editor crashes.
Last edited by Coder108 (6-Sep-2019 11:44:35)
My programming background is HiAsm and MQL4, PHP, JavaScript.
Offline
sample : http://www.arkeon.be/scol/os3d/addsourcecode.xos
you need to add a plugit to run the code and set the main function name in the plugit
Offline
Thank you arkeon, but when I load your code nothing happens. How can I practically use this addsource plugit? I thought it would let me develop my own plugits from scratch and editable it OS3D editor.
Could you give me some simple example with a button triggering a messagebox from addsoursecode plugit?
Last edited by Coder108 (6-Sep-2019 11:52:23)
My programming background is HiAsm and MQL4, PHP, JavaScript.
Offline
just resize the log view of the OS3D interface
https://www.openspace3d.com/documentati … rface.html (6)
you will see the hello world in the OS3D console
Offline
addsoursecode is not intended to make plugITs, just to use some scol code in your project or learn.
you can also make some code in links parameters with [code ] [/ code]
if you want to make your own plugit start here : https://redmine.scolring.org/projects/s … ate_plugIT
and here https://redmine.scolring.org/projects/o … dules.html
also open existing simple plugits code to learn
Offline
Already did it. Here's all that is in my log:
> Init default scene.
> Init default scene.
> Loading OpenSpace3D scene file : examples/addsourcecode.xos
> Number of plugIT instances in project: 2
> Number of links in project: 1
> examples/addsourcecode.xos loaded.
No hello..
Last edited by Coder108 (6-Sep-2019 12:05:54)
My programming background is HiAsm and MQL4, PHP, JavaScript.
Offline
addsoursecode is not intended to make plugITs, just to use some scol code in your project or learn.
you can also make some code in links parameters with
if you want to make your own plugit start here : https://redmine.scolring.org/projects/s … ate_plugIT
and here https://redmine.scolring.org/projects/o … dules.htmlalso open existing simple plugits code to learn
I see, thank you..
My programming background is HiAsm and MQL4, PHP, JavaScript.
Offline
did you hit the play button ?
try to redownload it in case I forgot to hit save before upload ^^
what I have
> Init default scene.
> Loading OpenSpace3D scene file : examples/addsourcecode.xos
> Number of plugIT instances in project: 2
> Number of links in project: 1
> examples/addsourcecode.xos loaded.
> Hello Scol Community !
Offline
You are righ, my fault( I hit play and "> Hello Scol Community !" appeared. Thank you.
My programming background is HiAsm and MQL4, PHP, JavaScript.
Offline
So it seems not every Scol code can be run in this plugit. Your code:
fun printHello (string)=
//addLogMessage show messages in OS3D logs window
addLogMessage strcat "Hello " string
;;
fun testMainfunction ()=
printHello "Scol Community !";
0;;
My (wrong) code copy-pasted from manual:
fun printHello (string)=
_fooS strcat "Hello " string
;;
fun test ()=
_showconsole;
printHello "Scol Community !";
0;;
My programming background is HiAsm and MQL4, PHP, JavaScript.
Offline
Also I've found that main function should be placed at the very end of plugit editor. Otherwise it does not trigger function.
My programming background is HiAsm and MQL4, PHP, JavaScript.
Offline
yes scol compile the code in order, so a function must exist before another call it. so the order in file is important but you can use proto myfun = [paramtypes] return type;;
to declare a function so it can be anywhere after in code
Offline
Thank you! I have to explore it more.
My programming background is HiAsm and MQL4, PHP, JavaScript.
Offline
Pages: 1