Scolring - Forum

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.

#1 2-Nov-2011 18:50:17

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,535
Website

Hello World not displaying in console

colleagues:

i wrote the following text in a .scol file

_showconsole
_fooS ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>Hello world !"

I placed the file in theDocuments and Settings\ADMIN\My Documents\Scol Voyager\Partition_LocalUsr\scol_programs folder. When I run the script, I see a sequence of functions listed by no "hello world":

screenshot

Am I missing something?

Offline

#2 2-Nov-2011 18:59:24

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Hello World not displaying in console

You must set the log mask in the Scol configuration panel (right click on scol icon and select Configure).
You can set it to "FOO" (or more)

I add this in the FAQ

Offline

#3 2-Nov-2011 19:45:06

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,535
Website

Re: Hello World not displaying in console

thx, now i see the whole list of text lines, and then "hello  world" at the bottom...is this what i should be seeing?

Offline

#4 2-Nov-2011 19:51:14

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Hello World not displaying in console

Yes, that's all. A very simple Hello World to begin smile

Offline

#5 2-Nov-2011 20:00:39

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,535
Website

Re: Hello World not displaying in console

thanks iri....now that i think about it i'll play more with openspace so i thoroughly understand the existing plugin system, most importantly the logic and math plugits.
-h

Offline

#6 2-Nov-2011 20:09:20

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Hello World not displaying in console

Yes, you can begin with the structure of plugIts or with the language, two will be required.
Have fun !

Offline

#7 10-Nov-2011 16:57:27

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,535
Website

Re: Hello World not displaying in console

With this text in a .scol file (at the root of the Partition_LocalUsr directory), the console appears:

_showconsole
_fooS “>>>>>>>>>>>> Hello World and Bonjour”

Then I created a folder named Tutorial in the root of the Partition_LocalUsr directory.

Then I created hello1.scol, which contains the code:

_load “Tutorial/hello1.pkg”

main

and hello1.pkg, which contains the code:

fun main()=
_showconsole;
_fooS “>>>>>>>>>>>> Hello World”;;

but no console window appears. here is where I presume the error appears in the .log file:

WRITE_OK
(!) Illegal character '\ffffffef'
(!) Line #1:
??_load “Tutorial/hello1.pkg”
(!) Function call was skipped since it could not be resolved
(!) Function 'main' is not defined in channel environment
(!) Line #3:
??main
(!) Function call was skipped since it could not be resolved
READ 1140
>CHK BUF:
1: 0
6: 0
>SCread 7

I assume I'm missing something, but I don't know where.

Thanks!
-h

Last edited by hebdemnobad (10-Nov-2011 18:21:18)

Offline

#8 10-Nov-2011 17:10:08

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Hello World not displaying in console

There is a bad encoding from your text editor.
What is your text editor ? (to write this script) Notepad ++ ?

Offline

#9 10-Nov-2011 17:12:16

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,157
Website

Re: Hello World not displaying in console

Make sure that your pkg files are in ascii and not UTF8

Offline

#10 10-Nov-2011 17:12:34

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,535
Website

Re: Hello World not displaying in console

i cut and pasted the code from this thread into bluefish and saved out the .sol and .pkg files from bluefish, still no success.

Offline

#11 10-Nov-2011 17:14:15

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Hello World not displaying in console

Look at the Preferences to change the default encoding

Offline

#12 10-Nov-2011 17:20:00

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,535
Website

Re: Hello World not displaying in console

arkeon wrote:

Make sure that your pkg files are in ascii and not UTF8

I can't figure out how to do that with windows notepad, bluefish, or dreamweaver (i thought i'd try that too.)

Offline

#13 10-Nov-2011 17:22:21

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,535
Website

Re: Hello World not displaying in console

iri wrote:

Look at the Preferences to change the default encoding

I can't find that option in the preferences dialog in bluefish.

Offline

#14 10-Nov-2011 18:10:49

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Hello World not displaying in console

  • With Notepad++ :

    Menu Settings >> Preferences
    In the dialog box, go to tab "New document / Default directory"
    Set "Format" = Windows
    Set "Encoding" = Ansi
    Clicks on Close button.

  • With Bluefish :
    Menu Edit >> Preferences
    In the dialog box, select Files (in the list, at left)
    In "Encoding" (at right), choose Windows-1251 instead of "UTF-8"

