From 6b758c4f6d50ed2cf7685d6997f43c8eb617ef44 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 25 Jul 2010 08:45:50 +0000 Subject: [PATCH] 2010-07-25 10:41 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/xhb/hbcompat.ch + Added xhb translations for hb_eol() and hb_ps(). * contrib/make.hbs - Deleted SetCancel(). * src/debug/tbrwtext.prg * src/debug/debugger.prg * src/rtl/errsys.prg * src/rtl/profiler.prg * src/rtl/hbini.prg * src/rtl/treport.prg * src/rtl/tpersist.prg * src/rtl/hbi18n2.prg * src/rtl/ttextlin.prg * src/rtl/teditor.prg * src/rdd/usrrdd/rdds/logrdd.prg * tests/hbpptest/hbpptest.prg * tests/longstr2.prg * tests/cdow.prg * tests/output.prg * tests/dirtest.prg * tests/tstdbi.prg * tests/speedold.prg * tests/dates3.prg * tests/set_test.prg * tests/rto_get.prg * tests/cpinfo.prg * tests/speedtst.prg * tests/dates.prg * tests/set_num.prg * tests/rto_tb.prg * tests/testhtml.prg * tests/round.prg * tests/dates2.prg * tests/dates4.prg * tests/version.prg * tests/seconds.prg * tests/gtkeys.prg * tests/adirtest.prg * include/simpleio.ch * include/assert.ch * contrib/hbct/tests/tab.prg * contrib/hbct/tests/expomant.prg * contrib/xhb/traceprg.prg * contrib/xhb/hblog.prg * contrib/xhb/dumpvar.prg * contrib/xhb/dbgfx.prg * contrib/xhb/xhberr.prg * contrib/xhb/cstruct.prg * contrib/hbqt/generator/hbqtgen.prg * contrib/hbqt/hbqt_errorsys.prg * contrib/hbqt/generator2/hbqtgen2.prg * contrib/hbxpp/hbxpp.ch * contrib/hbnetio/utils/netiosrv.prg * contrib/hbnetio/utils/rpcdemo.hbs * contrib/hbnetio/utils/netiocmd.prg * contrib/hbpgsql/tests/dbf2pg.prg * contrib/hbmisc/tests/readfile.prg * contrib/hbmisc/tests/testhbf.prg * contrib/hbtip/thtml.prg * contrib/hbtip/client.prg * contrib/hbwin/tests/testsim.prg * contrib/hbwin/tests/testole.prg * contrib/hbwin/tests/testsvc.prg * contrib/hbssl/tests/bio.prg * contrib/hbssl/tests/pem.prg * contrib/hbide/ideedit.prg * contrib/hbide/idemisc.prg * contrib/hbide/idethemes.prg * contrib/hbide/idesaveload.prg * contrib/hbide/idedocwriter.prg * contrib/hbide/hbide.ch * contrib/hbide/ideprojmanager.prg * contrib/hbide/idehome.prg * contrib/hbide/ideshortcuts.prg * utils/hbformat/hbformat.prg * utils/hbmk2/hbmk2.prg * utils/hbi18n/hbi18n.prg * utils/hbtest/hbtest.prg * examples/hbextern/hbextern.prg * examples/uhttpd2/umain.prg * examples/guestbk/inifiles.prg * examples/guestbk/testcgi.prg * examples/httpsrv/uhttpd.prg * examples/hscript/hscript.prg * hb_osnewline() -> hb_eol() (deleting temp variables and temp pp macros used in the past to workaround the long typing of the old function name) * Some formatting along the way in tests dir. * src/rtl/errsys.prg - Deleted usage of ISNIL(). It's a quite pointless macro. * src/rtl/errsys.prg * src/rtl/listbox.prg * src/rtl/profiler.prg * src/rtl/treport.prg * src/rtl/tpersist.prg * src/rtl/tgetlist.prg * src/rtl/teditor.prg % DO CASE -> SWITCH * src/rtl/alert.prg * Replaced DEFAULT TO with simple NIL check. * src/compiler/gencc.c * Formatting of generated code. * contrib/hbide/ideedit.prg * contrib/hbide/idemisc.prg * contrib/hbide/idethemes.prg * contrib/hbide/idesaveload.prg * contrib/hbide/idedocwriter.prg * contrib/hbide/hbide.ch * contrib/hbide/ideprojmanager.prg * contrib/hbide/idehome.prg * contrib/hbide/ideshortcuts.prg * hb_osPathSeparator() (and static variable) -> hb_ps() --- harbour/ChangeLog | 131 +++++++++- harbour/contrib/hbct/tests/expomant.prg | 22 +- harbour/contrib/hbct/tests/tab.prg | 44 ++-- harbour/contrib/hbide/hbide.ch | 1 - harbour/contrib/hbide/idedocwriter.prg | 8 +- harbour/contrib/hbide/ideedit.prg | 7 +- harbour/contrib/hbide/idehome.prg | 10 +- harbour/contrib/hbide/idemisc.prg | 32 +-- harbour/contrib/hbide/ideprojmanager.prg | 5 +- harbour/contrib/hbide/idesaveload.prg | 4 +- harbour/contrib/hbide/ideshortcuts.prg | 3 +- harbour/contrib/hbide/idethemes.prg | 4 +- harbour/contrib/hbmisc/tests/readfile.prg | 22 +- harbour/contrib/hbmisc/tests/testhbf.prg | 64 ++--- harbour/contrib/hbnetio/utils/netiocmd.prg | 10 +- harbour/contrib/hbnetio/utils/netiosrv.prg | 66 ++--- harbour/contrib/hbnetio/utils/rpcdemo.hbs | 2 +- harbour/contrib/hbpgsql/tests/dbf2pg.prg | 14 +- harbour/contrib/hbqt/generator/hbqtgen.prg | 99 ++++---- harbour/contrib/hbqt/generator2/hbqtgen2.prg | 26 +- harbour/contrib/hbqt/hbqt_errorsys.prg | 18 +- harbour/contrib/hbssl/tests/bio.prg | 4 +- harbour/contrib/hbssl/tests/pem.prg | 6 +- harbour/contrib/hbtip/client.prg | 4 +- harbour/contrib/hbtip/thtml.prg | 26 +- harbour/contrib/hbwin/tests/testole.prg | 6 +- harbour/contrib/hbwin/tests/testsim.prg | 6 +- harbour/contrib/hbwin/tests/testsvc.prg | 8 +- harbour/contrib/hbxpp/hbxpp.ch | 4 +- harbour/contrib/make.hbs | 2 - harbour/contrib/xhb/cstruct.prg | 6 +- harbour/contrib/xhb/dbgfx.prg | 2 +- harbour/contrib/xhb/dumpvar.prg | 86 ++++--- harbour/contrib/xhb/hbcompat.ch | 6 + harbour/contrib/xhb/hblog.prg | 12 +- harbour/contrib/xhb/traceprg.prg | 12 +- harbour/contrib/xhb/xhberr.prg | 16 +- harbour/examples/guestbk/inifiles.prg | 6 +- harbour/examples/guestbk/testcgi.prg | 18 +- harbour/examples/hbextern/hbextern.prg | 116 ++++----- harbour/examples/hscript/hscript.prg | 22 +- harbour/examples/httpsrv/uhttpd.prg | 6 +- harbour/examples/uhttpd2/umain.prg | 64 ++--- harbour/include/assert.ch | 2 +- harbour/include/simpleio.ch | 4 +- harbour/src/compiler/gencc.c | 6 +- harbour/src/debug/debugger.prg | 36 +-- harbour/src/debug/tbrwtext.prg | 2 +- harbour/src/rdd/usrrdd/rdds/logrdd.prg | 2 +- harbour/src/rtl/alert.prg | 8 +- harbour/src/rtl/errsys.prg | 18 +- harbour/src/rtl/hbi18n2.prg | 12 +- harbour/src/rtl/hbini.prg | 2 +- harbour/src/rtl/listbox.prg | 19 +- harbour/src/rtl/profiler.prg | 32 +-- harbour/src/rtl/teditor.prg | 50 ++-- harbour/src/rtl/tgetlist.prg | 250 +++++++++++-------- harbour/src/rtl/tpersist.prg | 70 +++--- harbour/src/rtl/treport.prg | 24 +- harbour/src/rtl/ttextlin.prg | 2 +- harbour/tests/adirtest.prg | 15 +- harbour/tests/cdow.prg | 23 +- harbour/tests/cpinfo.prg | 2 +- harbour/tests/dates.prg | 75 +++--- harbour/tests/dates2.prg | 43 ++-- harbour/tests/dates3.prg | 34 +-- harbour/tests/dates4.prg | 26 +- harbour/tests/dirtest.prg | 36 +-- harbour/tests/gtkeys.prg | 59 +++-- harbour/tests/hbpptest/hbpptest.prg | 224 ++++++++--------- harbour/tests/longstr2.prg | 16 +- harbour/tests/output.prg | 3 +- harbour/tests/round.prg | 3 +- harbour/tests/rto_get.prg | 74 +++--- harbour/tests/rto_tb.prg | 142 +++++------ harbour/tests/seconds.prg | 13 +- harbour/tests/set_num.prg | 10 +- harbour/tests/set_test.prg | 12 +- harbour/tests/speedold.prg | 248 +++++++++--------- harbour/tests/speedtst.prg | 2 +- harbour/tests/testhtml.prg | 20 +- harbour/tests/tstdbi.prg | 96 ++++--- harbour/tests/version.prg | 18 +- harbour/utils/hbformat/hbformat.prg | 2 +- harbour/utils/hbi18n/hbi18n.prg | 34 +-- harbour/utils/hbmk2/hbmk2.prg | 7 +- harbour/utils/hbtest/hbtest.prg | 68 ++--- 87 files changed, 1512 insertions(+), 1362 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d2c0ef4640..99592bc035 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,127 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-25 10:41 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/xhb/hbcompat.ch + + Added xhb translations for hb_eol() and hb_ps(). + + * contrib/make.hbs + - Deleted SetCancel(). + + * src/debug/tbrwtext.prg + * src/debug/debugger.prg + * src/rtl/errsys.prg + * src/rtl/profiler.prg + * src/rtl/hbini.prg + * src/rtl/treport.prg + * src/rtl/tpersist.prg + * src/rtl/hbi18n2.prg + * src/rtl/ttextlin.prg + * src/rtl/teditor.prg + * src/rdd/usrrdd/rdds/logrdd.prg + * tests/hbpptest/hbpptest.prg + * tests/longstr2.prg + * tests/cdow.prg + * tests/output.prg + * tests/dirtest.prg + * tests/tstdbi.prg + * tests/speedold.prg + * tests/dates3.prg + * tests/set_test.prg + * tests/rto_get.prg + * tests/cpinfo.prg + * tests/speedtst.prg + * tests/dates.prg + * tests/set_num.prg + * tests/rto_tb.prg + * tests/testhtml.prg + * tests/round.prg + * tests/dates2.prg + * tests/dates4.prg + * tests/version.prg + * tests/seconds.prg + * tests/gtkeys.prg + * tests/adirtest.prg + * include/simpleio.ch + * include/assert.ch + * contrib/hbct/tests/tab.prg + * contrib/hbct/tests/expomant.prg + * contrib/xhb/traceprg.prg + * contrib/xhb/hblog.prg + * contrib/xhb/dumpvar.prg + * contrib/xhb/dbgfx.prg + * contrib/xhb/xhberr.prg + * contrib/xhb/cstruct.prg + * contrib/hbqt/generator/hbqtgen.prg + * contrib/hbqt/hbqt_errorsys.prg + * contrib/hbqt/generator2/hbqtgen2.prg + * contrib/hbxpp/hbxpp.ch + * contrib/hbnetio/utils/netiosrv.prg + * contrib/hbnetio/utils/rpcdemo.hbs + * contrib/hbnetio/utils/netiocmd.prg + * contrib/hbpgsql/tests/dbf2pg.prg + * contrib/hbmisc/tests/readfile.prg + * contrib/hbmisc/tests/testhbf.prg + * contrib/hbtip/thtml.prg + * contrib/hbtip/client.prg + * contrib/hbwin/tests/testsim.prg + * contrib/hbwin/tests/testole.prg + * contrib/hbwin/tests/testsvc.prg + * contrib/hbssl/tests/bio.prg + * contrib/hbssl/tests/pem.prg + * contrib/hbide/ideedit.prg + * contrib/hbide/idemisc.prg + * contrib/hbide/idethemes.prg + * contrib/hbide/idesaveload.prg + * contrib/hbide/idedocwriter.prg + * contrib/hbide/hbide.ch + * contrib/hbide/ideprojmanager.prg + * contrib/hbide/idehome.prg + * contrib/hbide/ideshortcuts.prg + * utils/hbformat/hbformat.prg + * utils/hbmk2/hbmk2.prg + * utils/hbi18n/hbi18n.prg + * utils/hbtest/hbtest.prg + * examples/hbextern/hbextern.prg + * examples/uhttpd2/umain.prg + * examples/guestbk/inifiles.prg + * examples/guestbk/testcgi.prg + * examples/httpsrv/uhttpd.prg + * examples/hscript/hscript.prg + * hb_osnewline() -> hb_eol() + (deleting temp variables and temp pp macros used in the past + to workaround the long typing of the old function name) + * Some formatting along the way in tests dir. + + * src/rtl/errsys.prg + - Deleted usage of ISNIL(). It's a quite pointless macro. + + * src/rtl/errsys.prg + * src/rtl/listbox.prg + * src/rtl/profiler.prg + * src/rtl/treport.prg + * src/rtl/tpersist.prg + * src/rtl/tgetlist.prg + * src/rtl/teditor.prg + % DO CASE -> SWITCH + + * src/rtl/alert.prg + * Replaced DEFAULT TO with simple NIL check. + + * src/compiler/gencc.c + * Formatting of generated code. + + * contrib/hbide/ideedit.prg + * contrib/hbide/idemisc.prg + * contrib/hbide/idethemes.prg + * contrib/hbide/idesaveload.prg + * contrib/hbide/idedocwriter.prg + * contrib/hbide/hbide.ch + * contrib/hbide/ideprojmanager.prg + * contrib/hbide/idehome.prg + * contrib/hbide/ideshortcuts.prg + * hb_osPathSeparator() (and static variable) -> hb_ps() + 2010-07-24 18:27 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qth/HBQPlainTextEdit.qth * contrib/hbqt/qtgui/THBQPlainTextEdit.prg @@ -24,19 +145,19 @@ * contrib/hbqt/hbqt_hbqplaintextedit.cpp * contrib/hbqt/hbqt_hbqplaintextedit.h + Added: one more method call. - + * contrib/hbide/idebrowse.prg * contrib/hbide/ideedit.prg * contrib/hbide/ideeditor.prg - + Implemented: for + + Implemented: for FIELD-> and someAlias-> table fields for tables opened in ideDBU. How it Works: 1. Open few tables in ideDBU. - 2. In some editor instance type "FIELD->" + 2. In some editor instance type "FIELD->" It will set the field completion mode ON. 3. type some letter starting a field, say, "a" - Code completion dialog will open with all fields + Code completion dialog will open with all fields starting with "a" contained in all the tables opened. 4. To get list of all fields in all tables, after typing FIELD-> type "x" and then press back space. @@ -65,7 +186,7 @@ * contrib/hbqt/qtgui/HBQPlainTextEdit.cpp * contrib/hbqt/qtgui/THBQPlainTextEdit.prg * contrib/hbqt/qth/HBQPlainTextEdit.qth - + Prepared: to handle another field completion protocol - + + Prepared: to handle another field completion protocol - a work-in-progress. * contrib/hbxbp/xbpbrowse.prg diff --git a/harbour/contrib/hbct/tests/expomant.prg b/harbour/contrib/hbct/tests/expomant.prg index 407bd4e927..615b23e7b3 100644 --- a/harbour/contrib/hbct/tests/expomant.prg +++ b/harbour/contrib/hbct/tests/expomant.prg @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * CT3 function test for + * CT3 function test for * - EXPONENT * - MANTISSA * @@ -55,24 +55,24 @@ PROCEDURE MAIN -local n + local n - CTINIT() + CTINIT() - SET DECIMALS TO 15 + SET DECIMALS TO 15 - for n := 1 to 1000 - outstd (str(n,20,15)+": "+str(mantissa(n),20,15)+" "+str(exponent(n),4) + hb_osnewline()) - outstd (str(sqrt(n),20,15)+": "+str(mantissa(sqrt(n)),20,15)+" "+str(exponent(sqrt(n)),4) + hb_osnewline()) - next n + for n := 1 to 1000 + outstd (str(n,20,15)+": "+str(mantissa(n),20,15)+" "+str(exponent(n),4) + hb_eol()) + outstd (str(sqrt(n),20,15)+": "+str(mantissa(sqrt(n)),20,15)+" "+str(exponent(sqrt(n)),4) + hb_eol()) + next n // The call to str( infinity(.t.) ), generate a GPF. // outstd (str(infinity(.t.))+str(mantissa( infinity(.t.) ))+str(exponent( infinity(.t.) ))) // outstd (str(infinity(.t.)) ) - outstd (" infinity(.t.): "+str(mantissa(infinity(.t.)),20,15)+" ") - outstd (str(exponent(infinity(.t.)),4)+hb_osnewline()) + outstd (" infinity(.t.): "+str(mantissa(infinity(.t.)),20,15)+" ") + outstd (str(exponent(infinity(.t.)),4)+hb_eol()) - CTEXIT() + CTEXIT() RETURN diff --git a/harbour/contrib/hbct/tests/tab.prg b/harbour/contrib/hbct/tests/tab.prg index f5fc691030..6397a0b2a5 100644 --- a/harbour/contrib/hbct/tests/tab.prg +++ b/harbour/contrib/hbct/tests/tab.prg @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * Test CT3 functions TABEXPAND() and TABPACK() + * Test CT3 functions TABEXPAND() and TABPACK() * * Copyright 2002 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany * Author: Martin Vogel @@ -76,21 +76,21 @@ local cStr, nLen qout ("") qout ("Tests with newline characters: ^J == LF, ^M == CR") - cStr := hb_osnewline() + cStr := hb_eol() cStr := strtran (cStr, chr(10),"^J") cStr := strtran (cStr, chr(13),"^M") - qout ([ hb_osnewline() = "] + cStr +["]) - cStr := tabexpand("-"+chr(9)+"!"+hb_osnewline()+"----"+chr(9)+ "!",, "+") + qout ([ hb_eol() = "] + cStr +["]) + cStr := tabexpand("-"+chr(9)+"!"+hb_eol()+"----"+chr(9)+ "!",, "+") cStr := strtran (cStr, chr(10),"^J") cStr := strtran (cStr, chr(13),"^M") - qout ([ tabexpand("-"+chr(9)+"!"+hb_osnewline()+"----"+chr(9)+ "!",, "+")]) - qout ([ == "-+++++++!"+hb_osnewline()+"----++++!" ? -> "] + cStr +["]) - cStr := tabexpand("-"+chr(9)+"!$$--"+hb_osnewline()+"--"+chr(9)+ "!",, "+", "$") + qout ([ tabexpand("-"+chr(9)+"!"+hb_eol()+"----"+chr(9)+ "!",, "+")]) + qout ([ == "-+++++++!"+hb_eol()+"----++++!" ? -> "] + cStr +["]) + cStr := tabexpand("-"+chr(9)+"!$$--"+hb_eol()+"--"+chr(9)+ "!",, "+", "$") cStr := strtran (cStr, chr(10),"^J") cStr := strtran (cStr, chr(13),"^M") - qout ([ tabexpand("-"+chr(9)+"!$$--"+hb_osnewline()+--"+chr(9)+ "!",, "+", "$")]) - nLen := len (hb_osnewline()) - qout ([ == "-+++++++!$$--"+hb_osnewline()+"]+replicate("-",4-nLen)+[++!" ? -> "] + cStr +["]) + qout ([ tabexpand("-"+chr(9)+"!$$--"+hb_eol()+--"+chr(9)+ "!",, "+", "$")]) + nLen := len (hb_eol()) + qout ([ == "-+++++++!$$--"+hb_eol()+"]+replicate("-",4-nLen)+[++!" ? -> "] + cStr +["]) qout ("") qout ("Tests with tab characters:") @@ -116,18 +116,18 @@ local cStr, nLen qout ("") qout ("Tests with newline characters:") - cStr := hb_osnewline() + cStr := hb_eol() cStr := strtran (cStr, chr(10),"^J") cStr := strtran (cStr, chr(13),"^M") - qout ([ hb_osnewline() = "] + cStr +["]) + qout ([ hb_eol() = "] + cStr +["]) - cStr := "ABCD+" + hb_osnewline() + "++---+++++" + cStr := "ABCD+" + hb_eol() + "++---+++++" cStr := tabpack (cStr, 4, "+") cStr := strtran (cStr, chr(10),"^J") cStr := strtran (cStr, chr(13),"^M") cStr := strtran (cStr, chr(9),"^I") - qout ([ tabpack("ABCD+" + hb_osnewline() + "++---+++++", 4, "+")]) - qout ([ == "ABCD+"+hb_osnewline()+"++---"+chr(9)+"++" ? -> "] + cStr +["]) + qout ([ tabpack("ABCD+" + hb_eol() + "++---+++++", 4, "+")]) + qout ([ == "ABCD+"+hb_eol()+"++---"+chr(9)+"++" ? -> "] + cStr +["]) qout ("End test of TABPACK()") qout ("") @@ -138,21 +138,21 @@ local cStr, nLen // qout (" ...press any key to start the memoedit now...") // qout ("") // inkey (0) -// cls +// cls // dispbox (0,0,20,60) // cStr := memoedit (, 1, 1, 9, 59,,,59) // cls // qout (" Now printing the expanded text using a tab length of 4 and soft CRs") // cStr1 := tabexpand (cStr,4,"+",,,.F.) -// cStr1 := strtran (cStr, chr(141), hb_osnewline()) -// +// cStr1 := strtran (cStr, chr(141), hb_eol()) +// // for ni := 1 to mlcount (cStr1, 59, 4, .T.) // qout (" "+str(ni)+": "+memoline (cStr1, 59,ni,4,.T.)) // next ni -// +// // qout (" Now printing the expanded text using a tab length of 4 but without soft CRs") // cStr1 := tabexpand (cStr,4,"+",,,.T.) -// +// // for ni := 1 to mlcount (cStr1, 59, 4, .T.) // qout (" "+str(ni)+": "+memoline (cStr1, 59,ni,4,.T.)) // next ni @@ -161,7 +161,3 @@ local cStr, nLen ctexit() return - - - - diff --git a/harbour/contrib/hbide/hbide.ch b/harbour/contrib/hbide/hbide.ch index 44d23312f1..d064dffa62 100644 --- a/harbour/contrib/hbide/hbide.ch +++ b/harbour/contrib/hbide/hbide.ch @@ -63,7 +63,6 @@ #define UI_MODE_FUNC 1 #define UI_MODE_UI 2 -#define CRLF hb_osNewLine() #define _EOL Chr( 10 ) #define HBIDE_USE_UIC diff --git a/harbour/contrib/hbide/idedocwriter.prg b/harbour/contrib/hbide/idedocwriter.prg index ef818c9965..c92b614502 100644 --- a/harbour/contrib/hbide/idedocwriter.prg +++ b/harbour/contrib/hbide/idedocwriter.prg @@ -112,7 +112,7 @@ FUNCTION hbide_getSVNHeader() - RETURN "/* " + CRLF + " * $Id:" + CRLF + " */" + CRLF + CRLF + RETURN "/* " + hb_eol() + " * $Id:" + hb_eol() + " */" + hb_eol() + hb_eol() /*----------------------------------------------------------------------*/ @@ -141,7 +141,7 @@ FUNCTION hbide_arg2memo( aArg ) LOCAL s, cMemo := "" FOR EACH s IN aArg - cMemo += "<" + s + ">" + iif( s:__enumIndex() < len( aArg ), CRLF, "" ) + cMemo += "<" + s + ">" + iif( s:__enumIndex() < len( aArg ), hb_eol(), "" ) NEXT RETURN cMemo @@ -622,7 +622,7 @@ METHOD IdeDocWriter:saveInFile() IF !empty( cFile ) cBuffer := hb_memoread( cFile ) cBuffer := iif( "$Id:" $ cBuffer, cBuffer, hbide_getSVNHeader() + cBuffer ) - cBuffer += CRLF + cBuffer += hb_eol() cBuffer += hbide_arrayToMemo( txt_ ) hb_memowrit( cFile, cBuffer ) @@ -749,5 +749,3 @@ METHOD IdeDocWriter:buildDocument() RETURN txt_ /*----------------------------------------------------------------------*/ - - diff --git a/harbour/contrib/hbide/ideedit.prg b/harbour/contrib/hbide/ideedit.prg index d878786010..7782b4a6bf 100644 --- a/harbour/contrib/hbide/ideedit.prg +++ b/harbour/contrib/hbide/ideedit.prg @@ -849,7 +849,7 @@ METHOD IdeEdit:copyBlockContents( aCord ) ENDIF aadd( ::aBlockCopyContents, cLine ) - cClip += cLine + iif( i < nB, hb_osNewLine(), iif( cLine == oLine, hb_osNewLine(), "" ) ) + cClip += cLine + iif( i < nB, hb_eol(), iif( cLine == oLine, hb_eol(), "" ) ) NEXT * HB_TRACE( HB_TR_ALWAYS, "copyBlockContents", cClip ) @@ -918,7 +918,7 @@ METHOD IdeEdit:pasteBlockContents( nMode ) FOR i := 1 TO len( aCopy ) qCursor:insertText( aCopy[ i ] ) IF i < len( aCopy ) - qCursor:insertText( hb_osNewLine() ) + qCursor:insertText( hb_eol() ) ENDIF NEXT @@ -1271,7 +1271,7 @@ METHOD IdeEdit:getSelectedText() ENDIF - cClip += cLine + iif( i < nB, hb_osNewLine(), "" ) + cClip += cLine + iif( i < nB, hb_eol(), "" ) NEXT RETURN cClip @@ -2542,4 +2542,3 @@ STATIC FUNCTION hbide_normalizeRect( aCord, nT, nL, nB, nR ) RETURN NIL /*----------------------------------------------------------------------*/ - diff --git a/harbour/contrib/hbide/idehome.prg b/harbour/contrib/hbide/idehome.prg index 8edfa5e4f4..20b48b5efa 100644 --- a/harbour/contrib/hbide/idehome.prg +++ b/harbour/contrib/hbide/idehome.prg @@ -553,9 +553,9 @@ STATIC FUNCTION hbide_getFaqs() aadd( a_, 'Does hbIDE provides "intellisense" ? If yes, in what aspects ?' ) aadd( b_, 'Yes. Not so powerful yet, but "yes". hbIDE embeds two components as the basis of this intellisense, ' + ; - CRLF + ; - ' 1. Harbour Documentation, and ' + CRLF + ; - ' 2. Project(s) Prototype Tagging. ' + CRLF + ; + hb_eol() + ; + ' 1. Harbour Documentation, and ' + hb_eol() + ; + ' 2. Project(s) Prototype Tagging. ' + hb_eol() + ; 'Both these components can be pressed in servive simultaneously and as per need. Both are loaded ' + ; 'only when requested. Prototype Tagging extends one step forward as to offer to load only those ' + ; 'projects which a developer will be working on during that session. Both components can be aligned ' + ; @@ -563,8 +563,8 @@ STATIC FUNCTION hbide_getFaqs() 'hbIDE examines the contents of these components, if the function is available in Harbour Docs, ' + ; 'its details are dumped into the viewer, otherwise if the function is contained in the tagged ' + ; 'prototypes, it is made current in the list, and a html formatted prototype is displayed as tooltip ' + ; - 'beneth the current caret position. ' + CRLF + ; - CRLF + ; + 'beneth the current caret position. ' + hb_eol() + ; + hb_eol() + ; 'Code completion tool is almost done with, and probably will make up its presence in the hbIDE soon. ' ) RETURN { a_, b_ } diff --git a/harbour/contrib/hbide/idemisc.prg b/harbour/contrib/hbide/idemisc.prg index bbed2d0206..d1d81a2efe 100644 --- a/harbour/contrib/hbide/idemisc.prg +++ b/harbour/contrib/hbide/idemisc.prg @@ -184,7 +184,7 @@ FUNCTION hbide_menuAddSep( oMenu ) FUNCTION hbide_createTarget( cFile, txt_ ) LOCAL hHandle := fcreate( cFile ) - LOCAL cNewLine := hb_OsNewLine() + LOCAL cNewLine := hb_eol() IF hHandle != F_ERROR aeval( txt_, { |e| fWrite( hHandle, e + cNewLine ) } ) @@ -443,9 +443,9 @@ FUNCTION hbide_ar2delString( a_, cDlm ) FUNCTION hbide_arrayToMemo( a_ ) LOCAL s := "" - aeval( a_, {|e| s += e + CRLF } ) + aeval( a_, {|e| s += e + hb_eol() } ) - s += CRLF + s += hb_eol() RETURN s @@ -454,7 +454,7 @@ FUNCTION hbide_arrayToMemo( a_ ) FUNCTION hbide_arrayToMemoEx( a_ ) LOCAL s := "" - aeval( a_, {|e| s += e + CRLF } ) + aeval( a_, {|e| s += e + hb_eol() } ) s := substr( s, 1, len( s ) - 2 ) @@ -471,7 +471,7 @@ FUNCTION hbide_arrayToMemoEx2( a_ ) FOR EACH k IN a_ IF empty( k ) - s += CRLF + CRLF + s += hb_eol() + hb_eol() lNewPara := .t. ELSE s += iif( lNewPara, "", " " ) + k @@ -480,7 +480,7 @@ FUNCTION hbide_arrayToMemoEx2( a_ ) NEXT DO WHILE .t. - IF right( s, 2 ) == CRLF + IF right( s, 2 ) == hb_eol() s := substr( s, 1, len( s ) - 2 ) ELSE EXIT @@ -979,7 +979,7 @@ function hbide_toString( x, lLineFeed, lInherited, lType, cFile, lForceLineFeed IF len( x ) = 0 s += " " ELSE - s += iif( valtype( x[1] ) = "A" .or. lForceLineFeed, CRLF, "" ) + s += iif( valtype( x[1] ) = "A" .or. lForceLineFeed, hb_eol(), "" ) j := len( x ) FOR i := 1 TO j @@ -987,7 +987,7 @@ function hbide_toString( x, lLineFeed, lInherited, lType, cFile, lForceLineFeed s += iif( i <> j, ",", "" ) IF lLineFeed IF !lInherited .and. ( valtype( x[i] ) == "A" .or. lForceLineFeed ) - s += CRLF + s += hb_eol() ENDIF ENDIF NEXT @@ -997,10 +997,10 @@ function hbide_toString( x, lLineFeed, lInherited, lType, cFile, lForceLineFeed CASE ( t == "O" ) IF lInherited // É necessário linkar \harbour\lib\xhb.lib - // s := iif( lType, "[O]=", "" ) + hb_dumpvar( x ) + iif( lLineFeed, CRLF, "" ) - s := '' + iif( lLineFeed, CRLF, "" ) + // s := iif( lType, "[O]=", "" ) + hb_dumpvar( x ) + iif( lLineFeed, hb_eol(), "" ) + s := '' + iif( lLineFeed, hb_eol(), "" ) ELSE - s := iif( lType, "[O]=", "" ) + x:ClassName()+'():New()' + iif( lLineFeed, CRLF, "" ) + s := iif( lType, "[O]=", "" ) + x:ClassName()+'():New()' + iif( lLineFeed, hb_eol(), "" ) ENDIF ENDCASE @@ -1156,7 +1156,7 @@ FUNCTION hbide_buildLinesLabel( nFrom, nTo, nW, nMax ) IF ( ( nFrom + i ) % 10 ) == 0 s += "" + padl( hb_ntos( nFrom + i ), nW ) + "
" ELSE - //s += padl( hb_ntos( nFrom + i ), nW ) + CRLF + //s += padl( hb_ntos( nFrom + i ), nW ) + hb_eol() s += padl( hb_ntos( nFrom + i ), nW ) + "
" ENDIF NEXT @@ -1184,7 +1184,7 @@ FUNCTION hbide_getShellCommandsTempFile( aCmd ) cCmdFile := "" FOR EACH tmp IN aCmd - cCmdFile += tmp + hb_osNewLine() + cCmdFile += tmp + hb_eol() NEXT IF ( fhnd := hb_FTempCreateEx( @cCmdFileName, NIL, NIL, cExt ) ) != F_ERROR @@ -1364,10 +1364,10 @@ STATIC PROCEDURE hbide_HBPLoad( aParams, cFileName ) cFile := MemoRead( cFileName ) /* NOTE: Intentionally using MemoRead() which handles EOF char. */ - IF ! hb_osNewLine() == HBIDE_HBP_EOL - cFile := StrTran( cFile, hb_osNewLine(), HBIDE_HBP_EOL ) + IF ! hb_eol() == HBIDE_HBP_EOL + cFile := StrTran( cFile, hb_eol(), HBIDE_HBP_EOL ) ENDIF - IF ! hb_osNewLine() == Chr( 13 ) + Chr( 10 ) + IF ! hb_eol() == Chr( 13 ) + Chr( 10 ) cFile := StrTran( cFile, Chr( 13 ) + Chr( 10 ), HBIDE_HBP_EOL ) ENDIF diff --git a/harbour/contrib/hbide/ideprojmanager.prg b/harbour/contrib/hbide/ideprojmanager.prg index c92cc5619b..a31543f76c 100644 --- a/harbour/contrib/hbide/ideprojmanager.prg +++ b/harbour/contrib/hbide/ideprojmanager.prg @@ -1314,7 +1314,7 @@ METHOD IdeProjManager:buildSource( lExecutable ) IF hb_fileExists( ::cBatch ) cBuf := memoread( ::cBatch ) - cBuf += hb_osNewLine() + cExeHbMk2 + " " + cCmdParams + hb_osNewLine() + cBuf += hb_eol() + cExeHbMk2 + " " + cCmdParams + hb_eol() hb_memowrit( ::cBatch, cBuf ) ENDIF // @@ -1449,7 +1449,7 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) IF hb_fileExists( ::cBatch ) cBuf := memoread( ::cBatch ) - cBuf += hb_osNewLine() + cExeHbMk2 + " " + cHbpPath + cCmdParams + hb_osNewLine() + cBuf += hb_eol() + cExeHbMk2 + " " + cHbpPath + cCmdParams + hb_eol() hb_memowrit( ::cBatch, cBuf ) ENDIF // @@ -1624,4 +1624,3 @@ METHOD IdeProjManager:outputText( cText ) RETURN Self /*----------------------------------------------------------------------*/ - diff --git a/harbour/contrib/hbide/idesaveload.prg b/harbour/contrib/hbide/idesaveload.prg index 545822e4ad..cfecc374f1 100644 --- a/harbour/contrib/hbide/idesaveload.prg +++ b/harbour/contrib/hbide/idesaveload.prg @@ -967,8 +967,8 @@ METHOD IdeSetup:destroy() /*----------------------------------------------------------------------*/ METHOD IdeSetup:eol() - RETURN iif( ::oINI:cLineEndingMode == "CRLF", CRLF, iif( ::oINI:cLineEndingMode == "CR", chr( 13 ), ; - iif( ::oINI:cLineEndingMode == "LF", chr( 10 ), CRLF ) ) ) + RETURN iif( ::oINI:cLineEndingMode == "CRLF", hb_eol(), iif( ::oINI:cLineEndingMode == "CR", chr( 13 ), ; + iif( ::oINI:cLineEndingMode == "LF", chr( 10 ), hb_eol() ) ) ) /*----------------------------------------------------------------------*/ METHOD IdeSetup:setIcons() diff --git a/harbour/contrib/hbide/ideshortcuts.prg b/harbour/contrib/hbide/ideshortcuts.prg index bacccdeab7..1878cef8eb 100644 --- a/harbour/contrib/hbide/ideshortcuts.prg +++ b/harbour/contrib/hbide/ideshortcuts.prg @@ -1260,7 +1260,7 @@ METHOD IdeShortcuts:loadMethods() 'Executes a Tool defined and visible under tools menu.' } ) aadd( ::aMethods, { 'execTool( cCmd, cParams, cStartIn, lCapture, lShowOutput )' , ; 'execTool( "", "", "", .f., .f. )', ; - 'Executes a program or file with parameters and other attributes.' + CRLF + ; + 'Executes a program or file with parameters and other attributes.' + hb_eol() + ; 'http://hbide.vouch.info/ ( Topic: Tools and Utilities )' } ) aadd( ::aMethods, { 'execPlugin( cPlugin )', ; 'execPlugin( "" )', ; @@ -1673,4 +1673,3 @@ METHOD IdeShortcuts:mergeMacros( a_ ) ENDSWITCH #endif /*----------------------------------------------------------------------*/ - diff --git a/harbour/contrib/hbide/idethemes.prg b/harbour/contrib/hbide/idethemes.prg index 309c6a7bd0..b7b33e3fa7 100644 --- a/harbour/contrib/hbide/idethemes.prg +++ b/harbour/contrib/hbide/idethemes.prg @@ -806,7 +806,7 @@ METHOD IdeThemes:buildINI() NEXT aadd( txt_, " " ) - aeval( txt_, {|e| cINI += e + CRLF } ) + aeval( txt_, {|e| cINI += e + hb_eol() } ) RETURN cINI @@ -978,7 +978,7 @@ STATIC FUNCTION GetSource() aadd( txt_, ' RETURN xVal ' ) aadd( txt_, '/*----------------------------------------------------------------------*/ ' ) - aeval( txt_, {|e| s += trim( e ) + CRLF } ) + aeval( txt_, {|e| s += trim( e ) + hb_eol() } ) RETURN s diff --git a/harbour/contrib/hbmisc/tests/readfile.prg b/harbour/contrib/hbmisc/tests/readfile.prg index f30cef04ef..ebffc35830 100644 --- a/harbour/contrib/hbmisc/tests/readfile.prg +++ b/harbour/contrib/hbmisc/tests/readfile.prg @@ -1,8 +1,9 @@ -// -// $Id$ -// +/* + * $Id$ + */ + +/* Test program for new class that reads a file one line at a time */ -// Test program for new class that reads a file one line at a time /* Harbour Project source code http://harbour-project.org/ Donated to the public domain on 2001-03-08 by David G. Holm @@ -11,17 +12,18 @@ #include "fileio.ch" PROCEDURE Main( cFile ) -LOCAL oFile := TFileRead():New( cFile ) -LOCAL cNewLine := HB_OSNewLine() + LOCAL oFile := TFileRead():New( cFile ) + LOCAL cNewLine := hb_eol() oFile:Open() IF oFile:Error() QOUT( oFile:ErrorMsg( "FileRead: " ) ) ELSE - WHILE oFile:MoreToRead() + DO WHILE oFile:MoreToRead() OUTSTD( oFile:ReadLine() ) OUTSTD( cNewLine ) - END WHILE + ENDDO oFile:Close() - END IF -QUIT + ENDIF + + RETURN diff --git a/harbour/contrib/hbmisc/tests/testhbf.prg b/harbour/contrib/hbmisc/tests/testhbf.prg index e7c201b269..c45ef14afc 100644 --- a/harbour/contrib/hbmisc/tests/testhbf.prg +++ b/harbour/contrib/hbmisc/tests/testhbf.prg @@ -1,6 +1,6 @@ -// -// $Id$ -// +/* + * $Id$ + */ /* test program for hb_f*() @@ -17,39 +17,41 @@ inplementation of : * hb_fgobottom() */ -function main() -// open a text file here -if hb_fuse( "testhbf.prg", 0 ) > 1 - while !hb_feof() - qout( "line " + str(hb_frecno(),2) + " " + hb_freadln() ) - hb_fskip(1) - end - qout("") - my_goto(18) - my_goto(2) +PROCEDURE Main() - hb_fgobottom() - qout("") - qout( "after hb_fgobottom() now in line # " + ltrim(str(hb_frecno())) ) + // open a text file here + IF hb_fuse( "testhbf.prg", 0 ) > 1 - hb_fgotop() - qout("") - qout( "after hb_fgotop() now in line # " + ltrim(str(hb_frecno())) ) + DO WHILE ! hb_feof() + qout( "line " + str( hb_frecno(), 2 ) + " " + hb_freadln() ) + hb_fskip( 1 ) + ENDDO + qout( "" ) + my_goto( 18 ) + my_goto( 2 ) - qout("") - qout( "hb_flastrec() = " + ltrim(str(hb_flastrec())) ) + hb_fgobottom() + qout( "" ) + qout( "after hb_fgobottom() now in line # " + hb_ntos( hb_frecno() ) ) - // close the file - hb_fuse() + hb_fgotop() + qout( "" ) + qout( "after hb_fgotop() now in line # " + hb_ntos( hb_frecno() ) ) -end -return nil + qout( "" ) + qout( "hb_flastrec() = " + hb_ntos( hb_flastrec() ) ) -static function my_goto( n_go ) + // close the file + hb_fuse() + ENDIF -hb_fgoto( n_go ) -qout("") -qout( "after hb_fgoto("+ltrim(str(n_go))+")" ) -qout( "line "+ ltrim(str(hb_frecno())) + " is " + ltrim( hb_freadln() ) ) + RETURN -return nil +STATIC PROCEDURE my_goto( n_go ) + + hb_fgoto( n_go ) + qout( "" ) + qout( "after hb_fgoto("+ hb_ntos( n_go ) + ")" ) + qout( "line "+ hb_ntos( hb_frecno() ) + " is " + ltrim( hb_freadln() ) ) + + RETURN diff --git a/harbour/contrib/hbnetio/utils/netiocmd.prg b/harbour/contrib/hbnetio/utils/netiocmd.prg index 15ddadcd30..ff34fe8066 100644 --- a/harbour/contrib/hbnetio/utils/netiocmd.prg +++ b/harbour/contrib/hbnetio/utils/netiocmd.prg @@ -37,10 +37,10 @@ FUNCTION hbnetiosrv_LoadCmds( bQuit, bShowInfo ) - pausing server */ STATIC PROCEDURE cmdSysInfo() - QQOut( "OS: " + OS(), hb_osNewLine() ) - QQOut( "Harbour: " + Version(), hb_osNewLine() ) - QQOut( "C Compiler: " + hb_Compiler(), hb_osNewLine() ) - QQOut( "Memory: " + hb_ntos( Memory( 0 ) ) + "KB", hb_osNewLine() ) + QQOut( "OS: " + OS(), hb_eol() ) + QQOut( "Harbour: " + Version(), hb_eol() ) + QQOut( "C Compiler: " + hb_Compiler(), hb_eol() ) + QQOut( "Memory: " + hb_ntos( Memory( 0 ) ) + "KB", hb_eol() ) RETURN STATIC PROCEDURE cmdHelp( hCommands ) @@ -70,7 +70,7 @@ STATIC PROCEDURE cmdHelp( hCommands ) m := MaxRow() FOR EACH n IN aTexts - QQOut( n, hb_osNewLine() ) + QQOut( n, hb_eol() ) IF ++c == m c := 0 diff --git a/harbour/contrib/hbnetio/utils/netiosrv.prg b/harbour/contrib/hbnetio/utils/netiosrv.prg index 03ee2b37b9..415703bd82 100644 --- a/harbour/contrib/hbnetio/utils/netiosrv.prg +++ b/harbour/contrib/hbnetio/utils/netiosrv.prg @@ -134,7 +134,7 @@ PROCEDURE Main( ... ) HB_Usage() RETURN OTHERWISE - OutStd( "Warning: Unkown parameter ignored: " + cParam + hb_osNewLine() ) + OutStd( "Warning: Unkown parameter ignored: " + cParam + hb_eol() ) ENDCASE NEXT @@ -151,12 +151,12 @@ PROCEDURE Main( ... ) cPassword := NIL IF Empty( netiosrv[ _NETIOSRV_pListenSocket ] ) - OutStd( "Cannot start server." + hb_osNewLine() ) + OutStd( "Cannot start server." + hb_eol() ) ELSE ShowConfig( netiosrv ) - OutStd( hb_osNewLine() ) - OutStd( "Type a command or '?' for help.", hb_osNewLine() ) + OutStd( hb_eol() ) + OutStd( "Type a command or '?' for help.", hb_eol() ) lQuit := .F. aHistory := { "quit" } @@ -203,7 +203,7 @@ PROCEDURE Main( ... ) SetKey( K_INS, bKeyIns ) SetKey( K_TAB, bKeyTab ) - QQOut( hb_osNewLine() ) + QQOut( hb_eol() ) cCommand := AllTrim( cCommand ) @@ -226,15 +226,15 @@ PROCEDURE Main( ... ) aCmd := hb_HValueAt( hCommands, nPos ) Eval( aCmd[ 2 ], cCommand, netiosrv ) ELSE - QQOut( "Error: Unknown command '" + cCommand + "'.", hb_osNewLine() ) + QQOut( "Error: Unknown command '" + cCommand + "'.", hb_eol() ) ENDIF ENDDO netio_serverstop( netiosrv[ _NETIOSRV_pListenSocket ] ) netiosrv[ _NETIOSRV_pListenSocket ] := NIL - OutStd( hb_osNewLine() ) - OutStd( "Server stopped.", hb_osNewLine() ) + OutStd( hb_eol() ) + OutStd( "Server stopped.", hb_eol() ) ENDIF RETURN @@ -281,41 +281,41 @@ STATIC PROCEDURE ManageCursor( cCommand ) STATIC PROCEDURE ShowConfig( netiosrv ) - QQOut( "Listening on: " + netiosrv[ _NETIOSRV_cIFAddr ] + ":" + hb_ntos( netiosrv[ _NETIOSRV_nPort ] ), hb_osNewLine() ) - QQOut( "Root filesystem: " + netiosrv[ _NETIOSRV_cRootDir ], hb_osNewLine() ) - QQOut( "RPC support: " + iif( netiosrv[ _NETIOSRV_lRPC ], "enabled", "disabled" ), hb_osNewLine() ) - QQOut( "Encryption: " + iif( netiosrv[ _NETIOSRV_lEncryption ], "enabled", "disabled" ), hb_osNewLine() ) - QQOut( "RPC filter module: " + iif( Empty( netiosrv[ _NETIOSRV_cRPCFHRB ] ), iif( netiosrv[ _NETIOSRV_lRPC ], "not set (WARNING: unsafe open server)", "not set" ), netiosrv[ _NETIOSRV_cRPCFFileName ] ), hb_osNewLine() ) + QQOut( "Listening on: " + netiosrv[ _NETIOSRV_cIFAddr ] + ":" + hb_ntos( netiosrv[ _NETIOSRV_nPort ] ), hb_eol() ) + QQOut( "Root filesystem: " + netiosrv[ _NETIOSRV_cRootDir ], hb_eol() ) + QQOut( "RPC support: " + iif( netiosrv[ _NETIOSRV_lRPC ], "enabled", "disabled" ), hb_eol() ) + QQOut( "Encryption: " + iif( netiosrv[ _NETIOSRV_lEncryption ], "enabled", "disabled" ), hb_eol() ) + QQOut( "RPC filter module: " + iif( Empty( netiosrv[ _NETIOSRV_cRPCFHRB ] ), iif( netiosrv[ _NETIOSRV_lRPC ], "not set (WARNING: unsafe open server)", "not set" ), netiosrv[ _NETIOSRV_cRPCFFileName ] ), hb_eol() ) RETURN STATIC PROCEDURE HB_Logo() - OutStd( "Harbour NETIO Server " + HBRawVersion() + hb_osNewLine() +; - "Copyright (c) 2009, Przemyslaw Czerpak" + hb_osNewLine() + ; - "http://harbour-project.org/" + hb_osNewLine() +; - hb_osNewLine() ) + OutStd( "Harbour NETIO Server " + HBRawVersion() + hb_eol() +; + "Copyright (c) 2009, Przemyslaw Czerpak" + hb_eol() + ; + "http://harbour-project.org/" + hb_eol() +; + hb_eol() ) RETURN STATIC PROCEDURE HB_Usage() - OutStd( "Syntax:" , hb_osNewLine() ) - OutStd( hb_osNewLine() ) - OutStd( " netiosrv [options]" , hb_osNewLine() ) - OutStd( hb_osNewLine() ) - OutStd( "Options:" , hb_osNewLine() ) - OutStd( hb_osNewLine() ) - OutStd( " -port= accept incoming connections on IP port " , hb_osNewLine() ) - OutStd( " -iface= accept incoming connections on IPv4 interface " , hb_osNewLine() ) - OutStd( " -rootdir= use as root directory for served file system" , hb_osNewLine() ) - OutStd( " -rpc accept RPC requests" , hb_osNewLine() ) - OutStd( " -rpc= set RPC processor .hrb module to " , hb_osNewLine() ) - OutStd( hb_StrFormat( " file.hrb needs to have an entry function named %1$s()", _RPC_FILTER ), hb_osNewLine() ) - OutStd( " -pass= set server password" , hb_osNewLine() ) - OutStd( hb_osNewLine() ) - OutStd( " --version display version header only" , hb_osNewLine() ) - OutStd( " -help|--help this help" , hb_osNewLine() ) + OutStd( "Syntax:" , hb_eol() ) + OutStd( hb_eol() ) + OutStd( " netiosrv [options]" , hb_eol() ) + OutStd( hb_eol() ) + OutStd( "Options:" , hb_eol() ) + OutStd( hb_eol() ) + OutStd( " -port= accept incoming connections on IP port " , hb_eol() ) + OutStd( " -iface= accept incoming connections on IPv4 interface " , hb_eol() ) + OutStd( " -rootdir= use as root directory for served file system" , hb_eol() ) + OutStd( " -rpc accept RPC requests" , hb_eol() ) + OutStd( " -rpc= set RPC processor .hrb module to " , hb_eol() ) + OutStd( hb_StrFormat( " file.hrb needs to have an entry function named %1$s()", _RPC_FILTER ), hb_eol() ) + OutStd( " -pass= set server password" , hb_eol() ) + OutStd( hb_eol() ) + OutStd( " --version display version header only" , hb_eol() ) + OutStd( " -help|--help this help" , hb_eol() ) RETURN diff --git a/harbour/contrib/hbnetio/utils/rpcdemo.hbs b/harbour/contrib/hbnetio/utils/rpcdemo.hbs index 82e1b3a523..0ead0bc492 100644 --- a/harbour/contrib/hbnetio/utils/rpcdemo.hbs +++ b/harbour/contrib/hbnetio/utils/rpcdemo.hbs @@ -13,6 +13,6 @@ STATIC FUNCTION HBNETIOSRV_RPCMAIN( sFunc, ... ) - OutStd( "DO", sFunc:name, "WITH", ..., hb_osNewLine() ) + OutStd( "DO", sFunc:name, "WITH", ..., hb_eol() ) RETURN sFunc:exec( ... ) diff --git a/harbour/contrib/hbpgsql/tests/dbf2pg.prg b/harbour/contrib/hbpgsql/tests/dbf2pg.prg index 6043e58951..af8a9204be 100644 --- a/harbour/contrib/hbpgsql/tests/dbf2pg.prg +++ b/harbour/contrib/hbpgsql/tests/dbf2pg.prg @@ -159,7 +159,7 @@ PROCEDURE Main( ... ) oServer:DeleteTable( cTable ) IF oServer:NetErr() ? oServer:ErrorMsg() - FWrite( nHandle, "Error: " + oServer:ErrorMsg() + hb_osNewLine() ) + FWrite( nHandle, "Error: " + oServer:ErrorMsg() + hb_eol() ) FClose( nHandle ) QUIT ENDIF @@ -168,7 +168,7 @@ PROCEDURE Main( ... ) IF oServer:NetErr() ? oServer:ErrorMsg() - FWrite( nHandle, "Error: " + oServer:ErrorMsg() + hb_osNewLine() ) + FWrite( nHandle, "Error: " + oServer:ErrorMsg() + hb_eol() ) FClose( nHandle ) QUIT ENDIF @@ -178,7 +178,7 @@ PROCEDURE Main( ... ) oServer:Execute( "truncate table " + cTable ) IF oServer:NetErr() ? oServer:ErrorMsg() - FWrite( nHandle, "Error: " + oServer:ErrorMsg() + hb_osNewLine() ) + FWrite( nHandle, "Error: " + oServer:ErrorMsg() + hb_eol() ) FClose( nHandle ) QUIT ENDIF @@ -187,7 +187,7 @@ PROCEDURE Main( ... ) oTable := oServer:Query( "SELECT * FROM " + cTable + " LIMIT 1" ) IF oTable:NetErr() Alert( oTable:ErrorMsg() ) - FWrite( nHandle, "Error: " + oTable:ErrorMsg() + hb_osNewLine() ) + FWrite( nHandle, "Error: " + oTable:ErrorMsg() + hb_eol() ) FClose( nHandle ) QUIT ENDIF @@ -196,7 +196,7 @@ PROCEDURE Main( ... ) oServer:StartTransaction() ENDIF - FWrite( nHandle, "Start: " + Time() + hb_osNewLine() ) + FWrite( nHandle, "Start: " + Time() + hb_eol() ) ? "Start: ", Time() ? @@ -265,7 +265,7 @@ PROCEDURE Main( ... ) ? ? "Error Record: ", RecNo(), Left( oTable:ErrorMsg(), 70 ) ? - FWrite( nHandle, "Error at record: " + Str( RecNo() ) + " Description: " + oTable:ErrorMsg() + hb_osNewLine() ) + FWrite( nHandle, "Error at record: " + Str( RecNo() ) + " Description: " + oTable:ErrorMsg() + hb_eol() ) ELSE nCount++ ENDIF @@ -289,7 +289,7 @@ PROCEDURE Main( ... ) ENDIF ENDIF - FWrite( nHandle, "End: " + Time() + ", records in dbf: " + hb_ntos( RecNo() ) + ", imported recs: " + hb_ntos( nCount ) + hb_osNewLine() ) + FWrite( nHandle, "End: " + Time() + ", records in dbf: " + hb_ntos( RecNo() ) + ", imported recs: " + hb_ntos( nCount ) + hb_eol() ) ? "End: ", Time() ? diff --git a/harbour/contrib/hbqt/generator/hbqtgen.prg b/harbour/contrib/hbqt/generator/hbqtgen.prg index cd625598dd..7687b987bd 100644 --- a/harbour/contrib/hbqt/generator/hbqtgen.prg +++ b/harbour/contrib/hbqt/generator/hbqtgen.prg @@ -56,8 +56,6 @@ #define _EOL chr( 10 ) -STATIC s_NewLine -STATIC s_PathSep STATIC isClassObject STATIC zWidget STATIC aCore := {} @@ -89,9 +87,6 @@ FUNCTION Main( ... ) ENDIF ENDIF - s_NewLine := hb_OsNewLine() - s_PathSep := hb_OsPathSeparator() - DispLogo() aParam := hb_AParams() @@ -106,7 +101,7 @@ FUNCTION Main( ... ) IF empty( cExt ) .or. !( lower( cExt ) == ".qtp" ) cExt := ".qtp" ENDIF - x := iif( empty( cPath ), "", cPath + s_PathSep )+ cFile + cExt + x := iif( empty( cPath ), "", cPath + hb_ps() )+ cFile + cExt aadd( aPrjFiles, x ) CASE right( cLParam,4 ) == ".qtp" @@ -157,13 +152,13 @@ FUNCTION Main( ... ) IF empty( cPathDoc ) cPathDoc := hb_dirBase() ENDIF - IF Right( cPathOut, 1 ) == s_PathSep + IF Right( cPathOut, 1 ) == hb_ps() cPathOut := hb_StrShrink( cPathOut, 1 ) ENDIF - IF Right( cPathIn, 1 ) == s_PathSep + IF Right( cPathIn, 1 ) == hb_ps() cPathIn := hb_StrShrink( cPathIn, 1 ) ENDIF - IF Right( cPathDoc, 1 ) == s_PathSep + IF Right( cPathDoc, 1 ) == hb_ps() cPathDoc := hb_StrShrink( cPathDoc, 1 ) ENDIF @@ -191,7 +186,7 @@ STATIC FUNCTION ManageProject( cProFile, cPathIn, cPathOut, cPathDoc ) hb_fNameSplit( cProFile, @cPath, @cFile, @cExt ) IF empty( cPath ) - cFile := cPathIn + s_PathSep + cProFile + cFile := cPathIn + hb_ps() + cProFile ELSE cFile := cProFile ENDIF @@ -208,7 +203,7 @@ STATIC FUNCTION ManageProject( cProFile, cPathIn, cPathOut, cPathDoc ) cpp_:={} prg_:={} - OutStd( "Processing: " + cFile + s_NewLine ) + OutStd( "Processing: " + cFile + hb_eol() ) cPrj := memoread( cFile ) @@ -220,14 +215,14 @@ STATIC FUNCTION ManageProject( cProFile, cPathIn, cPathOut, cPathDoc ) /* We must have a matching pair */ nn := at( "*/", cPrj ) IF nn == 0 - OutStd( "Project file has unbalanced comment section..." + s_NewLine ) + OutStd( "Project file has unbalanced comment section..." + hb_eol() ) RETURN nil ENDIF cPrj := substr( cPrj, 1, n-1 ) + substr( cPrj, nn+2 ) ENDDO /* Prepare to be parsed properly */ - cPrj := strtran( cPrj, s_NewLine, _EOL ) + cPrj := strtran( cPrj, hb_eol(), _EOL ) cPrj := strtran( cPrj, chr( 13 )+chr( 10 ), _EOL ) cPrj := strtran( cPrj, chr( 13 ), _EOL ) @@ -335,28 +330,28 @@ STATIC FUNCTION GenSource( cProFile, cPathIn, cPathOut, cPathDoc ) zWidget := cWidget IF empty( cPath ) - cFile := cPathIn + s_PathSep + cProFile + cFile := cPathIn + hb_ps() + cProFile ELSE cFile := cProFile ENDIF IF ! hb_fileExists( cFile ) - OutStd( "Cannot find: " + cFile + s_NewLine ) + OutStd( "Cannot find: " + cFile + hb_eol() ) RETURN { nil } ENDIF cQth := memoread( cFile ) IF empty( cQth ) - OutStd( "Cannot read: " + cFile + s_NewLine ) + OutStd( "Cannot read: " + cFile + hb_eol() ) RETURN { nil } ENDIF - OutStd( "Processing: " + cFile + s_NewLine ) + OutStd( "Processing: " + cFile + hb_eol() ) /* Prepare to be parsed properly */ - IF ! hb_osNewLine() == _EOL - cQth := StrTran( cQth, hb_osNewLine(), _EOL ) + IF ! hb_eol() == _EOL + cQth := StrTran( cQth, hb_eol(), _EOL ) ENDIF - IF ! hb_osNewLine() == Chr( 13 ) + Chr( 10 ) + IF ! hb_eol() == Chr( 13 ) + Chr( 10 ) cQth := StrTran( cQth, Chr( 13 ) + Chr( 10 ), _EOL ) ENDIF @@ -774,18 +769,18 @@ FUNCTION GetSourcePathByLib( cWidget, cPathOut, cExt, cPre, cls_ ) DEFAULT cPre TO "" IF ( n := ascan( cls_, {|e_| lower( e_[ 1 ] ) == "folder" .AND. !empty( e_[ 2 ] ) } ) ) > 0 - cFileOut := iif( empty( cPathOut ), "", cPathOut + s_PathSep + cls_[ n,2 ] + s_pathSep ) + cPre + cWidget + cExt + cFileOut := iif( empty( cPathOut ), "", cPathOut + hb_ps() + cls_[ n,2 ] + hb_ps() ) + cPre + cWidget + cExt ELSE IF ascan( aGui, cWidget ) > 0 - cFileOut := cPathOut + s_PathSep + "qtgui" + s_pathSep + cPre + cWidget + cExt + cFileOut := cPathOut + hb_ps() + "qtgui" + hb_ps() + cPre + cWidget + cExt ELSEIF ascan( aCore, cWidget ) > 0 - cFileOut := cPathOut + s_PathSep + "qtcore" + s_pathSep + cPre + cWidget + cExt + cFileOut := cPathOut + hb_ps() + "qtcore" + hb_ps() + cPre + cWidget + cExt ELSEIF ascan( aWebkit, cWidget ) > 0 - cFileOut := cPathOut + s_PathSep + "qtwebkit" + s_pathSep + cPre + cWidget + cExt + cFileOut := cPathOut + hb_ps() + "qtwebkit" + hb_ps() + cPre + cWidget + cExt ELSEIF ascan( aNetwork, cWidget ) > 0 - cFileOut := cPathOut + s_PathSep + "qtnetwork" + s_pathSep + cPre + cWidget + cExt + cFileOut := cPathOut + hb_ps() + "qtnetwork" + hb_ps() + cPre + cWidget + cExt ELSE - cFileOut := cPathOut + s_PathSep + cPre + cWidget + cExt + cFileOut := cPathOut + hb_ps() + cPre + cWidget + cExt ENDIF ENDIF @@ -1253,7 +1248,7 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_, lList, fB cPrgRet := "p" + cDocNM ELSE - OutStd( "<<< " + cProto + " | " + aA[ PRT_CAST ] + " >>>" + s_NewLine ) + OutStd( "<<< " + cProto + " | " + aA[ PRT_CAST ] + " >>>" + hb_eol() ) cCmd := "" cPrgRet := "" @@ -1437,7 +1432,7 @@ STATIC FUNCTION ParseVariables( cProto, cWidget, txt_, doc_, aEnum, func_ ) cPrgRet := "p" + cDocNM ELSE - OutStd( "<<< " + cProto + " | " + aA[ PRT_CAST ] + " >>>" + s_NewLine ) + OutStd( "<<< " + cProto + " | " + aA[ PRT_CAST ] + " >>>" + hb_eol() ) cCmd := "" cPrgRet := "" @@ -1595,19 +1590,19 @@ STATIC FUNCTION BuildFooter( txt_ ) STATIC FUNCTION DispHelp() LOCAL cHlp := "" - cHlp += "" + s_NewLine - cHlp += "Syntax:" + s_NewLine - cHlp += " hbqtgen.exe [Options] [[@]] []" + s_NewLine - cHlp += "" + s_NewLine - cHlp += "Options:" + s_NewLine - cHlp += " -O [ e.g. c:\harbour\contrib\hbqt ] [D] Current folder" + s_NewLine - cHlp += " -I [ e.g. c:\harbour\contrib\hbqt\protos ] [D] Current folder" + s_NewLine - cHlp += " -D [ e.g. c:\harbour\contrib\hbqt\doc ] [D] Current folder" + s_NewLine - cHlp += " " + s_NewLine - cHlp += " -c If QT env is set, attempts to compile resulting .cpp" + s_NewLine - cHlp += "" + s_NewLine - cHlp += " -noretobject Skip object returning methods" + s_NewLine - cHlp += "" + s_NewLine + cHlp += "" + hb_eol() + cHlp += "Syntax:" + hb_eol() + cHlp += " hbqtgen.exe [Options] [[@]] []" + hb_eol() + cHlp += "" + hb_eol() + cHlp += "Options:" + hb_eol() + cHlp += " -O [ e.g. c:\harbour\contrib\hbqt ] [D] Current folder" + hb_eol() + cHlp += " -I [ e.g. c:\harbour\contrib\hbqt\protos ] [D] Current folder" + hb_eol() + cHlp += " -D [ e.g. c:\harbour\contrib\hbqt\doc ] [D] Current folder" + hb_eol() + cHlp += " " + hb_eol() + cHlp += " -c If QT env is set, attempts to compile resulting .cpp" + hb_eol() + cHlp += "" + hb_eol() + cHlp += " -noretobject Skip object returning methods" + hb_eol() + cHlp += "" + hb_eol() OutStd( cHlp ) @@ -1618,11 +1613,11 @@ STATIC FUNCTION DispHelp() STATIC FUNCTION DispLogo() LOCAL cHlp := "" - cHlp += "" + s_NewLine - cHlp += "Harbour Source Generator for QT " + HBRawVersion() + s_NewLine - cHlp += "Copyright (c) 2009, Pritpal Bedi " + s_NewLine - cHlp += "http://harbour-project.org/" + s_NewLine - cHlp += "" + s_NewLine + cHlp += "" + hb_eol() + cHlp += "Harbour Source Generator for QT " + HBRawVersion() + hb_eol() + cHlp += "Copyright (c) 2009, Pritpal Bedi " + hb_eol() + cHlp += "http://harbour-project.org/" + hb_eol() + cHlp += "" + hb_eol() OutStd( cHlp ) @@ -1638,12 +1633,12 @@ STATIC FUNCTION HBRawVersion() STATIC FUNCTION CreateTarget( cFile, txt_ ) LOCAL cContent := "" - AEval( txt_, { |e| cContent += RTrim( e ) + hb_osNewLine() } ) + AEval( txt_, { |e| cContent += RTrim( e ) + hb_eol() } ) /* Save it only if it has changed. */ IF !( hb_MemoRead( cFile ) == cContent ) - OutStd( "Creating: " + cFile + hb_osNewLine() ) + OutStd( "Creating: " + cFile + hb_eol() ) hb_MemoWrit( cFile, cContent ) ENDIF @@ -1857,14 +1852,14 @@ STATIC FUNCTION Build_Document( cWidget, cls_, doc_, cPathDoc, subCls_, docum_ ) aadd( txt_, " $END$ " ) aadd( txt_, " */ " ) - cFile := cPathDoc + s_PathSep + "en" + s_PathSep + "class_" + lower( cWidget ) + ".txt" + cFile := cPathDoc + hb_ps() + "en" + hb_ps() + "class_" + lower( cWidget ) + ".txt" RETURN CreateTarget( cFile, txt_ ) /*----------------------------------------------------------------------*/ STATIC FUNCTION Build_GarbageFile( cpp_, cPathOut ) - LOCAL cFile := iif( empty( cPathOut ), "", cPathOut + s_PathSep ) + "hbqt_garbage.h" + LOCAL cFile := iif( empty( cPathOut ), "", cPathOut + hb_ps() ) + "hbqt_garbage.h" LOCAL txt_ := {} LOCAL s @@ -1940,7 +1935,7 @@ STATIC FUNCTION Build_MakeFile( cpp_, prg_, cPathOut ) aadd( hbm_, + "T" + s + ".prg" ) NEXT // - cFile := iif( empty( cPathOut ), "", cPathOut + s_PathSep + aSubs[ i, 1 ] + s_PathSep ) + cFile := iif( empty( cPathOut ), "", cPathOut + hb_ps() + aSubs[ i, 1 ] + hb_ps() ) CreateTarget( cFile + "filelist.hbm", hbm_ ) NEXT @@ -1951,7 +1946,7 @@ STATIC FUNCTION Build_MakeFile( cpp_, prg_, cPathOut ) #define CRLF chr( 13 )+chr( 10 ) FUNCTION Build_HTML( cWidget, aHM_, aHF_, cPathOut, docum_ ) - LOCAL cFile := cPathOut + s_PathSep + "html" + s_PathSep + cWidget + ".htm" + LOCAL cFile := cPathOut + hb_ps() + "html" + hb_ps() + cWidget + ".htm" LOCAL i, j, s, nCounter := 0, cPara LOCAL nCols, aHTML LOCAL setColorBG, setColorText, setColorTable diff --git a/harbour/contrib/hbqt/generator2/hbqtgen2.prg b/harbour/contrib/hbqt/generator2/hbqtgen2.prg index 1787488c08..f702bf5134 100644 --- a/harbour/contrib/hbqt/generator2/hbqtgen2.prg +++ b/harbour/contrib/hbqt/generator2/hbqtgen2.prg @@ -36,17 +36,17 @@ PROCEDURE Main() ProcessHeader( aStuff, cHeaderDir + hb_osPathSeparator() + tmp1, cName, tmp1 ) // ASort( aStuff[ 2 ],,, {| x, y | x[ 1 ] < y[ 1 ] } ) // FOR EACH tmp2 IN aStuff[ 2 ] -// OutStd( aType[ tmp2[ 1 ] ], tmp2[ 2 ], hb_osNewLine() ) +// OutStd( aType[ tmp2[ 1 ] ], tmp2[ 2 ], hb_eol() ) // NEXT IF Len( aStuff[ 1 ] ) >= 2 cFile := "" - cFile += hb_osNewLine() - cFile += "" + hb_osNewLine() - cFile += "QObject = " + iif( aStuff[ 1 ][ 1 ], "yes", "no" ) + hb_osNewLine() - cFile += "Inherit = " + aStuff[ 1 ][ 2 ] + hb_osNewLine() - cFile += "Type = " + cName + hb_osNewLine() - cFile += "New = " + "" + hb_osNewLine() - cFile += "" + hb_osNewLine() + cFile += hb_eol() + cFile += "" + hb_eol() + cFile += "QObject = " + iif( aStuff[ 1 ][ 1 ], "yes", "no" ) + hb_eol() + cFile += "Inherit = " + aStuff[ 1 ][ 2 ] + hb_eol() + cFile += "Type = " + cName + hb_eol() + cFile += "New = " + "" + hb_eol() + cFile += "" + hb_eol() DumpToQTH( @cFile, aStuff, QM_ENUM ) DumpToQTH( @cFile, aStuff, QM_METHOD ) DumpToQTH( @cFile, aStuff, QM_SLOT ) @@ -68,14 +68,14 @@ STATIC PROCEDURE DumpToQTH( cFile, aStuff, nType ) "SLOT" ,; "SIGNAL" } - cFile += hb_osNewLine() - cFile += "<" + aType[ nType ] + ">" + hb_osNewLine() + cFile += hb_eol() + cFile += "<" + aType[ nType ] + ">" + hb_eol() FOR EACH tmp IN aStuff[ 2 ] IF tmp[ 1 ] == nType - cFile += tmp[ 2 ] + hb_osNewLine() + cFile += tmp[ 2 ] + hb_eol() ENDIF NEXT - cFile += "" + hb_osNewLine() + cFile += "" + hb_eol() RETURN @@ -87,7 +87,7 @@ STATIC PROCEDURE ProcessHeader( aStuff, cFileName, cLib, cOriFileName ) LOCAL cHeader LOCAL cDir - OutStd( "Loading:", cFileName, hb_osNewLine() ) + OutStd( "Loading:", cFileName, hb_eol() ) nPos := 1 IF ( tmp := hb_At( '#include "', cFile, nPos ) ) > 0 diff --git a/harbour/contrib/hbqt/hbqt_errorsys.prg b/harbour/contrib/hbqt/hbqt_errorsys.prg index a41b5a6085..7a61d08084 100644 --- a/harbour/contrib/hbqt/hbqt_errorsys.prg +++ b/harbour/contrib/hbqt/hbqt_errorsys.prg @@ -120,7 +120,7 @@ STATIC FUNCTION DefError( oError ) #if 0 DO WHILE nChoice == 0 - IF ISNIL( cDOSError ) + IF cDOSError == NIL nChoice := Alert( cMessage, aOptions ) ELSE nChoice := Alert( cMessage + ";" + cDOSError, aOptions ) @@ -130,29 +130,29 @@ STATIC FUNCTION DefError( oError ) #endif IF ! Empty( nChoice ) - DO CASE - CASE aOptions[ nChoice ] == "Break" + SWITCH aOptions[ nChoice ] + CASE "Break" Break( oError ) - CASE aOptions[ nChoice ] == "Retry" + CASE "Retry" RETURN .T. - CASE aOptions[ nChoice ] == "Default" + CASE "Default" RETURN .F. - ENDCASE + ENDSWITCH ENDIF // "Quit" selected - IF ! ISNIL( cDOSError ) + IF cDOSError != NIL cMessage += " " + cDOSError ENDIF - aadd( aMsg, hb_OSNewLine() ) + aadd( aMsg, hb_eol() ) aadd( aMsg, cMessage ) n := 1 DO WHILE ! Empty( ProcName( ++n ) ) - aadd( aMsg, hb_OSNewLine() ) + aadd( aMsg, hb_eol() ) aadd( aMsg, "Called from " + ProcName( n ) + ; "(" + hb_NToS( ProcLine( n ) ) + ") " ) diff --git a/harbour/contrib/hbssl/tests/bio.prg b/harbour/contrib/hbssl/tests/bio.prg index 08cca191d0..89ae5e3505 100644 --- a/harbour/contrib/hbssl/tests/bio.prg +++ b/harbour/contrib/hbssl/tests/bio.prg @@ -16,12 +16,12 @@ PROCEDURE Main() LOCAL bio ? bio := BIO_new_fd( 1, HB_BIO_NOCLOSE ) - ? "BIO_WRITE", BIO_write( bio, "Hello world!" + hb_osNewLine() ) + ? "BIO_WRITE", BIO_write( bio, "Hello world!" + hb_eol() ) ? "BIO_FLUSH", BIO_flush( bio ) ? "BIO_FREE", BIO_free( bio ) ? bio := BIO_new_file( "bio_test.txt", "a+" ) - ? "BIO_WRITE", BIO_write( bio, "Hello world!" + hb_osNewLine() ) + ? "BIO_WRITE", BIO_write( bio, "Hello world!" + hb_eol() ) ? "BIO_FLUSH", BIO_flush( bio ) ? "BIO_FREE", BIO_free( bio ) diff --git a/harbour/contrib/hbssl/tests/pem.prg b/harbour/contrib/hbssl/tests/pem.prg index fea1fd8c3b..3b6ea244a0 100644 --- a/harbour/contrib/hbssl/tests/pem.prg +++ b/harbour/contrib/hbssl/tests/pem.prg @@ -21,11 +21,11 @@ PROCEDURE Main() bioe := BIO_new_fd( 1, HB_BIO_NOCLOSE ) - ? PEM_READ_BIO_RSAPRIVATEKEY( "privkey.pem", {| lWrite | QOut( "Callback", lWrite, hb_osNewLine() ), "test" } ) + ? PEM_READ_BIO_RSAPRIVATEKEY( "privkey.pem", {| lWrite | QOut( "Callback", lWrite, hb_eol() ), "test" } ) ? ; ERR_print_errors( bioe ) ? PEM_READ_BIO_RSAPRIVATEKEY( "privkey.pem", "test" ) ? ; ERR_print_errors( bioe ) - ? PEM_READ_BIO_RSAPUBLICKEY( "privkey.pem", {| lWrite | QOut( "Callback", lWrite, hb_osNewLine() ), "test" } ) + ? PEM_READ_BIO_RSAPUBLICKEY( "privkey.pem", {| lWrite | QOut( "Callback", lWrite, hb_eol() ), "test" } ) ? ; ERR_print_errors( bioe ) ? PEM_READ_BIO_RSAPUBLICKEY( "privkey.pem", "test" ) ? ; ERR_print_errors( bioe ) @@ -51,7 +51,7 @@ B0NDIZKbaPJHHPb9Ne7nQECzv0/kzmAley9UMTZ1M7fq6KYemR0LsA== -----END RSA PRIVATE KEY----- ENDTEXT - ? PEM_READ_BIO_RSAPRIVATEKEY( bio := BIO_new_mem_buf( cString ), {| lWrite | QOut( "Callback", lWrite, hb_osNewLine() ), "test" } ) + ? PEM_READ_BIO_RSAPRIVATEKEY( bio := BIO_new_mem_buf( cString ), {| lWrite | QOut( "Callback", lWrite, hb_eol() ), "test" } ) ? ; ERR_print_errors( bioe ) BIO_free( bio ) ? PEM_READ_BIO_RSAPRIVATEKEY( bio := BIO_new_mem_buf( cString ), "test" ) diff --git a/harbour/contrib/hbtip/client.prg b/harbour/contrib/hbtip/client.prg index 7725b42ad5..9b7ccef87b 100644 --- a/harbour/contrib/hbtip/client.prg +++ b/harbour/contrib/hbtip/client.prg @@ -802,9 +802,9 @@ METHOD Log( ... ) CLASS tIPClient cMsg += iif( xVar:__enumIndex() < PCount() - 1, ", ", "" ) IF xVar:__enumIndex() == PCount() - 1 - cMsg += " )" + hb_osNewLine() + ">> " + cMsg += " )" + hb_eol() + ">> " ELSEIF xVar:__enumIndex() == PCount() - cMsg += " <<" + hb_osNewLine() + hb_osNewLine() + cMsg += " <<" + hb_eol() + hb_eol() ENDIF NEXT diff --git a/harbour/contrib/hbtip/thtml.prg b/harbour/contrib/hbtip/thtml.prg index bae094a287..631ed56c45 100644 --- a/harbour/contrib/hbtip/thtml.prg +++ b/harbour/contrib/hbtip/thtml.prg @@ -134,12 +134,12 @@ ENDCLASS METHOD new( cHtmlString ) CLASS THtmlDocument LOCAL cEmptyHtmlDoc, oNode, oSubNode, oErrNode, aHead, aBody, nMode := 0 - cEmptyHtmlDoc := '' + hb_osNewLine() +; - '' + hb_osNewLine() +; - ' ' + hb_osNewLine() +; - ' ' + hb_osNewLine() +; - ' ' + hb_osNewLine() +; - ' ' + hb_osNewLine() +; + cEmptyHtmlDoc := '' + hb_eol() +; + '' + hb_eol() +; + ' ' + hb_eol() +; + ' ' + hb_eol() +; + ' ' + hb_eol() +; + ' ' + hb_eol() +; '' IF ! ISCHARACTER( cHtmlString ) @@ -1034,7 +1034,7 @@ METHOD toString( nIndent ) CLASS THtmlNode IF ! ::isInline() .OR. ::htmlTagName == "!--" cHtml += cIndent ELSEIF ::keepFormatting() - cHtml += hb_osNewLine() + cHtml += hb_eol() ENDIF cHtml += "<" + ::htmlTagName + ::attrToString() @@ -1047,7 +1047,7 @@ METHOD toString( nIndent ) CLASS THtmlNode FOR EACH oNode IN ::htmlContent IF ! oNode:isInline() .OR. oNode:htmlTagName == "!--" - cHtml += hb_osNewLine() + cHtml += hb_eol() ENDIF cHtml += oNode:toString( nIndent + 1 ) NEXT @@ -1060,12 +1060,12 @@ METHOD toString( nIndent ) CLASS THtmlNode IF ::isInline() .OR. ::keepFormatting() .OR. ::isType( CM_HEADING ) .OR. ::isType( CM_HEAD ) RETURN cHtml += iif( ::htmlEndTagName == "/", " />", "<" + ::htmlEndTagName + ">" ) ENDIF - IF !( Right( cHtml, Len( hb_osNewLine() ) ) == hb_osNewLine() ) - cHtml += hb_osNewLine() + IF !( Right( cHtml, Len( hb_eol() ) ) == hb_eol() ) + cHtml += hb_eol() ENDIF RETURN cHtml += cIndent + iif( ::htmlEndTagName == "/", " />", "<" + ::htmlEndTagName + ">" ) ELSEIF ::htmlTagName $ "!--,br" - RETURN cHtml += hb_osNewLine() + cIndent + RETURN cHtml += hb_eol() + cIndent ENDIF RETURN cHtml @@ -1144,8 +1144,8 @@ METHOD getText( cEOL ) CLASS THtmlNode LOCAL cText := "" LOCAL oNode - IF cEOL == NIL - cEOL := hb_osNewLine() + IF ! ISCHARACTER( cEOL ) + cEOL := hb_eol() ENDIF IF ::htmlTagName == "_text_" diff --git a/harbour/contrib/hbwin/tests/testole.prg b/harbour/contrib/hbwin/tests/testole.prg index ea9010b971..26974e523d 100644 --- a/harbour/contrib/hbwin/tests/testole.prg +++ b/harbour/contrib/hbwin/tests/testole.prg @@ -163,7 +163,7 @@ STATIC PROCEDURE Exm_MSWord() oText := oWord:Selection() - oText:Text := "OLE from Harbour" + hb_OSNewLine() + oText:Text := "OLE from Harbour" + hb_eol() oText:Font:Name := "Arial" oText:Font:Size := 48 oText:Font:Bold := .T. @@ -437,7 +437,7 @@ STATIC PROCEDURE Exm_ADODB() STATIC PROCEDURE Exm_SOAP() LOCAL oSoapClient - + IF ! Empty( oSoapClient := win_oleCreateObject( "MSSOAP.SoapClient30" ) ) oSoapClient:msSoapInit( "http://www.dataaccess.com/webservicesserver/textcasing.wso?WSDL" ) @@ -461,7 +461,7 @@ STATIC PROCEDURE Exm_PocketSOAP() oEnvelope:Parameters:Create( "sAString", "lower UPPER" ) oHttp:Send( "http://www.dataaccess.com/webservicesserver/textcasing.wso?WSDL", oEnvelope:Serialize() ) oEnvelope:Parse( oHttp ) - + ? oEnvelope:Parameters:Item( 0 ):Value ELSE ? "Error: PocketSOAP not available.", win_oleErrorText() diff --git a/harbour/contrib/hbwin/tests/testsim.prg b/harbour/contrib/hbwin/tests/testsim.prg index 9971658817..9b9bca71b9 100644 --- a/harbour/contrib/hbwin/tests/testsim.prg +++ b/harbour/contrib/hbwin/tests/testsim.prg @@ -39,20 +39,20 @@ PROCEDURE Main() ENDIF a := o:aGetAllPhoneBookEntries() - Aeval(a, {| n, m | Alert("Phone: "+n[1]+hb_osNewLine()+"Name: "+n[2]+hb_osNewLine()+"Adr. Type: "+STR( n[3])+hb_osNewLine()+"Plan Type: "+STR( n[4])) }) + Aeval(a, {| n, m | Alert("Phone: "+n[1]+hb_eol()+"Name: "+n[2]+hb_eol()+"Adr. Type: "+STR( n[3])+hb_eol()+"Plan Type: "+STR( n[4])) }) */ IF !o:lGetSimPhoneEntry( 1, SIM_PBSTORAGE_SIM, @a ) Alert("Pos 1 error") ELSE Alert("VALTYPE-> "+VALTYPE(a)+" LEN -> "+STR(LEN(a)),a[1][1]) - Aeval(a, {| n, m | Alert("Phone: "+n[1]+hb_osNewLine()+"Name: "+n[2]+hb_osNewLine()+"Adr. Type: "+STR( n[3])+hb_osNewLine()+"Plan Type: "+STR( n[4]),"pos 1") }) + Aeval(a, {| n, m | Alert("Phone: "+n[1]+hb_eol()+"Name: "+n[2]+hb_eol()+"Adr. Type: "+STR( n[3])+hb_eol()+"Plan Type: "+STR( n[4]),"pos 1") }) ENDIF IF !o:lGetSimPhoneEntry( 110, SIM_PBSTORAGE_SIM, @a ) Alert("Pos 123 error") ELSE - Aeval(a, {| n, m | Alert("Phone: "+n[1]+hb_osNewLine()+"Name: "+n[2]+hb_osNewLine()+"Adr. Type: "+STR( n[3])+hb_osNewLine()+"Plan Type: "+STR( n[4]),"pos 110") }) + Aeval(a, {| n, m | Alert("Phone: "+n[1]+hb_eol()+"Name: "+n[2]+hb_eol()+"Adr. Type: "+STR( n[3])+hb_eol()+"Plan Type: "+STR( n[4]),"pos 110") }) ENDIF IF !o:lSetSimPhoneEntry( 80, SIM_PBSTORAGE_SIM, "660099696", "pepeluis", SIM_NUMPLAN_UNKNOWN, SIM_ADDRTYPE_NATIONAL ) diff --git a/harbour/contrib/hbwin/tests/testsvc.prg b/harbour/contrib/hbwin/tests/testsvc.prg index c38382d4b8..1c0510a97f 100644 --- a/harbour/contrib/hbwin/tests/testsvc.prg +++ b/harbour/contrib/hbwin/tests/testsvc.prg @@ -99,18 +99,18 @@ PROCEDURE SrvMain() LOCAL fhnd := hb_FCreate( hb_dirBase() + "testsvc.out", FC_NORMAL, FO_DENYNONE + FO_WRITE ) LOCAL cParam - FWrite( fhnd, "Startup" + hb_osNewLine() ) + FWrite( fhnd, "Startup" + hb_eol() ) FOR EACH cParam IN hb_AParams() - FWrite( fhnd, "Parameter " + hb_ntos( cParam:__enumIndex() ) + " >" + cParam + "<" + hb_osNewLine() ) + FWrite( fhnd, "Parameter " + hb_ntos( cParam:__enumIndex() ) + " >" + cParam + "<" + hb_eol() ) NEXT DO WHILE win_serviceGetStatus() == WIN_SERVICE_RUNNING - FWrite( fhnd, "Work in progress " + hb_ntos( ++n ) + hb_osNewLine() ) + FWrite( fhnd, "Work in progress " + hb_ntos( ++n ) + hb_eol() ) hb_idleSleep( 0.5 ) ENDDO - FWrite( fhnd, "Exiting..." + hb_osNewLine() ) + FWrite( fhnd, "Exiting..." + hb_eol() ) FClose( fhnd ) win_serviceSetExitCode( 0 ) diff --git a/harbour/contrib/hbxpp/hbxpp.ch b/harbour/contrib/hbxpp/hbxpp.ch index 65d320c4e8..e661b0cec0 100644 --- a/harbour/contrib/hbxpp/hbxpp.ch +++ b/harbour/contrib/hbxpp/hbxpp.ch @@ -91,10 +91,10 @@ /* TEXT INTO [WRAP []] [TRIMMED] */ #xcommand TEXT INTO [] [] => ; #pragma __text|+=iif(<.trm.>,ltrim(%s),%s)+; - iif(<.wrp.>,HB_OSNEWLINE(),"");:="" + iif(<.wrp.>,hb_eol(),"");:="" #xcommand TEXT INTO WRAP [] [] => ; #pragma __text|+=iif(<.trm.>,ltrim(%s),%s)+; - iif(<.EOL.>,,HB_OSNEWLINE());:="" + iif(<.EOL.>,,hb_eol());:="" #endif #endif diff --git a/harbour/contrib/make.hbs b/harbour/contrib/make.hbs index 96dd418fd2..3930b1e16b 100755 --- a/harbour/contrib/make.hbs +++ b/harbour/contrib/make.hbs @@ -70,8 +70,6 @@ STATIC s_hPackageList PROCEDURE Main( ... ) - SetCancel( .F. ) - s_cBase := "" s_cHome := StrTran( hb_DirBase(), hb_ps(), "/" ) s_cRoot := s_cHome + "../" diff --git a/harbour/contrib/xhb/cstruct.prg b/harbour/contrib/xhb/cstruct.prg index 0d9c8e54b0..2850783d0c 100644 --- a/harbour/contrib/xhb/cstruct.prg +++ b/harbour/contrib/xhb/cstruct.prg @@ -482,18 +482,18 @@ STATIC FUNCTION SayMembers( cPad, lShowMembers, lReturnString ) //QOut( cPad + Replicate( "-", Len( SubStr( QSelf():ClassName, 13 ) ) ) ) cOut += cPad + SubStr( QSelf():ClassName, 13 ) - cOut += hb_OSNewLine() + cPad + Replicate( "-", Len( SubStr( QSelf():ClassName, 13 ) ) ) + cOut += hb_eol() + cPad + Replicate( "-", Len( SubStr( QSelf():ClassName, 13 ) ) ) FOR EACH xProperty IN QSelf():Array IF HB_IS_CStructure( xProperty ) IF lReturnString - cOut += hb_OSNewLine() + hb_OSNewLine() + xProperty:SayMembers( cPad + cPad, lShowMembers, lReturnString ) + cOut += hb_eol() + hb_eol() + xProperty:SayMembers( cPad + cPad, lShowMembers, lReturnString ) ELSE xProperty:SayMembers( cPad + cPad, lShowMembers ) ENDIF ELSE //QOut( cPad + IIF( lShowMembers, acMembers[ xProperty:__enumIndex() ], "" ) + ":", xProperty ) - cOut += hb_OSNewLine() + cPad + IIF( lShowMembers, QSelf():acMembers[ xProperty:__enumIndex() ], "" ) + ":" + hb_cStr( xProperty ) + cOut += hb_eol() + cPad + IIF( lShowMembers, QSelf():acMembers[ xProperty:__enumIndex() ], "" ) + ":" + hb_cStr( xProperty ) ENDIF NEXT diff --git a/harbour/contrib/xhb/dbgfx.prg b/harbour/contrib/xhb/dbgfx.prg index e7accfb841..52efac80e9 100644 --- a/harbour/contrib/xhb/dbgfx.prg +++ b/harbour/contrib/xhb/dbgfx.prg @@ -111,7 +111,7 @@ PROCEDURE HB_ToLogFile( cLogFile, ... ) IF nHandle != F_ERROR FSeek( nHandle, 0, FS_END ) FWrite( nHandle, sprintf( ... ) ) - FWrite( nHandle, HB_OSNewLine() ) + FWrite( nHandle, hb_eol() ) FClose( nHandle ) ENDIF ENDIF diff --git a/harbour/contrib/xhb/dumpvar.prg b/harbour/contrib/xhb/dumpvar.prg index e4373f1f4a..585a514bc5 100644 --- a/harbour/contrib/xhb/dumpvar.prg +++ b/harbour/contrib/xhb/dumpvar.prg @@ -54,8 +54,6 @@ #include "common.ch" -#define CRLF HB_OsNewLine() - /* * (C) 2003 - Francesco Saverio Giudice * @@ -111,41 +109,41 @@ STATIC FUNCTION __HB_DumpVar( xVar, lAssocAsObj, lRecursive, nIndent, nRecursion CASE cType == "O" IF !lAssocAsObj .AND. xVar:ClassName == "TASSOCIATIVEARRAY" - cString += Space( nIndent ) + "Type='Associative' -> " + CRLF + cString += Space( nIndent ) + "Type='Associative' -> " + hb_eol() // Keys extraction. IF Len( xVar:Keys ) > 0 - nEolLen := Len( CRLF ) - cString += Space( nIndent ) + "{" + CRLF + nEolLen := Len( hb_eol() ) + cString += Space( nIndent ) + "{" + hb_eol() FOR EACH cKey IN xVar:Keys - cString += Space( nIndent ) + " '" + cKey + "' => " + asString( xVar:SendKey( cKey ) ) + ", " + CRLF + cString += Space( nIndent ) + " '" + cKey + "' => " + asString( xVar:SendKey( cKey ) ) + ", " + hb_eol() IF lRecursive .AND. ValType( xVar:SendKey( cKey ) ) $ "AOH" - cString := SubStr( cString, 1, Len( cString )-2-nEolLen ) + CRLF + cString := SubStr( cString, 1, Len( cString )-2-nEolLen ) + hb_eol() cString += __HB_DumpVar( xVar:SendKey( cKey ),, lRecursive, nIndent+3, nRecursionLevel + 1, nMaxRecursionLevel ) - cString := SubStr( cString, 1, Len( cString )-nEolLen ) + ", " + CRLF + cString := SubStr( cString, 1, Len( cString )-nEolLen ) + ", " + hb_eol() ENDIF NEXT - cString := SubStr( cString, 1, Len( cString )-2-nEolLen ) + CRLF - cString += Space( nIndent ) + "}" + CRLF + cString := SubStr( cString, 1, Len( cString )-2-nEolLen ) + hb_eol() + cString += Space( nIndent ) + "}" + hb_eol() ENDIF ELSE - cString += Space( nIndent ) + "<" + xVar:ClassName + " Object>" + CRLF - cString += Space( nIndent ) + " | " + CRLF - cString += Space( nIndent ) + " +- PRIVATE/HIDDEN:" + CRLF + cString += Space( nIndent ) + "<" + xVar:ClassName + " Object>" + hb_eol() + cString += Space( nIndent ) + " | " + hb_eol() + cString += Space( nIndent ) + " +- PRIVATE/HIDDEN:" + hb_eol() cString += DShowProperties( xVar, HB_OO_CLSTP_HIDDEN, lRecursive, nIndent, nRecursionLevel, nMaxRecursionLevel ) - cString += Space( nIndent ) + " +- PROTECTED:" + CRLF + cString += Space( nIndent ) + " +- PROTECTED:" + hb_eol() cString += DShowProperties( xVar, HB_OO_CLSTP_PROTECTED, lRecursive, nIndent, nRecursionLevel, nMaxRecursionLevel ) - cString += Space( nIndent ) + " +- EXPORTED/VISIBLE/PUBLIC:" + CRLF + cString += Space( nIndent ) + " +- EXPORTED/VISIBLE/PUBLIC:" + hb_eol() cString += DShowProperties( xVar, HB_OO_CLSTP_EXPORTED, lRecursive, nIndent, nRecursionLevel, nMaxRecursionLevel ) #ifdef __XHARBOUR__ - cString += Space( nIndent ) + " +- PUBLISHED:" + CRLF + cString += Space( nIndent ) + " +- PUBLISHED:" + hb_eol() cString += DShowProperties( xVar, HB_OO_CLSTP_PUBLISHED, lRecursive, nIndent, nRecursionLevel, nMaxRecursionLevel ) #endif - cString += Space( nIndent ) + " +----------->" + CRLF + cString += Space( nIndent ) + " +----------->" + hb_eol() ENDIF CASE cType == "A" IF nRecursionLevel == 1 - cString += Space( nIndent ) + "Type='A' -> { Array of " + LTrim( Str( Len( xVar ) ) ) + " Items }" + CRLF + cString += Space( nIndent ) + "Type='A' -> { Array of " + LTrim( Str( Len( xVar ) ) ) + " Items }" + hb_eol() ENDIF IF nMaxRecursionLevel > 0 .AND. nRecursionLevel > nMaxRecursionLevel cString += AsString( xVar ) @@ -155,7 +153,7 @@ STATIC FUNCTION __HB_DumpVar( xVar, lAssocAsObj, lRecursive, nIndent, nRecursion CASE cType == "H" IF nRecursionLevel == 1 - cString += Space( nIndent ) + "Type='H' -> { Hash of " + LTrim( Str( Len( xVar ) ) ) + " Items }" + CRLF + cString += Space( nIndent ) + "Type='H' -> { Hash of " + LTrim( Str( Len( xVar ) ) ) + " Items }" + hb_eol() ENDIF IF nMaxRecursionLevel > 0 .AND. nRecursionLevel > nMaxRecursionLevel cString += AsString( xVar ) @@ -164,7 +162,7 @@ STATIC FUNCTION __HB_DumpVar( xVar, lAssocAsObj, lRecursive, nIndent, nRecursion ENDIF OTHERWISE - cString += Space( nIndent ) + AsString( xVar ) + CRLF + cString += Space( nIndent ) + AsString( xVar ) + hb_eol() ENDCASE RETURN cString @@ -183,27 +181,27 @@ STATIC FUNCTION DShowProperties( oVar, nScope, lRecursive, nIndent, nRecursionLe // __SetClassScope( lOldScope ) IF Len( aProps ) > 0 - cString += Space( nIndent ) + " | +- >> Begin Data ------" + CRLF + cString += Space( nIndent ) + " | +- >> Begin Data ------" + hb_eol() FOR EACH xProp IN aProps - cString += Space( nIndent ) + " | +- " + PadR( xProp[ HB_OO_DATA_SYMBOL ], 20 ) + " [" + DecodeType( xProp[ HB_OO_DATA_TYPE ] ) + "] [" + DecodeScope( xProp[ HB_OO_DATA_SCOPE ] ) + "] " + ValType( xProp[ HB_OO_DATA_VALUE ] ) + " => " + AsString( xProp[ HB_OO_DATA_VALUE ] ) + CRLF + cString += Space( nIndent ) + " | +- " + PadR( xProp[ HB_OO_DATA_SYMBOL ], 20 ) + " [" + DecodeType( xProp[ HB_OO_DATA_TYPE ] ) + "] [" + DecodeScope( xProp[ HB_OO_DATA_SCOPE ] ) + "] " + ValType( xProp[ HB_OO_DATA_VALUE ] ) + " => " + AsString( xProp[ HB_OO_DATA_VALUE ] ) + hb_eol() IF lRecursive .AND. ValType( xProp[ HB_OO_DATA_VALUE ] ) $ "AO" - cString += __HB_DumpVar( xProp[ HB_OO_DATA_VALUE ],, lRecursive, nIndent + 3, nRecursionLevel + 1, nMaxRecursionLevel ) + CRLF + cString += __HB_DumpVar( xProp[ HB_OO_DATA_VALUE ],, lRecursive, nIndent + 3, nRecursionLevel + 1, nMaxRecursionLevel ) + hb_eol() ENDIF NEXT - cString += Space( nIndent ) + " | +- >> End Data ------" + CRLF - cString += Space( nIndent ) + " | " + CRLF + cString += Space( nIndent ) + " | +- >> End Data ------" + hb_eol() + cString += Space( nIndent ) + " | " + hb_eol() ENDIF IF Len( aMethods ) > 0 - cString += Space( nIndent ) + " | +- >> Begin Methods ------" + CRLF + cString += Space( nIndent ) + " | +- >> Begin Methods ------" + hb_eol() FOR EACH aMth IN aMethods - cString += Space( nIndent ) + " | +- " + PadR( aMth[HB_OO_DATA_SYMBOL], 20 ) + " [" + DecodeType( aMth[HB_OO_DATA_TYPE] ) + "]" + " [" + DecodeScope( aMth[HB_OO_DATA_SCOPE] ) + "] " + CRLF + cString += Space( nIndent ) + " | +- " + PadR( aMth[HB_OO_DATA_SYMBOL], 20 ) + " [" + DecodeType( aMth[HB_OO_DATA_TYPE] ) + "]" + " [" + DecodeScope( aMth[HB_OO_DATA_SCOPE] ) + "] " + hb_eol() NEXT - cString += Space( nIndent ) + " | +- >> End Methods ------" + CRLF - cString += Space( nIndent ) + " | " + CRLF + cString += Space( nIndent ) + " | +- >> End Methods ------" + hb_eol() + cString += Space( nIndent ) + " | " + hb_eol() ENDIF ENDIF IF Empty( cString ) - cString := Space( nIndent ) + " | " + CRLF + cString := Space( nIndent ) + " | " + hb_eol() ENDIF RETURN cString @@ -216,22 +214,22 @@ STATIC FUNCTION DShowArray( aVar, lRecursive, nIndent, nRecursionLevel, nMaxRecu //TraceLog( "DShowArray: aVar, lRecursive", aVar, lRecursive ) IF ISARRAY( aVar ) - nEolLen := Len( CRLF ) + nEolLen := Len( hb_eol() ) nChar := Len( LTrim( Str( Len( aVar ) ) ) ) // return number of chars to display that value // i.e. if Len( aVar ) == 99, then nChar := 2 - cString += Space( nIndent ) + "{" + CRLF + cString += Space( nIndent ) + "{" + hb_eol() FOR EACH xVal IN aVar - cString += Space( nIndent ) + " ["+ LTrim( StrZero( xVal:__EnumIndex(), nChar ) ) + "] => " + AsString( xVal ) + ", " + CRLF + cString += Space( nIndent ) + " ["+ LTrim( StrZero( xVal:__EnumIndex(), nChar ) ) + "] => " + AsString( xVal ) + ", " + hb_eol() IF lRecursive .AND. ValType( xVal ) $ "AOH" - cString := SubStr( cString, 1, Len( cString )-2-nEolLen ) + CRLF + cString := SubStr( cString, 1, Len( cString )-2-nEolLen ) + hb_eol() cString += __HB_DumpVar( xVal,, lRecursive, nIndent+3, nRecursionLevel + 1, nMaxRecursionLevel ) - cString := SubStr( cString, 1, Len( cString )-nEolLen ) + ", " + CRLF + cString := SubStr( cString, 1, Len( cString )-nEolLen ) + ", " + hb_eol() ENDIF NEXT IF Len( aVar ) > 0 - cString := SubStr( cString, 1, Len( cString )-2-nEolLen ) + CRLF + cString := SubStr( cString, 1, Len( cString )-2-nEolLen ) + hb_eol() ENDIF - cString += Space( nIndent ) + "}" + CRLF + cString += Space( nIndent ) + "}" + hb_eol() ENDIF RETURN cString @@ -246,20 +244,20 @@ STATIC FUNCTION DShowHash( hVar, lRecursive, nIndent, nRecursionLevel, nMaxRecur //TraceLog( "DShowHash: hVar, ValType( hVar ), lRecursive", hVar, ValType( hVar ), ValToPrg( hVar ), lRecursive ) IF ValType( hVar ) == "H" - nEolLen := Len( CRLF ) - cString += Space( nIndent ) + "{" + CRLF + nEolLen := Len( hb_eol() ) + cString += Space( nIndent ) + "{" + hb_eol() FOR EACH xVal IN hVar - cString += Space( nIndent ) + " ["+ LTrim( AsString( xVal:__enumKey() ) ) + "] => " + AsString( xVal ) + ", " + CRLF + cString += Space( nIndent ) + " ["+ LTrim( AsString( xVal:__enumKey() ) ) + "] => " + AsString( xVal ) + ", " + hb_eol() IF lRecursive .AND. ValType( xVal ) $ "AOH" - cString := SubStr( cString, 1, Len( cString )-2-nEolLen ) + CRLF + cString := SubStr( cString, 1, Len( cString )-2-nEolLen ) + hb_eol() cString += __HB_DumpVar( xVal,, lRecursive, nIndent+3, nRecursionLevel + 1, nMaxRecursionLevel ) - cString := SubStr( cString, 1, Len( cString )-nEolLen ) + ", " + CRLF + cString := SubStr( cString, 1, Len( cString )-nEolLen ) + ", " + hb_eol() ENDIF NEXT IF Len( hVar ) > 0 - cString := SubStr( cString, 1, Len( cString )-2-nEolLen ) + CRLF + cString := SubStr( cString, 1, Len( cString )-2-nEolLen ) + hb_eol() ENDIF - cString += Space( nIndent ) + "}" + CRLF + cString += Space( nIndent ) + "}" + hb_eol() ENDIF RETURN cString diff --git a/harbour/contrib/xhb/hbcompat.ch b/harbour/contrib/xhb/hbcompat.ch index 8e2de43604..1436e6576e 100644 --- a/harbour/contrib/xhb/hbcompat.ch +++ b/harbour/contrib/xhb/hbcompat.ch @@ -69,6 +69,9 @@ #xtranslate MaxRow(.T.) => gtInfo( HB_GTI_SCREENHEIGHT ) #xtranslate MaxCol(.T.) => gtInfo( HB_GTI_SCREENWIDTH ) + #xtranslate hb_osNewLine() => hb_eol() + #xtranslate hb_osPathSeparator() => hb_ps() + #xtranslate hb_dbPack() => __dbPack() #xtranslate hb_dbZap() => __dbZap() #xtranslate hb_dbDrop([]) => dbDrop() @@ -265,6 +268,9 @@ #define GTI_CLIENT 2 /* Maximum possible client size of a window */ #define GTI_MAX 3 /* Maximum possible window size (in Windows) */ + #xtranslate hb_eol() => hb_osNewLine() + #xtranslate hb_ps() => hb_osPathSeparator() + #xtranslate MaxRow(.T.) => hb_gtInfo( HB_GTI_VIEWPORTHEIGHT ) #xtranslate MaxCol(.T.) => hb_gtInfo( HB_GTI_VIEWPORTWIDTH ) diff --git a/harbour/contrib/xhb/hblog.prg b/harbour/contrib/xhb/hblog.prg index 793e27ef1f..e2f0cd8eb2 100644 --- a/harbour/contrib/xhb/hblog.prg +++ b/harbour/contrib/xhb/hblog.prg @@ -467,7 +467,7 @@ METHOD PROCEDURE Out( ... ) CLASS HB_LogConsole ENDIF NEXT IF ::lRealConsole - OutStd( cMsg, HB_OSnewLine() ) + OutStd( cMsg, hb_eol() ) ELSE QOut( cMsg ) ENDIF @@ -528,7 +528,7 @@ METHOD Open( cProgName ) CLASS HB_LogFile RETURN .F. ENDIF - Fwrite( ::nFileHandle, HB_BldLogMsg( HB_LogDateStamp(), Time(), "--", cProgName, "start --", HB_OsNewLine() ) ) + Fwrite( ::nFileHandle, HB_BldLogMsg( HB_LogDateStamp(), Time(), "--", cProgName, "start --", hb_eol() ) ) HB_Fcommit( ::nFileHandle ) ::lOpened := .T. @@ -541,7 +541,7 @@ METHOD Close( cProgName ) CLASS HB_LogFile RETURN .F. ENDIF - Fwrite( ::nFileHandle, HB_BldLogMsg( HB_LogDateStamp(), Time(), "--", cProgName, "end --", HB_OsNewLine() ) ) + Fwrite( ::nFileHandle, HB_BldLogMsg( HB_LogDateStamp(), Time(), "--", cProgName, "end --", hb_eol() ) ) FClose( ::nFileHandle ) ::nFileHandle := -1 @@ -554,13 +554,13 @@ METHOD Send( nStyle, cMessage, cProgName, nPriority ) CLASS HB_LogFile LOCAL nCount - FWrite( ::nFileHandle, ::Format( nStyle, cMessage, cProgName, nPriority ) + HB_OsNewLine() ) + FWrite( ::nFileHandle, ::Format( nStyle, cMessage, cProgName, nPriority ) + hb_eol() ) HB_FCommit( ::nFileHandle ); // see file limit and eventually swap file. IF ::nFileLimit > 0 IF FSeek( ::nFileHandle, 0, FS_RELATIVE ) > ::nFileLimit * 1024 - Fwrite( ::nFileHandle, HB_BldLogMsg( HB_LogDateStamp(), Time(), "LogFile: Closing file due to size limit breaking", HB_OsNewLine() ) ) + Fwrite( ::nFileHandle, HB_BldLogMsg( HB_LogDateStamp(), Time(), "LogFile: Closing file due to size limit breaking", hb_eol() ) ) FClose( ::nFileHandle ) IF ::nBackup > 1 @@ -574,7 +574,7 @@ METHOD Send( nStyle, cMessage, cProgName, nPriority ) CLASS HB_LogFile IF FRename( ::cFileName, ::cFileName + ".000" ) == 0 ::nFileHandle := hb_FCreate( ::cFileName, FC_NORMAL, FO_READWRITE ) - Fwrite( ::nFileHandle, HB_BldLogMsg( HB_LogDateStamp(), Time(), "LogFile: Reopening file due to size limit breaking", HB_OsNewLine() ) ) + Fwrite( ::nFileHandle, HB_BldLogMsg( HB_LogDateStamp(), Time(), "LogFile: Reopening file due to size limit breaking", hb_eol() ) ) ENDIF ENDIF ENDIF diff --git a/harbour/contrib/xhb/traceprg.prg b/harbour/contrib/xhb/traceprg.prg index 8593035ca3..496b1cc684 100644 --- a/harbour/contrib/xhb/traceprg.prg +++ b/harbour/contrib/xhb/traceprg.prg @@ -56,8 +56,6 @@ #define HB_SET_TRACESTACK_CURRENT 1 #define HB_SET_TRACESTACK_ALL 2 -#define CRLF HB_OsNewLine() - #xtranslate Write( ) => FWrite( FileHandle, ) //;HB_OutDebug( ) STATIC s_lSET_TRACE := .T. @@ -150,20 +148,20 @@ FUNCTION TraceLog( ... ) ENDIF IF nLevel > 1 .AND. ! ( ProcName( 2 ) == '' ) - Write( ' Called from: ' + CRLF ) + Write( ' Called from: ' + hb_eol() ) nLevel := 1 DO WHILE ! ( ( ProcName := ProcName( ++nLevel ) ) == '' ) - Write( space(30) + ProcFile( nLevel ) + "->" + ProcName + '(' + LTrim( Str( Procline( nLevel ) ) ) + ')' + CRLF ) + Write( space(30) + ProcFile( nLevel ) + "->" + ProcName + '(' + LTrim( Str( Procline( nLevel ) ) ) + ')' + hb_eol() ) ENDDO ELSE - Write( CRLF ) + Write( hb_eol() ) ENDIF FOR EACH xParam IN HB_aParams() - Write( 'Type: ' + ValType( xParam ) + ' >>>' + hb_CStr( xParam ) + '<<<' + CRLF ) + Write( 'Type: ' + ValType( xParam ) + ' >>>' + hb_CStr( xParam ) + '<<<' + hb_eol() ) NEXT - Write( CRLF ) + Write( hb_eol() ) FClose( FileHandle ) diff --git a/harbour/contrib/xhb/xhberr.prg b/harbour/contrib/xhb/xhberr.prg index 34115869d7..137d77b12f 100644 --- a/harbour/contrib/xhb/xhberr.prg +++ b/harbour/contrib/xhb/xhberr.prg @@ -626,8 +626,8 @@ STATIC FUNCTION strvalue( c, l ) STATIC PROCEDURE FWriteLine( nh, c ) - Fwrite( nh, c + HB_OsNewLine() ) - //HB_OutDebug( c + HB_OsNewLine() ) + Fwrite( nh, c + hb_eol() ) + //HB_OutDebug( c + hb_eol() ) RETURN STATIC FUNCTION Arguments( oErr ) @@ -654,22 +654,22 @@ FUNCTION __ErrorBlock( ) PROCEDURE __MinimalErrorHandler( oError ) - LOCAL cError := "Error!" + hb_osNewLine() + LOCAL cError := "Error!" + hb_eol() IF ISCHARACTER( oError:Operation ) - cError += "Operation: " + oError:Operation + hb_osNewLine() + cError += "Operation: " + oError:Operation + hb_eol() ENDIF IF ISCHARACTER( oError:Description ) - cError += "Description: " + oError:Description + hb_osNewLine() + cError += "Description: " + oError:Description + hb_eol() ENDIF IF ISCHARACTER( oError:ModuleName ) - cError += "Source: " + oError:ModuleName + hb_osNewLine() + cError += "Source: " + oError:ModuleName + hb_eol() ENDIF IF ISCHARACTER( oError:ProcName ) - cError += "Procedure: " + oError:ProcName + hb_osNewLine() + cError += "Procedure: " + oError:ProcName + hb_eol() ENDIF IF ISNUMBER( oError:ProcLine ) - cError += "Line: " + hb_ntos( oError:ProcLine ) + hb_osNewLine() + cError += "Line: " + hb_ntos( oError:ProcLine ) + hb_eol() ENDIF OutStd( cError ) diff --git a/harbour/examples/guestbk/inifiles.prg b/harbour/examples/guestbk/inifiles.prg index 8021463056..55e908fce4 100644 --- a/harbour/examples/guestbk/inifiles.prg +++ b/harbour/examples/guestbk/inifiles.prg @@ -4,8 +4,6 @@ #include "common.ch" -#define CRLF hb_osNewLine() - function TIniFile() static oClass @@ -176,7 +174,7 @@ static procedure WriteString(cSection, cIdent, cString) AAdd( ::Contents, {cSection, {{cIdent, cString}}} ) endif endif -return +return static function ReadNumber(cSection, cIdent, nDefault) local Self := QSelf() @@ -216,7 +214,7 @@ static procedure DeleteKey(cSection, cIdent) cSection := lower(cSection) i := AScan( ::Contents, {|x| ISCHARACTER(x[1]) .and. lower(x[1]) == cSection} ) - + if i > 0 cIdent := lower(cIdent) j := AScan( ::Contents[i][2], {|x| ISCHARACTER(x[1]) .and. lower(x[1]) == cIdent} ) diff --git a/harbour/examples/guestbk/testcgi.prg b/harbour/examples/guestbk/testcgi.prg index ba2d057d24..70a1d9f0ac 100644 --- a/harbour/examples/guestbk/testcgi.prg +++ b/harbour/examples/guestbk/testcgi.prg @@ -179,8 +179,8 @@ STATIC FUNCTION AddPara( cPara, cAlign ) LOCAL Self := QSelf() ::cBody := ::cBody + ; - "

