PDA

View Full Version : How to use Resed together with thinBasic and Freebasic-Compiler?



ReneMiner
10-04-2020, 09:48
Hi Guys,
I am a bit Stuck on this i try to find out what These Tools can do for me. I want to create a functional Type or Claas that will allocate some memory. I know how to create the Type in thinBasic but i never used any classes and i did Not find out how to make one in thinBasic. So i am with an Udt that has Functions, a few Statics and a bunch of Variables to it. Lets say thats my udt:


Uses "UI", "Ini"

Type tDatamgr
Static pTypes As Dword
Static pNames As Dword
pRecentData(20) as Dword
pCurrentData As Dword
'....i omit a Lot now since Not required die the questions i have.but also have Not only 1 function
Function allocateFor(byref pMem AS Dword, byval sType AS String) AS String
'. . .
End Type

At First: can i Convert the udt to become a class that is accesible after i compiled the Project? Or can Types including Functions be in a compiled dll with Freebasic-Compiler?
Also i use this ResEd to create some Dialog. No Problem to create any Windows or menus and IT can save IT in a way that i can Transfer the Data easily into my Scripts.
I Hope this Link Works as expected, IT should lead to Ketil Olsens ResEd. A pretty good GUI-editor that produces Things that i can use in thinBasic.

http://masm32.com/board/index.php?topic=239.0


Now i want to add a Windows with some controls that Shows Up only while i am editing in thinair but Not If a Script was started by thinAir-code-editor. But IT IS ok to Show the Window when a Script as a Tool from thinair runs.is IT possible to detect If a Script rund that was started by Debugger/Editor (F5 or F8 ) so i can avoid my Tool to Show Up If the User Tests a Script?

And can Freebasic-Compiler do anything for me with that ResEd (IT has settings in Options to enter command$ to compile ) but i never got IT to Work. All i make use of is the GUI-editor and i Transfer the saved Data into my Scripts - even i know it should Work to let thinBasic load this Ressource Files during Runtime.
Can this resed + Freebasic-Compiler Go together and make my Script a dll? And how about my udt? If it we're still the udt with Functions, can IT be that a dll Provides a Type that can be extended in User-Scripts? Or am i Stuck with a class that is Not Able to get extended? The finished library shall be useable from thinBasic only,vso No need to think of using it from any other language . If Not possible to have an Udt with Functions compiled How would i write it using thinBasic only that my udt will get compiled to be a class

I know thats a bunch of questions. But i am stuck currently because of the Problem that i don't know how

Petr Schreiber
10-04-2020, 10:27
Hi Rene,

#1
ThinBASIC TYPE with functions has memory representation identical to the TYPE without functions, just the data. The information about functions is stored elsewhere.

The only cross-language compatible type of class I know is COM class. Otherwise, C++ has its own classes, Python has its own classes and so on.

Unlike TYPE & structs, which are mostly transferable, classes are different beasts. Besides that, thinBASIC has no way to create classes from thinBASIC code.

#2
I think you can adjust the commandline of the tool launching in a way it sets environment variable.

If environment variable is set, you can make the tool behave differently.

You can read environment variables using OS_Environ.


Petr