gettingstarted
[Top] [All Lists]

RE: changing app's title

To: "'Getting Started'" <gettingstarted at lists dot realsoftware dot com>
Subject: RE: changing app's title
From: "RBNUBE" <rbnube at mabenterprises dot com>
Date: Sun, 27 Aug 2006 00:04:58 -0400
Delivered-to: listarchive at realsoftware dot com
Delivered-to: gettingstarted at lists dot realsoftware dot com
Importance: Normal
Keywords: RB-Getting Started
The following in the Open event of the window will change the window title:
  Dim d as Date
  d=New Date
  
  Me.Title = d.shortdate

However, it's not a good idea (if coding cross platform) to use that date
format to name a file because it contains forward slashes.


Something like this might be better:

  Dim d as Date
  Dim theMonth, theDay, theYear as String
  d=New Date
  
  If d.Month < 10 then
    // Add a leading zero.
    theMonth = "0" + Str(d.Month)
  Else
    theMonth = Str(d.Month)
  End If
  
  If d.Day < 10 then
    // Add a leading zero.
    theDay = "0" + Str(d.Day)
  Else
    theDay = Str(d.Day)
  End If
  
// Get the year and move from the right two
// characters to get only the last two characters.
  theYear = Right(Str(d.Year), 2)
  
  Me.Title = theMonth + theDay + theYear

HTH




_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>