" + hb_OSNewLine() + ; - cPara + hb_OSNewLine() + ; + "

" + hb_eol() + ; + cPara + hb_eol() + ; "

" RETURN Self @@ -194,11 +194,11 @@ STATIC FUNCTION Generate() // Is this a meta file or hand generated script? IF empty( ::cHTMLFile ) ::cContent := ; - "" + hb_OSNewLine() + ; - "" + ::cTitle + "" + hb_OSNewLine() + ; + "" + hb_eol() + ; + "" + ::cTitle + "" + hb_eol() + ; "" + + hb_OSNewLine() + ; - ::cBody + hb_OSNewLine() + ; + "vlink='" + ::cvLinkColor + "'>" + + hb_eol() + ; + ::cBody + hb_eol() + ; "" ELSE ::cContent := "" @@ -257,9 +257,9 @@ STATIC FUNCTION ShowResult() LOCAL Self := QSelf() - OutStd( ; - "HTTP/1.0 200 OK" + hb_OSNewLine() + ; - "CONTENT-TYPE: TEXT/HTML" + hb_OSNewLine() + hb_OSNewLine() + ; + OutStd( ; + "HTTP/1.0 200 OK" + hb_eol() + ; + "CONTENT-TYPE: TEXT/HTML" + hb_eol() + hb_eol() + ; ::cContent ) RETURN Self diff --git a/harbour/examples/hbextern/hbextern.prg b/harbour/examples/hbextern/hbextern.prg index fed5812012..05fca5d929 100644 --- a/harbour/examples/hbextern/hbextern.prg +++ b/harbour/examples/hbextern/hbextern.prg @@ -63,19 +63,7 @@ REQUEST HB_GT_CGI_DEFAULT // are not used anymore in Harbour core and RTL .prg files: // #define PRG_CAN_HAVE_HB_FUNC -#ifdef __HARBOUR__ - #define EOL hb_OSNewLine() -#else - #define EOL ( Chr( 13 ) + Chr( 10 ) ) -#endif - -#ifdef __PLATFORM__UNIX - #define PATH_SEPARATOR "/" - #define BASE_DIR "../../" -#else - #define PATH_SEPARATOR "\" - #define BASE_DIR "..\..\" -#endif +#define BASE_DIR ".." + hb_ps() + ".." + hb_ps() // List of known files which does not contain any real public function. STATIC s_aSkipFiles := { "profiler.prg", "msg_tpl.c" } @@ -139,7 +127,7 @@ PROCEDURE MAIN( ... ) CASE cArgName == "-?" .OR. cArgName == "--help" ShowHelp() RETURN - CASE cArgName == "-source" ; s_aSwitches[ sw_BaseDir ] := arg + IIf(SubStr(arg, -1, 1) == PATH_SEPARATOR, "", PATH_SEPARATOR) + CASE cArgName == "-source" ; s_aSwitches[ sw_BaseDir ] := arg + IIf(SubStr(arg, -1, 1) == hb_ps(), "", hb_ps()) CASE cArgName == "-skipdirs" s_aSkipDirs := FileToArray( arg ) CASE cArgName == "-skipfiles"; s_aSkipFiles := FileToArray( arg ) @@ -206,7 +194,7 @@ PROCEDURE MAIN( ... ) #define ca53X52 "/* CA-Cl*pper 5.3 compatible, CA-Cl*pper 5.2 undocumented, functions */" #define harb "/* Harbour extensions */" #define harbXcp "/* Harbour extensions, codepage support */" -#define harbXns "/* Harbour extensions violating extension namespace rules." + EOL + " See reasons in source. */" +#define harbXns "/* Harbour extensions violating extension namespace rules." + hb_eol() + " See reasons in source. */" #define dbgr "/* The debugger interface */" #define rdd "/* RDD related symbols */" #define rddSx "/* RDD SX related symbols */" @@ -232,8 +220,8 @@ PROCEDURE MAIN( ... ) Capture( ca51int, {|a,b,c,f| a,b,f, SubStr(c, 1, Len( "__") ) == "__" } ), ; Capture( harb , {|a,b,c,f| a,b,f, SubStr(c, 1, Len( "HB_") ) == "HB_" } ), ; Capture( dbgr , {|a,b,c,f| a,b,f, SubStr(c, 1, Len( "__DBG") ) == "__DBG" } ), ; - Capture( rdd , {|a,b,c,f| a,b,c, AT( PATH_SEPARATOR + "rdd" + PATH_SEPARATOR, f) > 0 } ), ; - Capture( rddSx , {|a,b,c,f| a,b, (SubStr(c, 1, 2) == "SX" .OR. SubStr(c, 1, 3) == "_SX" .OR. .F.) .AND. AT( PATH_SEPARATOR + "rdd" + PATH_SEPARATOR, f) > 0 } ), ; + Capture( rdd , {|a,b,c,f| a,b,c, AT( hb_ps() + "rdd" + hb_ps(), f) > 0 } ), ; + Capture( rddSx , {|a,b,c,f| a,b, (SubStr(c, 1, 2) == "SX" .OR. SubStr(c, 1, 3) == "_SX" .OR. .F.) .AND. AT( hb_ps() + "rdd" + hb_ps(), f) > 0 } ), ; Capture( hiper , {|a,b,c,f| a,b,f, SubStr(c, 1, Len( "HS_") ) == "HS_" } ), ; Capture( cfts , {|a,b,c,f| a,b,f, SubStr(c, 1, Len( "CFTS") ) == "CFTS" } ), ; Capture( i18n , {|a,b,c,f| a,b,f, SubStr(c, 1, Len( "HB_I18N") ) == "HB_I18N" } ), ; @@ -256,18 +244,18 @@ PROCEDURE MAIN( ... ) // action codepage first so the folder will be ignored when actioning source aActions := {; - { "hbextcdp.ch_", "HB_EXTCDP_CH_", "source" + PATH_SEPARATOR + "codepage", CDPACTIONS }, ; - { "hbextlng.ch_", "HB_EXTLNG_CH_", "source" + PATH_SEPARATOR + "lang", LNGACTIONS }, ; + { "hbextcdp.ch_", "HB_EXTCDP_CH_", "source" + hb_ps() + "codepage", CDPACTIONS }, ; + { "hbextlng.ch_", "HB_EXTLNG_CH_", "source" + hb_ps() + "lang", LNGACTIONS }, ; { "hbextern.ch_", "HB_EXTERN_CH_", "source", STDACTIONS }, ; } AEval( ; - Directory( s_aSwitches[ sw_BaseDir ] + "contrib" + PATH_SEPARATOR + "*", "D" ), ; + Directory( s_aSwitches[ sw_BaseDir ] + "contrib" + hb_ps() + "*", "D" ), ; {|ad| IIf( HB_AScan( s_aSkipDirs, ad[ F_NAME ] ) == 0 .AND. ad[ F_ATTR ] == "D", ; AAdd( aActions, ; { ad[ F_NAME ] + ".ch_", ; "HB_CONTRIB_EXTERN_" + Upper( ad[ F_NAME ] ) + "_CH_", ; - "contrib" + PATH_SEPARATOR + ad[ F_NAME ], ; + "contrib" + hb_ps() + ad[ F_NAME ], ; { Capture( "", {|a_,b_,c_,f_| a_,b_,c_,f_, .T. } ) } } ), ; ) ; } ; @@ -294,12 +282,12 @@ PROCEDURE MAIN( ... ) ENDIF FWrite( nOutput, ; - "// NOTE: Machine generated on: " + DTOC( DATE() ) + EOL + ; - "// This output should be edited by hand after extraction." + EOL + ; - EOL + ; - "#ifndef " + aa[ ACN_HEADER ] + EOL + ; - "#define " + aa [ ACN_HEADER ] + EOL + ; - EOL ; + "// NOTE: Machine generated on: " + DTOC( DATE() ) + hb_eol() + ; + "// This output should be edited by hand after extraction." + hb_eol() + ; + hb_eol() + ; + "#ifndef " + aa[ ACN_HEADER ] + hb_eol() + ; + "#define " + aa [ ACN_HEADER ] + hb_eol() + ; + hb_eol() ; ) s_aMethodAsProcedure := {} @@ -307,47 +295,47 @@ PROCEDURE MAIN( ... ) ProcessDir( s_aSwitches[ sw_BaseDir ] + aa[ ACN_FOLDER ], aa[ ACN_ACTIONS ] ) IF Len(s_aMethodAsProcedure) > 0 - FWrite( nOutput, "/*" + EOL + "Class methods defined as 'procedure':" + EOL ) - AEval(s_aMethodAsProcedure, {|ac| FWrite( nOutput, " " + ac[1] + " " + ac[2] + EOL ) } ) - FWrite( nOutput, "*/" + EOL + EOL ) + FWrite( nOutput, "/*" + hb_eol() + "Class methods defined as 'procedure':" + hb_eol() ) + AEval(s_aMethodAsProcedure, {|ac| FWrite( nOutput, " " + ac[1] + " " + ac[2] + hb_eol() ) } ) + FWrite( nOutput, "*/" + hb_eol() + hb_eol() ) ENDIF FOR EACH ao IN aa[ 4 ] IF ao != NIL IF Len( ao[ capt_Desc ] ) > 0 - FWrite( nOutput, ao[ capt_Desc ] + EOL ) + FWrite( nOutput, ao[ capt_Desc ] + hb_eol() ) ENDIF IF LEn( ao[ capt_Repository ] ) == 0 - FWrite( nOutput, "/* empty */" + EOL ) + FWrite( nOutput, "/* empty */" + hb_eol() ) ELSE - FWrite( nOutput, EOL ) + FWrite( nOutput, hb_eol() ) FOR EACH ar in ao[ capt_Repository ] - IF ar[ capt_Cond ] != NIL .AND. Len( ar[ capt_Cond ] ) > 0 ; FWrite( nOutput, ar[ capt_Cond ] + EOL ); ENDIF + IF ar[ capt_Cond ] != NIL .AND. Len( ar[ capt_Cond ] ) > 0 ; FWrite( nOutput, ar[ capt_Cond ] + hb_eol() ); ENDIF ASort( ar[ capt_Repository ] ) - AEval( ar[ capt_Repository ], {|a| FWrite( nOutput, "EXTERNAL " + a + EOL ) } ) + AEval( ar[ capt_Repository ], {|a| FWrite( nOutput, "EXTERNAL " + a + hb_eol() ) } ) IF ar[ capt_Cond ] != NIL .AND. Len( ar[ capt_Cond ] ) > 0 cDescription := "" DO WHILE Len( ar[ capt_Cond ] ) > 0 - cDescription := "#endif /* " + Parse( @ar[ capt_Cond ], EOL ) + " */" + EOL + cDescription + cDescription := "#endif /* " + Parse( @ar[ capt_Cond ], hb_eol() ) + " */" + hb_eol() + cDescription ENDDO FWrite( nOutput, cDescription ) ENDIF - FWrite( nOutput, EOL ) + FWrite( nOutput, hb_eol() ) NEXT ENDIF IF Len( ao[ capt_Desc ] ) > 0 - FWrite( nOutput, Stuff( ao[ capt_Desc ], 4, 0, "End of ") + EOL + EOL ) + FWrite( nOutput, Stuff( ao[ capt_Desc ], 4, 0, "End of ") + hb_eol() + hb_eol() ) ELSE - FWrite( nOutput, EOL ) + FWrite( nOutput, hb_eol() ) ENDIF ENDIF NEXT FWrite( nOutput, ; - "#endif /* " + aa [ ACN_HEADER ] + " */" + EOL ; + "#endif /* " + aa [ ACN_HEADER ] + " */" + hb_eol() ; ) FClose( nOutput ) @@ -369,11 +357,11 @@ STATIC PROCEDURE ShowHelp() "Syntax: ", ; " hbextern [options]", ; "options:", ; - " -source= // source folder, default is .." + PATH_SEPARATOR + "..", ; + " -source= // source folder, default is .." + hb_ps() + "..", ; " -skipdirs= // configuration file of folders to bypass, default:", ; - {|| AEval( s_aSkipDirs, {|c| OutStd( IIf( Empty(c), "", " " + c ) + EOL ) } ) }, ; + {|| AEval( s_aSkipDirs, {|c| OutStd( IIf( Empty(c), "", " " + c ) + hb_eol() ) } ) }, ; " -skipfiles= // configuration file of files to bypass, default:", ; - {|| AEval( s_aSkipFiles, {|c| OutStd( IIf( Empty(c), "", " " + c ) + EOL ) } ) }, ; + {|| AEval( s_aSkipFiles, {|c| OutStd( IIf( Empty(c), "", " " + c ) + hb_eol() ) } ) }, ; " -verbose=[silent|minimum|maximum] // verbose operation, default is maximum", ; " -silent // synonym for verbose=silent", ; " -case=[upper|lower|unchanged] // output case, default is upper", ; @@ -392,7 +380,7 @@ STATIC PROCEDURE ShowHelp() #undef OnOrOff // using hbmk2 style - AEval( aHelp, {|x| IIf( ValType( x ) == "B", Eval( x ), OutStd( IIf( Empty(x), "", x ) + EOL ) ) } ) + AEval( aHelp, {|x| IIf( ValType( x ) == "B", Eval( x ), OutStd( IIf( Empty(x), "", x ) + hb_eol() ) ) } ) RETURN @@ -407,7 +395,7 @@ STATIC PROCEDURE ProcessDir( cDir, aOutput ) IF s_aSwitches[ sw_Verbose ] > 0 ; ? cDir ; ENDIF - cDir += PATH_SEPARATOR + cDir += hb_ps() aFiles := Directory( cDir + "*.*", "D" ) IF ( nLen := LEN( aFiles ) ) > 0 @@ -455,7 +443,7 @@ STATIC PROCEDURE ProcessFile( cFile, lPRG, aOutput ) IF s_aSwitches[ sw_Verbose ] > 1 ; ? cFile ; ENDIF - cHeader := "//" + EOL + "// symbols from file: " + cFile + EOL + "//" + EOL + cHeader := "//" + hb_eol() + "// symbols from file: " + cFile + hb_eol() + "//" + hb_eol() IF .NOT. s_aSwitches[ sw_ExcludeEmptyFiles ] bOutputHeader := .F. @@ -801,7 +789,7 @@ STATIC PROCEDURE WriteSymbol( cFile, cLine, cMethodType, bOutputHeader, cHeader, ENDIF IF s_aSwitches[ sw_ConditionalDepth ] == 0 - AEval( s_aConditions, {|/* c */| s_aSwitches[ sw_ConditionalDepth ]++/* , FWrite( nOutput, c + EOL ) */ } ) + AEval( s_aConditions, {|/* c */| s_aSwitches[ sw_ConditionalDepth ]++/* , FWrite( nOutput, c + hb_eol() ) */ } ) ENDIF IF s_aSwitches[ sw_MimicHBExtern ].OR. Empty(cMethodType) .OR. s_aSwitches[ sw_ExcludeClassMethods ] @@ -811,8 +799,8 @@ STATIC PROCEDURE WriteSymbol( cFile, cLine, cMethodType, bOutputHeader, cHeader, ENDIF cConditions := "" - AEval( s_aConditions, {|c| cConditions += c + EOL } ) - IF Len( cConditions ) > Len( EOL ) ; cConditions := SubStr( cConditions, 1, Len( cConditions ) - Len( EOL ) ) ; ENDIF + AEval( s_aConditions, {|c| cConditions += c + hb_eol() } ) + IF Len( cConditions ) > Len( hb_eol() ) ; cConditions := SubStr( cConditions, 1, Len( cConditions ) - Len( hb_eol() ) ) ; ENDIF // the first entry has a hard-coded TRUE value so one will always be found idxOutput := HB_RAScan( aOutput, {|ao| ; @@ -828,22 +816,22 @@ STATIC PROCEDURE WriteSymbol( cFile, cLine, cMethodType, bOutputHeader, cHeader, ENDIF AAdd( aOutput[ idxOutput ][ capt_Repository ][ idxRepository ][ capt_Repository ], cLine /* + cHeader */ ) - //~ FWrite( nOutput, "EXTERNAL " + cLine + cMethodType + EOL ) + //~ FWrite( nOutput, "EXTERNAL " + cLine + cMethodType + hb_eol() ) ENDIF ENDIF RETURN STATIC PROCEDURE CopyGenericCopyrightToTarget( cSource, nOutput ) - LOCAL cFile := s_aSwitches[ sw_BaseDir ] + "doc" + PATH_SEPARATOR + "hdr_tpl.txt" + LOCAL cFile := s_aSwitches[ sw_BaseDir ] + "doc" + hb_ps() + "hdr_tpl.txt" LOCAL nInput LOCAL cBuffer2 FWrite( nOutput, ; - "/*" + EOL + ; - " * $" + "Id" + "$" + EOL + ; - "*/" + EOL + ; - EOL ) + "/*" + hb_eol() + ; + " * $" + "Id" + "$" + hb_eol() + ; + "*/" + hb_eol() + ; + hb_eol() ) IF ( nInput := FOpen( cFile ) ) > 0 // assume there are two comment blocks seperated by a blank line (svn header and copyright) @@ -854,7 +842,7 @@ STATIC PROCEDURE CopyGenericCopyrightToTarget( cSource, nOutput ) cBuffer2 := StrTran( cBuffer2, " 2001", "" ) cBuffer2 := StrTran( cBuffer2, "{list of individual authors and e-mail addresses}", "- automaticallyt generated by hbextern; do not edit" ) cBuffer2 := StrTran( cBuffer2, "{one-liner description about the purpose of this source file}", "Harbour " + cSource + " contrib external header" ) - FWrite( nOutput, "/*" + cBuffer2 + EOL + EOL ) + FWrite( nOutput, "/*" + cBuffer2 + hb_eol() + hb_eol() ) ENDIF FClose( nInput ) ELSE @@ -863,18 +851,18 @@ STATIC PROCEDURE CopyGenericCopyrightToTarget( cSource, nOutput ) ENDIF STATIC PROCEDURE CopyExistingSourceToTarget( cSource, nOutput ) - LOCAL cFile := s_aSwitches[ sw_BaseDir ] + "include" + PATH_SEPARATOR + cSource + LOCAL cFile := s_aSwitches[ sw_BaseDir ] + "include" + hb_ps() + cSource LOCAL nInput LOCAL cBuffer1, cBuffer2 IF Empty( Directory( cFile ) ) #if 0 FWrite( nOutput, ; - "/*" + EOL + ; - " * $" + "Id" + "$" + EOL + ; - "*/" + EOL + ; - EOL ) - cFile := s_aSwitches[ sw_BaseDir ] + "doc" + PATH_SEPARATOR + "hdr_tpl.txt" + "/*" + hb_eol() + ; + " * $" + "Id" + "$" + hb_eol() + ; + "*/" + hb_eol() + ; + hb_eol() ) + cFile := s_aSwitches[ sw_BaseDir ] + "doc" + hb_ps() + "hdr_tpl.txt" IF ( nInput := FOpen( cFile ) ) > 0 // assume there are two comment blocks seperated by a blank line (svn header and copyright) IF FReadUntil( nInput, "*/", "" /* discard ID comment */ ) .AND. ; @@ -884,7 +872,7 @@ STATIC PROCEDURE CopyExistingSourceToTarget( cSource, nOutput ) cBuffer2 := StrTran( cBuffer2, " 2001", "" ) cBuffer2 := StrTran( cBuffer2, "{list of individual authors and e-mail addresses}", "- automaticallyt generated by hbextern; do not edit" ) cBuffer2 := StrTran( cBuffer2, "{one-liner description about the purpose of this source file}", "Harbour " + cSource + " contrib external header" ) - FWrite( nOutput, "/*" + cBuffer2 + EOL + EOL ) + FWrite( nOutput, "/*" + cBuffer2 + hb_eol() + hb_eol() ) ENDIF FClose( nInput ) ENDIF @@ -892,7 +880,7 @@ STATIC PROCEDURE CopyExistingSourceToTarget( cSource, nOutput ) ELSEIF ( nInput := FOpen( cFile ) ) > 0 // assume there are two comment blocks seperated by a blank line (svn header and copyright) IF FReadUntil( nInput, "*/", @cBuffer1 ) .AND. FReadUntil( nInput, "*/", @cBuffer2 ) - FWrite( nOutput, cBuffer1 + cBuffer2 + EOL + EOL ) + FWrite( nOutput, cBuffer1 + cBuffer2 + hb_eol() + hb_eol() ) ENDIF FClose( nInput ) ELSE diff --git a/harbour/examples/hscript/hscript.prg b/harbour/examples/hscript/hscript.prg index e19743b6d2..e95b4d243f 100644 --- a/harbour/examples/hscript/hscript.prg +++ b/harbour/examples/hscript/hscript.prg @@ -86,13 +86,13 @@ PROCEDURE Main( cScript ) IF Empty( cScriptName ) IF !Empty( GetEnv( "SERVER_NAME" ) ) - OutStd( "content-type: text/html" + hb_OSNewLine() ) - OutStd( hb_OSNewLine() ) - OutStd( "

Server Error

" + hb_OSNewLine() ) - OutStd( "Must specify scriptname using hscript.exe?script=" + hb_OSNewLine() ) - OutStd( "" + hb_OSNewLine() ) + OutStd( "content-type: text/html" + hb_eol() ) + OutStd( hb_eol() ) + OutStd( "

Server Error

" + hb_eol() ) + OutStd( "Must specify scriptname using hscript.exe?script=" + hb_eol() ) + OutStd( "" + hb_eol() ) ELSE - OutStd( "Please give .hs name" + hb_OSNewLine() ) + OutStd( "Please give .hs name" + hb_eol() ) ENDIF EXIT ENDIF @@ -100,9 +100,9 @@ PROCEDURE Main( cScript ) // Script not found IF !File( cScriptName ) IF !Empty( GetEnv( "SERVER_NAME" ) ) - OutStd( "CONTENT-TYPE: text/html" + hb_OSNewLine() ) + OutStd( "CONTENT-TYPE: text/html" + hb_eol() ) ENDIF - OutStd( "

Server Error

Script not found: " + cScriptName + hb_OSNewLine() ) + OutStd( "

Server Error

Script not found: " + cScriptName + hb_eol() ) EXIT ENDIF @@ -129,7 +129,7 @@ PROCEDURE Main( cScript ) // Abre script IF i > 1 //cTrans += " ; " - cTrans += hb_OSNewLine() + cTrans += hb_eol() ENDIF IF i + 1 < nLen cTrans += "OutStd( '" @@ -148,7 +148,7 @@ PROCEDURE Main( cScript ) lOpen := .f. IF i < nLen // cTrans += " ; " - cTrans += hb_OSNewLine() + cTrans += hb_eol() ENDIF ENDIF @@ -173,7 +173,7 @@ PROCEDURE Main( cScript ) cFile := cLocation + cHost + ".prg" // Output file name hFile := FCreate( cFile ) FOR i := 1 TO Len( aResult ) - FWrite( hFile, aResult[i] + hb_OSNewLine() ) + FWrite( hFile, aResult[i] + hb_eol() ) NEXT FClose( hFile ) diff --git a/harbour/examples/httpsrv/uhttpd.prg b/harbour/examples/httpsrv/uhttpd.prg index 9bdc2293a5..cf171dd56c 100644 --- a/harbour/examples/httpsrv/uhttpd.prg +++ b/harbour/examples/httpsrv/uhttpd.prg @@ -1429,7 +1429,7 @@ STATIC PROCEDURE WriteToLog( cRequest ) LEFT( cRequest, AT( CR_LF, cRequest ) - 1 ) + '" ' + ; LTRIM( STR( t_nStatusCode ) ) + " " + IIF( nSize == 0, "-", LTRIM( STR( nSize ) ) ) + ; ' "' + IIF( Empty( cReferer ), "-", cReferer ) + '" "' + _SERVER[ "HTTP_USER_AGENT" ] + ; - '"' + HB_OSNewLine() + '"' + hb_eol() //hb_ToOutDebug( "AccessLog = %s \n\r", cAccess ) @@ -1445,7 +1445,7 @@ STATIC PROCEDURE WriteToLog( cRequest ) cError := "[" + Left( aDays[ nDoW ], 3 ) + " " + aMonths[ nMonth ] + " " + StrZero( nDay, 2 ) + " " + ; PadL( LTrim( cTime ), 8, "0" ) + " " + StrZero( nYear, 4 ) + "] [error] [client " + _SERVER[ "REMOTE_ADDR" ] + "] " + ; - cErrorMsg + HB_OSNewLine() + cErrorMsg + hb_eol() //hb_ToOutDebug( "ErrorLog = %s \n\r", cError ) @@ -2416,7 +2416,7 @@ STATIC FUNCTION uhttpd_DefError( oError ) LOCAL n LOCAL cDateTime, cString - LOCAL cNewLine := hb_OSNewLine() + LOCAL cNewLine := hb_eol() // By default, division by zero results in zero IF oError:genCode == EG_ZERODIV .AND. ; diff --git a/harbour/examples/uhttpd2/umain.prg b/harbour/examples/uhttpd2/umain.prg index 053c57c37a..3e5e97375f 100644 --- a/harbour/examples/uhttpd2/umain.prg +++ b/harbour/examples/uhttpd2/umain.prg @@ -178,7 +178,7 @@ RETURN NIL METHOD LogError(cError) CLASS UHttpd hb_mutexLock(Self:hmtxLog) - FWRITE(Self:hErrorLog, DTOS(DATE()) + " " + TIME() + " " + cError + " " + HB_OSNewLine()) + FWRITE(Self:hErrorLog, DTOS(DATE()) + " " + TIME() + " " + cError + " " + hb_eol()) hb_mutexUnlock(Self:hmtxLog) RETURN NIL @@ -192,7 +192,7 @@ LOCAL cDate := DTOS(DATE()), cTime := TIME() "/" + LEFT(cDate, 4) + ":" + cTime + ' +0000] "' + server["REQUEST_ALL"] + '" ' + ; LTRIM(STR(s_nStatusCode)) + " " + LTRIM(STR(LEN(s_cResult))) + ; ' "' + server["HTTP_REFERER"] + '" "' + server["HTTP_USER_AGENT"] + ; - '"' + HB_OSNewLine()) + '"' + hb_eol()) hb_mutexUnlock(Self:hmtxLog) RETURN NIL @@ -679,57 +679,57 @@ RETURN NIL STATIC FUNC GetErrorDesc(oErr) LOCAL cRet, nI - cRet := "ERRORLOG ============================================================" + HB_OSNewLine() + ; + cRet := "ERRORLOG ============================================================" + hb_eol() + ; "Error: " + oErr:subsystem + "/" + ErrDescCode(oErr:genCode) + "(" + LTRIM(STR(oErr:genCode)) + ") " + ; - LTRIM(STR(oErr:subcode)) + HB_OSNewLine() - IF !EMPTY(oErr:filename); cRet += "File: " + oErr:filename + HB_OSNewLine() + LTRIM(STR(oErr:subcode)) + hb_eol() + IF !EMPTY(oErr:filename); cRet += "File: " + oErr:filename + hb_eol() ENDIF - IF !EMPTY(oErr:description); cRet += "Description: " + oErr:description + HB_OSNewLine() + IF !EMPTY(oErr:description); cRet += "Description: " + oErr:description + hb_eol() ENDIF - IF !EMPTY(oErr:operation); cRet += "Operacija: " + oErr:operation + HB_OSNewLine() + IF !EMPTY(oErr:operation); cRet += "Operacija: " + oErr:operation + hb_eol() ENDIF - IF !EMPTY(oErr:osCode); cRet += "OS error: " + LTRIM(STR(oErr:osCode)) + HB_OSNewLine() + IF !EMPTY(oErr:osCode); cRet += "OS error: " + LTRIM(STR(oErr:osCode)) + hb_eol() ENDIF IF VALTYPE(oErr:args) == "A" - cRet += "Arguments:" + HB_OSNewLine() - AEVAL(oErr:args, {|X, Y| cRet += STR(Y, 5) + ": " + HB_CStr(X) + HB_OSNewLine()}) + cRet += "Arguments:" + hb_eol() + AEVAL(oErr:args, {|X, Y| cRet += STR(Y, 5) + ": " + HB_CStr(X) + hb_eol()}) ENDIF - cRet += HB_OSNewLine() + cRet += hb_eol() - cRet += "Stack:" + HB_OSNewLine() + cRet += "Stack:" + hb_eol() nI := 2 DO WHILE ! EMPTY(PROCNAME(++nI)) - cRet += " " + PROCNAME(nI) + "(" + LTRIM(STR(PROCLINE(nI))) + ")" + HB_OSNewLine() + cRet += " " + PROCNAME(nI) + "(" + LTRIM(STR(PROCLINE(nI))) + ")" + hb_eol() ENDDO - cRet += HB_OSNewLine() + cRet += hb_eol() - cRet += "Executable: " + HB_PROGNAME() + HB_OSNewLine() - cRet += "Versions:" + HB_OSNewLine() - cRet += " OS: " + OS() + HB_OSNewLine() - cRet += " Harbour: " + VERSION() + ", " + HB_BUILDDATE() + HB_OSNewLine() - cRet += HB_OSNewLine() + cRet += "Executable: " + HB_PROGNAME() + hb_eol() + cRet += "Versions:" + hb_eol() + cRet += " OS: " + OS() + hb_eol() + cRet += " Harbour: " + VERSION() + ", " + HB_BUILDDATE() + hb_eol() + cRet += hb_eol() IF oErr:genCode != EG_MEM - cRet += "Database areas:" + HB_OSNewLine() - cRet += " Current: " + LTRIM(STR(SELECT())) + " " + ALIAS() + HB_OSNewLine() + cRet += "Database areas:" + hb_eol() + cRet += " Current: " + LTRIM(STR(SELECT())) + " " + ALIAS() + hb_eol() BEGIN SEQUENCE WITH {|o| BREAK(o)} IF !EMPTY(ALIAS()) - cRet += " Filter: " + DBFILTER() + HB_OSNewLine() - cRet += " Relation: " + DBRELATION() + HB_OSNewLine() - cRet += " Index expression: " + ORDKEY(ORDSETFOCUS()) + HB_OSNewLine() - cRet += HB_OSNewLine() + cRet += " Filter: " + DBFILTER() + hb_eol() + cRet += " Relation: " + DBRELATION() + hb_eol() + cRet += " Index expression: " + ORDKEY(ORDSETFOCUS()) + hb_eol() + cRet += hb_eol() BEGIN SEQUENCE WITH {|o| BREAK(o)} FOR nI := 1 to FCOUNT() - cRet += STR(nI, 6) + " " + PADR(FIELDNAME(nI), 14) + ": " + HB_VALTOEXP(FIELDGET(nI)) + HB_OSNewLine() + cRet += STR(nI, 6) + " " + PADR(FIELDNAME(nI), 14) + ": " + HB_VALTOEXP(FIELDGET(nI)) + hb_eol() NEXT RECOVER - cRet += "!!! Error reading database fields !!!" + HB_OSNewLine() + cRet += "!!! Error reading database fields !!!" + hb_eol() END SEQUENCE - cRet += HB_OSNewLine() + cRet += hb_eol() ENDIF RECOVER - cRet += "!!! Error accessing current workarea !!!" + HB_OSNewLine() + cRet += "!!! Error accessing current workarea !!!" + hb_eol() END SEQUENCE FOR nI := 1 to 250 @@ -738,14 +738,14 @@ LOCAL cRet, nI DBSELECTAREA(nI) cRet += STR(nI, 6) + " " + RDDNAME() + " " + PADR(ALIAS(), 15) + ; STR(RECNO()) + "/" + STR(LASTREC()) + ; - IIF(EMPTY(ORDSETFOCUS()), "", " Index " + ORDSETFOCUS() + "(" + LTRIM(STR(ORDNUMBER())) + ")") + HB_OSNewLine() + IIF(EMPTY(ORDSETFOCUS()), "", " Index " + ORDSETFOCUS() + "(" + LTRIM(STR(ORDNUMBER())) + ")") + hb_eol() DBCLOSEAREA() ENDIF RECOVER - cRet += "!!! Error accessing workarea number: " + STR(nI, 4) + "!!!" + HB_OSNewLine() + cRet += "!!! Error accessing workarea number: " + STR(nI, 4) + "!!!" + hb_eol() END SEQUENCE NEXT - cRet += HB_OSNewLine() + cRet += hb_eol() ENDIF RETURN cRet diff --git a/harbour/include/assert.ch b/harbour/include/assert.ch index 9f17a38ec0..18bc3a75b7 100644 --- a/harbour/include/assert.ch +++ b/harbour/include/assert.ch @@ -64,7 +64,7 @@ #command ASSERT( [, ] ) => ; IF !( ) ; ; OutStd( ; - hb_OSNewLine() + ProcName( 0 ) + ; + hb_eol() + ProcName( 0 ) + ; "(" + hb_NToS( ProcLine() ) + ")" + ; " Assertion failed: " + ; iif( <.msg.>, , <"exp"> ) ; diff --git a/harbour/include/simpleio.ch b/harbour/include/simpleio.ch index 3e97098383..01d3706c95 100644 --- a/harbour/include/simpleio.ch +++ b/harbour/include/simpleio.ch @@ -53,10 +53,10 @@ #ifndef _SIMPLEIO_CH #define _SIMPLEIO_CH -#command ? [ ] => ( OutStd( hb_OSNewLine() ) [, OutStd( ) ] ) +#command ? [ ] => ( OutStd( hb_eol() ) [, OutStd( ) ] ) #command ?? [ ] => OutStd( ) -#command ACCEPT TO => := StrTran( FReadStr( 0, 256 ), hb_OSNewLine() ) +#command ACCEPT TO => := StrTran( FReadStr( 0, 256 ), hb_eol() ) #command ACCEPT TO => ? ; ACCEPT TO #endif /* _SIMPLEIO_CH */ diff --git a/harbour/src/compiler/gencc.c b/harbour/src/compiler/gencc.c index 489601effa..1d6cdb826d 100644 --- a/harbour/src/compiler/gencc.c +++ b/harbour/src/compiler/gencc.c @@ -1807,11 +1807,11 @@ static HB_GENC_FUNC( hb_p_switch ) "\t\ttype = hb_itemType( pSwitch );\n" ); if( fStr ) { - fprintf( cargo->yyc, "\t\tpszText = (type & HB_IT_STRING) ? hb_itemGetCPtr( pSwitch ) : NULL;\n" ); + fprintf( cargo->yyc, "\t\tpszText = ( type & HB_IT_STRING ) ? hb_itemGetCPtr( pSwitch ) : NULL;\n" ); fprintf( cargo->yyc, "\t\tnLen = pszText ? hb_itemGetCLen( pSwitch ) : 0;\n" ); } if( fNum ) - fprintf( cargo->yyc, "\t\tlVal = (type & HB_IT_NUMINT) ? hb_itemGetNL( pSwitch ) : 0;\n\n" ); + fprintf( cargo->yyc, "\t\tlVal = ( type & HB_IT_NUMINT ) ? hb_itemGetNL( pSwitch ) : 0;\n\n" ); } nPCodePos = nStart + 3; @@ -1820,7 +1820,7 @@ static HB_GENC_FUNC( hb_p_switch ) switch( pFunc->pCode[ nPCodePos ] ) { case HB_P_PUSHLONG: - fprintf( cargo->yyc, "\t\tif( (type & HB_IT_NUMINT) != 0 && lVal == %ldL )\n", + fprintf( cargo->yyc, "\t\tif( ( type & HB_IT_NUMINT ) != 0 && lVal == %ldL )\n", HB_PCODE_MKLONG( &pFunc->pCode[ nPCodePos + 1 ] ) ); nPCodePos += 5; break; diff --git a/harbour/src/debug/debugger.prg b/harbour/src/debug/debugger.prg index fdbdb23632..e34d75c30f 100644 --- a/harbour/src/debug/debugger.prg +++ b/harbour/src/debug/debugger.prg @@ -2269,7 +2269,7 @@ METHOD SaveSettings() CLASS HBDebugger IF LastKey() != K_ESC IF ! Empty( ::cPathForFiles ) - cInfo += "Options Path " + ::cPathForFiles + hb_OSNewLine() + cInfo += "Options Path " + ::cPathForFiles + hb_eol() ENDIF cInfo += "Options Colors {" @@ -2279,60 +2279,60 @@ METHOD SaveSettings() CLASS HBDebugger cInfo += "," ENDIF NEXT - cInfo += "}" + hb_OSNewLine() + cInfo += "}" + hb_eol() IF ::lMonoDisplay - cInfo += "Options mono " + hb_OSNewLine() + cInfo += "Options mono " + hb_eol() ENDIF IF !::lRunAtStartup - cInfo += "Options NoRunAtStartup " + hb_OSNewLine() + cInfo += "Options NoRunAtStartup " + hb_eol() ENDIF IF ::nSpeed != 0 - cInfo += "Run Speed " + hb_NToS( ::nSpeed ) + hb_OSNewLine() + cInfo += "Run Speed " + hb_NToS( ::nSpeed ) + hb_eol() ENDIF IF ::nTabWidth != 4 - cInfo += "Options Tab " + hb_NToS( ::nTabWidth ) + hb_OSNewLine() + cInfo += "Options Tab " + hb_NToS( ::nTabWidth ) + hb_eol() ENDIF IF ::lShowStatics - cInfo += "Monitor Static" + hb_OSNewLine() + cInfo += "Monitor Static" + hb_eol() ENDIF IF ::lShowPublics - cInfo += "Monitor Public" + hb_OSNewLine() + cInfo += "Monitor Public" + hb_eol() ENDIF IF ::lShowLocals - cInfo += "Monitor Local" + hb_OSNewLine() + cInfo += "Monitor Local" + hb_eol() ENDIF IF ::lShowPrivates - cInfo += "Monitor Private" + hb_OSNewLine() + cInfo += "Monitor Private" + hb_eol() ENDIF IF ::lShowGlobals - cInfo += "Monitor Global" + hb_OSNewLine() + cInfo += "Monitor Global" + hb_eol() ENDIF IF ::lSortVars - cInfo += "Monitor Sort" + hb_OSNewLine() + cInfo += "Monitor Sort" + hb_eol() ENDIF IF ::lShowCallStack - cInfo += "View CallStack" + hb_OSNewLine() + cInfo += "View CallStack" + hb_eol() ENDIF IF ! ::lLineNumbers - cInfo += "Num Off" + hb_OSNewLine() + cInfo += "Num Off" + hb_eol() ENDIF IF ! Empty( ::aBreakPoints ) FOR n := 1 TO Len( ::aBreakPoints ) cInfo += "BP " + hb_NToS( ::aBreakPoints[ n ][ 1 ] ) + " " + ; - AllTrim( ::aBreakPoints[ n ][ 2 ] ) + hb_OSNewLine() + AllTrim( ::aBreakPoints[ n ][ 2 ] ) + hb_eol() NEXT ENDIF @@ -2340,10 +2340,10 @@ METHOD SaveSettings() CLASS HBDebugger FOR n := 1 TO Len( ::aWindows ) oWnd := ::aWindows[ n ] cInfo += "Window Size " + hb_NToS( oWnd:nBottom - oWnd:nTop + 1 ) + " " - cInfo += hb_NToS( oWnd:nRight - oWnd:nLeft + 1 ) + hb_OSNewLine() + cInfo += hb_NToS( oWnd:nRight - oWnd:nLeft + 1 ) + hb_eol() cInfo += "Window Move " + hb_NToS( oWnd:nTop ) + " " - cInfo += hb_NToS( oWnd:nLeft ) + hb_OSNewLine() - cInfo += "Window Next" + hb_OSNewLine() + cInfo += hb_NToS( oWnd:nLeft ) + hb_eol() + cInfo += "Window Next" + hb_eol() NEXT hb_MemoWrit( ::cSettingsFileName, cInfo ) diff --git a/harbour/src/debug/tbrwtext.prg b/harbour/src/debug/tbrwtext.prg index 1adc114f56..f722108ff4 100644 --- a/harbour/src/debug/tbrwtext.prg +++ b/harbour/src/debug/tbrwtext.prg @@ -353,7 +353,7 @@ STATIC FUNCTION WhichEOL( cString ) RETURN Chr( 13 ) + Chr( 10 ) ENDIF - RETURN HB_OSNewLine() + RETURN hb_eol() STATIC FUNCTION Text2Array( cString ) diff --git a/harbour/src/rdd/usrrdd/rdds/logrdd.prg b/harbour/src/rdd/usrrdd/rdds/logrdd.prg index ff2c4f9e7e..b5c4f57b82 100644 --- a/harbour/src/rdd/usrrdd/rdds/logrdd.prg +++ b/harbour/src/rdd/usrrdd/rdds/logrdd.prg @@ -453,7 +453,7 @@ STATIC PROCEDURE ToLog( cCmd, nWA, xPar1, xPar2, xPar3 ) ENDIF // Log to file only if cLog is a valid string IF HB_ISSTRING( cLog ) - FWrite( nHandle, cLog + hb_OSNewLine() ) + FWrite( nHandle, cLog + hb_eol() ) ENDIF ENDIF diff --git a/harbour/src/rtl/alert.prg b/harbour/src/rtl/alert.prg index 453771fbfb..f3cd8071c7 100644 --- a/harbour/src/rtl/alert.prg +++ b/harbour/src/rtl/alert.prg @@ -48,7 +48,9 @@ FUNCTION Alert( cMessage, aOptions, cColorNorm ) #ifdef HB_CLP_UNDOC - DEFAULT s_lNoAlert TO hb_argCheck( "NOALERT" ) + IF s_lNoAlert == NIL + s_lNoAlert := hb_argCheck( "NOALERT" ) + ENDIF IF s_lNoAlert RETURN NIL @@ -103,7 +105,9 @@ FUNCTION hb_Alert( xMessage, aOptions, cColorNorm, nDelay ) #ifdef HB_CLP_UNDOC - DEFAULT s_lNoAlert TO hb_argCheck( "NOALERT" ) + IF s_lNoAlert == NIL + s_lNoAlert := hb_argCheck( "NOALERT" ) + ENDIF IF s_lNoAlert RETURN NIL diff --git a/harbour/src/rtl/errsys.prg b/harbour/src/rtl/errsys.prg index d056c52460..b0d7b60725 100644 --- a/harbour/src/rtl/errsys.prg +++ b/harbour/src/rtl/errsys.prg @@ -120,7 +120,7 @@ STATIC FUNCTION DefError( oError ) nChoice := 0 DO WHILE nChoice == 0 - IF ISNIL( cDOSError ) + IF cDOSError == NIL nChoice := Alert( cMessage, aOptions ) ELSE nChoice := Alert( cMessage + ";" + cDOSError, aOptions ) @@ -129,29 +129,29 @@ STATIC FUNCTION DefError( oError ) ENDDO IF ! Empty( nChoice ) - DO CASE - CASE aOptions[ nChoice ] == "Break" + SWITCH aOptions[ nChoice ] + CASE "Break" Break( oError ) - CASE aOptions[ nChoice ] == "Retry" + CASE "Retry" RETURN .T. - CASE aOptions[ nChoice ] == "Default" + CASE "Default" RETURN .F. - ENDCASE + ENDSWITCH ENDIF // "Quit" selected - IF ! ISNIL( cDOSError ) + IF cDOSError != NIL cMessage += " " + cDOSError ENDIF - OutErr( hb_OSNewLine() ) + OutErr( hb_eol() ) OutErr( cMessage ) n := 1 DO WHILE ! Empty( ProcName( ++n ) ) - OutErr( hb_OSNewLine() ) + OutErr( hb_eol() ) OutErr( "Called from " + ProcName( n ) + ; "(" + hb_NToS( ProcLine( n ) ) + ") " ) diff --git a/harbour/src/rtl/hbi18n2.prg b/harbour/src/rtl/hbi18n2.prg index 01c9dfad08..7a65e68e73 100644 --- a/harbour/src/rtl/hbi18n2.prg +++ b/harbour/src/rtl/hbi18n2.prg @@ -120,10 +120,10 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) cErrorMsg := "cannot read from file: " + cFile RETURN NIL ENDIF - IF !hb_osNewLine() == _I18N_EOL - cValue := strtran( cValue, hb_osNewLine(), _I18N_EOL ) + IF !hb_eol() == _I18N_EOL + cValue := strtran( cValue, hb_eol(), _I18N_EOL ) ENDIF - IF !hb_osNewLine() == chr( 13 ) + chr( 10 ) + IF !hb_eol() == chr( 13 ) + chr( 10 ) cValue := strtran( cValue, chr( 13 ) + chr( 10 ), _I18N_EOL ) ENDIF aLines := hb_aTokens( cValue, _I18N_EOL ) @@ -139,7 +139,7 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) cLine := alltrim( cLine ) ++nLine IF lCont - cValue += hb_osNewLine() + cValue += hb_eol() ELSE IF cLine = "#" .AND. nMode == _I18N_NONE IF cLine = "#:" // source code references @@ -309,7 +309,7 @@ FUNCTION __I18N_POTARRAYSAVE( cFile, aTrans, cErrorMsg, lVersionNo, lSourceRef ) ENDIF lRet := .F. - cEol := hb_osNewLine() + cEol := hb_eol() cFlg := "#, c-format" + cEol cPOT := "#" + cEol + ; "# This file is generated by " + iif( lVersionNo, hb_version(), "Harbour" ) + cEol + ; @@ -535,7 +535,7 @@ FUNCTION HB_I18N_SAVEPOT( cFile, pI18N, cErrorMsg ) cErrorMsg := "wrong translation set item" lRet := .F. ELSE - cEol := hb_osNewLine() + cEol := hb_eol() cFlg := "#, c-format" + cEol cPOT := "#" + cEol + ; "# This file is generated by " + hb_version() + cEol + ; diff --git a/harbour/src/rtl/hbini.prg b/harbour/src/rtl/hbini.prg index 7c7aac6ac2..6bef62e33e 100644 --- a/harbour/src/rtl/hbini.prg +++ b/harbour/src/rtl/hbini.prg @@ -324,7 +324,7 @@ FUNCTION hb_IniWrite( xFileName, hIni, cCommentBegin, cCommentEnd, lAutoMain ) RETURN .T. FUNCTION hb_IniWriteStr( hIni, cCommentBegin, cCommentEnd, lAutoMain ) - LOCAL cNewLine := hb_OSNewLine() + LOCAL cNewLine := hb_eol() LOCAL cSection LOCAL cBuffer := "" diff --git a/harbour/src/rtl/listbox.prg b/harbour/src/rtl/listbox.prg index 5a2e87880d..53ecfceb6b 100644 --- a/harbour/src/rtl/listbox.prg +++ b/harbour/src/rtl/listbox.prg @@ -599,8 +599,8 @@ METHOD scroll( nMethod ) CLASS LISTBOX LOCAL nKey LOCAL nCount - DO CASE - CASE nMethod == HTSCROLLTHUMBDRAG + SWITCH nMethod + CASE HTSCROLLTHUMBDRAG nPrevMRow := MRow() @@ -637,24 +637,27 @@ METHOD scroll( nMethod ) CLASS LISTBOX ENDIF ENDIF ENDDO + EXIT - CASE nMethod == HTSCROLLUNITDEC + CASE HTSCROLLUNITDEC IF ::nTopItem > 1 ::nTopItem-- ::oVScroll:current := ::scrollbarPos() ::display() ENDIF + EXIT - CASE nMethod == HTSCROLLUNITINC + CASE HTSCROLLUNITINC IF ( ::nTopItem + ::nBottom - ::nTop ) <= ::nItemCount + 1 ::nTopItem++ ::oVScroll:current := ::scrollbarPos() ::display() ENDIF + EXIT - CASE nMethod == HTSCROLLBLOCKDEC + CASE HTSCROLLBLOCKDEC nPos := ::nBottom - ::nTop - iif( ::lDropDown, 2, 1 ) nTopItem := ::nTopItem - nPos @@ -663,8 +666,9 @@ METHOD scroll( nMethod ) CLASS LISTBOX ::oVScroll:current := ::scrollbarPos() ::display() ENDIF + EXIT - CASE nMethod == HTSCROLLBLOCKINC + CASE HTSCROLLBLOCKINC nPos := ::nBottom - ::nTop - 1 nItemCount := ::nItemCount @@ -677,8 +681,9 @@ METHOD scroll( nMethod ) CLASS LISTBOX ::oVScroll:current := ::scrollbarPos() ::display() ENDIF + EXIT - ENDCASE + ENDSWITCH RETURN Self diff --git a/harbour/src/rtl/profiler.prg b/harbour/src/rtl/profiler.prg index 3b5f7d12fd..2a9c4c744c 100644 --- a/harbour/src/rtl/profiler.prg +++ b/harbour/src/rtl/profiler.prg @@ -166,33 +166,37 @@ PROCEDURE CallMe500Times() STATIC PROCEDURE Browser( oBrowse ) LOCAL lBrowsing := .T. - LOCAL nKey DO WHILE lBrowsing oBrowse:forceStable() - nKey := Inkey( 0 ) - - DO CASE - CASE nKey == K_ESC + SWITCH Inkey( 0 ) + CASE K_ESC lBrowsing := .F. - CASE nKey == K_DOWN + EXIT + CASE K_DOWN oBrowse:down() - CASE nKey == K_UP + EXIT + CASE K_UP oBrowse:up() - CASE nKey == K_LEFT + EXIT + CASE K_LEFT oBrowse:left() - CASE nKey == K_RIGHT + EXIT + CASE K_RIGHT oBrowse:right() - CASE nKey == K_PGDN + EXIT + CASE K_PGDN oBrowse:pageDown() - CASE nKey == K_PGUP + EXIT + CASE K_PGUP oBrowse:pageUp() + EXIT // And so on.... (not really necessary for this test) - ENDCASE + ENDSWITCH ENDDO @@ -639,7 +643,7 @@ ENDCLASS METHOD writeLines( aLines ) CLASS HBProfileReportToFile IF ::hFile != F_ERROR - AEval( aLines, {| c | FWrite( ::hFile, c + HB_OSNewLine() ) } ) + AEval( aLines, {| c | FWrite( ::hFile, c + hb_eol() ) } ) ENDIF RETURN Self @@ -710,7 +714,7 @@ ENDCLASS METHOD generate( bFilter ) CLASS HBProfileReportToString LOCAL cReport := "" - AEval( ::super:generate( bFilter ), {| c | cReport += c + HB_OSNewLine() } ) + AEval( ::super:generate( bFilter ), {| c | cReport += c + hb_eol() } ) RETURN cReport diff --git a/harbour/src/rtl/teditor.prg b/harbour/src/rtl/teditor.prg index d3b171bfe6..1579610071 100644 --- a/harbour/src/rtl/teditor.prg +++ b/harbour/src/rtl/teditor.prg @@ -286,7 +286,7 @@ METHOD LineLen( nRow ) CLASS HBEditor METHOD GetText() CLASS HBEditor LOCAL cString := "" - LOCAL cEOL := HB_OSNewLine() + LOCAL cEOL := hb_eol() IF ::lWordWrap AEval( ::aText, {| cItem | cString += cItem:cText + iif( cItem:lSoftCR, "", cEOL ) },, ::naTextLen - 1 ) @@ -470,8 +470,8 @@ METHOD MoveCursor( nKey ) CLASS HBEditor LOCAL lMoveKey := .T. - DO CASE - CASE nKey == K_DOWN + SWITCH nKey + CASE K_DOWN IF !::lEditAllow DO WHILE ::Row() < ::nBottom .AND. ::nRow < ::naTextLen ::nRow++ @@ -491,8 +491,9 @@ METHOD MoveCursor( nKey ) CLASS HBEditor ::SetPos( ::Row() + 1, ::Col() ) ENDIF ENDIF + EXIT - CASE nKey == K_PGDN + CASE K_PGDN IF ::nRow + ::nNumRows < ::naTextLen ::nRow += ::nNumRows IF ::nFirstRow + ::nNumRows > ::naTextLen @@ -506,16 +507,18 @@ METHOD MoveCursor( nKey ) CLASS HBEditor ::SetPos( Min( ::nTop + ::naTextLen - 1, ::nBottom ), ::Col() ) ENDIF ::display() + EXIT - CASE nKey == K_CTRL_PGDN + CASE K_CTRL_PGDN ::nRow := ::naTextLen ::nCol := Max( ::LineLen( ::nRow ) + 1, 1 ) ::nFirstRow := Max( ::naTextLen - ::nNumRows + 1, 1 ) ::nFirstCol := Max( ::nCol - ::nNumCols + 1, 1 ) ::SetPos( Min( ::nTop + ::naTextLen - 1, ::nBottom ), Min( ::nLeft + ::nCol - 1, ::nRight ) ) ::display() + EXIT - CASE nKey == K_UP + CASE K_UP IF ! ::lEditAllow DO WHILE ::Row() > ::nTop .AND. ::nRow > 1 ::nRow-- @@ -533,8 +536,9 @@ METHOD MoveCursor( nKey ) CLASS HBEditor ::nRow-- ::SetPos( ::Row() - 1, ::Col() ) ENDIF + EXIT - CASE nKey == K_PGUP + CASE K_PGUP IF ( ::nRow - ::nNumRows ) > 1 ::nRow -= ::nNumRows ::nFirstRow -= ::nNumRows @@ -549,16 +553,18 @@ METHOD MoveCursor( nKey ) CLASS HBEditor ::SetPos( ::nTop, ::Col() ) ENDIF ::display() + EXIT - CASE nKey == K_CTRL_PGUP + CASE K_CTRL_PGUP ::nRow := 1 ::nCol := 1 ::nFirstCol := 1 ::nFirstRow := 1 ::SetPos( ::nTop, ::nLeft ) ::display() + EXIT - CASE nKey == K_RIGHT + CASE K_RIGHT IF ::Col() == ::nRight IF ::nCol <= iif( ::lWordWrap, ::nWordWrapCol, ::LineLen( ::nRow ) ) hb_scroll( ::nTop, ::nLeft, ::nBottom, ::nRight,, 1 ) @@ -570,8 +576,9 @@ METHOD MoveCursor( nKey ) CLASS HBEditor ::nCol++ ::SetPos( ::Row(), ::Col() + 1 ) ENDIF + EXIT - CASE nKey == K_CTRL_RIGHT + CASE K_CTRL_RIGHT // NOTE: should be faster without call to ::GetLine() DO WHILE ::nCol <= iif( ::lWordWrap, Min( ::nWordWrapCol, ::LineLen( ::nRow ) ), ::LineLen( ::nRow ) ) .AND. !( SubStr( ::aText[ ::nRow ]:cText, ::nCol, 1 ) == " " ) ::MoveCursor( K_RIGHT ) @@ -579,8 +586,9 @@ METHOD MoveCursor( nKey ) CLASS HBEditor DO WHILE ::nCol <= iif( ::lWordWrap, Min( ::nWordWrapCol, ::LineLen( ::nRow ) ), ::LineLen( ::nRow ) ) .AND. SubStr( ::aText[ ::nRow ]:cText, ::nCol, 1 ) == " " ::MoveCursor( K_RIGHT ) ENDDO + EXIT - CASE nKey == K_LEFT + CASE K_LEFT IF ::Col() == ::nLeft IF ::nCol > 1 hb_scroll( ::nTop, ::nLeft, ::nBottom, ::nRight,, -1 ) @@ -592,36 +600,41 @@ METHOD MoveCursor( nKey ) CLASS HBEditor ::nCol-- ::SetPos( ::Row(), ::Col() - 1 ) ENDIF + EXIT - CASE nKey == K_CTRL_LEFT + CASE K_CTRL_LEFT DO WHILE ::nCol > 1 .AND. !( SubStr( ::aText[ ::nRow ]:cText, ::nCol, 1 ) == " " ) ::MoveCursor( K_LEFT ) ENDDO DO WHILE ::nCol > 1 .AND. SubStr( ::aText[ ::nRow ]:cText, ::nCol, 1 ) == " " ::MoveCursor( K_LEFT ) ENDDO + EXIT - CASE nKey == K_HOME + CASE K_HOME ::nCol := 1 ::nFirstCol := 1 ::SetPos( ::Row(), ::nLeft ) ::display() + EXIT - CASE nKey == K_CTRL_HOME + CASE K_CTRL_HOME ::nCol := 1 ::nFirstCol := 1 ::nRow -= ( ::Row() - ::nTop ) ::SetPos( ::nTop, ::nLeft ) ::display() + EXIT - CASE nKey == K_END + CASE K_END // Empty lines have 0 len ::nCol := Max( ::LineLen( ::nRow ) + 1, 1 ) ::nFirstCol := Max( ::nCol - ::nNumCols + 1, 1 ) ::SetPos( ::Row(), Min( ::nLeft + ::nCol - 1, ::nRight ) ) ::display() + EXIT - CASE nKey == K_CTRL_END + CASE K_CTRL_END ::nRow += ::nBottom - ::Row() IF ::nRow > ::naTextLen ::nRow := ::naTextLen @@ -630,11 +643,12 @@ METHOD MoveCursor( nKey ) CLASS HBEditor ::nFirstCol := Max( ::nCol - ::nNumCols + 1, 1 ) ::SetPos( Min( ::nTop + ::naTextLen - 1, ::nBottom ), Min( ::nLeft + ::nCol - 1, ::nRight ) ) ::display() + EXIT OTHERWISE lMoveKey := .F. - ENDCASE + ENDSWITCH RETURN lMoveKey @@ -1081,7 +1095,7 @@ STATIC FUNCTION WhichEOL( cString ) RETURN Chr( 13 ) + Chr( 10 ) ENDIF - RETURN HB_OSNewLine() + RETURN hb_eol() // Converts a string to an array of strings splitting input string at EOL boundaries STATIC FUNCTION Text2Array( cString, nWordWrapCol ) diff --git a/harbour/src/rtl/tgetlist.prg b/harbour/src/rtl/tgetlist.prg index 3141d21d3d..091b5dbc03 100644 --- a/harbour/src/rtl/tgetlist.prg +++ b/harbour/src/rtl/tgetlist.prg @@ -361,47 +361,59 @@ METHOD GetApplyKey( nKey, oGet, oMenu, aMsg ) CLASS HBGetList HB_SYMBOL_UNUSED( aMsg ) #endif - DO CASE - CASE nKey == K_UP + SWITCH nKey + CASE K_UP oGet:exitState := GE_UP + EXIT - CASE nKey == K_SH_TAB + CASE K_SH_TAB oGet:exitState := GE_UP + EXIT - CASE nKey == K_DOWN + CASE K_DOWN oGet:exitState := GE_DOWN + EXIT - CASE nKey == K_TAB + CASE K_TAB oGet:exitState := GE_DOWN + EXIT - CASE nKey == K_ENTER + CASE K_ENTER oGet:exitState := GE_ENTER + EXIT - CASE nKey == K_ESC + CASE K_ESC IF Set( _SET_ESCAPE ) oGet:undo() oGet:exitState := GE_ESCAPE ENDIF + EXIT - CASE nKey == K_PGUP + CASE K_PGUP oGet:exitState := GE_WRITE + EXIT - CASE nKey == K_PGDN + CASE K_PGDN oGet:exitState := GE_WRITE + EXIT - CASE nKey == K_CTRL_HOME + CASE K_CTRL_HOME oGet:exitState := GE_TOP + EXIT #ifdef CTRL_END_SPECIAL - CASE nKey == K_CTRL_END + CASE K_CTRL_END oGet:exitState := GE_BOTTOM + EXIT #else - CASE nKey == K_CTRL_W + CASE K_CTRL_W oGet:exitState := GE_WRITE + EXIT #endif #ifdef HB_COMPAT_C53 - CASE nKey == K_LBUTTONDOWN .OR. nKey == K_LDBLCLK + CASE K_LBUTTONDOWN + CASE K_LDBLCLK nMRow := MRow() nMCol := MCol() @@ -449,47 +461,61 @@ METHOD GetApplyKey( nKey, oGet, oMenu, aMsg ) CLASS HBGetList ELSE oGet:exitState := GE_NOEXIT ENDIF + EXIT #endif - CASE nKey == K_UNDO + CASE K_UNDO oGet:undo() + EXIT - CASE nKey == K_HOME + CASE K_HOME oGet:home() + EXIT - CASE nKey == K_END + CASE K_END oGet:end() + EXIT - CASE nKey == K_RIGHT + CASE K_RIGHT oGet:right() + EXIT - CASE nKey == K_LEFT + CASE K_LEFT oGet:left() + EXIT - CASE nKey == K_CTRL_RIGHT + CASE K_CTRL_RIGHT oGet:wordRight() + EXIT - CASE nKey == K_CTRL_LEFT + CASE K_CTRL_LEFT oGet:wordLeft() + EXIT - CASE nKey == K_BS + CASE K_BS oGet:backSpace() + EXIT - CASE nKey == K_DEL + CASE K_DEL oGet:delete() + EXIT - CASE nKey == K_CTRL_T + CASE K_CTRL_T oGet:delWordRight() + EXIT - CASE nKey == K_CTRL_Y + CASE K_CTRL_Y oGet:delEnd() + EXIT - CASE nKey == K_CTRL_BS + CASE K_CTRL_BS oGet:delWordLeft() + EXIT - CASE nKey == K_INS + CASE K_INS Set( _SET_INSERT, ! Set( _SET_INSERT ) ) ::ShowScoreboard() + EXIT OTHERWISE @@ -515,7 +541,7 @@ METHOD GetApplyKey( nKey, oGet, oMenu, aMsg ) CLASS HBGetList ENDIF ENDIF ENDIF - ENDCASE + ENDSWITCH RETURN Self @@ -684,33 +710,38 @@ METHOD Settle( nPos, lInit ) CLASS HBGetList ENDIF - DO CASE - CASE nExitState == GE_UP + SWITCH nExitState + CASE GE_UP nPos-- + EXIT - CASE nExitState == GE_DOWN + CASE GE_DOWN nPos++ + EXIT - CASE nExitState == GE_TOP + CASE GE_TOP nPos := 1 ::lBumpTop := .T. nExitState := GE_DOWN + EXIT - CASE nExitState == GE_BOTTOM + CASE GE_BOTTOM nPos := Len( ::aGetList ) ::lBumpBot := .T. nExitState := GE_UP + EXIT - CASE nExitState == GE_ENTER + CASE GE_ENTER nPos++ + EXIT - CASE nExitState == GE_SHORTCUT + CASE GE_SHORTCUT RETURN ::nNextGet - CASE nExitState == GE_MOUSEHIT + CASE GE_MOUSEHIT RETURN ::nNextGet - ENDCASE + ENDSWITCH IF nPos == 0 IF ! Set( _SET_EXIT ) .AND. ! ::lBumpBot @@ -991,52 +1022,64 @@ METHOD GUIApplyKey( oGet, oGUI, nKey, oMenu, aMsg ) CLASS HBGetList ENDIF - DO CASE - CASE nKey == K_UP + SWITCH nKey + CASE K_UP oGet:exitState := GE_UP + EXIT - CASE nKey == K_SH_TAB + CASE K_SH_TAB oGet:exitState := GE_UP + EXIT - CASE nKey == K_DOWN + CASE K_DOWN oGet:exitState := GE_DOWN + EXIT - CASE nKey == K_TAB + CASE K_TAB oGet:exitState := GE_DOWN + EXIT - CASE nKey == K_ENTER + CASE K_ENTER oGet:exitState := GE_ENTER + EXIT - CASE nKey == K_ESC + CASE K_ESC IF Set( _SET_ESCAPE ) oGet:exitState := GE_ESCAPE ENDIF + EXIT - CASE nKey == K_PGUP + CASE K_PGUP oGet:exitState := GE_WRITE + EXIT - CASE nKey == K_PGDN + CASE K_PGDN oGet:exitState := GE_WRITE + EXIT - CASE nKey == K_CTRL_HOME + CASE K_CTRL_HOME oGet:exitState := GE_TOP + EXIT #ifdef CTRL_END_SPECIAL // Both ^W and ^End go to the last GET - CASE nKey == K_CTRL_END + CASE K_CTRL_END oGet:exitState := GE_BOTTOM + EXIT #else // Both ^W and ^End terminate the READ (the default) - CASE nKey == K_CTRL_W + CASE K_CTRL_W oGet:exitState := GE_WRITE + EXIT #endif - CASE nKey == K_LBUTTONDOWN .OR. nKey == K_LDBLCLK + CASE K_LBUTTONDOWN + CASE K_LDBLCLK nMRow := MRow() nMCol := MCol() @@ -1084,7 +1127,9 @@ METHOD GUIApplyKey( oGet, oGUI, nKey, oMenu, aMsg ) CLASS HBGetList oGUI:Display() ENDIF - ENDCASE + EXIT + + ENDSWITCH RETURN Self @@ -1203,41 +1248,48 @@ METHOD TBApplyKey( oGet, oTB, nKey, oMenu, aMsg ) CLASS HBGetList nKey := 0 ENDIF - DO CASE - CASE nKey == K_TAB + SWITCH nKey + CASE K_TAB oGet:exitState := GE_DOWN + EXIT - CASE nKey == K_SH_TAB + CASE K_SH_TAB oGet:exitState := GE_UP + EXIT - CASE nKey == K_ENTER + CASE K_ENTER #ifndef HB_CLP_STRICT IF !oTb:Stable() oTb:ForceStable() ENDIF #endif oGet:exitState := GE_ENTER + EXIT - CASE nKey == K_ESC + CASE K_ESC IF Set( _SET_ESCAPE ) oGet:exitState := GE_ESCAPE ENDIF + EXIT #ifdef CTRL_END_SPECIAL // Both ^W and ^End go to the last GET - CASE nKey == K_CTRL_END + CASE K_CTRL_END oGet:exitState := GE_BOTTOM + EXIT #else // Both ^W and ^End terminate the READ (the default) - CASE nKey == K_CTRL_W + CASE K_CTRL_W oGet:exitState := GE_WRITE + EXIT #endif - CASE nKey == K_LBUTTONDOWN .OR. nKey == K_LDBLCLK + CASE K_LBUTTONDOWN + CASE K_LDBLCLK nMRow := MRow() nMCol := MCol() @@ -1261,7 +1313,9 @@ METHOD TBApplyKey( oGet, oTB, nKey, oMenu, aMsg ) CLASS HBGetList ENDIF ENDIF - ENDCASE + EXIT + + ENDSWITCH RETURN Self @@ -1519,48 +1573,48 @@ METHOD HitTest( nMRow, nMCol, aMsg ) CLASS HBGetList METHOD ReadStats( nElement, xNewValue ) CLASS HBGetList LOCAL xRetVal - DO CASE - CASE nElement == SLUPDATED ; xRetVal := ::lUpdated - CASE nElement == SBFORMAT ; xRetVal := ::bFormat - CASE nElement == SLKILLREAD ; xRetVal := ::lKillRead - CASE nElement == SLBUMPTOP ; xRetVal := ::lBumpTop - CASE nElement == SLBUMPBOT ; xRetVal := ::lBumpBot - CASE nElement == SNLASTEXIT ; xRetVal := ::nLastExitState - CASE nElement == SNLASTPOS ; xRetVal := ::nLastPos - CASE nElement == SOACTIVEGET ; xRetVal := ::oActiveGet - CASE nElement == SXREADVAR ; xRetVal := ::cVarName - CASE nElement == SCREADPROCNAME ; xRetVal := ::cReadProcName - CASE nElement == SNREADPROCLINE ; xRetVal := ::nReadProcLine - CASE nElement == SNNEXTGET ; xRetVal := ::nNextGet - CASE nElement == SNHITCODE ; xRetVal := ::nHitCode - CASE nElement == SNPOS ; xRetVal := ::nPos - CASE nElement == SCSCRSVMSG ; xRetVal := ::cMsgSaveS - CASE nElement == SNMENUID ; xRetVal := ::nMenuID - CASE nElement == SNSVCURSOR ; xRetVal := ::nSaveCursor - OTHERWISE ; xRetVal := NIL - ENDCASE + SWITCH nElement + CASE SLUPDATED ; xRetVal := ::lUpdated ; EXIT + CASE SBFORMAT ; xRetVal := ::bFormat ; EXIT + CASE SLKILLREAD ; xRetVal := ::lKillRead ; EXIT + CASE SLBUMPTOP ; xRetVal := ::lBumpTop ; EXIT + CASE SLBUMPBOT ; xRetVal := ::lBumpBot ; EXIT + CASE SNLASTEXIT ; xRetVal := ::nLastExitState ; EXIT + CASE SNLASTPOS ; xRetVal := ::nLastPos ; EXIT + CASE SOACTIVEGET ; xRetVal := ::oActiveGet ; EXIT + CASE SXREADVAR ; xRetVal := ::cVarName ; EXIT + CASE SCREADPROCNAME ; xRetVal := ::cReadProcName ; EXIT + CASE SNREADPROCLINE ; xRetVal := ::nReadProcLine ; EXIT + CASE SNNEXTGET ; xRetVal := ::nNextGet ; EXIT + CASE SNHITCODE ; xRetVal := ::nHitCode ; EXIT + CASE SNPOS ; xRetVal := ::nPos ; EXIT + CASE SCSCRSVMSG ; xRetVal := ::cMsgSaveS ; EXIT + CASE SNMENUID ; xRetVal := ::nMenuID ; EXIT + CASE SNSVCURSOR ; xRetVal := ::nSaveCursor ; EXIT + OTHERWISE ; xRetVal := NIL + ENDSWITCH IF PCount() > 1 - DO CASE - CASE nElement == SLUPDATED ; ::lUpdated := xNewValue - CASE nElement == SBFORMAT ; ::bFormat := xNewValue - CASE nElement == SLKILLREAD ; ::lKillRead := xNewValue - CASE nElement == SLBUMPTOP ; ::lBumpTop := xNewValue - CASE nElement == SLBUMPBOT ; ::lBumpBot := xNewValue - CASE nElement == SNLASTEXIT ; ::nLastExitState := xNewValue - CASE nElement == SNLASTPOS ; ::nLastPos := xNewValue - CASE nElement == SOACTIVEGET ; ::oActiveGet := xNewValue - CASE nElement == SXREADVAR ; ::xReadVar := xNewValue - CASE nElement == SCREADPROCNAME ; ::cReadProcName := xNewValue - CASE nElement == SNREADPROCLINE ; ::nReadProcLine := xNewValue - CASE nElement == SNNEXTGET ; ::nNextGet := xNewValue - CASE nElement == SNHITCODE ; ::nHitCode := xNewValue - CASE nElement == SNPOS ; ::nPos := xNewValue - CASE nElement == SCSCRSVMSG ; ::cMsgSaveS := xNewValue - CASE nElement == SNMENUID ; ::nMenuID := xNewValue - CASE nElement == SNSVCURSOR ; ::nSaveCursor := xNewValue - ENDCASE + SWITCH nElement + CASE SLUPDATED ; ::lUpdated := xNewValue ; EXIT + CASE SBFORMAT ; ::bFormat := xNewValue ; EXIT + CASE SLKILLREAD ; ::lKillRead := xNewValue ; EXIT + CASE SLBUMPTOP ; ::lBumpTop := xNewValue ; EXIT + CASE SLBUMPBOT ; ::lBumpBot := xNewValue ; EXIT + CASE SNLASTEXIT ; ::nLastExitState := xNewValue ; EXIT + CASE SNLASTPOS ; ::nLastPos := xNewValue ; EXIT + CASE SOACTIVEGET ; ::oActiveGet := xNewValue ; EXIT + CASE SXREADVAR ; ::xReadVar := xNewValue ; EXIT + CASE SCREADPROCNAME ; ::cReadProcName := xNewValue ; EXIT + CASE SNREADPROCLINE ; ::nReadProcLine := xNewValue ; EXIT + CASE SNNEXTGET ; ::nNextGet := xNewValue ; EXIT + CASE SNHITCODE ; ::nHitCode := xNewValue ; EXIT + CASE SNPOS ; ::nPos := xNewValue ; EXIT + CASE SCSCRSVMSG ; ::cMsgSaveS := xNewValue ; EXIT + CASE SNMENUID ; ::nMenuID := xNewValue ; EXIT + CASE SNSVCURSOR ; ::nSaveCursor := xNewValue ; EXIT + ENDSWITCH ENDIF RETURN xRetVal diff --git a/harbour/src/rtl/tpersist.prg b/harbour/src/rtl/tpersist.prg index 832310ebfe..bad185e056 100644 --- a/harbour/src/rtl/tpersist.prg +++ b/harbour/src/rtl/tpersist.prg @@ -128,9 +128,9 @@ METHOD SaveToText( cObjectName, nIndent ) CLASS HBPersistent nIndent := 0 ENDIF - cObject := iif( nIndent > 0, hb_OSNewLine(), "" ) + Space( nIndent ) + ; + cObject := iif( nIndent > 0, hb_eol(), "" ) + Space( nIndent ) + ; "OBJECT " + iif( nIndent != 0, "::", "" ) + cObjectName + " AS " + ; - ::ClassName() + hb_OSNewLine() + ::ClassName() + hb_eol() aProperties := __ClsGetProperties( ::ClassH ) @@ -147,7 +147,7 @@ METHOD SaveToText( cObjectName, nIndent ) CLASS HBPersistent cObject += ArrayToText( uValue, aProperties[ n ], nIndent ) nIndent -= 3 IF n < Len( aProperties ) - cObject += hb_OSNewLine() + cObject += hb_eol() ENDIF CASE cType == "O" @@ -155,89 +155,79 @@ METHOD SaveToText( cObjectName, nIndent ) CLASS HBPersistent cObject += uValue:SaveToText( aProperties[ n ], nIndent ) ENDIF IF n < Len( aProperties ) - cObject += hb_OSNewLine() + cObject += hb_eol() ENDIF OTHERWISE IF n == 1 - cObject += hb_OSNewLine() + cObject += hb_eol() ENDIF cObject += Space( nIndent ) + " ::" + ; aProperties[ n ] + " = " + ValToText( uValue ) + ; - hb_OSNewLine() + hb_eol() ENDCASE ENDIF NEXT - cObject += hb_OSNewLine() + Space( nIndent ) + "ENDOBJECT" + hb_OSNewLine() + cObject += hb_eol() + Space( nIndent ) + "ENDOBJECT" + hb_eol() RETURN cObject STATIC FUNCTION ArrayToText( aArray, cName, nIndent ) - LOCAL cArray := hb_OSNewLine() + Space( nIndent ) + "ARRAY ::" + cName + ; - " LEN " + hb_NToS( Len( aArray ) ) + hb_OSNewLine() + LOCAL cArray := hb_eol() + Space( nIndent ) + "ARRAY ::" + cName + ; + " LEN " + hb_NToS( Len( aArray ) ) + hb_eol() LOCAL n LOCAL uValue - LOCAL cType FOR n := 1 TO Len( aArray ) uValue := aArray[ n ] - cType := ValType( uValue ) - DO CASE - CASE cType == "A" + SWITCH ValType( uValue ) + CASE "A" nIndent += 3 cArray += ArrayToText( uValue, cName + "[ " + ; - hb_NToS( n ) + " ]", nIndent ) + hb_OSNewLine() + hb_NToS( n ) + " ]", nIndent ) + hb_eol() nIndent -= 3 + EXIT - CASE cType == "O" + CASE "O" IF __objDerivedFrom( uValue, "HBPERSISTENT" ) cArray += uValue:SaveToText( cName + "[ " + hb_NToS( n ) + ; " ]", nIndent ) ENDIF + EXIT OTHERWISE IF n == 1 - cArray += hb_OSNewLine() + cArray += hb_eol() ENDIF cArray += Space( nIndent ) + " ::" + cName + ; + "[ " + hb_NToS( n ) + " ]" + " = " + ; - ValToText( uValue ) + hb_OSNewLine() - ENDCASE + ValToText( uValue ) + hb_eol() + ENDSWITCH NEXT - cArray += hb_OSNewLine() + Space( nIndent ) + "ENDARRAY" + hb_OSNewLine() + cArray += hb_eol() + Space( nIndent ) + "ENDARRAY" + hb_eol() RETURN cArray STATIC FUNCTION ValToText( uValue ) - LOCAL cType := ValType( uValue ) - LOCAL cText + SWITCH ValType( uValue ) + CASE "C" + RETURN hb_StrToExp( uValue ) + CASE "N" + RETURN hb_NToS( uValue ) + CASE "D" + RETURN "0d" + iif( Empty( DToS( uValue ) ), "00000000", DToS( uValue ) ) + CASE "T" + RETURN 't"' + hb_TSToStr( uValue, .T. ) + '"' + ENDSWITCH - DO CASE - CASE cType == "C" - cText := hb_StrToExp( uValue ) - - CASE cType == "N" - cText := hb_NToS( uValue ) - - CASE cType == "D" - cText := DToS( uValue ) - cText := "0d" + iif( Empty( cText ), "00000000", cText ) - - CASE cType == "T" - cText := 't"' + hb_TSToStr( uValue, .T. ) + '"' - - OTHERWISE - cText := hb_ValToStr( uValue ) - ENDCASE - - RETURN cText + RETURN hb_ValToStr( uValue ) /* Notice: nFrom must be supplied by reference */ diff --git a/harbour/src/rtl/treport.prg b/harbour/src/rtl/treport.prg index 9830efc742..0a614a9c07 100644 --- a/harbour/src/rtl/treport.prg +++ b/harbour/src/rtl/treport.prg @@ -777,7 +777,7 @@ METHOD ExecuteReport() CLASS HBReportForm ::aReportData[RPT_COLUMNS,nCol,RCT_WIDTH]), nMaxLines) ELSEIF ::aReportData[RPT_COLUMNS,nCol,RCT_TYPE] $ "C" nMaxLines := Max( XMLCOUNT( StrTran( Eval( ::aReportData[RPT_COLUMNS,nCol,RCT_EXP]),; - ";", hb_osNewLine() ),; + ";", hb_eol() ),; ::aReportData[RPT_COLUMNS,nCol,RCT_WIDTH]), nMaxLines) ENDIF NEXT @@ -796,7 +796,7 @@ METHOD ExecuteReport() CLASS HBReportForm // with multi-lines per record ";"- method IF ::aReportData[RPT_COLUMNS,nCol,RCT_TYPE] $ "C" cLine := XMEMOLINE( RTrim( StrTran( Eval(::aReportData[RPT_COLUMNS,nCol,RCT_EXP]),; - ";", hb_osNewLine() ) ),; + ";", hb_eol() ) ),; ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ], nLine ) ELSE cLine := XMEMOLINE( RTrim( Eval( ::aReportData[ RPT_COLUMNS, nCol, RCT_EXP ] ) ),; @@ -1320,23 +1320,29 @@ METHOD GetColumn( cFieldsBuffer AS STRING, nOffset AS NUMERIC ) CLASS HBReportFo IF Used() cType := ValType( Eval( aColumn[ RCT_EXP ] ) ) aColumn[ RCT_TYPE ] := cType - DO CASE - CASE cType == "C" .OR. cType == "M" + SWITCH cType + CASE "C" + CASE "M" aColumn[ RCT_PICT ] := Replicate("X", aColumn[ RCT_WIDTH ]) - CASE cType == "D" + EXIT + CASE "D" aColumn[ RCT_PICT ] := "@D" - CASE cType == "T" + EXIT + CASE "T" aColumn[ RCT_PICT ] := "@T" - CASE cType == "N" + EXIT + CASE "N" IF aColumn[ RCT_DECIMALS ] != 0 aColumn[ RCT_PICT ] := Replicate("9", aColumn[ RCT_WIDTH ] - aColumn[ RCT_DECIMALS ] -1) + "." + ; Replicate("9", aColumn[ RCT_DECIMALS ]) ELSE aColumn[ RCT_PICT ] := Replicate("9", aColumn[ RCT_WIDTH ]) ENDIF - CASE cType == "L" + EXIT + CASE "L" aColumn[ RCT_PICT ] := "@L" + Replicate("X",aColumn[ RCT_WIDTH ]-1) - ENDCASE + EXIT + ENDSWITCH ENDIF // Update offset into ?_buffer diff --git a/harbour/src/rtl/ttextlin.prg b/harbour/src/rtl/ttextlin.prg index 7aea31a825..635392406e 100644 --- a/harbour/src/rtl/ttextlin.prg +++ b/harbour/src/rtl/ttextlin.prg @@ -55,7 +55,7 @@ CREATE CLASS HBTextLine VAR cText /* A line of text */ - VAR lSoftCR /* true if line doesn't end with a hb_OSNewLine() char (word wrapping) */ + VAR lSoftCR /* true if line doesn't end with a hb_eol() char (word wrapping) */ METHOD New( cLine, lSoftCR ) diff --git a/harbour/tests/adirtest.prg b/harbour/tests/adirtest.prg index a778d167e6..9a3a12c883 100644 --- a/harbour/tests/adirtest.prg +++ b/harbour/tests/adirtest.prg @@ -20,8 +20,6 @@ STATIC FUNCTION TestIt( cSpec ) LOCAL a4 LOCAL a5 - LOCAL cNewLine := HB_OSNewLine() - // In order to account for documented behavour, this call will ensure // that Adir() returns the same length array in both cases. // ie: adir( cSpec ) could return a different length array than @@ -39,17 +37,16 @@ STATIC FUNCTION TestIt( cSpec ) a5 := Array( a + 1 ) OutStd( "--------------------------------------------------------" ) - OutStd( cNewLine ) + OutStd( hb_eol() ) ADIR( cSpec , a1, a2, a3, a4, a5 ) - aEval(a1, {|tmp| OutStd( tmp ), OutStd( cNewLine ) } ) - aEval(a2, {|tmp| OutStd( tmp ), OutStd( cNewLine ) } ) - aEval(a3, {|tmp| OutStd( tmp ), OutStd( cNewLine ) } ) - aEval(a4, {|tmp| OutStd( tmp ), OutStd( cNewLine ) } ) - aEval(a5, {|tmp| OutStd( tmp ), OutStd( cNewLine ) } ) + aEval(a1, {|tmp| OutStd( tmp ), OutStd( hb_eol() ) } ) + aEval(a2, {|tmp| OutStd( tmp ), OutStd( hb_eol() ) } ) + aEval(a3, {|tmp| OutStd( tmp ), OutStd( hb_eol() ) } ) + aEval(a4, {|tmp| OutStd( tmp ), OutStd( hb_eol() ) } ) + aEval(a5, {|tmp| OutStd( tmp ), OutStd( hb_eol() ) } ) ADIR( cSpec, 10, "A", NIL, NIL, NIL ) RETURN NIL - diff --git a/harbour/tests/cdow.prg b/harbour/tests/cdow.prg index c82ffc1b47..8220b0f6ad 100644 --- a/harbour/tests/cdow.prg +++ b/harbour/tests/cdow.prg @@ -1,16 +1,15 @@ -// -// $Id$ -// +/* + * $Id$ + */ -function main() -local cNewLine := HB_OSNewLine() +PROCEDURE main() - OutStd( cMonth( date() ) + cNewLine ) - OutStd( cMonth( date() + 31 ) + cNewLine ) - OutStd( cMonth( date() + 60 ) + cNewLine ) + OutStd( cMonth( date() ) + hb_eol() ) + OutStd( cMonth( date() + 31 ) + hb_eol() ) + OutStd( cMonth( date() + 60 ) + hb_eol() ) - OutStd( cDow( date() ) + cNewLine ) - OutStd( cDow( date() + 6 ) + cNewLine ) - OutStd( cDow( date() + 7 ) + cNewLine ) + OutStd( cDow( date() ) + hb_eol() ) + OutStd( cDow( date() + 6 ) + hb_eol() ) + OutStd( cDow( date() + 7 ) + hb_eol() ) -return nil + RETURN diff --git a/harbour/tests/cpinfo.prg b/harbour/tests/cpinfo.prg index fc2965af90..d6dc21425a 100644 --- a/harbour/tests/cpinfo.prg +++ b/harbour/tests/cpinfo.prg @@ -312,7 +312,7 @@ return cInfo #ifdef __HARBOUR__ #include "hbextcdp.ch" - #define EOL hb_osNewLine() + #define EOL hb_eol() #else #define EOL chr( 13 ) + chr( 10 ) #endif diff --git a/harbour/tests/dates.prg b/harbour/tests/dates.prg index eb9fb48555..1e86df7acf 100644 --- a/harbour/tests/dates.prg +++ b/harbour/tests/dates.prg @@ -1,82 +1,81 @@ -// -// $Id$ -// +/* + * $Id$ + */ // Testing Harbour dates management. #include "set.ch" function Main() -local cNewLine := HB_OSNewLine() local dDate, dDate2, cMask, cDate - OUTSTD (cNewLine, "Testing Harbour dates management on", DATE()) + OUTSTD (hb_eol(), "Testing Harbour dates management on", DATE()) - TestCentury(cNewLine) + TestCentury() - OUTSTD (cNewLine, "") - OUTSTD (cNewLine, "dDate := CToD( '02/04/1999' ) =>", dDate := CToD( "02/04/1999" )) + OUTSTD (hb_eol(), "") + OUTSTD (hb_eol(), "dDate := CToD( '02/04/1999' ) =>", dDate := CToD( "02/04/1999" )) - OUTSTD (cNewLine, "ValType( dDate ) =", ValType( dDate )) + OUTSTD (hb_eol(), "ValType( dDate ) =", ValType( dDate )) - OUTSTD (cNewLine, "Day( dDate ) =", Day( dDate )) - OUTSTD (cNewLine, "Month( dDate ) =", Month( dDate )) - OUTSTD (cNewLine, "Year( dDate ) =", Year( dDate ), cNewLine) + OUTSTD (hb_eol(), "Day( dDate ) =", Day( dDate )) + OUTSTD (hb_eol(), "Month( dDate ) =", Month( dDate )) + OUTSTD (hb_eol(), "Year( dDate ) =", Year( dDate ), hb_eol()) - OUTSTD (cNewLine, "dDate + 5 =", dDate2 := dDate + 5) - OUTSTD (cNewLine, "dDate - 5 =", dDate - 5, cNewLine ) + OUTSTD (hb_eol(), "dDate + 5 =", dDate2 := dDate + 5) + OUTSTD (hb_eol(), "dDate - 5 =", dDate - 5, hb_eol() ) - OUTSTD (cNewLine, "dDate2 - dDate =", dDate2 - dDate) + OUTSTD (hb_eol(), "dDate2 - dDate =", dDate2 - dDate) - OUTSTD (cNewLine, "") - OUTSTD (cNewLine, dDate, DTOS (dDate)) + OUTSTD (hb_eol(), "") + OUTSTD (hb_eol(), dDate, DTOS (dDate)) - OUTSTD (cNewLine, "19990429", STOD ("19990429")) + OUTSTD (hb_eol(), "19990429", STOD ("19990429")) - OUTSTD (cNewLine, "") + OUTSTD (hb_eol(), "") SET (_SET_EPOCH, 1950) cMask := "dd/mm/yyyy" cDate := "02/04/49" SET (_SET_DATEFORMAT, cMask) dDate := CTOD (cDate) - OUTSTD (cNewLine, cDate, cMask, dDate, DTOS (dDate), DTOC (dDate)) + OUTSTD (hb_eol(), cDate, cMask, dDate, DTOS (dDate), DTOC (dDate)) - OUTSTD (cNewLine, "") + OUTSTD (hb_eol(), "") cMask := "mm/dd/yyyy" SET (_SET_DATEFORMAT, cMask) dDate := CTOD (cDate) - OUTSTD (cNewLine, cDate, cMask, dDate, DTOS (dDate), DTOC (dDate)) + OUTSTD (hb_eol(), cDate, cMask, dDate, DTOS (dDate), DTOC (dDate)) - OUTSTD (cNewLine, "") + OUTSTD (hb_eol(), "") cMask := "yyyy/mm/dd" SET (_SET_DATEFORMAT, cMask) dDate := CTOD (cDate) - OUTSTD (cNewLine, cDate, cMask, dDate, DTOS (dDate), DTOC (dDate)) - OUTSTD (cNewLine, "") - OUTSTD (cNewLine, "49/02/04", cMask, CTOD ("49/02/04")) + OUTSTD (hb_eol(), cDate, cMask, dDate, DTOS (dDate), DTOC (dDate)) + OUTSTD (hb_eol(), "") + OUTSTD (hb_eol(), "49/02/04", cMask, CTOD ("49/02/04")) - TestCentury(cNewLine) + TestCentury(hb_eol()) - OUTSTD (cNewLine, "") + OUTSTD (hb_eol(), "") cMask := "yyyy/dd/mm" SET (_SET_DATEFORMAT, cMask) dDate := CTOD (cDate) - OUTSTD (cNewLine, cDate, cMask, dDate, DTOS (dDate), DTOC (dDate)) - OUTSTD (cNewLine, "") - OUTSTD (cNewLine, "49/02/04", cMask, CTOD ("49/02/04")) + OUTSTD (hb_eol(), cDate, cMask, dDate, DTOS (dDate), DTOC (dDate)) + OUTSTD (hb_eol(), "") + OUTSTD (hb_eol(), "49/02/04", cMask, CTOD ("49/02/04")) - OUTSTD (cNewLine, "") + OUTSTD (hb_eol(), "") cMask := "ddd/mmm/yy" SET (_SET_DATEFORMAT, cMask) dDate := CTOD (cDate) - OUTSTD (cNewLine, cDate, cMask, dDate, DTOS (dDate), DTOC (dDate)) + OUTSTD (hb_eol(), cDate, cMask, dDate, DTOS (dDate), DTOC (dDate)) -return nil + return nil -procedure TestCentury(cNewLine) - OUTSTD (cNewLine, "") - OUTSTD (cNewLine, __SETCENTURY ()) +procedure TestCentury() + OUTSTD (hb_eol(), "") + OUTSTD (hb_eol(), __SETCENTURY ()) __SETCENTURY ("ON") OUTSTD (__SETCENTURY ()) __SETCENTURY ("OFF") @@ -87,4 +86,4 @@ procedure TestCentury(cNewLine) OUTSTD (__SETCENTURY ()) __SETCENTURY (5) OUTSTD (__SETCENTURY ()) -return + return diff --git a/harbour/tests/dates2.prg b/harbour/tests/dates2.prg index fa32dafc24..9f41446684 100644 --- a/harbour/tests/dates2.prg +++ b/harbour/tests/dates2.prg @@ -1,41 +1,42 @@ -// -// $Id$ -// +/* + * $Id$ + */ #include "set.ch" + function main() - local newline := HB_OSNewLine() local dDate := CTOD ("04/30/99") - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) set (_SET_DATEFORMAT, "yyy/mm/ddd") - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) __SETCENTURY ( "on" ) - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) __SETCENTURY ( "off" ) - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) set (_SET_DATEFORMAT, "yyy/m/d/yyy") - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) __SETCENTURY ( "on" ) - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) __SETCENTURY ( "off" ) - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) set (_SET_DATEFORMAT, "m/d/y/m/d") - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) __SETCENTURY ( "on" ) - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) __SETCENTURY ( "off" ) - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) set (_SET_DATEFORMAT, "mmmm/ddddd") - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) __SETCENTURY ( "on" ) - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) __SETCENTURY ( "off" ) - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) set (_SET_DATEFORMAT, "mmmmm/dd") - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) __SETCENTURY ( "on" ) - outstd (SET (_SET_DATEFORMAT), dDate, newline) + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) __SETCENTURY ( "off" ) - outstd (SET (_SET_DATEFORMAT), dDate, newline) -return nil + outstd (SET (_SET_DATEFORMAT), dDate, hb_eol()) + + return nil diff --git a/harbour/tests/dates3.prg b/harbour/tests/dates3.prg index 6d75ce3fec..98fec2eb74 100644 --- a/harbour/tests/dates3.prg +++ b/harbour/tests/dates3.prg @@ -1,6 +1,6 @@ -// -// $Id$ -// +/* + * $Id$ + */ // Testing Harbour dates management. @@ -8,44 +8,44 @@ function main() - LOCAL dDate, i, cNewLine := HB_OSNewLine() + LOCAL dDate, i set( _SET_DATEFORMAT, "dd/mm/yyyy" ) dDate := cToD( "25/05/1999" ) - OutStd( dDate, dow( dDate ), cNewLine ) + OutStd( dDate, dow( dDate ), hb_eol() ) - OutStd( LastMonday( dDate ), cNewLine ) + OutStd( LastMonday( dDate ), hb_eol() ) dDate += 3 - OutStd( dDate, dow( dDate ), cNewLine ) + OutStd( dDate, dow( dDate ), hb_eol() ) dDate += 4 - OutStd( dDate, dow( dDate ), cNewLine ) + OutStd( dDate, dow( dDate ), hb_eol() ) set( _SET_DATEFORMAT, "mm/dd/yyyy" ) dDate := cToD( "05/25/1999" ) - OutStd( dDate, dow( dDate ), cNewLine ) + OutStd( dDate, dow( dDate ), hb_eol() ) - OutStd( LastMonday( dDate ), cNewLine ) + OutStd( LastMonday( dDate ), hb_eol() ) dDate += 3 - OutStd( dDate, dow( dDate ), cNewLine ) + OutStd( dDate, dow( dDate ), hb_eol() ) dDate += 4 - OutStd( dDate, dow( dDate ), cNewLine ) + OutStd( dDate, dow( dDate ), hb_eol() ) - OutStd( cNewLine ) + OutStd( hb_eol() ) dDate := DATE () FOR i := 1 TO 7 - OutStd( dDate, dow( dDate ), cNewLine ) + OutStd( dDate, dow( dDate ), hb_eol() ) dDate++ NEXT - OutStd( ctod( "" ), dow( ctod( "" ) ), cNewLine ) + OutStd( ctod( "" ), dow( ctod( "" ) ), hb_eol() ) -return nil + return nil // Like NG's sample function LastMonday( dDate ) -return dDate - dow( dDate ) + 2 + return dDate - dow( dDate ) + 2 diff --git a/harbour/tests/dates4.prg b/harbour/tests/dates4.prg index c29502627c..71fb0bf362 100644 --- a/harbour/tests/dates4.prg +++ b/harbour/tests/dates4.prg @@ -5,14 +5,10 @@ // Testing Harbour dates management. #include "set.ch" -STATIC s_cNewLine - function main() LOCAL i LOCAL dDate := date() - s_cNewLine := HB_OSNewLine() - set( _SET_DATEFORMAT, "dd/mm/yyyy" ) for i := 7 to 49 step 7 @@ -20,19 +16,19 @@ function main() dDate += i next -return nil + return nil function CheckDate( dDate ) - OutStd( "Testing date:", dDate , s_cNewLine ) - OutStd( "Days in month..:", daysinmonth( dDate ), s_cNewLine ) - OutStd( "Day of year....:", doy( dDate ), s_cNewLine ) - OutStd( "Begin of month.:", bom( dDate ), s_cNewLine ) - OutStd( "End of month...:", eom( dDate ), s_cNewLine ) - OutStd( "Week of month..:", wom( dDate ), s_cNewLine ) - OutStd( "Week of year...:", woy( dDate ), s_cNewLine ) - OutStd( "Begin of year..:", boy( dDate ), s_cNewLine ) - OutStd( "End of year....:", eoy( dDate ), s_cNewLine ) + OutStd( "Testing date:", dDate , hb_eol() ) + OutStd( "Days in month..:", daysinmonth( dDate ), hb_eol() ) + OutStd( "Day of year....:", doy( dDate ), hb_eol() ) + OutStd( "Begin of month.:", bom( dDate ), hb_eol() ) + OutStd( "End of month...:", eom( dDate ), hb_eol() ) + OutStd( "Week of month..:", wom( dDate ), hb_eol() ) + OutStd( "Week of year...:", woy( dDate ), hb_eol() ) + OutStd( "Begin of year..:", boy( dDate ), hb_eol() ) + OutStd( "End of year....:", eoy( dDate ), hb_eol() ) __Accept( "Press ENTER to continue..." ) OutStd( chr( 10 ), chr( 10 ) ) -return nil + return nil diff --git a/harbour/tests/dirtest.prg b/harbour/tests/dirtest.prg index 60286c1f5b..cfaed79a3f 100644 --- a/harbour/tests/dirtest.prg +++ b/harbour/tests/dirtest.prg @@ -1,29 +1,29 @@ -// -// $Id$ -// +/* + * $Id$ + */ // directory test -function main(filespec,attribs,cshort) +PROCEDURE Main( filespec, attribs, cshort ) -local adir := {} -local x := 0, lShort := .f., cNewLine := HB_OSNewLine() + LOCAL adir := {} + LOCAL x := 0, lShort := .f. IF !cshort == NIL .and. (Upper( cShort ) == "TRUE" .or. Upper( cShort ) == ".T.") lShort := .t. ENDIF -//adir := asort( directory(filespec,attribs,lShort),,, {|x,y|upper(x[1]) < upper(y[1])} ) - adir := directory(filespec,attribs,lShort) +// adir := asort( directory(filespec,attribs,lShort),,, {|x,y|upper(x[1]) < upper(y[1])} ) + adir := directory(filespec,attribs,lShort) -SET CENTURY ON + SET CENTURY ON -for x := 1 to len(adir) - outstd(cNewLine) - outstd(padr(adir[x,1], 20), "|", ; - transform(adir[x,2], "9,999,999,999"), "|", ; - adir[x,3], "|", ; - adir[x,4], "|", ; - adir[x,5]) -next x + FOR x := 1 TO len( adir ) + outstd(hb_eol()) + outstd(padr(adir[x,1], 20), "|", ; + transform(adir[x,2], "9,999,999,999"), "|", ; + adir[x,3], "|", ; + adir[x,4], "|", ; + adir[x,5]) + NEXT -return nil + RETURN diff --git a/harbour/tests/gtkeys.prg b/harbour/tests/gtkeys.prg index 2c3972a49b..b10b457512 100644 --- a/harbour/tests/gtkeys.prg +++ b/harbour/tests/gtkeys.prg @@ -11,7 +11,6 @@ * */ - #include "inkey.ch" #ifdef __HARBOUR__ #include "hbgtinfo.ch" @@ -216,43 +215,43 @@ setcancel(.f.) //altd(0) #ifdef __HARBOUR__ - set(_SET_EVENTMASK,INKEY_ALL) - hb_gtInfo(HB_GTI_ESCDELAY,50) - hb_cdpSelect( "PLMAZ" ) - hb_setTermCP( "PLISO" ) - ? hb_gtVersion(1), hb_gtVersion() + set(_SET_EVENTMASK,INKEY_ALL) + hb_gtInfo(HB_GTI_ESCDELAY,50) + hb_cdpSelect( "PLMAZ" ) + hb_setTermCP( "PLISO" ) + ? hb_gtVersion(1), hb_gtVersion() #endif ? "@ - interrupt, keycodes checking: " ? while (.t.) - k:=inkey(0,INKEY_ALL) - if (i:=ascan(aKeys, { |x| x[2]==k }))!=0 - ? " key:"+str(aKeys[i,2],7)+" "+padr(aKeys[i,1],18)+aKeys[i,3] - elseif k>=32 .and. k<=126 .or. (k>=160 .and. k<=255) .or. IsAlpha(chr(k)) - ? "char:"+str(k,7)+" "+chr(k) - else - ? " key:"+str(k,7) - endif -// ?? " ("+ltrim(str(maxrow()))+":"+ltrim(str(maxcol()))+")" + k:=inkey(0,INKEY_ALL) + if (i:=ascan(aKeys, { |x| x[2]==k }))!=0 + ? " key:"+str(aKeys[i,2],7)+" "+padr(aKeys[i,1],18)+aKeys[i,3] + elseif k>=32 .and. k<=126 .or. (k>=160 .and. k<=255) .or. IsAlpha(chr(k)) + ? "char:"+str(k,7)+" "+chr(k) + else + ? " key:"+str(k,7) + endif +// ?? " ("+ltrim(str(maxrow()))+":"+ltrim(str(maxcol()))+")" - if k==asc("@") .and. nextkey()==0 - exit + if k==asc("@") .and. nextkey()==0 + exit #ifdef __HARBOUR__ - elseif k==K_CTRL_INS - if alert( "Would you like to show clipboard text?", { "YES", "NO" } ) == 1 - s := hb_gtInfo( HB_GTI_CLIPBOARDDATA ) - ? "Clipboard text: [" + s + "]" - endif - elseif k==K_CTRL_END - if alert( "Would you like to set clipboard text?", { "YES", "NO" } ) == 1 - s := hb_tstostr( hb_datetime() ) + hb_osNewLine() + ; - "Harbour " + hb_gtVersion() + " clipboard test" + hb_osNewLine() - ? "New clipboard text: [" + s + "]" - hb_gtInfo( HB_GTI_CLIPBOARDDATA, s ) - endif + elseif k==K_CTRL_INS + if alert( "Would you like to show clipboard text?", { "YES", "NO" } ) == 1 + s := hb_gtInfo( HB_GTI_CLIPBOARDDATA ) + ? "Clipboard text: [" + s + "]" + endif + elseif k==K_CTRL_END + if alert( "Would you like to set clipboard text?", { "YES", "NO" } ) == 1 + s := hb_tstostr( hb_datetime() ) + hb_eol() + ; + "Harbour " + hb_gtVersion() + " clipboard test" + hb_eol() + ? "New clipboard text: [" + s + "]" + hb_gtInfo( HB_GTI_CLIPBOARDDATA, s ) + endif #endif - endif + endif enddo ? return nil diff --git a/harbour/tests/hbpptest/hbpptest.prg b/harbour/tests/hbpptest/hbpptest.prg index d076a269e8..fcceb1eb04 100644 --- a/harbour/tests/hbpptest/hbpptest.prg +++ b/harbour/tests/hbpptest/hbpptest.prg @@ -5,13 +5,13 @@ #include "common.ch" #ifndef __HARBOUR__ - #xtranslate HB_OSNewLine() => ( Chr( 13 ) + Chr( 10 ) ) + #xtranslate hb_eol() => ( Chr( 13 ) + Chr( 10 ) ) #endif /* #command TEXT TO VAR => #pragma __stream|:=%s */ #command TEXT TO VAR => #pragma __text|+=%s;:="" #command CTEXT TO VAR => #pragma __cstream|:=%s -#command XTEXT TO VAR => #pragma __text|+=%s+HB_OSNEWLINE();:="" +#command XTEXT TO VAR => #pragma __text|+=%s+hb_eol();:="" /* Testing preprocessor */ @@ -21,7 +21,7 @@ LOCAL nCnt:=0 LOCAL nRes:=0 /* ---------------------------------------------------------------------*/ - in := "#xtranslate CCC => QOUT( [2] [, \[\]\[3\]] )"+HB_OSNewLine()+; + in := "#xtranslate CCC => QOUT( [2] [, \[\]\[3\]] )"+hb_eol()+; "CCC b" pre := "QOUT(b[2] ,bb[3] )" nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -49,7 +49,7 @@ XTEXT TO VAR in #xcommand SET TOOLTIP TO OF

