ReneMiner
25-12-2021, 16:22
I wonder if it were possible to use thinBasic-keywords - that are no functions nor operators itself - directly as function parameter.
I know the keywords have some token-codes but i don't know how to use it and it were probably some additional code-word for the function-headers necessary and would make it easier to understand.
I am talkin about keywords that are of the modifier-type and will not fire any actions because these are used in conjunction with another keyword as for example
ICON
BITMAP
BUTTON
ASCEND
TREEVIEW
SCAN
DIALOG
IMAGELIST
TEXTBOX
PICTURE
OBJECT
USER
SEND
CLIENT
HANDLE
SUM
UNIQUE
FiLE
etc.
to name a few.
there is two ways that i think of, lets take the most common thought first:
I will let the user create a control within an udt that wraps maybe a dialog in a way as
myDialog.AddControl <control-type>, "controlName","some text", 0, 0, 100, 100...
right now that works only with non-thinbasic-controltypes when the classname is passed as string and creating 40 different named functions that do the same or substituting it with equates theirs datapointers are used to differ if a string -expression was passed is also dividing it into 2 branches - the byval and the byref-way
- its all no satisfying solution.
Now i think of a new keyword that were a 3rd way. Imagine i will programatically load all imagefiles from a directory to an imagelist that meet the users needs. He will pass size, bitdepth and those keywords how to apply as Image/Bitmap/Icon/Masked and the folder where to search icons or images and to fill these into imagellists
Type tsomeImagelistwrapper
'...
Function GetFromDir( Byval sPath as String,
ByToken toApply as Symbol,
byval lWidth as Long,...
'...
so this variable: toApply would receive the token-code of the passed keyword (Icon|Bitmap|Mask)
just as a local short-time-ALIAS - so i could call the Imagelist_Add - function and pass the Alias-variable as for what to apply the image or in case
of creating controls or when passing modifiers how to scan or sort it were so easy if the user could just pass Ascend or Descend as sorting parameters
that we can directly use to call Array Sort or to create a desired control
ByToken varname As Symbol
or
BySym varname As thinBasicToken
Alias varname As Symbol
BySym varname As Alias...
I know the keywords have some token-codes but i don't know how to use it and it were probably some additional code-word for the function-headers necessary and would make it easier to understand.
I am talkin about keywords that are of the modifier-type and will not fire any actions because these are used in conjunction with another keyword as for example
ICON
BITMAP
BUTTON
ASCEND
TREEVIEW
SCAN
DIALOG
IMAGELIST
TEXTBOX
PICTURE
OBJECT
USER
SEND
CLIENT
HANDLE
SUM
UNIQUE
FiLE
etc.
to name a few.
there is two ways that i think of, lets take the most common thought first:
I will let the user create a control within an udt that wraps maybe a dialog in a way as
myDialog.AddControl <control-type>, "controlName","some text", 0, 0, 100, 100...
right now that works only with non-thinbasic-controltypes when the classname is passed as string and creating 40 different named functions that do the same or substituting it with equates theirs datapointers are used to differ if a string -expression was passed is also dividing it into 2 branches - the byval and the byref-way
- its all no satisfying solution.
Now i think of a new keyword that were a 3rd way. Imagine i will programatically load all imagefiles from a directory to an imagelist that meet the users needs. He will pass size, bitdepth and those keywords how to apply as Image/Bitmap/Icon/Masked and the folder where to search icons or images and to fill these into imagellists
Type tsomeImagelistwrapper
'...
Function GetFromDir( Byval sPath as String,
ByToken toApply as Symbol,
byval lWidth as Long,...
'...
so this variable: toApply would receive the token-code of the passed keyword (Icon|Bitmap|Mask)
just as a local short-time-ALIAS - so i could call the Imagelist_Add - function and pass the Alias-variable as for what to apply the image or in case
of creating controls or when passing modifiers how to scan or sort it were so easy if the user could just pass Ascend or Descend as sorting parameters
that we can directly use to call Array Sort or to create a desired control
ByToken varname As Symbol
or
BySym varname As thinBasicToken
Alias varname As Symbol
BySym varname As Alias...