Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
use of string in destFolder?
#1
Hi,

is it possible to use a string in destFolder function so i can use a filename i stored earlier to create files?

or is there another way to manage this..

code used now is:

destFolder+"\file-%i.txt"

what i like is the file part replaced by something stored in string...


THX
#2
Iv never used destFolder so dunno how to test but i think this might work
Function Function3
Code:
Copy      Help
str FileName="";str a="\";str b="-%i.txt"
a+FileName;a+b
destFolder+ a
#3
I just found your other post and tested it here is whole code it works

Function Function4
Code:
Copy      Help
;change these
str sFile="$desktop$\led.txt" ;;large file
str destFolder="$desktop$\936543" ;;destination folder
int nLinesInFile=3000 ;;number of lines in small files
int enable=1 ;;change to 1 to create the files. By default, just displays file paths.

;____________________________________

if(enable) mkdir destFolder
str FileName="xx";str a="\";str b="-%i.txt"
a+FileName;a+b
destFolder+a

str s s1 s2 s3
s1.getfile(sFile)
int i j
foreach s s1
,s2.addline(s)
,i+1
,if(i=nLinesInFile)
,,;g1
,,j+1
,,s3.format(destFolder j)
,,out "%s (%i lines)" s3 i
,,if(enable) s2.setfile(s3)
,,s2=""
,,i=0

if(s2.len) goto g1


Forum Jump:


Users browsing this thread: 1 Guest(s)