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
is there an app that I can use to view an xos file as text? bluefish and notepad are unable to open the file as text.
Last edited by hebdemnobad (21-Oct-2014 20:19:02)
Offline
Offline
A .xos file is a text file, any text editor must open them.
Maybe this software doesn't automatically open these files but manuelly, it does.
Thx Iri...
is there some setting I have to change in bluefish?
Offline
Offline
In the last version I changed a bit the xos format, so it can be zipped.
use XMLload and then XMLwrite
it will load the zipped file and write it in clear text
Offline
In the last version I changed a bit the xos format, so it can be zipped.
use XMLload and then XMLwrite
it will load the zipped file and write it in clear text
.....I assume the filereader.pkg that loads the .xos must load xmlparser.pkg. does filereader.pkg (and filrereader.scol which calls the 'main' function in filereader.pkg) have to be in the C:\Program Files (x86)\Scol Voyager\Partition_LockedApp\tools folder?
Last edited by hebdemnobad (19-Oct-2014 15:11:16)
Offline
if you copy the player the xmlparser.pkg is already loaded.
no directory of the pkg file does not matter
So my filereader.pkg in my openspce3d partition can load a .pkg in \tools\whatever subdirectory?
Last edited by hebdemnobad (19-Oct-2014 17:08:03)
Offline
thanks for the replies guys, I'm hiking up a this afternoon, I will post when I get home...
my Android doesn't allow me to dictate scol terms into the microphone
Offline
there was snow up there!
Last edited by hebdemnobad (19-Oct-2014 23:00:06)
Offline
this is what I have gotten to...I think I got the loop through the list of the dependencies right, but the vm doesn't recognize XMLload:
fun secureLoad(pack)=
let _testpak pack -> ret in
if (ret == nil) then
(
_fooS "xmlparser loading";
_load pack;
1;
)
else
(
_fooS strcat "Error in " ret;
0;
);;
fun load_dependencies() =
let "tests/filereader/tools.pkg"::"tests/filereader/xmlparser.pkg"::nil -> list_of_dependencies in
(
while (list_of_dependencies!= nil)&& (secureLoad hd list_of_dependencies) do
(
set list_of_dependencies = tl list_of_dependencies;
_fooS "dependencies loading";
);
//all dependencies have been read
if list_of_dependencies==nil then
(
let XMLload "tests/filereader/hybridgui.xos" -> xml_file in
(
XMLwrite xml_file "tests/filereader/hybridgui.xml";
);
0;
)
else
(
_fooS "error in dependency loading";
0;
);
);
0;;
fun main ()=
_showconsole;
load_dependencies;
0;;
the code breaks at "XMLload" as unknown...ps how do I make my code more readable in my posts...chrome always messses with the indentation.
Last edited by hebdemnobad (19-Oct-2014 23:19:40)
Offline
lol where did you go to have snow ?
Indian Head Mountain, NY US
Offline
tests/filereader/xmlparser.pkg is the correct path ?
you can load it directly from oS3Dlib directory
I'll try that. Thx.
Offline
I changed
let "tests/filereader/tools.pkg"::"tests/filereader/xmlparser.pkg"::nil -> list_of_dependencies in
to
let "tools/os3dlib/tools.pkg"::"tools/os3dlib/xmlparser.pkg"::nil -> list_of_dependencies in
still get the same error
Offline
ho ok
when your pkg file compile, at this time it don't know xmlLoad functions since the files are not loaded yet
two solutions :
- you add a pkg file with one predeclared function "mainPlayer" for example using proto and start your player code here
- you predeclare all the unknown function xmlParser ... using proto
proto XMLload = fun [S] XMLfile;;
proto XMLwrite = fun [XMLfile S] I;;
Offline
yes that works. thx arkon!!!
...I don't understand though how the proto declaration makes the vm execute XMLload when XMLload is defined in xmlparser.pkg. I've read (and reread) the scol tutorial .pdf and the online docs on scolring, but there I still don't understand the meaning of it.
Either something lost in translation from French to English or something is lost on me since I don't have a degree in computer science.
...and doesn't the vm execute:
while (list_of_dependencies!= nil)&& (secureLoad hd list_of_dependencies) do
(
set list_of_dependencies = tl list_of_dependencies;
_fooS "dependencies loading";
);
before proceeding to execute:
//all dependencies have been read
if list_of_dependencies==nil then
Last edited by hebdemnobad (20-Oct-2014 00:39:09)
Offline
pkg files are compiled on the fly.
so when a pkg is compiled only functions and variables in pkg loaded before are known.
in your case you use the _load function that load a new file in runtime, so only pkg loaded after will know this functions.
The prototype declaration allow to pre-declare this functions so compiler know the function name and prototype before it exist, and you can call it.
if the function is pre-declared but not loaded you should run into an "empty prototype" error when you call it.
Offline
pkg files are compiled on the fly.
so when a pkg is compiled only functions and variables in pkg loaded before are known.in your case you use the _load function that load a new file in runtime, so only pkg loaded after will know this functions.
The prototype declaration allow to pre-declare this functions so compiler know the function name and prototype before it exist, and you can call it.if the function is pre-declared but not loaded you should run into an "empty prototype" error when you call it.
So if I load
Tools.pkg::xmlparser.pkg::filereader.pkg::nil
In loader.pkg
And then call somefunction defined in filereader.pkg in a line of code in the loader.pkg that will work without proto declaration in loader. pkg.
Offline
no you will need to pre declare the function of filereader.pkg to be able to call it, but you will have only one function to declare not all of them
Offline
no you will need to pre declare the function of filereader.pkg to be able to call it, but you will have only one function to declare not all of them
I see, so for any .pkg, let's say player.pkg, if there is a function called in player.pkg that is defined in some other .pkg, such as tools.pkg, xmlparser.pkg, supernewsoftware.pkg, the proto statements for functions loaded in tools and xmlparser must have proto statements. Is that correct?
I must be not correct since in os3dplayer.pkg there is the function InitOs3dPlayer(file, projname, pw ,ph, fullscreen)...while there is a proto declaration in os3dload.pkg for InitOs3dPlayer(), there is no proto declaration for InitOs3dPlayer() in os3dplayer.pkg, even though InitOs3dPlayer is not defined in os3dplayer.pkg.
It works a bit different in javascript as I recall (save for an art festival in 2013 I haven't used it much since 2007.) ...I think if you name second.js as a source for javascript in a web page that holds javascript code (hostpage.htm) , you can just call the method as defined in second.js in inline javascript code in hostpage.htm without any proto declarations.
Offline
pkg files are compiled on the fly.
so when a pkg is compiled only functions and variables in pkg loaded before are known.in your case you use the _load function that load a new file in runtime, so only pkg loaded after will know this functions.
The prototype declaration allow to pre-declare this functions so compiler know the function name and prototype before it exist, and you can call it.if the function is pre-declared but not loaded you should run into an "empty prototype" error when you call it.
wait I think I understand now.....no need to answer my question unless I run into more problems and then I'll ask after troubleshooting.
anyway here is the whole.pkg that reads a hard coded .xos file and writes it to an .xml file.
I'm thinking of creating a file format for my modded player to use that will be reading and writing xml files (very simple ones, that contain one 3d object, up to three lights, a few environment variables (ambient color, diffuse color, etc.) that will integrate the drag and drop functionality of the editor in the player for other 3d file formats. (that's in the future, although I have a bit of learning to do before that.)
thx arkeon!
proto XMLload = fun [S] XMLfile;;
proto XMLwrite = fun [XMLfile S] I;;
fun secureLoad(pack)=
let _testpak pack -> ret in
if (ret == nil) then
(
_fooS "xmlparser loading";
_load pack;
1;
)
else
(
_fooS strcat "Error in " ret;
0;
);;
fun load_dependencies() =
let "tools/os3dlib/tools.pkg"::"tools/os3dlib/xmlparser.pkg"::nil -> list_of_dependencies in
(
while (list_of_dependencies!= nil)&& (secureLoad hd list_of_dependencies) do
(
set list_of_dependencies = tl list_of_dependencies;
_fooS "dependencies loading";
);
//all dependencies have been read
if list_of_dependencies==nil then
(
//read hybridgui.xos and write to hybridgui.xml in openspace3d/tests/filreader
let XMLload "tests/filereader/hybridgui.xos" -> xml_file in
(
XMLwrite xml_file "tests/filereader/hybridgui.xml";
);
0;
)
else
(
_fooS "error in dependency loading";
0;
);
);
0;;
fun main ()=
_showconsole;
load_dependencies;
0;;
Last edited by hebdemnobad (20-Oct-2014 14:54:42)
Offline
Pages: 1