| View previous topic :: View next topic |
| Author |
Message |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Jan 19, 2003 12:23 am Post subject: Code Problem |
|
|
I can't think of how to fix this code:
| Code: | repeat
if @not(@equal(%a,@winactive()))
%a = @winactive()
end
window settext,%a,%a | @datetime(dddddd "*" hh:nn:ss am/pm)
%a = ""
wait .5
until |
What I want it to do is to just append the date and time to the current
window. But it keeps repeating itself even with the if @not(@equal(%
a,@winactive())).
Thanks in advance for any help.
- FreezingFire |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Jan 19, 2003 12:54 am Post subject: |
|
|
Something like this maybe...
| Code: |
REPEAT
%a = @winactive()
window settext, %a, %a | @datetime(dddddd "*" hh:nn:ss am/pm)
REPEAT
WAIT ".01"
UNTIL @not(@equal(%a,@winactive())) also leave a way out here
UNTIL leave a way out here
|
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Jan 19, 2003 1:04 am Post subject: |
|
|
Hmmm.
Still it just keeps appending the text to the title bar and it goes of the
side. I have really no idea how to fix it so it just appends it once but then updates it every second or so.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Jan 19, 2003 1:12 am Post subject: |
|
|
Did ya try your original one without clearing %a each time?
%a needs to keep the last window so ya have something
to compare @winactive() with...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Sun Jan 19, 2003 1:20 am Post subject: |
|
|
May not be the most elegant way to do it... but it should work.
| Code: |
repeat
if @not(@equal(%h,@winactive()))
%a = @winactive()
%h = @winactive(I)
end
IF @EQUAL(@POS("|",%a),0)
window settext,%h,@SUBSTR(%a,1,@LEN(%a)) | @datetime(dddddd "*" hh:nn:ss am/pm)
ELSE
window settext,%h,@SUBSTR(%a,1,@FSUB(@POS("|",%a),2)) | @datetime(dddddd "*" hh:nn:ss am/pm)
END
%a = ""
wait .5
until
|
|
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Sun Jan 19, 2003 1:48 am Post subject: |
|
|
If you're going to be using this on a system that you use the VDS IDE, you'll want to add a couple lines to keep it from changing the title bar text of the VDS editor window. This is because when you go to save your script, VDS uses the text of the title bar as the initial filename. If there are illegal characters in the title bar (like a colon or a slash) it will give you an exception.
| Code: | repeat
if @not(@equal(%h,@winactive()))
%a = @winactive()
%h = @winactive(I)
end
IF @EQUAL(@POS("|",%a),0)
IF @NOT(@EQUAL(@SUBSTR(%a,@FSUB(@LEN(%a),3),@LEN(%a)),".dsc"))
window settext,%h,@SUBSTR(%a,1,@LEN(%a)) | @datetime(dddddd "*" hh:nn:ss am/pm)
END
ELSE
IF @NOT(@EQUAL(@SUBSTR(%a,@FSUB(@POS("|",%a),5),@FSUB(@POS("|",%a),2)),".dsc"))
window settext,%h,@SUBSTR(%a,1,@FSUB(@POS("|",%a),2)) | @datetime(dddddd "*" hh:nn:ss am/pm)
END
END
%a = ""
wait .5
until
|
Last edited by Hortalonus on Sun Jan 19, 2003 2:26 am; edited 1 time in total |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Jan 19, 2003 2:03 am Post subject: |
|
|
Many thanks for all of your help!  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|