forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Replacing part of a string

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
nemisis010
Newbie


Joined: 29 May 2002
Posts: 17
Location: Australia

PostPosted: Mon Jun 03, 2002 11:52 am    Post subject: Replacing part of a string Reply with quote

Here's the problem, i'm trying to create a directory from the date and time that vds can aquire

%B = @datetime(dd-mm-yy-t,%T)

When creating a directory you cannot put the : in the name, but when vds aquires the time format it has a : in the middle of it, character 11 to be exact.

Here's the code i've worked out so far;

%A = @datetime(dd-mm-yy-t,%T)

%X = @strdel(%A,11)

%X = @strins(%A,11,-)


The problem i'm getting now is that when vds aquires the time from the computer it doesn't grab the double digits, eg

9.15 PM

instead of

09.15 PM

When the time is say 10.15 PM it creates the problem that 11 is not the character to change anymore.

Is there a way to accomplish this??

_________________
------------------------------------


Boo
Back to top
View user's profile Send private message
moke
Contributor
Contributor


Joined: 02 Jan 2002
Posts: 162

PostPosted: Mon Jun 03, 2002 1:28 pm    Post subject: Reply with quote

How about using something like this:

%A = @datetime(dd-mm-yy-t,%T)
If @greater(@len(%A),15)
%X = @strdel(%A,12)
%X = @strins(%A,12,-)
Else
%X = @strdel(%A,11)
%X = @strins(%A,11,-)
End

I think that should work.

moke
Back to top
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Jun 03, 2002 1:32 pm    Post subject: Reply with quote

__________________________________________________________
Here ya go (although I'm kinda wondering why you're
using day-month-year format...):

%A = @datetime(dd-mm-yy-hh-nn-ss,%T)

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
moke
Contributor
Contributor


Joined: 02 Jan 2002
Posts: 162

PostPosted: Mon Jun 03, 2002 2:05 pm    Post subject: Reply with quote

Yikes!!! Embarassed

I should've known that. Maybe giving up coffe was not such a good idea after all.
Back to top
View user's profile Send private message Send e-mail
nemisis010
Newbie


Joined: 29 May 2002
Posts: 17
Location: Australia

PostPosted: Tue Jun 04, 2002 4:48 am    Post subject: Thank guys Reply with quote

Yeah that worked fine.

Mac, i'm using the date month year format because it's the only way to create folders that are random enough but easy to understand when they where backed up.

I'm creating a mod tool for a game that backs up the datafiles when you make changes then you can restore the older ones if something goes wrong.

_________________
------------------------------------


Boo
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Tue Jun 04, 2002 5:15 am    Post subject: Reply with quote

OK, just wondering. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help 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 can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group