Page 1 of 1 1
Topic Options
#37075 - 2003-02-27 05:51 PM Marque style text screen
WillUK Offline
Fresh Scripter

Registered: 2001-12-30
Posts: 18
Loc: derby, uk
Hi,

I am looking to create a kixform/dos window script, that can display text moving across the screen like the marque screen saver.

Can someone give me a hint on how I can set the text moving from one side of the screen to another. The text would come from a text file, and loop around.

Someone please help....
_________________________
If at first you don't succeed, give up your making a fool of yourself.

Top
#37076 - 2003-02-27 06:19 PM Re: Marque style text screen
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Use AT to place it on a specific part of the screen. Use LEFT/RIGHT/SUBSTR to split up your string and splice it back together.

code:
$text='whatever'
at (1,1) $text
$a=0
while not $key
$text=substr($text,2)+right($a,1)
at (1,1) $text
get $key
loop

or something like it
_________________________
There are two types of vessels, submarines and targets.

Top
#37077 - 2003-02-27 06:33 PM Re: Marque style text screen
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, here is kixforms version:
code:
$=createobject("kixtart.form")
$.size=$.screen.width,40
$.left=0
$.top=0
$.borderstyle=5
$text="some text scrolling around like marquee..."
$looper=$.timer(100)
$looper.ontimer="mover"

$.show
while $.visible $eh=execute($.doevents) loop

function mover()
$.backcolor=$.backcolor
$.printxy($.width-$counter,5,$text)
$counter=$counter+3
if $counter>0.9*$.fontsize*len($text)+$.width
$counter=0
endif
endfunction



[ 27. February 2003, 18:34: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#37078 - 2003-02-27 06:54 PM Re: Marque style text screen
WillUK Offline
Fresh Scripter

Registered: 2001-12-30
Posts: 18
Loc: derby, uk
Thanks,

Can you let me know how to do the following:

I have made a text file on my c drive, and this needs to be updated - when saved can this update the form too:

$=createobject("kixtart.form")
$.size=$.screen.width,60
$.left=0
$.top=804
$.borderstyle=5
Open(1, "c:\test.txt",2)
$text = ReadLine(1)
$looper=$.timer(100)
$looper.ontimer="mover"

$.show
while $.visible $eh=execute($.doevents) loop

function mover()
$.backcolor=$.backcolor
$.printxy($.width-$counter,5,$text)
$counter=$counter+3
if $counter>0.9*$.fontsize*len($text)+$.width
$counter=0
endif
endfunction
Close (1)

When I try and save an update to the text file, it says that that the file is in use....

Also can the kixform be made to always be on top?

thanks again
_________________________
If at first you don't succeed, give up your making a fool of yourself.

Top
#37079 - 2003-02-27 06:59 PM Re: Marque style text screen
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
in which place you want the change of file to happen?

as you have the close at the end, it indeed is in use until the script is closed.

always on top?

can be done...
with looping with setfocus...
_________________________
!

download KiXnet

Top
#37080 - 2003-02-27 07:05 PM Re: Marque style text screen
WillUK Offline
Fresh Scripter

Registered: 2001-12-30
Posts: 18
Loc: derby, uk
Currently we have a web page that refreshes every 60secs, users can update the text file and at the next update this also updates the screen..

Setfocus("window name")
loop
_________________________
If at first you don't succeed, give up your making a fool of yourself.

Top
#37081 - 2003-02-27 08:39 PM Re: Marque style text screen
WillUK Offline
Fresh Scripter

Registered: 2001-12-30
Posts: 18
Loc: derby, uk
while $.visible $eh=execute($.doevents)
Open(1, "c:\test2.txt",2)
$text = ReadLine(1)
$looper=$.timer(40)
$looper.ontimer="mover"
close (1)
loop

Thanks

[ 27. February 2003, 20:40: Message edited by: WillUK ]
_________________________
If at first you don't succeed, give up your making a fool of yourself.

Top
#37082 - 2003-02-27 08:42 PM Re: Marque style text screen
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
uh, little weird solution but it should work.

if you use wkix32 (console-less kix) you should silence the functions:
Open(1, "c:\test2.txt",2)

should be:
$dummy=Open(1, "c:\test2.txt",2)

otherwise these will open console and show "0" or something there.
not good for GUI script [Wink]
_________________________
!

download KiXnet

Top
#37083 - 2003-02-28 04:59 PM Re: Marque style text screen
WillUK Offline
Fresh Scripter

Registered: 2001-12-30
Posts: 18
Loc: derby, uk
Thanks,

Is there anyway that I can stop the text from flickering at all - or is this a video card issue?
_________________________
If at first you don't succeed, give up your making a fool of yourself.

Top
#37084 - 2003-02-28 05:04 PM Re: Marque style text screen
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
try to change the mover:
$counter=$counter+3

to:
$counter=$counter+1

and make the update faster:
$looper=$.timer(10)

or even less than 10.
but, it will indeed use more cpu power.
_________________________
!

download KiXnet

Top
#37085 - 2003-03-03 10:59 AM Re: Marque style text screen
WillUK Offline
Fresh Scripter

Registered: 2001-12-30
Posts: 18
Loc: derby, uk
Can the close button be switched off - to prevent closing the window?
_________________________
If at first you don't succeed, give up your making a fool of yourself.

Top
#37086 - 2003-03-03 11:03 AM Re: Marque style text screen
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Partly :

set

$.SysMenu = 0

this will hide the buttons and the app Icon but still ALT+F4 will close it

[ 03. March 2003, 11:26: Message edited by: jpols ]
_________________________



Top
#37087 - 2003-03-03 11:26 AM Re: Marque style text screen
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you could also change:
$.borderstyle=5

to:
$.border=0
_________________________
!

download KiXnet

Top
#37088 - 2003-03-03 11:27 AM Re: Marque style text screen
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
still there is the possibility to close for the 'slightly-advanced' User [Razz]
_________________________



Top
#37089 - 2003-03-03 11:46 AM Re: Marque style text screen
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
isn't there always?
just do "kill *kix32.exe -f" closes all kix-based stuff.
_________________________
!

download KiXnet

Top
#37090 - 2003-03-04 12:41 AM Re: Marque style text screen
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
yeah ... but who has kill.exe amongst your users, honestly [Big Grin]
_________________________



Top
#37091 - 2003-03-04 12:55 AM Re: Marque style text screen
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
mm... quess [Big Grin]
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 640 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.035 seconds in which 0.013 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org