Jumat, 11 Mei 2012

RE: [AccessDevelopers] Initalizing variables ; study help please

 

The `Static NotFirstTime As Boolean`  is just Declaring the variable.  You can assign a value to the variable on another line.  Although, Boolean variables should start with value False by default.
 
HTH,
Toby
 
-----Original Message-----
From: AccessDevelopers@yahoogroups.com [mailto:AccessDevelopers@yahoogroups.com] On Behalf Of dwightknotgunn
Sent: Thursday, May 10, 2012 11:06 PM
To: AccessDevelopers@yahoogroups.com
Subject: [AccessDevelopers] Initalizing variables ; study help please

 

{SHOULD NOT THE 4TH LINE BE NotFirstTime = True or False or Something}
From O'Reilly's Access Database-Design & Programming 2nd Edition page 170. Example 10-1. Using a Static Variable

Sub StaticExample()

'Declare static Boolean variable
Static NotFirstTime As Boolean

'If first time, then run special code
If NotFirstTime = False Then

'Code here that runs only the first time procedure is called

'No longer the first time
NotFirstTime = True

Else

'Not the first time
'Code here will run if not first time

End If
'Code here will run if not first time
End Sub

__._,_.___
Recent Activity:

Please zip all files prior to uploading to Files section.
.

__,_._,___

Tidak ada komentar:

Posting Komentar