=> SM( TTH (<"form">), 1, RGB(\[1], \[2\], [, \[ 3 \] ]), 0) SET TOOLTIP TO RED OF form1 ENDTEXT -TEXT TO VAR pre +TEXT TO VAR pre SM(TTH ("form1"),1,RGB({255,0,0}[1],{255,0,0}[2],{255,0,0},{255,0,0}[ 3 ] ),0) ENDTEXT nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -108,7 +108,7 @@ ENDTEXT in := "_REGULAR_(a)" pre :="rm(a )" nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - + in := '_REGULAR_("a")' pre :='rm("a" )' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -161,7 +161,7 @@ ENDTEXT //NORMAL in := '#command _NORMAL_M() => nm( <"z"> )' __PreProcess( in ) - + in := "_NORMAL_M(a)" pre :='nm("a" )' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -218,7 +218,7 @@ ENDTEXT //SMART in := '#command _SMART_M() => sm( <(z)> )' __PreProcess( in ) - + in := "_SMART_M(a)" pre :='sm("a" )' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -377,7 +377,7 @@ ENDTEXT nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) TEXT TO VAR in -#xcommand SET [, ] WITH => +#xcommand SET [, ] WITH => :=[; :=] ENDTEXT __PreProcess( in ) @@ -387,7 +387,7 @@ ENDTEXT TEXT TO VAR in #xcommand INSERT INTO ( [, ] ) VALUES ( [, ] ) => if
->( dbappend() )
-> := [
-> := ]
->( dbunlock() ) endif -ENDTEXT +ENDTEXT __PreProcess( in ) TEXT TO VAR in insert into test ( FIRST, LAST, STREET ) values ( "first", "last", "street" ) @@ -398,13 +398,13 @@ ENDTEXT nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) TEXT TO VAR in -#xcommand INSERT2 INTO
( [, ] ) VALUES ( [, ] ) => +#xcommand INSERT2 INTO
( [, ] ) VALUES ( [, ] ) => if
->( dbappend() ) ;
-> := ; - [
-> := ; ] + [
-> := ; ]
->( dbunlock() ) ; endif -ENDTEXT +ENDTEXT __PreProcess( in ) TEXT TO VAR in insert2 into test ( FIRST, LAST, STREET ) @@ -428,14 +428,14 @@ ENDTEXT nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) TEXT TO VAR in -#command MYCOMMAND [] [MYCLAUSE ] => +#command MYCOMMAND [] [MYCLAUSE ] => MyFunction( {} [, ] ) ENDTEXT __PreProcess( in ) in := 'MYCOMMAND MYCLAUSE 321 "HELLO"' pre := 'MyFunction({"HELLO"} ,321 )' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - + in := 'MYCOMMAND MYCLAUSE 321 "HELLO","all"' pre := 'MyFunction({"HELLO","all"} ,321 )' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -445,7 +445,7 @@ ENDTEXT nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) TEXT TO VAR in -#command MYCOMMAND2 [] [MYCLAUSE ] [ALL] => +#command MYCOMMAND2 [] [MYCLAUSE ] [ALL] => MyFunction( {} [, ] ) ENDTEXT __PreProcess( in ) @@ -458,7 +458,7 @@ ENDTEXT in := 'MYCOMMAND2 ALL MYCLAUSE 321 "HELLO"' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := 'MYCOMMAND2 MYCLAUSE 321 "HELLO" ALL' + in := 'MYCOMMAND2 MYCLAUSE 321 "HELLO" ALL' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) in := 'MYCOMMAND2 MYCLAUSE 321 ALL "HELLO"' @@ -466,7 +466,7 @@ ENDTEXT TEXT TO VAR in -#command MYCOMMAND3 [] [MYCLAUSE ] [] => +#command MYCOMMAND3 [] [MYCLAUSE ] [] => MyFunction( {} [, ] [,<.all.>] ) ENDTEXT __PreProcess( in ) @@ -487,7 +487,7 @@ ENDTEXT nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) TEXT TO VAR in -#command MYCOMMAND2 [] +#command MYCOMMAND2 [] [MYCLAUSE ] [MYOTHER ] => MyFunction( {}, , ) ENDTEXT __PreProcess( in ) @@ -588,19 +588,19 @@ ENDTEXT pre := '&cVar+1(&cVar,"mzcall" )' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MXCALL &cVar" + in := "MXCALL &cVar" pre := '(&cVar)' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MXCALL &cVar." + in := "MXCALL &cVar." pre := '(&cVar.)' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MXCALL &cVar.1" + in := "MXCALL &cVar.1" pre := '(&cVar.1)' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MXCALL &cVar + 1" + in := "MXCALL &cVar + 1" pre := '(&cVar) + 1' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -660,7 +660,7 @@ ENDTEXT pre := '&cVar.(+1,"mycall" )' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MYCALL &cVar.1 +1" + in := "MYCALL &cVar.1 +1" pre := '&cVar.1(+1,"mycall" )' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -680,39 +680,39 @@ ENDTEXT pre := 'cVar+var+1' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MXCALL &cVar()" + in := "MXCALL &cVar()" pre := '(&cVar)()' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MXCALL &cVar++" + in := "MXCALL &cVar++" pre := '(&cVar)++' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "(MXCALL &cVar)++" + in := "(MXCALL &cVar)++" pre := '((&cVar))++' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MXCALL &cVar.()" + in := "MXCALL &cVar.()" pre := '(&cVar.)()' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MXCALL &cVar.++" + in := "MXCALL &cVar.++" pre := '(&cVar.)++' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "(MXCALL &cVar.)++" + in := "(MXCALL &cVar.)++" pre := '((&cVar.))++' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MXCALL &cVar.1 ()" + in := "MXCALL &cVar.1 ()" pre := '(&cVar.1) ()' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MXCALL &cVar.1 ++" + in := "MXCALL &cVar.1 ++" pre := '(&cVar.1) ++' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "(MXCALL &cVar.1) ++" + in := "(MXCALL &cVar.1) ++" pre := '((&cVar.1)) ++' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -760,7 +760,7 @@ ENDTEXT pre :='macro_t(cVar)++' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MTRANSLATE &cVar.++" + in := "MTRANSLATE &cVar.++" pre :='macro_t(cVar)++' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -768,7 +768,7 @@ ENDTEXT pre :='macro_t(cVar)+=1' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MTRANSLATE &cVar.-=2" + in := "MTRANSLATE &cVar.-=2" pre :='macro_t(cVar)-=2' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -788,7 +788,7 @@ ENDTEXT pre :='macro_t(cVar)^=2' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MTRANSLATE &cVar:=1" + in := "MTRANSLATE &cVar:=1" pre :='macro_t(cVar):=1' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -858,7 +858,7 @@ ENDTEXT pre :='normal_c("&cVar++")' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MCOMMAND &cVar.++" + in := "MCOMMAND &cVar.++" pre :='normal_c("&cVar.++")' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -866,7 +866,7 @@ ENDTEXT pre :='normal_c("&cVar+=1")' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MCOMMAND &cVar.-=2" + in := "MCOMMAND &cVar.-=2" pre :='normal_c("&cVar.-=2")' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -874,7 +874,7 @@ ENDTEXT pre :='normal_c("&cVar*=1")' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in := "MCOMMAND &cVar/=2" + in := "MCOMMAND &cVar/=2" pre :='normal_c("&cVar/=2")' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -885,7 +885,7 @@ ENDTEXT in := "MCOMMAND &cVar^=2" pre :='normal_c("&cVar^=2")' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - + in := "MCOMMAND &cVar:=1" pre :='normal_c("&cVar:=1")' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -920,7 +920,7 @@ ENDTEXT /* repeated optional clauses */ TEXT TO VAR in -#xcommand SET [, ] WITH => +#xcommand SET [, ] WITH => := [; :=] ENDTEXT __PreProcess( in ) @@ -948,7 +948,7 @@ ENDTEXT in := "AVG f1 TO s1" pre := "AVERAGE({||s1:=s1+f1} )" nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - + in := "AVG f1, f2 TO s1, s2" pre := "AVERAGE({||s1:=s1+f1} ,{||s2:=s2+f2} )" nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -964,23 +964,23 @@ ENDTEXT /* ---------------------------------------------------------------------*/ TEXT TO VAR in -#command @ , GET - [PICTURE ] - [VALID ] - [WHEN ] - [CAPTION ) - ; AAdd( GetList, - _GET_( , <"var">, , <{valid}>, <{when}> ) ) - [; ATail(GetList):Caption := GET + [PICTURE ] + [VALID ] + [WHEN ] + [CAPTION ) + ; AAdd( GetList, + _GET_( , <"var">, , <{valid}>, <{when}> ) ) + [; ATail(GetList):Caption := GET - PUSHBUTTON - [VALID ] - [WHEN ] - [CAPTION
] - [MESSAGE ] - [SEND ] - - => SetPos( , ] - [; ATail(GetList):CapRow := ATail(Getlist):row - ; ATail(GetList):CapCol := ATail(Getlist):col - - __CapLength() - 1] - [; ATail(GetList):message := ] - [; ATail(GetList):] +#command @ , ] + [MESSAGE ] + [SEND ] + + => SetPos( , ] + [; ATail(GetList):CapRow := ATail(Getlist):row + ; ATail(GetList):CapCol := ATail(Getlist):col - + __CapLength() - 1] + [; ATail(GetList):message := ] + [; ATail(GetList):] ; ATail(GetList):Display() ENDTEXT __PreProcess( in ) @@ -1014,32 +1014,32 @@ ENDTEXT nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) /* ---------------------------------------------------------------------*/ - in :='@ 1,1 GET a RANGE 0,100' + in :='@ 1,1 GET a RANGE 0,100' pre := 'SetPos(1,1 ) ; AAdd(GetList,_GET_(a,"a",,{|_1| RangeCheck(_1,, 0, 100)}, ) ) ; ATail(GetList):Display()' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in :='@ 1,2 GET a PICTURE "X" RANGE 0,100' + in :='@ 1,2 GET a PICTURE "X" RANGE 0,100' pre := 'SetPos(1,2 ) ; AAdd(GetList,_GET_(a,"a","X",{|_1| RangeCheck(_1,, 0, 100)}, ) ) ; ATail(GetList):Display()' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) /* NOTE: Clipper fails here */ - in :='@ 1,3 GET a PICTURE "X" VALID .T. RANGE 0,100' + in :='@ 1,3 GET a PICTURE "X" VALID .T. RANGE 0,100' pre := 'SetPos(1,3 ) ; AAdd(GetList,_GET_(a,"a","X",{|| .T.}, ) ) ; ATail(GetList):Display()' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in :='@ 1,4 GET a PICTURE "X" WHEN .T. RANGE 0,100' + in :='@ 1,4 GET a PICTURE "X" WHEN .T. RANGE 0,100' pre := 'SetPos(1,4 ) ; AAdd(GetList,_GET_(a,"a","X",{|_1| RangeCheck(_1,, 0, 100)},{|| .T.} ) ) ; ATail(GetList):Display()' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in :='@ 1,5 GET a PICTURE "X" WHEN .T. CAPTION "myget" RANGE 0,100' + in :='@ 1,5 GET a PICTURE "X" WHEN .T. CAPTION "myget" RANGE 0,100' pre := 'SetPos(1,5 ) ; AAdd(GetList,_GET_(a,"a","X",{|_1| RangeCheck(_1,, 0, 100)},{|| .T.} ) ) ; ATail(GetList):Caption := "myget" ; ATail(GetList):CapRow := ATail(Getlist):row ; ATail(GetList):CapCol := ATail(Getlist):col - __CapLength("myget") - 1 ; ATail(GetList):Display()' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in :='@ 1,6 GET a PICTURE "X" WHEN .T. CAPTION "myget" MESSAGE "mymess" RANGE 0,100' + in :='@ 1,6 GET a PICTURE "X" WHEN .T. CAPTION "myget" MESSAGE "mymess" RANGE 0,100' pre := 'SetPos(1,6 ) ; AAdd(GetList,_GET_(a,"a","X",{|_1| RangeCheck(_1,, 0, 100)},{|| .T.} ) ) ; ATail(GetList):Caption := "myget" ; ATail(GetList):CapRow := ATail(Getlist):row ; ATail(GetList):CapCol := ATail(Getlist):col - __CapLength("myget") - 1 ; ATail(GetList):message := "mymess" ; ATail(GetList):Display()' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in :='@ 1,7 GET a PICTURE "X" WHEN .T. CAPTION "myget" MESSAGE "mymess" SEND send() RANGE 0,100' + in :='@ 1,7 GET a PICTURE "X" WHEN .T. CAPTION "myget" MESSAGE "mymess" SEND send() RANGE 0,100' pre := 'SetPos(1,7 ) ; AAdd(GetList,_GET_(a,"a","X",{|_1| RangeCheck(_1,, 0, 100)},{|| .T.} ) ) ; ATail(GetList):Caption := "myget" ; ATail(GetList):CapRow := ATail(Getlist):row ; ATail(GetList):CapCol := ATail(Getlist):col - __CapLength("myget") - 1 ; ATail(GetList):message := "mymess" ; ATail(GetList):send() ; ATail(GetList):Display()' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -1051,7 +1051,7 @@ ENDTEXT pre := 'SetPos(2,2 ) ; AAdd(GetList,_GET_(a,"a","X",{|_1| RangeCheck(_1,, 0, 100)}, ) ) ; ATail(GetList):Display()' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) - in :='@ 2,3 GET a PICTURE "X" RANGE 0,100' + in :='@ 2,3 GET a PICTURE "X" RANGE 0,100' pre := 'SetPos(2,3 ) ; AAdd(GetList,_GET_(a,"a","X",{|_1| RangeCheck(_1,, 0, 100)}, ) ) ; ATail(GetList):Display()' nRes += PreResult( pre, PreRun( in, pre ), @nCnt ) @@ -1074,43 +1074,43 @@ ENDTEXT /* ---------------------------------------------------------------------*/ TEXT TO VAR in -#command @ , ] - [MESSAGE ] - [COLOR ] - [FOCUS ] - [STATE ] - [STYLE