Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi!

 

I come from germany and so my english is very bad - but I'll try to explain my problem, that can anybody help me :?

I search help in german-forums, but nowbody wanted to helped me - i hope, you wont disappoint me too :cry:

 

My job is:

 

i have a JScript-File. I don't know really what it is do, but i have to add to a function, which check (only!!) all the filename (which are in the same folder like the script). It have to test if "settings.txt" embodied in the filename. If yes, it have to save the filename in a variable and then it will be finish-worked, if not the script have to test the next file on his filename. How can i code it??

 

I have a try, but I don't know if it is right:

 

var filesearch = "settings.txt";

var search_c = "<br>";

var filename, pos, pos_c, repeat;

 

var flist = ShowFolderFileList(folderspec);

 

repeat =1;

do{

pos_c = flist.indexOf(search_c, pos);

pos = flist.indexOf(filesearch, pos+1);

 

if(pos != -1 || pos_c != -1)

{

if(pos < pos_c)

{

filename = flist.slice(0, pos+12);

document.forms[0].input.value=filename;

}

else

{ filename = flist.slice(pos_c+4, pos+12); document.forms[0].input.value=filename;

}

}

else

{

repeat =0;

}

 

if(repeat == 1)

{

create_setupfile(filename); //the filename will be finished-worked

 

}

 

}while(repeat == 1);

 

 

Please - help me :oops:

 

Greetings

Kitty

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...