forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Code Problem

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Jan 19, 2003 12:23 am    Post subject: Code Problem Reply with quote

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())). Confused

Thanks in advance for any help. Very Happy

- FreezingFire
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Jan 19, 2003 12:54 am    Post subject: Reply with quote

Something like this maybe... Wink
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 Smile

_________________
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
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Jan 19, 2003 1:04 am    Post subject: Reply with quote

Hmmm. Confused

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. Confused

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Jan 19, 2003 1:12 am    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Sun Jan 19, 2003 1:20 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Sun Jan 19, 2003 1:48 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Jan 19, 2003 2:03 am    Post subject: Reply with quote

Many thanks for all of your help! Very Happy Very Happy
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group