ACCESS CRASH and MULTIPLE-COMMANDS-IN-LINE

P

PACALA_BA

Hi my typical function:
I am SHORTEN my lines now
Is there some Restriction of usage of:
-Double-DOT-OPERATOR ?(Here is an MASSIVE usage example)
-ONE-line FOR-NEXT
-ONE-line SELECT-CASE
-ONE line IF-THEN-IF-THEN-IF-THEN....
***********************************************
Public Function FF_TEXTAPPEND(cTEXT, Optional cFullFileName = gkPath_MOJ_TMP
& tmp & ".txt", Optional bCreateFile As Boolean = False, Optional nLimitText
As Long = gknLimit_TEXTBOX, Optional bRetOverFlow As Boolean, Optional
bMsgOverFlow As Boolean = True) As Boolean: On Error GoTo XPAC_CHYBA: Dim
llRet As Boolean, llCreateNew As Boolean, B As Scripting.TextStream,
lnLenALL&, lc_FileName$, ln_TRY_FILE&, ln_TRY_DIR&, il&, il_max&,
lc__proc_meno$, f As New Scripting.FileSystemObject, lc__proc_ErrUSR$,
ln__proc_err&, lc_LINE$, lc_cTEXT$: lc__proc_meno$ = "FF_TEXTAPPEND": If Not
IsNull(cTEXT) Then lc_cTEXT = CStr(cTEXT)
lc_FileName = cFullFileName: lnLenALL = Len(lc_cTEXT): If (lnLenALL >
nLimitText) Then ERROR_RAISE lc__proc_meno, lnLenALL & ", nLimitText OVERFLOW
(MAX=" & nLimitText & ") !" & vbCrLf & "FF: " & lc_FileName, bDummyErr:=Not
bMsgOverFlow: bRetOverFlow = True: GoTo xPAC_KONIEC
llCreateNew = bCreateFile: If Not FF_EXISTS(lc_FileName) Then llCreateNew =
True
If llCreateNew Then
If FF_EXISTS(lc_FileName) Then bb = FF_DEL(lc_FileName, Force:=True)
LBL_TRY_FILE: Set B = f.CreateTextFile(lc_FileName, True): B.Close
End If '-----BIG >>>> lc_cTEXT, dlho to pocita...If Len(lc_cTEXT) < 10000
Then
LBL_TRY_DIR: If (ln_TRY_DIR > 0) Then If (ln_TRY_FILE = 0) Then bb =
FO_CHECK(FF_PARSE(lc_FileName, eFPPath), bShowFolderError:=True): If Not bb
Then GoSub F_CRT_ERROR
Set B = f.OpenTextFile(lc_FileName, ForAppending): If B Is Nothing Then GoTo
xPAC_KONIEC
If Not (lc_cTEXT Like ("*" & vbLf & "*")) Then '' OLD: If (Not
EE_STR_SEEK(vbLf, lc_cTEXT)) Then
il_max = LINECount(lc_cTEXT): For il = 1 To il_max: lc_LINE =
LINEGet1(lc_cTEXT, il): B.WriteLine (lc_LINE): Next il
Else: B.Write lc_cTEXT
End If: B.Close: llRet = True
xPAC_KONIEC: Set f = Nothing: Set B = Nothing: FF_TEXTAPPEND = llRet: Exit
Function
F_CRT_ERROR: ERROR_RAISE lc__proc_meno, "Could <NOT> create... Folder: " &
lc_FileName: GoTo xPAC_KONIEC
F_FILE_ERROR: ERROR_RAISE lc__proc_meno, "Could <NOT> create... File: " &
lc_FileName: GoTo xPAC_KONIEC
XPAC_CHYBA: If (Err = 76 And (ln_TRY_DIR = 0)) Then ln_TRY_DIR = ln_TRY_DIR
+ 1: Err.Clear: Resume LBL_TRY_DIR
If (Err = 76 And (ln_TRY_DIR > 0)) Then ln_TRY_DIR = ln_TRY_DIR + 1:
Err.Clear: Resume F_CRT_ERROR
If (Err = 53 And (ln_TRY_FILE = 0)) Then ln_TRY_FILE = ln_TRY_FILE + 1:
Err.Clear: Resume LBL_TRY_FILE
If (Err = 53 And (ln_TRY_FILE > 0)) Then ln_TRY_FILE = ln_TRY_FILE + 1:
Err.Clear: Resume F_FILE_ERROR
lc__proc_ErrUSR = "File: " & cFullFileName: ln__proc_err& = ERROR_SHOW(Err,
lc__proc_meno$, lc__proc_ErrUSR$, lkCurModul_NV): Select Case ln__proc_err:
Case 1: Resume: Case 2: Resume Next: Case Else: GoTo xPAC_KONIEC: End Select:
End Function


----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...-b5db-f547cfc78aaf&dg=microsoft.public.access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top