Jump to content

set a key to press as a variable


b3vad
 Share

Recommended Posts

Hi  ^_^ 
I'm trying to define a key inside a variable but I have no idea what I'm doing. >_< 
can somebody point me at the right direction please.
trying to define

Send("{DEL 4}")

as

$key='"{DEL'+4+'}"'

Send($key)

Func breakit()
   $jdi = StringSplit($for, ".")
EndFunc

Func doit()
   send("{F2}")
   if $jdi[0]=0 Then
      send("{HOME}")
      $s="{LEFT "
      $d="{DEL "
   Else
      send("{END}")
      $s='"{RIGHT '+2+'}"'
      $d='"{BS '+2+'}"'
   EndIf
   rest()
EndFunc

as you can see tried some things but nothing works so far. :whistle: thank you

[center]My language! gets the job done![/center]

Link to comment
Share on other sites

You should use concatenation, use for concatenation

$key='{DEL' & 4 & '}'

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

Hi,

You are using the wrong operators.

From the helpfile:

Assignment operator

&: Concatenates/joins two strings. e.g. "one" & 10 (equals "one10")

Mathematical operator

+: Adds two numbers. e.g. 10 + 20 (equals 30)

$key='"{DEL'+4+'}"'

;should be:
$key='"{DEL' & 4 & '}"'

;but:
Send($key)
;gives:
Send('"{DEL4}"')

;so the right string is:
$key = "{DEL " & 4 & "}"
Do not hesitate to make some debugging with the MsgBox/ConsoleWrite functions.

Br, FireFox.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...