The problem is, when i open a thinBasic-script it instantly is code.
ThinAir should "learn" to apply all those things that were just checkboxes Option Explicit or the bundle options a few dropdowns, even the list of included files and directories - adding to be done with a common dialog or remove clicking a button for that and the editor will write it somewhere as this
<?thinBasic version="1.2021.0.0" encoding="utf-8"?>
<project name="myProject" MinVersion="1.2021" >
<preparse>
<directives>
<directive="Option Explicit"/>
</directives>
<thinBundle>
<bundle file="file" source="..." destination="..." Option="Value" />
<bundle icon="..." />
<bundle type="GUI"/>
<bundle version="versioninfo" comment="comment" author="the Authorities etc."/>
</thinBundle>
<Uses>
<use module="UI" />
<use module="tokenizer" />
<use module="ini" />
</Uses>
<Includes>
<IncludeDir="….." />
<Include="file.tbasicI" once="True" delayed="False" />
</Includes>
<Resources>
<Resource file="myRes.rc" />
</Resources>
<Compilers>
<compiledRegions>
<regionsCount>3</regionsCount>
<compiled region="1" name="name of compiled region to name the dll after" _
file="name of scriptfile that contains the region" line="..." language="powerbasic"/>
<!-- scriptfile and line were if thinAir displays compiled sections as well as udts, subs and functions in separate codewindows to keep track on the position within the project -->
<compiled region="2" name="name of compiled region to name the dll after" _
file="name of scriptfile that contains
the region" line="..." language="freebasic"/>
<compiled region="3" name="name of compiled region to name the dll after" _
file="name of scriptfile that contains
the region" line="..." language="visualbasic6"/>
<!-- were also nice if the name of the compiled section could be used as _
a CallCompiled "region" to change the behaviour of a compiled function completely -->
</compilers>
</preparse>
<udts>
<type name="myUDT">
Type myUdt
x as whatever
' here a type definition including all its methoods & properties -complete all the code until:
End Type
</type>
<union name ="someUnion">
union someUnion
' also to be displayed on a separated page in the editor
RGBA(4) as Byte
lColor As Long
end union
<union>
<declarations>
' here: a section on displayed top within the editor but actually placed to be very last of all
.
' declarations section will contain all global dimensioned and declared stuff, equates and
' actually anything must be written into a declarations section. depending on the first keyword
'of the line the enter-key will transfer the line to be another section of code, that might be
' keywords as "Type" or "Callback" or "Compiled", "Begin", "Function" or "Sub"-
' typed into declarations section will open a new codewindow/jump there in full view or
' display every region as a separate page. if typing one of those keywords in other sections than
' within declarations means either the function or sub belongs to the type above or are part of
' the compiled region. As a Sub within another sub is impossible thinAir could bug the user...
' so here is some code that is outside any functions, type-definitions and compiled-regions.
' This should be collected in older scripts to be placed at the very end of the script
' that thincore will get to execute.
</declarations>
<entry point="TBMain>
Function TBMain()
'...
' to be displaed on top of the code, right after declarations, actually the last function so thincore
' has to go over all the code before it gets here.
End Function
' HERE WILL NEVER ANYTHING EXIST - the line above is the last of the project
</entry>
<script name="file.tbasicI" >
<!-- a placeholder actually that thinAir knows where the include is to position in view -->
</script>
<script name="myProjectmainscriptfile.tBasic">
' this is actually the main scripts program code that were in front of the declarations on execution
' all here must be inside of a function or sub so its likely to offer the view "by function" also
</script>
<final>
' its also an idea to provide a section of things to do when the program ends which is just a reminder only...
</final>
</project>
a little bit of structure... already ordered by the editor and a few rules to follow - actually is forcing the user to provide code in a certain order would certainly make it easier to exclude some error-sources.
Users can not handle too much freedom. They need limitations to break them down
Bookmarks