I hope it works

Offline

#15 10-Nov-2011 18:17:57

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Hello World not displaying in console

You should reimport the script in the new file. The old could stay in UTF-8 format ...

Offline

#16 10-Nov-2011 18:25:46

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,535
Website

Re: Hello World not displaying in console

iri wrote:
  • With Notepad++ :

    Menu Settings >> Preferences
    In the dialog box, go to tab "New document / Default directory"
    Set "Format" = Windows
    Set "Encoding" = Ansi
    Clicks on Close button.

  • With Bluefish :
    Menu Edit >> Preferences
    In the dialog box, select Files (in the list, at left)
    In "Encoding" (at right), choose Windows-1251 instead of "UTF-8"

I hope it works

i followed your directions (thanks!) and just pasted in the text from this thread into both notepad++ and bluefish. the voyager still flags the same error. sad

Offline

#17 10-Nov-2011 19:58:35

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Hello World not displaying in console

Oh, i didn't see your quote !! Sorry

“ and ” are incorrects
you must use " " only

Try this :

_load "Tutorial/hello1.pkg"
main

and

fun main()=
    _showconsole;
    _fooS ">>>>>>>>>>>> Hello World";

It works fine smile

Offline

#18 10-Nov-2011 20:09:19

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,535
Website

Re: Hello World not displaying in console

aha! that's what i get for trying my french!  now there is an error a bit more serious, but nothing on my end (i think):

> exec: _connected

WRITE_OK

> exec: _load "Tutorial/hello1.pkg"

F:/Partition_LocalUsr/ - Tutorial/hello1.pkg - F:\Partition_LocalUsr\tutorial\hello1.pkg

Loading F:\Partition_LocalUsr\tutorial\hello1.pkg ...
typechecking
line 458 in ..\..\..\vm\kernel5\src\compiler\typmag2.cpp
File : F:\Partition_LocalUsr\tutorial\hello1.pkg
(!) Line #3:
    _fooS ">>>>>>>>>>>> Hello World";

syntax error
Dead Scol Machine -2 (0)
syntax error
EndScolMachine -1
delete servers
SCKend-
flagactiveX=0

Offline

#19 10-Nov-2011 20:15:59

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Hello World not displaying in console

Yes, i make a mistake ... I missed the double semicolon at the end of the function when i stupidely copied it

fun main()=
    _showconsole;
    _fooS ">>>>>>>>>>>> Hello World";;

Offline

#20 10-Nov-2011 20:19:55

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,535
Website

Re: Hello World not displaying in console

iri wrote:

Yes, i make a mistake ... I missed the double semicolon at the end of the function when i stupidely copied it

fun main()=
    _showconsole;
    _fooS ">>>>>>>>>>>> Hello World";;

yay, it works!

a question on scol and ogre....to manipulate the parts of ogre and newton that the existing os3d plugits access, all i need to know is scol.

but to access stuff like hydrax or skyx that is not yet implemented with plugits (or partially), i need to program the connection between the scol voyager and ogre/newton with c++...did i get that right?

Last edited by hebdemnobad (10-Nov-2011 20:20:29)

Offline

#21 10-Nov-2011 22:23:58

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Hello World not displaying in console

Yes, you should define the Scol api functions and then, load them by the SO3Engine plugin. It is quite complicated ...

A remark : smile
The Scol voyager is a graphical interface : the Scol icon in your taskbar, the contextual menu, the configuration panel, ...
The Scol engine is the primary (mother if you want) virtual machine. The Scol voyager is a "wrapper" of the Scol engine.
Scol is an interpreted language. When you launch an application (your HelloWorld or Openspace3d), packages written in Scol are loaded and ran in a new Scol virtual machine linked at the Scol engine.

A package is a *.pkg file. It contains a source code written in Scol. Your HelloWorld contains one package. Openspace3d contains a lot of packages. The principle is the same.

Offline

#22 10-Nov-2011 22:35:16

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,535
Website

Re: Hello World not displaying in console

thx for that iri

Offline

Board footer

Powered by FluxBB