KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Variable Folder Name anyone?

 
Post new topic   Reply to topic    KiXforms Forum Index -> Script Archive
View previous topic :: View next topic  
Author Message
OwenJ
KiXforms Follower
KiXforms Follower


Joined: 14 Jan 2007
Posts: 19
Location: Alton, Hampshire, England (UK)

PostPosted: Mon Aug 18, 2008 2:25 pm    Post subject: Variable Folder Name anyone? Reply with quote

Hi all,

Its been a while since I logged a thread here, but I need halp! Sad
I have created a UI to save a specified file, to a bespoke folder, that is configured within a series of text boxs.

hmmm all seemed perfect until the folder name went a bit funny after creating this function:


function Upload_Click
Dim $file,$fold,$comp,$lice,$mail,$date

$file = $txtFile.Text
$fold = $txtFold.Text
$comp = $txtCompany.Text
$lice = $txtLicence.Text
$mail = $txtEmail.Text
$date = $txtExpiry.Text

MD "C:\TEST\$comp+$lice+notify+$mail+$date"
Copy "$file" "C:\TEST\$comp+$lice+notify+$mail+$date"
endfunction


Now the only problem I have come up accross, is when I do run this function, it creates a folder like this:
"company+licence+notify+email+date"

I need it to say:
"company_licence_notify_email_date"

I am losing my mind here, halp!



TEST.kix
 Description:
Here is the script I have created so far.
When you fill out the form details, it creates a folder with "+" instead of "_".

Download
 Filename:  TEST.kix
 Filesize:  1.71 KB
 Downloaded:  1474 Time(s)


_________________
Owen Johnson. aka |SirianKnight| Shocked
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Mon Aug 18, 2008 6:24 pm    Post subject: Reply with quote

Have to do some string math example:

$folder = "C:\TEST\"+$comp+"_"+$lice+"_notify_"+$mail+"_"+$date

MD $folder
COPY $file $folder

p.s. and watch that $date value for invalid characters in a filename. might have to sanitize that first.
Back to top
View user's profile Send private message
OwenJ
KiXforms Follower
KiXforms Follower


Joined: 14 Jan 2007
Posts: 19
Location: Alton, Hampshire, England (UK)

PostPosted: Mon Aug 18, 2008 11:58 pm    Post subject: Woohoo! Reply with quote

Shawn,

Thanks for all ya help! Here is the finished util. Its just a time saver util, but a great example of how to create a folder, from text box's.



File Uploader .kix
 Description:

Download
 Filename:  File Uploader .kix
 Filesize:  1.69 KB
 Downloaded:  1543 Time(s)


_________________
Owen Johnson. aka |SirianKnight| Shocked
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Script Archive All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group