Scriptol - Frequently Asked Questions
Language
- Redeclaration - Each OO language must use local namespaces
- How to switch from code to PHP or C++
- Can I call the base class constructor in an inherited class?
Scriptol and PHP
- Can Scriptol compile my PHP scripts?
- Can I use Script as a conversion tool?
- PHP: Form variables not recognized
- Convert PHP to C++
- Using PHP Objects in Script
- How to use Script and MySQL?
- Compiling C++ code produces heaps of error messages
- My program cannot be compiled
- C++ case sensitive
- My program doesn't work
Scriptol interpreter
Expansions
Toolbox
Marketing and the future
- Will the Script compiler remain free?
- When will the .NET version be available?
- Is the Script compiler finished?
Can I call the base class constructor in an inherited class?
I inherit the Car class from the Vehicle class, for example. Can I call the Vehicle manufacturer from Car? I do it in Java.
Java has the keyword "super" to call the class constructor from an inherited class.
There is no equivalent in Scriptol. Calling the superclass constructor creates a new instance of the superclass.
But you can assign base class attributes in the constructor of the inherited class, which is tantamount to "super" Java .
A super instruction was added to Script 2 in 2014. This allows you to switch from parameters to the constructor of the inherited class.
C++ code is not compiled in my program
When I call solc, I get the following errors both when compiling and when editing links:
"Invalid command."
You need to check if the C++ compiler is available.
Enter:
bc32 or
gcc -v or
cl/?
If the version is displayed, the installation is correct, otherwise the program must be available, for this it must be added to the Windows PATH environment variable:
- Windows Menu
- Control panel
- System
- Extended tab
- Environment variables button.
Example with bc32:
PATH = %PATH%;c:\bcc55\bin\
Scriptol compiles in PHP or C++, but C++ produces a bunch of error messages.
I've been trying to make your Script compilers work for 2 days now, which I installed. I also downloaded BCC 5.5.
I can compile Script programs into .CPP or .PHP, but I can't make them work, even simple demos included in the archive.
It looks like they need a lot of libraries, header files and so on... for work. BCC generates a bunch of error messages, mainly because it does not find files included as math.h, iostream.h, which call other files that cannot be found.
I have a project to write, but I spend twice as much time with tools as if I did the work by hand!
I also spend twice as much time with external programs and libraries as on the Script compiler itself. It looks like the Borland compiler or PHP interpreter is not fully installed.
To find out if PHP is installed, simply type:
php -v
But for a C++ compiler, it's not that easy. There are two configuration files in the bcc55\bin folder - bc32.cfg and ilink32.cfg, which contain compiler paths and files to include. There is also win32.cfg at the root of bc55.
Can we use Script as a conversion tool?
If PHP coders could compile PHP, using the conversion tool would be really good. But otherwise, if for this you need to rewrite the script, or only change it, after the conversion.
Script currently compiles the source scriptol in PHP or C++. There is no need to rewrite anything. For already written PHP code, it must be included in the Script code.
But to compile PHP into binary, you need a specialized compiler, this exists.
C++ case sensitive
You say in the manual that C++ is not case sensitive, but my compiler makes the difference between "var" and "VAR," for example.
The C++ reference editor may or may not be available depending on the configuration. I use a mode that will always work, regardless of configuration, in both C++ and PHP, which is also sensitive or not depending on the case, so the sources are portable.
How to go from code, should to C++, or to PHP?
To include code in C++ or PHP, you must use ~~ tag to insert code that will be processed by the C++ compiler or PHP interpreter.
Strings starting with # are C++ directives. These are comments in PHP and they are ignored.
Thus, the code below includes a C++ file not used in PHP and conditional code ignore 'en C++, but recognized in PHP, which ignores the condition.
~~ #include "header.hpp" #if 0 echo "this is PHP code\n"; #endif ~~
But with Script 2, this is useless. The code of the target file can be included depending on the file extension:
include "forcpp.hpp" // inclus seulement dans le code C++ include "forphp.php" // inclus seulement dans le code PHP
My program doesn't work
I have a full installation, with an Apache server, but my Script PHP program shows an error. Here's the code:
<sol include("button.php"); ?>
When you get used to classical language, such problems are frequent. Indeed, "include" is the keyword in Scriptol, you should write:
require("button.php"); ou include_once("button.php").
Can the interpreter be used in CGI?
It's really possible.
Can OpenGL and Glue be used with Scriptol
?With the compiler in PHP, you need an extension to PHP.
With a compiler in C++, you can use OpenGL as with any C++ program.
You must add the library to solc.ini or create your own program configuration file.
Not yet built into the interpreter, but it will be possible because it is extensible .
Can Scriptol compile my PHP scripts?
Scripting can only compile Script sources to PHP or binary. PHP scripts can only be included in Script.
How to use PHP objects with Script?
I use a PHP object with 5 methods. If I put an object in VAR, the program works great, but a bunch of error messages are displayed.
You must declare an external PHP class, its attributes, and its methods. In addition, it would be advisable to do this with these functions. Example:
extern class xxxx int attribute void fun(int) .... return /class /extern
Then declare a PHP object and assign it with a zero if the class is not recognized by the PHP interpreter:
xxxx myobject = null
PHP: form variables are not recognized
When I compile an HTML page containing Script code, the HTML variables of the forms are ignored by the generated PHP code.
If you installed PHP before version 4.3 and then a later version without updating php.ini, you need to make changes. After PHP 4.2, the following flag must be set:
register_globals = On
What runtime files do I need to enable to distribute my application?
Here's what I think: a very good language, it can do .exe, it provides GUI capabilities... I can also produce nice applications with it.
But when I distribute it, what execution time is required?
For my type of work, it is unacceptable to tell the user: "You first need to install and configure PHP." So I'm not interested in SCC and .NET in the future.
If your program is bound only to static libraries (lib extension), only the executable file is required.
Unless you are compiling with Visual C++, which requires gcms.dll, but this will be removed soon.
On the other hand, dynamic libraries, in .dll or .so on Linux, must be enabled.
Use Visual Studio
Does scriptol work with Visual Studio?
The compiler can be added as an external tool.
Convert PHP to C++
I want to convert my PHP programs to binary. Since PHP syntax is close to C++ syntax, why use Script instead of directly converting sources?
Studying Scriptol is a matter of hours. But in order for a PHP program to become an executable binary, if you do not use a commercial PHP compiler (probably limited), you also need to convert PHP libraries, which is a matter of years (PHP was born in 1995 and continues to develop).
Script compiler will remain free
?Scriptol will remain free forever. The library is open source and available on GitHub. I'd rather sell Script T-shirts than make it paid;)
How do I convert a manual to PDF?
Simply upload the HTML file to FreeOffice and export it to PDF.
Is the Script compiler considered complete?
There are three levels in the programming language:
- Procedural language,
- object-oriented language,
- reactive programming.
And other opportunities that are being considered or developed.
The first two levels are complete.
The third is implemented in the JavaScript compiler.
When available
.NET version?There is no project for the .NET version of the language in the near future. The WebAssembly version will be launched as soon as wasm is released.
Moreover, everyone is free to make a version of the compiler for any platform.
Order parallel port with script
lapenduledent
webmaster
lapenduledent
webmaster
lapenduledent
Which runtime files must be enabled to distribute my application
?FAQ
Redeclaration - Each OO language must use namespaces
for(int i=0;i<5;i++) { } int i; while(i < 5) { // do something here }Each OO language implements local block-level namespaces
FAQ
Here are two examples of what Scriptol allows or not:
Example 1 (not allowed)
int i for x in a int i = 5 // mauvais print i * x /for
Example 2 (RESOLUTION)
int i for x in a int j = 5 print j * x /for for x in b int j = 50 print j * x /for
The scriptol does not allow reuse of the identifier for different things within the block. We can do that for consecutive blocks. It removes a source of bewilderment.
Do not be afraid of the lack of identifiers: with two letters or numbers, you can already create more than 1000.