AutoHotkey Community

It is currently May 26th, 2012, 7:30 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: if var question
PostPosted: July 6th, 2005, 5:47 pm 
Offline

Joined: October 10th, 2004, 7:18 pm
Posts: 3
I use the following script to capture a file name and go get it from an FTP server. However, if nothing is entered it gets ALL the files, which we don't want. How do I put in the if statement that if JobNum is blank to go to Finish?

Home:
InputBox, JobNo, 78 PMMC SmartFETCH, Enter Job No., ,250, 150
if ErrorLevel <> 0
Gosub, Finish
Else
Gosub, Cont
Cont:
FileCreateDir, C:\Ascend
FileCreateDir, C:\Ascend\Voice
FileAppend, open 1.1.1.1`nloginname`natahs2004`nlcd C:\Ascend\Voice `ncd assigned/78`nprompt`nhash`nmget %JobNo%*.*`ndisconnect`nquit`n, GetJob.txt
RunWait, %COMSPEC% /C ftp -v -s:GetJob.txt,,hide
FileDelete, GetJob.txt
Gosub, Home
Finish:
ExitApp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 6th, 2005, 9:59 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Please try this
Code:
FileCreateDir, C:\Ascend
FileCreateDir, C:\Ascend\Voice
Loop
{
  InputBox, JobNo, 78 PMMC SmartFETCH, Enter Job No., ,250, 150
  if not JobNo
     break
  FileAppend, open 1.1.1.1`nloginname`natahs2004`nlcd C:\Ascend\Voice `ncd assigned/78`nprompt`nhash`nmget %JobNo%*.*`ndisconnect`nquit`n, GetJob.txt
  RunWait, %COMSPEC% /C ftp -v -s:GetJob.txt,,hide
  FileDelete, GetJob.txt
}
*not tested*

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 6th, 2005, 10:01 pm 
Offline

Joined: April 16th, 2005, 1:05 am
Posts: 28
you should be able to just say "if JobNum" this will evaluate it as a boolang (true/false) false if the contents of JobNum is blank or 0, else it will be true.

_________________
cstone


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Alpha Bravo, Cephei1, hd0202, krajan, over21, RaptorX, Xx7 and 64 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group