I must have had EOFCHAR set to off because it still would not work, so I set it on and it worked like a Rcharm. This code just made my life alot easier. Thanks for you help
Tom Hart ________________________________ From: Mikeb <[email protected]> To: RBASE-L Mailing List <[email protected]> Sent: Sun, February 27, 2011 6:48:50 PM Subject: [RBASE-L] - Re: Passing a variable from Rbase Tom, You probably have EOFCHAR set to OFF. You can do one of two things: 1. You can issue the following command before the code I sent: set EOFCHAR ON 2. You can add a CR/LF at the end of the code before the OUTPUT SCREEN like: set var vWrite = ((Char(13)) + (Char(10))) Write .vWrite ----- Original Message ----- From: "TOM HART" <[email protected]> To: "RBASE-L Mailing List" <[email protected]> Sent: Sunday, February 27, 2011 6:41 PM Subject: [RBASE-L] - Re: Passing a variable from Rbase > Your code works just like I want to except when I run it, it gives me the > following error > > Running C:\Rbase9.1EmailWork\scriptname.ftp > ***** Script error on line 7, column 1: EOF expected > > > ^ > If I edit the scriptname.ftp file, put a blank line and save, then launch > scriptname.ftp it works > Is it looking for a carriage return or what? > > Tom Hart > > > > > ________________________________ > From: Mikeb <[email protected]> > To: RBASE-L Mailing List <[email protected]> > Sent: Sun, February 27, 2011 9:01:31 AM > Subject: [RBASE-L] - Re: Passing a variable from Rbase > > { You will have to employ whatever collection method you > use to set the variables for user/pass... > } > > Set var vWrite text = null > Set var vMyUser text = (CVAL('User')) > Set var vPass text = '123456' > Set var vFtpHost text = 'ftp.myhost.com' > > output scriptname.ftp > > $host = ' > set var vWrite = '$host="ftp.myhost.com"' > Write .vWrite > set var vWrite = '$user="' + .vMyUser +'"' > Write .vWrite > set var vWrite = '$password="123456"' > Write .vWrite > > set var vWrite = 'OPENHOST($host,$user,$password)' > Write .vWrite > set var vWrite = 'PUTFILE("*.*",SUBDIRS)' > > Write .vWrite > > Output Screen > > launch scriptname.ftp > > > > ----- Original Message ----- > From: "TOM HART" <[email protected]> > To: "RBASE-L Mailing List" <[email protected]> > Sent: Sunday, February 27, 2011 9:15 AM > Subject: [RBASE-L] - Re: Passing a variable from Rbase > > >> Can you give me an example of a write statement? >> >> >> >> >> ________________________________ >> From: Mikeb <[email protected]> >> To: RBASE-L Mailing List <[email protected]> >> Sent: Sun, February 27, 2011 8:11:27 AM >> Subject: [RBASE-L] - Re: Passing a variable from Rbase >> >> Simple enough then. Create your ScripName.ftp file dynamically in RBase >> and >> write the command lines as needed, collecting whatever RBase variable is >> needed into a write statement. >> When complete, then launch as you do now. >> >> >> ----- Original Message ----- >> From: "TOM HART" <[email protected]> >> To: "RBASE-L Mailing List" <[email protected]> >> Sent: Saturday, February 26, 2011 8:20 PM >> Subject: [RBASE-L] - Re: Passing a variable from Rbase >> >> >>> Here is an example of the script >>> To run from Rbase I launch scriptname.ftp >>> the help files say you can create variables with the $ >>> like $ftpname="ftp.myftp.com" and could do this >>> OPENHOST($ftpname,etc,) >>> # >>> # More script samples at http://www.ScriptFTP.com/examples.php >>> # Online scripting guide at http://www.ScriptFTP.com/reference.php >>> # Free technical support at http://www.ScriptFTP.com/contact.php >>> # >>> # Remember to save the changes before clicking run on the ScriptFTP >>> window. >>> >>> # Connect to FTP server >>> OPENHOST("ftp.myftp.com","myuserid","mypassword") >>> >>> # Download the new or modified asc files from the FTP site >>> SYNC("C:\myfolder","/mainfolder/ftpfolder",DOWNLOAD,"*.asc") >>> >>> # Transfer finished, close the connection >>> CLOSEHOST >>> >>> >>> >>> >>> >>> >>> ________________________________ >>> From: Mikeb <[email protected]> >>> To: RBASE-L Mailing List <[email protected]> >>> Sent: Sat, February 26, 2011 5:40:33 PM >>> Subject: [RBASE-L] - Re: Passing a variable from Rbase >>> >>> OK.. I get that there are command scripts the are executed toward the >>> FTP >>> program, but: >>> >>> What is the environment in which the commands (OPENHOST / PUTFILE) are >>> run? >>> Command Prompt? Or does the FTP program host its own scripting >>> environment >>> like the R> in RBase. >>> >>> ----- Original Message ----- >>> From: "TOM HART" <[email protected]> >>> To: "RBASE-L Mailing List" <[email protected]> >>> Sent: Saturday, February 26, 2011 3:39 PM >>> Subject: [RBASE-L] - Re: Passing a variable from Rbase >>> >>> >>>> here is an example >>>> >>>> $host="ftp.myhost.com" >>>> $user="myuser" >>>> $password="123456" >>>> >>>> OPENHOST($host,$user,$password) >>>> PUTFILE("*.*",SUBDIRS) >>>> >>>> >>>> >>>> ________________________________ >>>> From: Mikeb <[email protected]> >>>> To: RBASE-L Mailing List <[email protected]> >>>> Sent: Sat, February 26, 2011 1:48:40 PM >>>> Subject: [RBASE-L] - Re: Passing a variable from Rbase >>>> >>>> how does the ftp program get the variables? Command Line? >>>> >>>> >>>> ----- Original Message ----- From: "TOM HART" <[email protected]> >>>> To: "RBASE-L Mailing List" <[email protected]> >>>> Sent: Saturday, February 26, 2011 1:14 PM >>>> Subject: [RBASE-L] - Passing a variable from Rbase >>>> >>>> >>>>> Can a variable be passed from Rbase to another program that can use >>>>> variables. >>>>> EG >>>>> I found an FTP program that I can integrate into Rbase, this program >>>>> can >>>>> use >>>>> variables >>>>> >>>>> In Rbase >>>>> set variable in Rbase- set var vFTPHost text = 'My host name' >>>>> >>>>> I know in Rbase the variable will be .vFTPHost but in the FTP program >>>>> a >>>>>variable >>>>> is defined with $variablename >>>>> Can this be done >>>>> >>>>> Tom Hart >>>>>

