[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TESTPUT




Shannon,

Below is an email from Buck to me when I asked a question regarding passing variables in to the API vs. something hardcoded.  Perhaps this will help.

Regards,
Brian


> I am a little unsure as to how to use
> file fields when invoking some of the
> APIs.  Here is a specific example:
>
> * Connect to an FTP server.                                        
> *                                                                  
>C                   eval      ftp = ftp_conn('ftp2.freebsd.org':    
>C                                            'anonymous':          
>C                                            'anon.e.mouse@xxxxxxx')
>
> What I want to do is use fields from a
> file to pass in to open the connection,
> but I am not sure if they just need
> separated by : or what how exactly to
> format the string in to the API.


This is traditional RPG IV syntax.  The colons separate parameters from each other.  To use a variable instead of a literal, just put the variable in the statement instead!

eval      ftp = ftp_conn(ftpURL:    
                        ftpUser:
                        ftpPass)





"Shannon ODonnell" <sodonnell@xxxxxxxxxxxxxxxxx>
Sent by: owner-ftpapi@xxxxxxxxxxxxx

01/20/2005 12:40 PM

Please respond to
ftpapi@xxxxxxxxxxxxx

To
<ftpapi@xxxxxxxxxxxxx>
cc
Subject
TESTPUT





Just started to take a look at FTPAPI  and I am very impressed. Scott did an amazing job with this.
 
Quick question..when I tried the TESTPUT sample program, it worked very well when I hardcoded a remote and local path name.  
 
However, when I attempt to use a variable for those paramaters, I always get a "No Such File or Directory" error message.  I've tried adding an apostrophe around both ends of the path.
I've tried appending a null to it, and of course, I trim all the extraneous garbage from the variable that may have been passed along with it on the call to the program.
 
I can't figure out why a hard coded path works but using a variable for the path doesn't.  
 
No doubt it's something very basic I'm missing here, but I can't seem to figure it out.
 
Any suggestions on things I can try?
 
The variables are defined as 256A, btw.
 
Shannon O'Donnell