b3vad Posted September 7, 2013 Posted September 7, 2013 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. thank you [center]My language! gets the job done![/center]
PhoenixXL Posted September 7, 2013 Posted September 7, 2013 (edited) You should use concatenation, use & for concatenation $key='{DEL' & 4 & '}' Edited September 7, 2013 by PhoenixXL My code: Reveal hidden contents 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.
FireFox Posted September 7, 2013 Posted September 7, 2013 Hi,You are using the wrong operators.From the helpfile: Quote 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.
b3vad Posted September 7, 2013 Author Posted September 7, 2013 so that's what I was doing wrong thanks [center]My language! gets the job done![/center]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now