Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
String functions in VB
Message
 
 
À
26/02/2003 17:15:19
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00758442
Message ID:
00758561
Vues:
34
>For 200302261629, maybe: Format(Date(),"yyyymmdd") & Format(Time(),"hhmm").

Exactly that I figured. Except that I'm still confusing & and + as in VFP.

Thanks again.

BTW, do you know, how much does each function cost? For instance, I showed my manager the following code, suggested at the forum:

=========
<%@ Language="VBScript" %>
<% Option Explicit %>
<%
'''''''''''
'UNIQUE ID'
'''''''''''
mvar = Trim(Cstr(Month(Now)))
dvar = Trim(Cstr(Day(Now)))
IF Len(mvar) = 1 THEN
    mvar = "0" & mvar
END IF
IF Len(dvar) = 1 THEN
    dvar = "0" & dvar
END IF
ui = Right(Cstr(Session.SessionID),3) & Year(Now) & mvar & dvar & Timer
%>
Your unique id is now stored in the VBScript variable ui. I like to use the Timer property. This is the amount of seconds, to the 100th of a second, that has elasped since midnight. Makes duplicating this ID virtually impossible since it also include the last 3 digits of the Session ID.

ToddWW
===========================
His comments were - 1) no need for trim, 2) doing cast operation is costly

So, it would be interesting to know the "weight" of each operation...

Can you comment?

Thanks.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform