PDA

View Full Version : FLASHING TEXT



fravado
07-04-2008, 12:54
Hi all.
I am new in programming in TB and still learning so i donīt realy know how to go about it yet, but i am making progress.
I am testing out some very small programs i wrote and then delete them again if they donīt react the way i want.
Now i want to put some FLASHING or BLINKING text in my program (a telephonebook).
Does someone know how to do this ? EROS told me to use some OLD MSDOS code, but is not sure about it i think.
Anyway, thank EROS for the tip.
I anyone chould have any answers on my question, pls send it to my E-mail address:
axel201255@yahoo.co.uk
Thanks to all.
Bye Frank.

ErosOlmi
07-04-2008, 13:14
Ciao Frank an wellcome here.

If with "Flashing text" you are referring to blinking text inside a Console window, I'm quite sure it cannot be done in standard Win32 Console. It is not a limit of thinBasic but a feature not implemented in Win32 Console. So something to ask to Microsoft.
Maybe some assembler man can help us here and see if there is a work around.

If with "Flashing text" you are referring to text going on/off in a standard window dialog, than I think we can make it using a timer.

Can you be so kind to tell what script type you are making? Console or Window?
I think you are working in a console window using commands like "CONSOLE_WRITELINE". If not, please let me know.

More, if you have some code not woking like you would like, please post here. It will be of great help for everyone to better understand it and try to find different solutions.

Ciao
Eros

Petr Schreiber
07-04-2008, 13:26
Eros,

one thing occured to me - Mikes TBEM module!

See this sample, needs latest TBEM from here (http://community.thinbasic.com/index.php?topic=1624.msg11718#msg11718) copied to thinBASIC\Lib directory, with 1.6.0.3 default it won't work.



' -- Flashing part of the screen

uses "Console"
uses "TBEM"
uses "UI"

alias Console_PrintLine as PrintLn
alias Console_SetCursorPosition as Locate
alias Console_setTextAttribute as SetColor
alias Console_ColorAt as SetColorAt
alias Console_Waitkey as WaitKey

PrintLn("Hi there, this is some text")
PrintLn("... really random text, press ESC to quit")

' -- Event fired each second ( = 1000ms )
dim eventFlash as long
%evt_UpdateFlash = 1

' -- This event will call "MakeAFlash" each 1000 ms
eventFlash = TBEM_AddEvent("MakeAFlash", %evt_UpdateFlash)
TBEM_Addtrigger(%evt_UpdateFlash)
TBEM_setRepeat(eventFlash, %TRUE, 1000)

' -- Loop
do

' -- Event manager, handles the flashing
TBEM_RUN

' -- If ESCAPE is pressed then exit loop
if GetAsyncKeyState(%VK_ESCAPE) then exit do

loop

PrintLn("Program ended")
WaitKey

function MakeAFlash()
static Flip as long

' -- Flip will take value 1, 0, 1, 0, 1, 0, 1
Flip = Flip xor 1
if Flip = 1 then
SetColor(%CONSOLE_FOREGROUND_GREEN or %CONSOLE_FOREGROUND_INTENSITY )
else
SetColor(%CONSOLE_FOREGROUND_RED or %CONSOLE_FOREGROUND_INTENSITY )
end if
Locate(77, 0)
PrintLn(" ")

end function



Bye,
Petr

ErosOlmi
07-04-2008, 14:24
You always have clever idea but ...
is it worth just for blinking text ;)

Michael Hartlef
07-04-2008, 20:45
Hey, at least one usage for TBEM ;)

Petr Schreiber
07-04-2008, 21:22
Hey, at least one usage for TBEM ;)


Don't worry Mike, this module won't be script-less for long ;)


Petr

ErosOlmi
07-04-2008, 21:26
Yes that's sure. I have a lot of ideas where to use it. It is just so clever.
I just need more time, more time, more tiiiiime!

Michael Hartlef
07-04-2008, 21:37
Time???? What is that? I gave up searching for it. ;)

sandyrepope
08-04-2008, 16:05
I downloaded the script and the latest version of the TBEM module but it doesn't flash anything. What should flash?

Thanks
Sandy

Petr Schreiber
08-04-2008, 16:32
Hi Sandy,

you are right, to make it work properly you need thinCore.dll and thinRes.dll from here (http://community.thinbasic.com/index.php?topic=1655.msg11999;topicseen#new).

... the number of dependencies grows, time for new thinBASIC preview with all this inside :)


Petr

ErosOlmi
08-04-2008, 20:51
... the number of dependencies grows, time for new thinBASIC preview with all this inside :)

Right you are :-[

It is more than 1 week I want to release version 1.6.0.4 but no time.
I have a presentation tomorrow. Passed that I think I can have some hours to compile and test all in order to release new version.

Sorry
Eros

Petr Schreiber
08-04-2008, 21:28
No problem Eros,

good luck with presentation,
I can wait :)


Petr