PDA

View Full Version : Set static enviroment paths



David
03-10-2013, 20:43
Hi all,

NeoBook plugin works fine and i found the way to solve end execution error message.

I don't know if NeoBook users had installed all thinBasic distribution

Each time i do a NEW NeoBook project and write into a NEW .tbasic file some like


uses "File" or uses "Console", etc,

I need include the "bin" and "inc" folders, with the program package.

From the Help file:


USES will search for the requested module following below path sequence:



1. Source script path

2. Source script path + Lib

3. Source script path + Bin

4. Source script path + Mod

5. Source script path + Lib + "thinBasic_" + ModuleName

6. Source script path + Bin + "thinBasic_" + ModuleName

7. Source script path + Mod + "thinBasic_" + ModuleName

11. thinBasic path

12. thinBasic path + Lib

13. thinBasic path + Bin

14. thinBasic path + Mod

15. thinBasic path + Lib + "thinBasic_" + ModuleName

16. thinBasic path + Bin + "thinBasic_" + ModuleName

17. thinBasic path + Mod + "thinBasic_" + ModuleName


Ok, but the thinBasic path is not setted (on my system).

Does the thinCore.dll search for an specifc path or are there any way to set the "thinBasic path" value ? (via ini file, registry, etc )

If it will be possible, each time I (or we) create a new program, don't need include the "bin" and "inc" folders, and load needed data from the setted folders.

Thanks in advance,
David

ErosOlmi
03-10-2013, 20:52
Dear David,

there is no need to set any INI or registry option.

Just pass 1 or 2 in 5th parameter of thinBasic_RUN. thinCore.dll will use your executable path as base path.


'---Run the program
thinBasic_RUN( _
0& , _ 'Will be used in future release
sEmbedded_Script_Main , _ 'File name or string Buffer
1& , _ '0 = previous string is a File Name, 1 = previous string is a string Buffer
1 Or 2 , _ '1=use EXE path, 2=avoid PostQuitMessage in case of RTE '<<<<<<<<<<<<<<<<<<<!!!!!!
%FALSE , _ 'Debug Mode %TRUE/%FALSE
%FALSE , _ 'Log Mode %TRUE/%FALSE
%FALSE , _ 'Obfuscate Mode %TRUE/%FALSE
0& , _ 'Calling Program 1=thinBasic, 2=Console
%FALSE _ 'Dependancy Mode %TRUE/%FALSE
) To lRet


Ciao
Eros

David
03-10-2013, 21:10
Thanks Eros,

Perhaps i don't explain well my question.

In this sample:

https://app.box.com/s/pj2vd8jy8aax6hyiy1e7

I need add the "lib" and "inc" folders because i don't know if you, as user, has installed thinBasic.

If i could check if this folders exists in any place, or set it before instalation of the program, i could refer this folders as paths for the USES command. and the next program i upload, or send to user, I know were are this folders and refer them directly.

Is pretty confusing ?

Thanks in advance again,
David

ErosOlmi
03-10-2013, 21:30
Yes I got it from the first post.
But I supposed you release what your need with your application.

To be able to function as embedded scripting language thinBasic just need thinCore.dll, nothing else.
So thinBasic as embedded scripting language is not dependent from thinBasic as stand alone application.
And it must be that way because you would fall into a nightmare!
Never mix or depend from anything else than the DLL you release with your app.

You added

USES "File"
command in order to use thinBasic_File.dll module functionalities.
Just release your application with <your app folder>\Lib\ directory and place in there the thinBasic modules you want release with your app.

In the example you provided, you can avoid to add "File" module if you only need loading and saving files. thinCore.dll has 2 native file functions for loading and saving files:


texto = Load_File(infile)
Save_File(outfile, Texto)


Ciao
Eros

ErosOlmi
03-10-2013, 22:49
David,

I tested your "mail image strip" example.
Seems working fine and quick. thinBasic is very fast in string handling.

Ciao
Eros