|
-
Nov 11th, 2002, 11:42 AM
#1
Thread Starter
New Member
Can t get VB to send [return]
The following code works for all except (R) which should send a return to the program ........
Open Jobname For Input As #1
Do While Not EOF(1)
Input #1, varcheck
Sleep (10000)
If varcheck = "(K)" Then
Input #1, FPath
If FPath = "C:\MAR" Then
FPath = "C:\MA" & Format(jdate, "YY") & Format(jdate, "MM") & Format(jdate, "DD") & ".MAR"
End If
Kill FPath
'the following should send a return
' after reading (R)
' to the program but it just hangs up
' works OK for all other codes
ElseIf varcheck = "(R)" Then
Sendkys Chr$(13)
ElseIf varcheck = "(P)" Then
Input #1, TLength
Sleep TLength
ElseIf varcheck = "(S)" Then
Sendkys VK_SPACE
ElseIf varcheck = "(D)" Then
Sendkys (Format(jdate, "DDMMYY"))
ElseIf varcheck = "(A)" Then
Sendkys (Format(jAdd, "DDMMYY"))
ElseIf varcheck = "(T)" Then
Sendkys (Format(Date, "DDMMYY"))
ElseIf varcheck = "(C)" Then
Input #1, FPath
If FPath = "C:\MAR" Then
FPath = "C:\MA" & Format(jdate, "YY") & Format(jdate, "MM") & Format(jdate, "DD") & ".MAR"
startwait = Timer
Do While Timer < startwait + 2700
DoEvents
-
Nov 11th, 2002, 11:48 AM
#2
1) Goto http://msdn.microsoft.com and search for SendKeys -- I know there's some specific code needed to send a return
2) You're more likely to get help faster by say JUST WHAT THE PROBLEM is.... nothing annoys people here than posts that simply say "It doesn't work." What do mean it the "(R)" doesn't work... what does happen?
3) Format your code using [ vbcode] and [ /vbcode] (w/o the spaces) it'll look nicer and people can read it.
4) You can also do a search on the forums.... I know there are several threads on SendKeys
-
Nov 11th, 2002, 02:13 PM
#3
Addicted Member
To send the Enter Key (or any key that does not display a character when pressed) you must use specific syntax.
Enter is sent as {ENTER} or ~
See MSDN for a full discussion on the subject.
Some days you're the dog,
and some days you're the hydrant.
VB6 Enterprise
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|