PDA

View Full Version : question about EM_FINDTEXT or SETTEXTEX



stapper
12-08-2011, 16:35
Hi,

Are the structures defined is thinBasic or is there another way ?

Regards

Patrick

Petr Schreiber
12-08-2011, 17:58
Hi Patrick,

the equates (constants) in ThinBASIC are usually prefixed by %.

So EM_FINDTEXT is available as %EM_FINDTEXT. The module which defines this equate is UI, so you need to make sure you use that module first:


Uses "UI"

MsgBox(0, %EM_FINDTEXT)


ThinBASIC pre-defines the most commonly used equates, but not all from the Win32.
Good news is that you can define them yourself, and then use.

So for example the %EM_SETTEXTEX is not defined, but you can make it usable this way:


%EM_SETTEXTEX = %WM_USER + 97


One last thing - if you wish some new functionality in UI or other module, please head to the Support (http://www.thinbasic.com/community/project.php) section, click on thinBasic (http://www.thinbasic.com/community/project.php?projectid=1) and then in the "Post new issue" combobox select feature. Simple form will appear, and you can submit suggestion for enhancing the language (for example "I would like to see %EM_SETTEXTEX predefined in UI module" ). This way it is easy to follow for the developers.


Petr

stapper
12-08-2011, 19:35
Thanks for the info Pter,

1 last question for the moment.
Can i find somewhere wich equates and structures are included in thinbasic.
I tried to look up %EM_FINDTEXT in the help file but its there.

Regards Patrick

Petr Schreiber
12-08-2011, 19:52
Hi Patrick!,

to get complete list of equates in thinBasic, please go to:
..\thinBasic\SampleScripts\General\Keywords\

and then click on Equates.tBasic located there.

It will run for a moment, and then it will output file Equates.inc. You can open it in Notepad and you will see alphabetical list of all equates defined.

If you want just that ones for UI, you can run this script I just prepaired for you:


Uses "UI", "FILE"

#MINVERSION 1.8.8.0

String outputFile = APP_SourcePath+"Equates_And_UDTs_in_UI_and_FILE_module.txt"
String outputData = "EQUATES"+$CRLF+Repeat$(80, "=")+$CRLF+APP_ListEquates($CRLF)+
"TYPEs (structures)"+$CRLF+Repeat$(80, "=")+$CRLF+APP_ListUDTs($CRLF)

FILE_Save(outputFile, outputData)


Note: The structures (in thinBasic called UDT aka User Defined Types) are documented in detail in help file at:
thinBasic Modules > UI (User Interface) >UDT predefined in UI module


Petr

stapper
12-08-2011, 20:07
Ok Pter, I got them.

thanks alot, i can experiment futher.

Regards

Patrick