| View previous topic :: View next topic |
| Author |
Message |
nemisis010 Newbie

Joined: 29 May 2002 Posts: 17 Location: Australia
|
Posted: Mon Jun 03, 2002 11:52 am Post subject: Replacing part of a string |
|
|
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 |
|
 |
moke Contributor

Joined: 02 Jan 2002 Posts: 162
|
Posted: Mon Jun 03, 2002 1:28 pm Post subject: |
|
|
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 |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Jun 03, 2002 1:32 pm Post subject: |
|
|
__________________________________________________________
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  _________________ 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 |
|
 |
moke Contributor

Joined: 02 Jan 2002 Posts: 162
|
Posted: Mon Jun 03, 2002 2:05 pm Post subject: |
|
|
Yikes!!!
I should've known that. Maybe giving up coffe was not such a good idea after all. |
|
| Back to top |
|
 |
nemisis010 Newbie

Joined: 29 May 2002 Posts: 17 Location: Australia
|
Posted: Tue Jun 04, 2002 4:48 am Post subject: Thank guys |
|
|
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 |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Jun 04, 2002 5:15 am Post subject: |
|
|
OK, just wondering.
Cheers, Mac  _________________ 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 |
|
 |
|