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 


Get content from Clipboard to a variable...
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 19, 2003 12:54 pm    Post subject: Get content from Clipboard to a variable... Reply with quote

How can I retrieve the contents of the windows clipboard and put the content into a variable?

I want to use this in the EVLOOP part to check if the user copies a URL to the clipboard.

Also, not sure, but I guess I have to use the parse thing to check if the content of the clipboard is a valid URL.

Could anyone help me with this?
I'm making a simple download program, (My first in VDS) and want the download button only to be enabled when a valid URL is in the clipboard.

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


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

PostPosted: Wed Feb 19, 2003 1:36 pm    Post subject: Reply with quote

Create a list and use LIST COPY, then retrieve it from the list. Wink
Code:

LIST CREATE, 1
LIST PASTE, 1
%%var = @text(1)

EDIT - OOPS - shoulda been LIST PASTE... Embarassed

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


Last edited by Mac on Wed Feb 19, 2003 1:59 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 19, 2003 1:49 pm    Post subject: Reply with quote

I tried this, but It don't seem to work Sad
Code:
DIALOG CREATE,New Dialog,-1,0,240,160
LIST CREATE, 1
LIST COPY, 1
DIALOG SHOW


%%var = @text(1)
info Result: %%var

:Close
Exit

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


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

PostPosted: Wed Feb 19, 2003 1:57 pm    Post subject: Reply with quote

OOPS... Embarassed

DUH - Should be LIST PASTE not LIST COPY... Laughing

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
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 19, 2003 2:02 pm    Post subject: Reply with quote

Laughing

Works great. Thanks Mac Worship

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Feb 19, 2003 2:19 pm    Post subject: Reply with quote

Maybe you should put it into a loop, to keep on checking untill there is something on the clipboard...

Code:

list create,1

repeat
  list paste,1
  %%var = @text(1)
  wait 0.1
until %%var


info Result: %%var
Back to top
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 19, 2003 2:32 pm    Post subject: Reply with quote

Yeah, I thought about that.
But wont that cause a recursion of the script?
With the unlimited loop I mean.

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


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

PostPosted: Wed Feb 19, 2003 2:37 pm    Post subject: Reply with quote

Ya could use a TIMER event, OR add @event() to the
REPEAT/UNTIL loop exit criteria... Wink
Code:

REPEAT
  LIST PASTE, 1
  WAIT "0.1"
  %%var = @text(1)
UNTIL %%var @event()

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
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 19, 2003 2:47 pm    Post subject: Reply with quote

Is it posible to cause a recursion to the script when using loops with VDS?

I would like to have a past button that is disabled if there is no valid URL to a downloadable file in the clipboard. And if there is a valid download URL the past button becomes enabled.

Is this possible?

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


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

PostPosted: Wed Feb 19, 2003 3:00 pm    Post subject: Reply with quote

Yep - you can lock VDS up tighter than a drum if ya have any
kind of a loop with no way out of it.

But - as long as ya have a close button (and a CLOSE label),
and use @event() as one outlet for the loop, there shouldn't
be a problem.

A TIMER event would prolly work fine for what you're doin'
though. Wink

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
Mac
Professional Member
Professional Member


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

PostPosted: Wed Feb 19, 2003 3:03 pm    Post subject: Reply with quote

One other note about loops - if you're gonna have one run
constantly, use some kind of WAIT in it. Otherwise CPU usage
goes to 100%.

Here's an example:

http://www.vdsworld.com/forum/viewtopic.php?t=458

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
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 19, 2003 3:09 pm    Post subject: Reply with quote

That's a good idea.
When using your loop example with the wait command my CPU usage actually dropped a few precents Smile

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Feb 19, 2003 10:08 pm    Post subject: Reply with quote

Here's a question on why the loops cause 100% CPU usage: is it a bug in
the way VDS is programmed? Why does it not cause 100% CPU even
when you use WAIT "0.0000000000000000000001"? Perhaps it
should be a feature pre-built into VDS that it waits even less than a
nano-second (I'm not scientific here, just used as a figure of speech Wink )
to avoid the 100% CPU load. 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: Thu Feb 20, 2003 12:42 am    Post subject: Reply with quote

I dunno - maybe loops are high priority? Although, if there was
a built in delay, @datetime() would be off more... Confused

Another note - about the fastest I've been able to get a
WAIT to do is aprox 1/100 of a second (".01") - anything
faster (".001", etc.) appears to wait about the same length
of time (used @datetime() to check this).

Wondering if this varies with CPU speed, or is there just a
point where VDS won't execute a WAIT any faster?

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
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Feb 20, 2003 4:58 pm    Post subject: Reply with quote

I think the wait command can't be faster the 1/100 of a second, because VDS is a interpretted language. Or it's because it uses the Windows API or something, which probably won't be much accurater then 1/100 of a sec...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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