Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strfind more than one string

Status
Not open for further replies.

ok1397

Technical User
Feb 7, 2005
70
US
Hello everyone, need help with this script. I transfer file using ftp, my problem is that i have a dialog box that prompts the user for a date. The file that needs to be searched contains the following: DCR0721051 which (072105) is the date so the strfind needs to search for "DCR" and the date (072105) which is entered using a text box I called (TextStr1), strfind sLine("DCR",TextStr1)
does not work, any ideas ?????????????

Thank you for your help !!!!!!!!!!!!!!!!!
 
I have a couple different scripts on my sample page that may do what you want. Search for mstrfind and you will see the two scripts. The first version I wrote just let you know that one of the strings you were looking for was found, the second one returns that actual string. I'm not sure they will work as-is for what you want, but hopefully it's a good starting point.


 
well i finally got it to work here's the piece of code that worked for me, hope it helps anyone with the same issue....

if not nullstr TextStr1 ;If text box is not blank
if not nullstr sData ;If line is not blank
if strfind sData "DCR" ;Search for file that starts with "DCR"
if strfind sData TextStr1 ;Search for String in textbox entered by user
ftp remote copyfile sData
while $FTPSTATUS ;Loop while file is being copied
yield
endwhile
strfmt sNewFile "%s_%02d%02d%d" sData ;Format file name to (DCRDDMMYY)
strcat sNewFile ".TXT" ;Convert to text file
ftp LOCAL rename sData sNewFile ;Rename Downloaded file to date searched as .TXT format
pause 1
endif
endif
endif
endif
endwhile
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top