1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: status.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-13 10:27:06 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : thorsten.bosbach@sun.com
36 '* short description : Routines for the status page feature
38 '\*****************************************************************************************
40 sub hStatusIn ( sTestAppArea as String, sTestname as String, optional sName as String )
41 '///hStatusIn : initilize variables before the teststart
42 '/// input : sTestAppArea => name of the application, to where the test is bound in status database -> gTestAppArea
43 ' sTestname => name of the test (converted to LOWERCASE in this sub!) -> gTestName
44 '///+ output : gStatusDuration => starttime of the test
45 '///+_ : gTestname => global name of the test
46 '///+_ : gTestAppArea => global name of the tested application as defined in status database
47 '///+_ : gTestDate => global start date of the test ( yyyy-mm-dd )
48 '///+_ : gTestTime => global start time of the test
50 ' sNname => DEPRECATED just kept for compatibility
52 dim bOverRide as boolean
55 gStatusDuration = now () '(1) used in hStatusOut
56 ' temporarly misused to set the start Date and Time!
58 ' Always needed for crashreporter test hint
59 gTestName = lcase (sTestname) '(2)
61 ' -------------- EXIT condition ----------------------
62 if (NOT isStatusEnabled()) then
66 gTestAppArea = lcase (sTestAppArea) '(3)
68 gTestDate = convertDateToDatabase (gStatusDuration) '(4)
69 gTestTime = convertTimeToDatabase (gStatusDuration) '(5)
71 ListAllDelete(glsStatusPage())
72 gErrorSum = getErrorCount() ' not 0! if you run 2-times status in/out in one bas-file!
73 gWarningSum = getWarningCount()
74 gQaErrorSum = getQaErrorCount()
76 ' make sure we have everything to update the status-Database.
77 gDatabasePath = getDatabasePath(privateDatabasePath)
78 if ("" = gDatabasePath) then
79 'Disable statusfeature, because the public filespace is not available.
80 gStatusDatabase = FALSE
81 printlog "** Status will be written to : DISABLED"
83 printlog "** Status will be written to : " + gDatabasePath
85 printlog "** Test environment preparation : " + wielange(gTestcaseStart)
88 sub hStatusOut ( optional NoKill as Boolean )
89 '///hStatusOut : last output for the status-page feature
90 '///+ -> create the duration value for the test and call the routine to write the data into the database
92 Dim sLocalTestDuration as string
95 printlog "** All tests finished."
96 sLocalTestDuration = WieLange( gStatusDuration )
97 gTestcaseStart= now () ' get time for writing status to database
99 ' -------------- EXIT condition ----------------------
100 ' don't record status if outside of status database
101 if (NOT isStatusEnabled()) then
102 Printlog "Date: " + Date() + "; Time: " + Time() + "; Duration: " + WieLange ( gStatusDuration )
106 if (""=gTestName) then
107 warnlog "status.inc::hStatusOut: You forgot to call hStatusIn(''Application'',''FileName.bas'')"
109 printlog "** Start generating quaste database files."
110 hStatusWriteOutputFirstFile() ' write again, to have correct duration written.
112 printlog "** Creating status duration : " + wielange(gTestcaseStart)
115 PrintLog Chr(13) + "* - End of the test - *"
116 Printlog "Date : " + Date() + " Time: " + Time()
117 Printlog "Duration : " + sLocalTestDuration
120 sub hStatusAddTestcase()
121 ' called from master.inc::TestExit() after every testcase
122 ' add to list for second file : testresult table / glsStatusPage()
123 ' reset gErrorSum, gWarningSum
124 dim sTestcaseDuration as string
125 dim sTestcaseStart as string
126 Dim sTCname as String
128 dim iErrorCount as integer
129 dim sErrorList() as string
130 dim iQaErrorCount as integer
131 dim sQaErrorList() as string
132 dim iWarningCount as integer
133 dim sWarningList() as string
134 Dim sOutput as String
135 dim iAllErrorCount as integer
136 dim sAllErrorList(42000) as string
138 dim iErrorLevel as integer
139 dim sErrorString(4) as string
141 '///The entries in the list are ( seperated by TAB ) :
142 '///+ testcase name => name of the current testcase in the running test
143 '///+ errors => only the errors for the current testcase
144 '///+ warnings => only the warnings for the current testcase
145 '///+ duration => the duration of the testcase
147 sTestcaseDuration = wielange(gTestcaseStart, 1) '(2)
148 sTestcaseStart = convertDateToDatabase(gTestcaseStart) + " " + convertTimeToDatabase(gTestcaseStart) ' TODO: ask HDE/TBO
150 sTCname = GetTestcaseName ' testtool basic command
151 iCut = Instr ( sTCname, "(" )
153 sTCname = Left ( sTCname, iCut - 1 )
155 sTCname = Trim ( sTCname ) '(1)
156 iErrorCount = getErrorCount() - gErrorSum ' only the errors in a testcase
157 iWarningCount = getWarningCount() - gWarningSum ' only the warnings in a testcase
158 iQaErrorCount = getQaErrorCount() - gQaErrorSum ' only the qaErrors in a testcase
160 iAllErrorCount = iErrorCount + iWarningCount + iQaErrorCount
161 if (iAllErrorCount > 0) then
163 sWarningList() = getWarningList()
164 for i = (GetWarningCount()+1-iWarningCount) to GetWarningCount()
165 sAllErrorList(x) = sWarningList(i)
166 'd printlog "++ " + sAllErrorList(x)
169 sErrorList() = getErrorList()
170 for i = (GetErrorCount()+1-iErrorCount) to GetErrorCount()
171 sAllErrorList(x) = sErrorList(i)
172 'd printlog "++ " + sAllErrorList(x)
175 sQaErrorList() = getQaErrorList()
176 for i = (getQaErrorCount()+1-iQaErrorCount) to getQaErrorCount()
177 sAllErrorList(x) = sQaErrorList(i)
178 'd printlog "++ " + sAllErrorList(x)
182 sAllErrorList(0) = "0;0;0;0"
185 ' generate status line for testcase and append to global array
186 '/// iErrorLevel: 0: no faults; 1: Warning; 2: Error; 3: qaError ///'
188 'D printlog "Iall: " + iAllErrorCount + " W:" + iWarningCount + " E: " + iErrorCount
189 for i = 0 to iAllErrorCount
191 case 0: if (0 = iAllErrorCount) then ' no errors at all
194 case 1 to iWarningCount: iErrorLevel = 1 'warnings
195 case (iWarningCount +1) to (iWarningCount + iErrorCount): iErrorLevel = 2 ' Errors
196 case (iWarningCount + iErrorCount +1) to (iWarningCount + iErrorCount + iQaErrorCount): iErrorLevel = 3 ' qaErrors
198 if (iErrorLevel > -1) then
199 'd printlog " " + i + " -------------"
200 'd printlog "'" + sAllErrorList(i) + "'"
201 sGetErrorStringFields(sAllErrorList(i), sErrorString())
202 'd printlog " -------------"
204 + Chr(9) + sTestcaseDuration _
205 + Chr(9) + iErrorLevel _
206 + Chr(9) + fRemoveLineBreaks(sErrorString(4)) _
207 + Chr(9) + sErrorString(2) _
208 + Chr(9) + trim(sErrorString(3)) _
209 + Chr(9) + fgetFileName(sErrorString(1)) _
210 + Chr(9) 'Description (4)_ 'Line (2)_ 'CVSversion (3)_ 'Filename (1)
211 if (sTCname <> "") then
212 ListAppend (glsStatusPage(), sOutput)
215 qaErrorlog "please try not to call a testcase from a testcase #116584#"
220 ' to set the variables to the current numbers
221 gErrorSum = getErrorCount()
222 gQaErrorSum = getQaErrorCount()
223 gWarningSum = getWarningCount()
226 sub hStatusWriteOutputFirstFile ()
227 ' called from hStatusOut and hStatusIn
229 Dim sOutFile as String
230 Dim sOutFileTemp as String
231 Dim sBuildHisPath as string
232 Dim sResultPath as string ' location where to write the files for status to
235 dim lTestrun(50) as string
236 dim sVersionMajor as string
237 dim sVersionMinor as string
238 dim sVersionBuilID as string
239 dim sDebugInfo as string
241 dim sFileName as string
242 dim slVersion() as string
243 dim ilVersion as integer
244 dim sVersionCWS as string
247 dim bError as boolean
248 dim sTestDuration as string
249 dim sSource as string
250 dim sProduct as string
251 dim sUsername as string
253 '///hStatusWriteOutputFirstFile : output routine for status page of our testscripts
254 '///The entries in the list are ( seperated by NEWLINE ) :
255 '///+ 1 major => major number of full buildID of StarOffice ( e.g. '642' )
256 '///+ 2 minor => minor number of full buildID of StarOffice ( e.g.'L' )
257 '///+ 3 buildID => only the buildID of full buildID of StarOffice ( e.g.'7733' )
258 '///+ 4 date ( gTestDate ) time ( gTestTime ) => fix date when the test started
259 '///+ 5 platform => short cut for platform
260 '///+ 6 machine name => name of the PC or UNIX-machine where the test is running
261 '///+ 7 user name => E-mail adress of user
262 '///+ 8 fileformat => version belonging to this spec
263 '///+ 9 language => language of the office
264 '///+ 10 test name => name of the test ( e.g. first.bas )
265 '///+ 11 test application area (gApplication) => which application is tested
266 '///+ 12 test duration => Hours:Minutes:Seconds ( e.g.'01:20:33' )
267 '///+ 13 cws name => if it is the master: 'Master' else the name of the childworkspace
268 '///+ 14 source tree =>
274 if ("unx" = gPlatgroup) then '(5)
280 slVersion() = Split(gProductName, " ") '(15)
281 sProduct = slVersion(0)
283 ' major is from start to 'm'
285 iPosB = instr(gVersionsnummer, "m")
286 if (iPosB = 0) then ' there is no minor
287 iPosB = instr(gVersionsnummer, "(")
289 sVersionMajor = Mid(gVersionsnummer, iPosA, (iPosB-iPosA)) '(1) Major
291 iPosB = instr(gVersionsnummer, "(")
292 sVersionMinor = Mid(gVersionsnummer, iPosA, iPosB-iPosA) '(2) Minor
293 iPosA = instr(gVersionsnummer, ":") + 1
294 iPosB = instr(gVersionsnummer, ")")
295 sVersionBuilID = Mid(gVersionsnummer, iPosA, iPosB-iPosA) '(3) Build
297 iPosA = instr(iPosB, gVersionsnummer, ":") + 1
298 iPosB = instr(iPosA, gVersionsnummer, "]")
299 sVersionCWS = Mid(gVersionsnummer, iPosA, iPosB-iPosA) '(13) CWS
301 sVersionCWS = "Master"
303 sSource = left(gMajor,3) '(14) Source tree
305 ' for MSC calculation of test duration hh:mm
306 sTestDuration = wielange(gStatusDuration, 1) '(12)
308 if ("" = gReturnAddress) then '(7)
309 if ("" = gLocalStatusDatabase) then
310 warnlog "Please set an e-mail adress for your crashreports in TestTool: Extra->Settings->Crashreport:EMail, it will also be used to send you notifications in case of problems submitting the status of the test to the database (quaste)."
314 sUsername = gReturnAddress
317 ListAppend ( lTestrun(), "fileformat=0.2" )
318 ListAppend ( lTestrun(), "product=" + sProduct )
319 ListAppend ( lTestrun(), "sourcetree=" + sSource )
320 ListAppend ( lTestrun(), "major=" + sVersionMajor )
321 ListAppend ( lTestrun(), "minor=" + sVersionMinor )
322 ListAppend ( lTestrun(), "buildid=" + sVersionBuilID )
323 ListAppend ( lTestrun(), "oooorigin=" + "")
324 ListAppend ( lTestrun(), "startdate=" + gTestDate + " " + gTestTime) '(4) ' generated in hStatusIn
325 ListAppend ( lTestrun(), "duration=" + sTestDuration )
326 ListAppend ( lTestrun(), "platform=" + sPlat )
327 ListAppend ( lTestrun(), "hostname=" + gPCName ) '(6)
328 ListAppend ( lTestrun(), "username=" + sUsername ) '(7)
329 ListAppend ( lTestrun(), "application=" + gTestAppArea) '(11) ' generated in hStatusIn
330 ListAppend ( lTestrun(), "testname=" + gTestName ) '(10) ' generated in hStatusIn
331 ListAppend ( lTestrun(), "cws=" + sVersionCWS )
332 ListAppend ( lTestrun(), "ooolanguage=" + iSprache ) '(9)
333 ListAppend ( lTestrun(), "checksum=" + "")
334 ' ListAppend ( lTestrun(), "data=" + )
336 ' files are created at (convertPath'ed):
337 sResultPath = convertPath(gDatabasePath)
338 sFileName = fGetQuasteFileName()
339 sOutFile = sResultPath + sFileName
341 ' TODO: make sure location is writeable! with file 'sOutFile'!!!
345 sOutFileTemp = sOutFile+i+".txt"
346 if (FileExists(sOutFileTemp)) then
347 ' printlog sOutFileTemp
349 if (dir(sOutFileTemp) <> "") then
350 warnLog "OLD File can't get deleted: " + sOutFileTemp
355 ListWrite (lTestrun(), sOutFile+"1.txt")
358 function fGetQuasteFileName() as string
362 if ("unx" = gPlatgroup) then
368 sName = lcase(sPlat + gUser + gPCname + Left(gTestname, Len(gTestname)-4) + "-" + iSprache + "-" )
369 fGetQuasteFileName = removeCharacter(sName,46) ' remove '.' dots from filename, would result in errors on uploading file.
372 sub hStatusWriteOutput (optional NoKill as Boolean)
373 ' called from hStatusOut
375 Dim sOutFile as String
376 Dim sOutFileTemp as String
377 Dim sBuildHisPath as string
378 Dim sResultPath as string ' location where to write the files for status to
381 dim sDebugInfo as string
383 dim sFileName as string
384 dim bError as boolean
385 dim sTestDuration as string
387 if ("unx" = gPlatgroup) then '(5)
393 ' files are created at (convertPath'ed):
394 sResultPath = convertPath(gDatabasePath)
395 sFileName = fGetQuasteFileName()
396 sOutFile = sResultPath + sFileName
398 for i = 1 to ListCount(glsStatusPage())
399 glsStatusPage(i) = "data=" + glsStatusPage(i)
402 ListWriteAppend (glsStatusPage(), sOutFile+"1.txt")
403 if (dir(sOutFile+"1.txt") = "") then warnlog "File wasn't created: " + sOutFile+"1.txt"
406 ' from now on the status routines are not executed, because i use tescases for displaying debug information, that should not get recorded
407 gTestName="" '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
409 ' call php-script to get file into the database
410 bError = StatusIntoDatabase (sFileName, sPlat, FALSE, gDatabasePath)
412 exit sub ' -> on error no file get's deleted!
415 ' wait until result-file got created; after 3 minutes cancel wait!
416 sOutFileTemp = sOutFile+"3.txt"
418 listAllDelete(glsStatusPage())
419 while (("" = dir(sOutFileTemp)) AND (i < 18))
424 if (i = 18) then ' big database error; resultfile wasn't created
425 warnlog "Status Write Error! (TimeOut waiting for webservice result)" +chr(13)+ "Email is send to: " + gReturnAddress
427 ListRead(glsStatusPage(), sOutFileTemp) '3
428 i = ListCount(glsStatusPage())
430 if (glsStatusPage(1) <> "OK") then
431 warnlog "Error in writing status to database (<> OK): '" + glsStatusPage(1) + "'" +chr(13)+ "Email is send to: " + gReturnAddress
433 if (gStatusFeatureLevel < 2) then
434 printlog " * - Status successfully written into database - * "
436 printlog " * - Status file successfully created - * "
441 warnlog "Error in writing status to database (<> 1 line)" +chr(13)+ "Email is send to: " + gReturnAddress
446 if (bError=FALSE) then
447 sOutFileTemp = sOutFile+"1.txt"
449 if (dir(sOutFileTemp) <> "") then
450 kill ( sOutFileTemp )
454 if (dir (sOutFileTemp) <> "") then
455 warnlog "File wasn't deleted: " + sOutFileTemp
458 sOutFileTemp = sOutFile+"3.txt"
460 if (dir(sOutFileTemp) <> "") then
461 kill ( sOutFileTemp )
465 if (dir (sOutFileTemp) <> "") then
466 warnlog "File wasn't deleted: " + sOutFileTemp
468 sOutFileTemp = sOutFile+"4.htm"
470 if (dir(sOutFileTemp) <> "") then
471 kill ( sOutFileTemp )
475 if (dir (sOutFileTemp) <> "") then
476 warnlog "File wasn't deleted: " + sOutFileTemp
478 ListAllDelete (glsStatusPage()) ' delete the list, because if you want to use hStatusIn twice or more
482 function StatusIntoDatabase (sFile as String, sPlat as String, NoKill as Boolean, sPath as string) as boolean
483 dim sSource as string
484 dim sDestination as string
487 '///StatusIntoDatabase : write the collected data into the database
488 if (gStatusFeatureLevel < 2) then
489 ' Automatical entry into database
490 printlog "** Calling webservice to grab status file."
491 StatusIntoDatabase = getWebPage (sPath, sPath+sFile+"4.htm", sPlat, privateDatabaseServerIP, privateDatabaseServerPath + sFile + "1.txt")
492 printlog "** Waiting for result from webservice."
494 ' preparation for manual entry into database
495 StatusIntoDatabase = FALSE
496 'create 3. file with OK :-)
497 sSource = convertPath(sPath)
500 ' if we have a CWS, generate a string of the CWS name
501 i = instr(gVersionsnummer, "[")
503 sDestination = Mid(gVersionsnummer, i+1)
504 i = len(sDestination)
505 sDestination = left(sDestination, i-1)
506 i = inStr(sDestination, ":")
507 mid(sDestination, i, 1, "_")
510 sDestination = sSource + lCase(gMajor + gMinor + sDestination)
511 TextInDatei("OK", sSource+sFile+"3.txt")
512 'move other files to directory, because standard is to delele successfull submitted data
513 if (dir(sDestination, 16) = "") then ' doesn't exist
515 if (dir(sDestination, 16) = "") then ' doesn't exist
516 warnlog "Database directory can't get created: '" + sDestination + "'"
518 printlog "Database directory created: '" + sDestination + "'"
521 sDestination = sDestination + gPathSigne
522 filecopy(sSource+sFile+"1.txt", sDestination+sFile+"1.txt")
526 function getWebPage (sPath as string, sResult as String, sPlat as String, sHost as string, sPage as string) as boolean
527 dim iShellReturn as integer
529 if (sPlat = "win") then
534 'httpSetProxy(Host, Port)
535 iShellReturn = httpSend(sHost, sPage, 80, sResult)
539 ' when using internal httpSend, iShellReturn contains http status numbers: 200 means: ok
540 if (iShellReturn = 99) then
541 printlog "Writing status to database with internal httpsend command failed: " + iShellReturn + chr(13) + sHost+sPage + chr(13) + sResult
543 if (iShellReturn <> 200) then
544 warnlog "Writing status to database with internal httpsend command failed: " + iShellReturn + chr(13) + sHost+sPage
550 testcase tDebugInfoMysql (sTemp as string)
551 ' to show the debuginfo folded in a testcase (if nokill = true)
552 dim fTemp(900) as string
557 ListRead (fTemp(), sTemp)
558 for i=1 to ListCount (fTemp())
559 if (fTemp(i) <> "") then printlog fTemp(i)
565 function isStatusEnabled() as boolean
566 '/// enable status only when: ///'
567 '///+ basedirectory is on server (variable is set to 1 gStatusFeatureLevel) ///'
568 isStatusEnabled = gStatusDatabase
571 function convertDateToDatabase(byVal inDate as Date) as string
572 Dim IsoData$, y$, m$, d$
574 IsoData$ = CDateToIso (inDate)
575 y$ = left$( IsoData$, 4 )
576 m$ = mid$( IsoData$, 5, 2 )
577 d$ = right$( IsoData$, 2 )
578 convertDateToDatabase = y$ + "-" + m$ + "-" + d$
581 function convertTimeToDatabase(byVal inTime as Date) as string
582 dim iSpace as integer
584 iSpace = inStr(inTime, " ")
586 inTime = right(inTime, len(inTime) - iSpace)
588 if (iSystemSprache = 1) then
590 convertTimeToDatabase = TimeValue(inTime)
592 qaErrorLog "global::system::inc::status.inc::convertTimeToDatabase; looking for root cause: 'Data type mismatch'; Input: '" + inTime + "'"
595 convertTimeToDatabase = Format (inTime, "hh:mm:ss")
599 function getDatabasePath(sSubDirectory as string) as string
601 dim sPathSeed as string
603 if gStatusFeatureLevel = 2 then
604 ' write it below 'errorlog' directory
605 sPath = convertPath(GetIniValue (gTesttoolIni, gTTProfileName , "LogBaseDir"))
606 if (right(sPath, 1) <> gPathSigne) then
607 sPath = sPath + gPathSigne
609 getDatabasePath = sPath
610 gLocalStatusDatabase = sPath
612 ' assumption: the only supported testcases are always on local fileserver -> gTestToolPath provides a valid volume !
613 if (gStatusFeatureLevel = 1) then
614 ' global filespace for database is defined in testtoolrc
615 sPath = gLocalStatusDatabase + gPathSigne
616 sPath = fRemoveDoubleCharacter(sPath, gPathSigne)
618 'gStatusFeatureLevel = 0
619 ' status database server is global defined
620 sPath = gTestToolPath + gPathSigne + sSubDirectory
621 sPath = convertPath(sPath)
622 sPath = fRemoveDoubleCharacter(sPath, gPathSigne)
623 sPath = fRelativeToAbsolutePath(sPath)
624 sPath = fRemoveDoubleCharacter(sPath+ gPathSigne, gPathSigne)
626 if (NOT fileExists(sPath + "quaste.txt")) then
627 qaErrorLog "The public file space seems to be wrong: " + sPath
630 getDatabasePath = sPath
633 sub sGetErrorStringFields(sIn as string, sOut() as string)
634 '/// put semicolon seperated string into an array ///'
635 '/// only used on every line from returnvalue of get*List() ///'
636 dim sTemp(3) as string
637 dim sTemp2() as string
639 if ("" = sIn) then ' workaround for i23697 split() returns wrong value on empty string
644 sTemp() = Split(sIn, ";")
646 if ((uBound(sTemp())+1) <> uBound(sOut())) then
647 for i = 1 to (uBound(sOut()) -1)
650 redim sTemp2(uBound(sTemp()) - uBound(sOut())+1) as string
651 for i = (uBound(sOut())-1) to uBound(sTemp())
652 sTemp2(i-(uBound(sOut())-1)) = sTemp(i)
654 sOut(uBound(sOut())) = join(sTemp2(), ":")
656 for i = 0 to uBound(sTemp())
661 ' for i = 0 to uBound(sTemp())
662 'd printlog "" + i + ": " + sTemp(i)
666 function fRemoveLineBreaks(sIn as string) as string
667 '/// Clean string from reserved characters and remove linebreaks ///'
668 '/// only used for errormessage in third field from get*List() ///'
671 dim iCharacters(7) as integer
672 iCharacters(1) = 9 ' TAB because it is field seperator in data file
673 iCharacters(2) = 10 ' LF because no linebreak is allowed in data file
674 iCharacters(3) = 13 ' CR because no linebreak is allowed in data file
675 iCharacters(4) = 39 ' ' because is string delemiter for mysql
676 iCharacters(5) = 8216 ' ' because is string delemiter for mysql
677 iCharacters(6) = 8217 ' ' because is string delemiter for mysql
678 iCharacters(7) = 92 '\ ' because it is escape code
683 sLocal = removeCharacter(sLocal,iCharacters(x))
686 fRemoveLineBreaks = sLocal
689 function removeCharacter(sIn as string, iCharacter as integer) as string
691 dim sArray() as string
693 dim iBound as integer
695 if ("" = sLocal) then ' workaround for i23697 split() returns wrong value on empty string
700 sArray() = split(sLocal, chr(iCharacter))
703 iBound = uBound(sArray())
704 ' if (iBound > 0) then printlog "########## " + i + " - " + iCharacters(x) + " ++++ " + iBound
706 sLocal = sLocal + sArray(i)
708 removeCharacter = sLocal
711 function fgetFileName(byVal sIn as string) as string
712 '/// extract file name from string, where PathSeperator is always Backslash ///'
713 '/// only used for filestring in first field from get*List() ///'
714 dim sTemp(0) as string
715 if ("" = sIn) then ' workaround for i23697 split() returns wrong value on empty string
718 sTemp() = split(sIn, "\") ' GH returns hopefully always a Backslash as seperator
720 fgetFileName = sTemp(uBound(sTemp()))