From df2b7a9ebd45e3b1c7f16c37e994e4ec7b4785e7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 31 Oct 2012 13:04:01 +0000 Subject: [PATCH] 2012-10-31 13:25 UTC+0200 Viktor Szakats (harbour syenar.net) * include/harbour.hbx * fixes/changes to some function names * config/hb_c.cfg + updated to do better vertical aligment in structs, var declarations and assignments ; TODO: move this to /bin folder and add to 'install'-ed file list, rename to 'harbour.ucf' * src/debug/*.prg * src/rdd/*.prg * src/rdd/hbsix/*.prg * src/rdd/usrrdd/rdds/*.prg * src/rtl/*.prg * src/vm/*.prg * utils/hbi18n/hbi18n.prg * utils/hbmk2/hbmk2.prg * utils/hbmk2/examples/*.hb * contrib/hbblat/blatcls.prg * contrib/gtwvg/*.prg * contrib/gtwvg/tests/*.prg * contrib/hbblink/*.prg * contrib/hbcairo/tests/*.prg * contrib/hbcomm/*.prg * contrib/hbcomm/tests/*.prg * contrib/hbcups/tests/*.prg * contrib/hbcurl/tests/*.prg * contrib/hbexpat/*.prg * contrib/hbexpat/tests/*.prg * contrib/hbfbird/*.prg * contrib/hbfbird/tests/*.prg * contrib/hbfoxpro/*.prg * contrib/hbfship/*.prg * contrib/hbgd/*.prg * contrib/hbgd/tests/*.prg * contrib/hbgs/tests/*.prg * contrib/hbhpdf/*.prg * contrib/hbhpdf/tests/*.prg * contrib/hbhttpd/*.prg * contrib/hbhttpd/tests/*.prg * contrib/hblzf/tests/*.prg * contrib/hbmagic/tests/*.prg * contrib/hbmisc/*.prg * contrib/hbmisc/tests/*.prg * contrib/hbct/*.prg * contrib/hbct/tests/*.prg * contrib/hbmlzo/tests/*.prg * contrib/hbmxml/*.prg * contrib/hbmxml/tests/*.prg * contrib/hbmysql/*.prg * contrib/hbmysql/tests/*.prg * contrib/hboslib/*.prg * contrib/hbsms/*.prg * contrib/hbtinymt/tests/*.prg * contrib/hbtpathy/*.prg * contrib/hbtpathy/tests/*.prg * contrib/hbunix/tests/*.prg * contrib/hbxdiff/tests/*.prg * contrib/hbzebra/tests/*.prg * contrib/hbziparc/*.prg * contrib/hbziparc/tests/*.prg * contrib/rddads/*.prg * contrib/rddads/tests/*.prg * contrib/hbodbc/*.prg * contrib/hbodbc/tests/*.prg * contrib/hbpgsql/*.prg * contrib/hbpgsql/tests/*.prg * contrib/hbsqlit3/*.prg * contrib/hbsqlit3/tests/*.prg * contrib/hbwin/*.prg * contrib/hbwin/tests/*.prg * contrib/hbxpp/*.prg * contrib/hbxpp/tests/*.prg * contrib/hbxhb/*.prg * contrib/hbxhb/tests/*.prg * contrib/hbnetio/*.prg * contrib/hbnetio/utils/hbnetio/*.hb * contrib/hbnetio/utils/hbnetio/*.prg * contrib/hbtip/*.prg * contrib/hbtip/tests/*.prg * tests/usrrdd/*.prg * tests/funcarr.prg * extras/gfspell/spell.prg * extras/gtwvw/tests/*.prg * extras/guestbk/*.prg * extras/hbdoc/*.prg * extras/rddado/*.prg * extras/rddado/tests/*.prg * extras/hbxlsxml/*.prg * extras/httpsrv/*.prg * extras/httpsrv/modules/*.prg * extras/hbsuper/*.prg * extras/hbvpdf/*.prg * extras/hbvpdf/tests/*.prg * tests/*.prg (except some which are well formatted but in different/fast-typing style) * tests/*.hb * bin/*.hb * contrib/*.hb * config/*.hb * some manual formatting to better be able to verify changes made by hbformat and be friendlier with hbformat. * most files reformatted with hbformat using Maurizio's patch, with mostly minor manual corrections and verification. All hbformat changes for revised one-by-one. ! __DIR(): fixed to be unicode compatible ! __hbdoc_ToSource(): make sure to not generate line ending spaces in output. + hbmk2/hbrun: HBMK_WITH_GTXWC built-time option to include GTXWC. Useful for hbrun. * hbct tests: change to not use [] as string delimiter + added full prototypes to Array class declaration ; NOTE: Only these were not or not fully formatted: contrib/hbnetio/tests/*.prg tests/hbpptest/*.prg tests/mt/*.prg tests/multifnc/*.prg tests/rddtest/*.prg utils/hbmk2/hbmk2.prg (for the most part) src/rtl/tbrowse.prg (for the most part) utils/hbtest/*.prg *.ch, *.c, *.h * src/rtl/cdpapihb.c * src/rtl/hbadler.c * src/rtl/hbsocket.c * src/rtl/sha1.c * src/vm/classes.c * src/vm/dynsym.c * src/vm/garbage.c * src/debug/dbgentry.c * do not end macros with ';' to avoid uncrustify warning and wrong formatting as a consequence * src/compiler/cmdcheck.c * minor changes for uncrustify-friendliness * contrib/hbformat/utils/hbfmtcls.prg * contrib/hbformat/utils/hbformat.prg % optimizations in hbformat.prg ! fixed mask/filename handling to be multiplatform in hbformat.prg + added 'HBXList=' hbformat.ini parameter allowing to add any .hbx file for proper function name casing. ! fixed progress bar to display correctly * tests/speedstr.prg ! fixed to run as intended in unicode code * hbformatted - contrib/hbwin/tests/dlg.xml * contrib/hbwin/tests/dlg.rc - extras/gtwvw/tests/wvwtest9.xml + extras/gtwvw/tests/wvwtest9.mft * extras/gtwvw/tests/wvwtest9.rc * renamed manifest to have .mft extension % deleted unnecessary manifest * "Win32 API" -> "Windows API" ! deleted CPU arch from manifest * package/harb_win.mft * formatting * src/common/hbver.c + added version detection for win 8 and win server 2012 * minor formatting/code cleanup * tests/gfx.prg * updated to run in script mode. ; TOFIX: it doesn't draw anything with GTWVT * tests/gfx.prg * tests/gtwin.prg * tests/gtxfnt.prg * tests/wvt_fs.prg * tests/wvtext.prg + support for GTXWC when run as script * doc/en/*.txt * contrib/hbct/doc/en/*.txt * contrib/hbgd/doc/en/*.txt * contrib/hbgt/doc/en/*.txt * contrib/hbmisc/doc/en/*.txt * contrib/hbnf/doc/en/*.txt * contrib/hbziparc/doc/en/*.txt * contrib/rddads/doc/en/*.txt ! fixed few broken tags reported by Carlos % deleted line ending spaces * some minor formatting * contrib/hbnf/*.c * contrib/hbnf/*.h * extras/gfspell/spellc.c * uncrustified with updated hb_c.cfg * contrib/hbnf/*.prg * contrib/hbnf/tests/*.prg * hbformatted with Mauriozo's patch. * a few manual corrections (avoiding #translates, using hb_ColorIndex()) in general and to make hbformat happy. + contrib/hbnf/tests/menuto.prg + added sample code for MENU TO (adatped from docs) - src/rdd/dbfntx/dbfntx0.prg - deleted unused file with no enabled code in it * contrib/hbtip/tests/dbtohtml.prg * contrib/hbtip/tests/loadhtml.prg * contrib/hbtip/tests/tipmmail.prg * minor cleanups * contrib/hbtip/thtml.prg ! fixed typo due to s&r % use hb_memowrit() * src/rtl/tbrowse.prg * conditional code sorted to be hbformat friendly * some formatting * INSTALL * package/harbour.rb * package/mpkg_src_nightly.sh * package/mpkg_win_nightly.bat * package/updt_web_nightly.sh * website/changelog.html * website/faq/harbour17.html * website/faq/harbour27.html * website/index.html * website/menu/harbour-menu.js * updated repository URL to new sf.net one * tests/function.cfm * contrib/hbhttpd/tests/tpl/_main.tpl * contrib/hbtip/tests/tipmmail.prg * website/faq/*.html * website/samples/*.html * use utf-8 in html and email * contrib/hbrun/hbrun.hbp + support for HBMK_WITH_GTXWC * tests/rto_get.prg * tests/onidle.prg * tests/mousetst.prg * tests/wcecon.prg * tests/vmasort.prg - contrib/hbnf/tests/metaph.prg * minor cleanups * contrib/hbmysql/tests/test.prg * contrib/hbmysql/tests/dbf2mysq.prg % minor optimization, deleted outdated comment/line * src/compiler/harbour.yyc * src/compiler/harbour.y * minor formatting --- harbour/ChangeLog | 260 ++ harbour/INSTALL | 15 +- harbour/bin/3rdpatch.hb | 148 +- harbour/bin/commit.hb | 33 +- harbour/bin/find.hb | 3 + harbour/config/hb_c.cfg | 30 +- harbour/config/postinst.hb | 72 +- harbour/contrib/gtwvg/class.prg | 94 +- harbour/contrib/gtwvg/crt.prg | 2 +- harbour/contrib/gtwvg/drawarea.prg | 2 +- harbour/contrib/gtwvg/htmlview.prg | 2 +- harbour/contrib/gtwvg/listbox.prg | 2 +- harbour/contrib/gtwvg/menubar.prg | 14 +- harbour/contrib/gtwvg/paint.prg | 112 +- harbour/contrib/gtwvg/statbar.prg | 2 +- harbour/contrib/gtwvg/static.prg | 2 +- harbour/contrib/gtwvg/syswnd.prg | 20 +- harbour/contrib/gtwvg/tests/activex.prg | 106 +- harbour/contrib/gtwvg/tests/cuigdlgs.prg | 18 +- harbour/contrib/gtwvg/tests/demowvg.prg | 59 +- harbour/contrib/gtwvg/tests/demowvg1.prg | 2 +- harbour/contrib/gtwvg/tests/demoxbp.prg | 92 +- harbour/contrib/gtwvg/tests/dyndlgs.prg | 16 +- harbour/contrib/gtwvg/tests/modal.prg | 24 +- harbour/contrib/gtwvg/tests/tbrowser.prg | 18 +- harbour/contrib/gtwvg/tests/utils.prg | 28 +- harbour/contrib/gtwvg/tests/wvtcls.prg | 32 +- harbour/contrib/gtwvg/tests/xbp.prg | 62 +- harbour/contrib/gtwvg/toolbar.prg | 16 +- harbour/contrib/gtwvg/wnd.prg | 6 +- harbour/contrib/hbblat/blatcls.prg | 138 +- harbour/contrib/hbblink/blinker.prg | 106 +- harbour/contrib/hbcairo/tests/fancytxt.prg | 62 +- harbour/contrib/hbcairo/tests/glyphdbg.prg | 12 +- harbour/contrib/hbcairo/tests/hellow.prg | 8 +- harbour/contrib/hbcairo/tests/lightning.prg | 65 +- harbour/contrib/hbcairo/tests/table.prg | 121 +- harbour/contrib/hbcomm/comm.prg | 11 +- harbour/contrib/hbcomm/tests/test.prg | 6 + harbour/contrib/hbct/doc/en/addascii.txt | 2 +- harbour/contrib/hbct/doc/en/atadjust.txt | 4 +- harbour/contrib/hbct/doc/en/color.txt | 72 +- harbour/contrib/hbct/doc/en/count.txt | 16 +- harbour/contrib/hbct/doc/en/ct.txt | 12 +- harbour/contrib/hbct/doc/en/ctc.txt | 14 +- harbour/contrib/hbct/doc/en/ctmath.txt | 14 +- harbour/contrib/hbct/doc/en/ctmath2.txt | 6 +- harbour/contrib/hbct/doc/en/ctpad.txt | 16 +- harbour/contrib/hbct/doc/en/ctstr.txt | 36 +- harbour/contrib/hbct/doc/en/datetime.txt | 48 +- harbour/contrib/hbct/doc/en/dattime2.txt | 122 +- harbour/contrib/hbct/doc/en/dattime3.txt | 42 +- harbour/contrib/hbct/doc/en/exponent.txt | 28 +- harbour/contrib/hbct/doc/en/finan.txt | 20 +- harbour/contrib/hbct/doc/en/ftoc.txt | 32 +- harbour/contrib/hbct/doc/en/justify.txt | 16 +- harbour/contrib/hbct/doc/en/keyset.txt | 56 +- harbour/contrib/hbct/doc/en/misc1.txt | 18 +- harbour/contrib/hbct/doc/en/num1.txt | 6 +- harbour/contrib/hbct/doc/en/numat.txt | 8 +- harbour/contrib/hbct/doc/en/numconv.txt | 48 +- harbour/contrib/hbct/doc/en/pos1.txt | 32 +- harbour/contrib/hbct/doc/en/pos2.txt | 32 +- harbour/contrib/hbct/doc/en/posdiff.txt | 16 +- harbour/contrib/hbct/doc/en/print.txt | 28 +- harbour/contrib/hbct/doc/en/range.txt | 8 +- harbour/contrib/hbct/doc/en/relation.txt | 16 +- harbour/contrib/hbct/doc/en/remove.txt | 24 +- harbour/contrib/hbct/doc/en/replace.txt | 24 +- harbour/contrib/hbct/doc/en/screen1.txt | 104 +- harbour/contrib/hbct/doc/en/strdiff.txt | 8 +- harbour/contrib/hbct/doc/en/strswap.txt | 10 +- harbour/contrib/hbct/doc/en/tab.txt | 10 +- harbour/contrib/hbct/doc/en/token1.txt | 10 +- harbour/contrib/hbct/doc/en/token2.txt | 40 +- harbour/contrib/hbct/doc/en/trig.txt | 6 +- harbour/contrib/hbct/doc/en/video.txt | 30 +- harbour/contrib/hbct/doc/en/wordtoch.txt | 8 +- harbour/contrib/hbct/keysec.prg | 4 +- harbour/contrib/hbct/kxlat.prg | 510 ++-- harbour/contrib/hbct/tests/addascii.prg | 10 +- harbour/contrib/hbct/tests/afteratn.prg | 38 +- harbour/contrib/hbct/tests/asciisum.prg | 6 +- harbour/contrib/hbct/tests/ascpos.prg | 6 +- harbour/contrib/hbct/tests/atnum.prg | 38 +- harbour/contrib/hbct/tests/atrepl.prg | 12 +- harbour/contrib/hbct/tests/attoken.prg | 14 +- harbour/contrib/hbct/tests/beforatn.prg | 38 +- harbour/contrib/hbct/tests/charadd.prg | 8 +- harbour/contrib/hbct/tests/charand.prg | 4 +- harbour/contrib/hbct/tests/chareven.prg | 6 +- harbour/contrib/hbct/tests/charhist.prg | 6 +- harbour/contrib/hbct/tests/charlist.prg | 4 +- harbour/contrib/hbct/tests/charmirr.prg | 6 +- harbour/contrib/hbct/tests/charmix.prg | 10 +- harbour/contrib/hbct/tests/charnlst.prg | 4 +- harbour/contrib/hbct/tests/charnot.prg | 12 +- harbour/contrib/hbct/tests/charodd.prg | 4 +- harbour/contrib/hbct/tests/charone.prg | 10 +- harbour/contrib/hbct/tests/charonly.prg | 4 +- harbour/contrib/hbct/tests/charor.prg | 4 +- harbour/contrib/hbct/tests/charrem.prg | 4 +- harbour/contrib/hbct/tests/charrepl.prg | 10 +- harbour/contrib/hbct/tests/charrll.prg | 10 +- harbour/contrib/hbct/tests/charrlr.prg | 10 +- harbour/contrib/hbct/tests/charshl.prg | 10 +- harbour/contrib/hbct/tests/charshr.prg | 10 +- harbour/contrib/hbct/tests/charslst.prg | 4 +- harbour/contrib/hbct/tests/charsort.prg | 18 +- harbour/contrib/hbct/tests/charsub.prg | 8 +- harbour/contrib/hbct/tests/charswap.prg | 4 +- harbour/contrib/hbct/tests/charxor.prg | 6 +- harbour/contrib/hbct/tests/csetarge.prg | 2 +- harbour/contrib/hbct/tests/ctwtest.prg | 2 +- harbour/contrib/hbct/tests/datetime.prg | 262 +- harbour/contrib/hbct/tests/expomant.prg | 4 +- harbour/contrib/hbct/tests/numline.prg | 22 +- harbour/contrib/hbct/tests/numtoken.prg | 20 +- harbour/contrib/hbct/tests/rangerem.prg | 12 +- harbour/contrib/hbct/tests/rangerep.prg | 12 +- harbour/contrib/hbct/tests/strdiff.prg | 12 +- harbour/contrib/hbct/tests/tab.prg | 92 +- harbour/contrib/hbct/tests/token.prg | 26 +- harbour/contrib/hbct/tests/token2.prg | 102 +- harbour/contrib/hbct/tests/tokenlow.prg | 24 +- harbour/contrib/hbct/tests/tokensep.prg | 18 +- harbour/contrib/hbct/tests/tokenupp.prg | 24 +- harbour/contrib/hbct/tests/valpos.prg | 8 +- harbour/contrib/hbct/tests/wordone.prg | 6 +- harbour/contrib/hbct/tests/wordonly.prg | 4 +- harbour/contrib/hbct/tests/wordrem.prg | 4 +- harbour/contrib/hbct/tests/wordrepl.prg | 10 +- harbour/contrib/hbct/tests/wordswap.prg | 4 +- harbour/contrib/hbcups/tests/test.prg | 11 +- harbour/contrib/hbcurl/tests/ftp_uldl.prg | 18 +- harbour/contrib/hbexpat/tests/test.prg | 18 +- harbour/contrib/hbexpat/tests/tohash.prg | 25 +- harbour/contrib/hbexpat/unitable.prg | 1 + harbour/contrib/hbfbird/tests/simple.prg | 86 +- harbour/contrib/hbfbird/tests/stress.prg | 24 +- harbour/contrib/hbfbird/tfirebrd.prg | 34 +- harbour/contrib/hbformat/hbfmtcls.prg | 170 +- harbour/contrib/hbformat/utils/hbformat.ini | 3 + harbour/contrib/hbformat/utils/hbformat.prg | 98 +- harbour/contrib/hbfoxpro/dll.prg | 17 +- harbour/contrib/hbfoxpro/misc.prg | 1 + harbour/contrib/hbfship/fldarr.prg | 18 +- harbour/contrib/hbfship/isdb.prg | 8 +- harbour/contrib/hbgd/doc/en/hbgd.txt | 610 ++-- harbour/contrib/hbgd/gd.prg | 40 +- harbour/contrib/hbgd/gdbar.prg | 2 +- harbour/contrib/hbgd/gdbarcod.prg | 6 +- harbour/contrib/hbgd/gdchart.prg | 247 +- harbour/contrib/hbgd/gdimage.prg | 66 +- harbour/contrib/hbgd/tests/animgif.prg | 2 +- harbour/contrib/hbgd/tests/antialia.prg | 2 +- harbour/contrib/hbgd/tests/barms.prg | 8 +- harbour/contrib/hbgd/tests/gdtestcl.prg | 70 +- harbour/contrib/hbgd/tests/test_out.prg | 28 +- harbour/contrib/hbgd/tests/tostring.prg | 2 +- harbour/contrib/hbgs/tests/testgs.prg | 17 +- harbour/contrib/hbgt/doc/en/hbgt.txt | 168 +- harbour/contrib/hbhpdf/misc.prg | 1 + harbour/contrib/hbhpdf/tests/harupdf.prg | 48 +- harbour/contrib/hbhttpd/core.prg | 520 ++-- harbour/contrib/hbhttpd/log.prg | 1 + harbour/contrib/hbhttpd/tests/eshop.prg | 192 +- harbour/contrib/hbhttpd/tests/tpl/_main.tpl | 4 +- harbour/contrib/hbhttpd/widgets.prg | 56 +- harbour/contrib/hblzf/tests/test.prg | 9 +- harbour/contrib/hblzf/tests/test2.prg | 25 +- harbour/contrib/hbmagic/tests/hbmagit.prg | 81 +- harbour/contrib/hbmisc/calldll.prg | 13 +- harbour/contrib/hbmisc/doc/en/ht_class.txt | 24 +- harbour/contrib/hbmisc/doc/en/ht_doc.txt | 28 +- harbour/contrib/hbmisc/fcomma.prg | 78 +- harbour/contrib/hbmisc/nconvert.prg | 33 + harbour/contrib/hbmisc/numtxten.prg | 64 +- harbour/contrib/hbmisc/numtxthu.prg | 12 +- harbour/contrib/hbmisc/stringp.prg | 2 +- harbour/contrib/hbmisc/tests/numtxtru.prg | 7 +- harbour/contrib/hbmisc/tests/pe.prg | 3 + harbour/contrib/hbmisc/tests/readfile.prg | 1 + harbour/contrib/hbmisc/tests/rtfclass.prg | 33 +- harbour/contrib/hbmisc/tests/testbbab.prg | 22 +- harbour/contrib/hbmisc/tests/testcall.prg | 3 + harbour/contrib/hbmisc/tests/udpdstst.prg | 6 +- harbour/contrib/hbmisc/udpds.prg | 4 +- harbour/contrib/hbmlzo/tests/test.prg | 16 +- harbour/contrib/hbmxml/format.prg | 6 +- harbour/contrib/hbmxml/tests/custom.prg | 23 +- harbour/contrib/hbmxml/tests/reminder.prg | 8 +- harbour/contrib/hbmxml/tests/testmxml.prg | 151 +- harbour/contrib/hbmysql/tests/dbf2mysq.prg | 10 +- harbour/contrib/hbmysql/tests/test.prg | 2 +- harbour/contrib/hbmysql/tmysql.prg | 251 +- harbour/contrib/hbmysql/tsqlbrw.prg | 4 +- harbour/contrib/hbnetio/netiomt.prg | 14 +- .../hbnetio/utils/hbnetio/netiocon.prg | 38 +- .../contrib/hbnetio/utils/hbnetio/netiomgm.hb | 50 +- .../hbnetio/utils/hbnetio/netiosrv.prg | 189 +- .../hbnetio/utils/hbnetio/netiosvc.prg | 2 + harbour/contrib/hbnf/adapter.prg | 1 + harbour/contrib/hbnf/any2any.prg | 4 +- harbour/contrib/hbnf/aredit.prg | 2 +- harbour/contrib/hbnf/asum.prg | 6 +- harbour/contrib/hbnf/at2.prg | 2 + harbour/contrib/hbnf/blink.prg | 10 +- harbour/contrib/hbnf/calendar.prg | 19 +- harbour/contrib/hbnf/caplock.c | 6 +- harbour/contrib/hbnf/cint86.c | 2 +- harbour/contrib/hbnf/clrsel.prg | 96 +- harbour/contrib/hbnf/datecnfg.prg | 2 +- harbour/contrib/hbnf/daytobow.prg | 2 +- harbour/contrib/hbnf/descendn.c | 6 +- harbour/contrib/hbnf/dhkey.h | 84 +- harbour/contrib/hbnf/dispc.c | 198 +- harbour/contrib/hbnf/dispmsg.prg | 1 + harbour/contrib/hbnf/doc/en/aavg.txt | 12 +- harbour/contrib/hbnf/doc/en/acctmnth.txt | 12 +- harbour/contrib/hbnf/doc/en/acctqtr.txt | 12 +- harbour/contrib/hbnf/doc/en/acctweek.txt | 12 +- harbour/contrib/hbnf/doc/en/acctyear.txt | 8 +- harbour/contrib/hbnf/doc/en/adapter.txt | 6 +- harbour/contrib/hbnf/doc/en/adessort.txt | 10 +- harbour/contrib/hbnf/doc/en/aemaxlen.txt | 14 +- harbour/contrib/hbnf/doc/en/aeminlen.txt | 14 +- harbour/contrib/hbnf/doc/en/amedian.txt | 10 +- harbour/contrib/hbnf/doc/en/anomatch.txt | 12 +- harbour/contrib/hbnf/doc/en/any2any.txt | 4 +- harbour/contrib/hbnf/doc/en/aredit.txt | 34 +- harbour/contrib/hbnf/doc/en/asum.txt | 10 +- harbour/contrib/hbnf/doc/en/at2.txt | 24 +- harbour/contrib/hbnf/doc/en/bitclr.txt | 10 +- harbour/contrib/hbnf/doc/en/bitset.txt | 12 +- harbour/contrib/hbnf/doc/en/blink.txt | 6 +- harbour/contrib/hbnf/doc/en/byt2bit.txt | 6 +- harbour/contrib/hbnf/doc/en/byt2hex.txt | 6 +- harbour/contrib/hbnf/doc/en/byteand.txt | 4 +- harbour/contrib/hbnf/doc/en/byteneg.txt | 4 +- harbour/contrib/hbnf/doc/en/bytenot.txt | 4 +- harbour/contrib/hbnf/doc/en/byteor.txt | 4 +- harbour/contrib/hbnf/doc/en/bytexor.txt | 4 +- harbour/contrib/hbnf/doc/en/calendar.txt | 22 +- harbour/contrib/hbnf/doc/en/chdir.txt | 2 +- harbour/contrib/hbnf/doc/en/cint86.txt | 56 +- harbour/contrib/hbnf/doc/en/clrsel.txt | 38 +- harbour/contrib/hbnf/doc/en/cntryset.txt | 4 +- harbour/contrib/hbnf/doc/en/color2n.txt | 2 +- harbour/contrib/hbnf/doc/en/d2e.txt | 6 +- harbour/contrib/hbnf/doc/en/datecnfg.txt | 32 +- harbour/contrib/hbnf/doc/en/dayofyr.txt | 18 +- harbour/contrib/hbnf/doc/en/daytobow.txt | 4 +- harbour/contrib/hbnf/doc/en/default.txt | 2 +- harbour/contrib/hbnf/doc/en/dfile.txt | 20 +- harbour/contrib/hbnf/doc/en/diskfunc.txt | 2 +- harbour/contrib/hbnf/doc/en/dispc.txt | 18 +- harbour/contrib/hbnf/doc/en/dispmsg.txt | 30 +- harbour/contrib/hbnf/doc/en/dosver.txt | 6 +- harbour/contrib/hbnf/doc/en/e2d.txt | 4 +- harbour/contrib/hbnf/doc/en/easter.txt | 2 +- harbour/contrib/hbnf/doc/en/elapsed.txt | 12 +- harbour/contrib/hbnf/doc/en/findith.txt | 8 +- harbour/contrib/hbnf/doc/en/floptst.txt | 8 +- harbour/contrib/hbnf/doc/en/ftattr.txt | 12 +- harbour/contrib/hbnf/doc/en/fttext.txt | 346 +-- harbour/contrib/hbnf/doc/en/gcd.txt | 2 +- harbour/contrib/hbnf/doc/en/getenvrn.txt | 18 +- harbour/contrib/hbnf/doc/en/hex2dec.txt | 2 +- harbour/contrib/hbnf/doc/en/iamidle.txt | 8 +- harbour/contrib/hbnf/doc/en/idle.txt | 10 +- harbour/contrib/hbnf/doc/en/inp.txt | 2 +- harbour/contrib/hbnf/doc/en/isbit.txt | 10 +- harbour/contrib/hbnf/doc/en/isbiton.txt | 4 +- harbour/contrib/hbnf/doc/en/isprint.txt | 12 +- harbour/contrib/hbnf/doc/en/isshare.txt | 2 +- harbour/contrib/hbnf/doc/en/kspeed.txt | 6 +- harbour/contrib/hbnf/doc/en/linked.txt | 10 +- harbour/contrib/hbnf/doc/en/madd.txt | 8 +- harbour/contrib/hbnf/doc/en/menu1.txt | 68 +- harbour/contrib/hbnf/doc/en/menutonf.txt | 70 +- harbour/contrib/hbnf/doc/en/metaph.txt | 2 +- harbour/contrib/hbnf/doc/en/miltime.txt | 18 +- harbour/contrib/hbnf/doc/en/mkdir.txt | 2 +- harbour/contrib/hbnf/doc/en/month.txt | 14 +- harbour/contrib/hbnf/doc/en/mouse1.txt | 76 +- harbour/contrib/hbnf/doc/en/netpv.txt | 10 +- harbour/contrib/hbnf/doc/en/nooccur.txt | 10 +- harbour/contrib/hbnf/doc/en/ntow.txt | 14 +- harbour/contrib/hbnf/doc/en/numlock.txt | 10 +- harbour/contrib/hbnf/doc/en/nwlstat.txt | 4 +- harbour/contrib/hbnf/doc/en/nwsem.txt | 68 +- harbour/contrib/hbnf/doc/en/nwuid.txt | 8 +- harbour/contrib/hbnf/doc/en/ontick.txt | 20 +- harbour/contrib/hbnf/doc/en/origin.txt | 6 +- harbour/contrib/hbnf/doc/en/outp.txt | 4 +- harbour/contrib/hbnf/doc/en/page.txt | 8 +- harbour/contrib/hbnf/doc/en/pchr.txt | 30 +- harbour/contrib/hbnf/doc/en/peek.txt | 4 +- harbour/contrib/hbnf/doc/en/pending.txt | 18 +- harbour/contrib/hbnf/doc/en/poke.txt | 6 +- harbour/contrib/hbnf/doc/en/popadder.txt | 40 +- harbour/contrib/hbnf/doc/en/proper.txt | 4 +- harbour/contrib/hbnf/doc/en/prtesc.txt | 2 +- harbour/contrib/hbnf/doc/en/putkey.txt | 10 +- harbour/contrib/hbnf/doc/en/qtr.txt | 14 +- harbour/contrib/hbnf/doc/en/rand1.txt | 4 +- harbour/contrib/hbnf/doc/en/reboot.txt | 8 +- harbour/contrib/hbnf/doc/en/rmdir.txt | 2 +- harbour/contrib/hbnf/doc/en/round.txt | 20 +- harbour/contrib/hbnf/doc/en/savearr.txt | 30 +- harbour/contrib/hbnf/doc/en/scancode.txt | 14 +- harbour/contrib/hbnf/doc/en/scregion.txt | 28 +- harbour/contrib/hbnf/doc/en/setdate.txt | 16 +- harbour/contrib/hbnf/doc/en/setkeys.txt | 8 +- harbour/contrib/hbnf/doc/en/setlastk.txt | 8 +- harbour/contrib/hbnf/doc/en/settime.txt | 14 +- harbour/contrib/hbnf/doc/en/shadow.txt | 4 +- harbour/contrib/hbnf/doc/en/sinkey.txt | 2 +- harbour/contrib/hbnf/doc/en/sleep.txt | 12 +- harbour/contrib/hbnf/doc/en/sqzn.txt | 18 +- harbour/contrib/hbnf/doc/en/sysmem.txt | 4 +- harbour/contrib/hbnf/doc/en/tbwhile.txt | 22 +- harbour/contrib/hbnf/doc/en/tempfile.txt | 18 +- harbour/contrib/hbnf/doc/en/vertmenu.txt | 8 +- harbour/contrib/hbnf/doc/en/vidcur.txt | 22 +- harbour/contrib/hbnf/doc/en/video1.txt | 42 +- harbour/contrib/hbnf/doc/en/wda.txt | 14 +- harbour/contrib/hbnf/doc/en/week.txt | 14 +- harbour/contrib/hbnf/doc/en/workdays.txt | 10 +- harbour/contrib/hbnf/doc/en/woy.txt | 18 +- harbour/contrib/hbnf/doc/en/xbox.txt | 24 +- harbour/contrib/hbnf/doc/en/year.txt | 10 +- harbour/contrib/hbnf/dosver.c | 2 +- harbour/contrib/hbnf/easter.prg | 2 +- harbour/contrib/hbnf/elapmil.prg | 5 +- harbour/contrib/hbnf/eltime.prg | 11 +- harbour/contrib/hbnf/findith.prg | 1 + harbour/contrib/hbnf/floptst.prg | 2 + harbour/contrib/hbnf/ftattr.c | 36 +- harbour/contrib/hbnf/fttext.c | 296 +- harbour/contrib/hbnf/gcd.prg | 1 + harbour/contrib/hbnf/getenvrn.c | 34 +- harbour/contrib/hbnf/hex2dec.prg | 1 + harbour/contrib/hbnf/invclr.prg | 2 +- harbour/contrib/hbnf/isprint.c | 4 +- harbour/contrib/hbnf/kspeed.c | 4 +- harbour/contrib/hbnf/linked.prg | 1 + harbour/contrib/hbnf/menu1.prg | 54 +- harbour/contrib/hbnf/menuto.prg | 106 +- harbour/contrib/hbnf/metaph.prg | 166 +- harbour/contrib/hbnf/miltime.prg | 16 +- harbour/contrib/hbnf/min2dhm.prg | 10 +- harbour/contrib/hbnf/mouse1.prg | 11 +- harbour/contrib/hbnf/netpv.prg | 1 - harbour/contrib/hbnf/nooccur.prg | 1 + harbour/contrib/hbnf/ntow.prg | 8 +- harbour/contrib/hbnf/numlock.c | 6 +- harbour/contrib/hbnf/nwsem.prg | 3 + harbour/contrib/hbnf/nwuid.prg | 1 + harbour/contrib/hbnf/ontick.prg | 6 +- harbour/contrib/hbnf/pchr.prg | 9 +- harbour/contrib/hbnf/peek.c | 18 +- harbour/contrib/hbnf/pegs.prg | 33 +- harbour/contrib/hbnf/popadder.prg | 228 +- harbour/contrib/hbnf/proper.c | 10 +- harbour/contrib/hbnf/prtscr.c | 2 +- harbour/contrib/hbnf/round.prg | 13 +- harbour/contrib/hbnf/scancode.prg | 1 + harbour/contrib/hbnf/scregion.prg | 13 +- harbour/contrib/hbnf/setdate.c | 8 +- harbour/contrib/hbnf/settime.c | 6 +- harbour/contrib/hbnf/sinkey.prg | 12 +- harbour/contrib/hbnf/support.c | 34 +- harbour/contrib/hbnf/tbwhile.prg | 34 +- harbour/contrib/hbnf/tests/clrsel.prg | 4 +- harbour/contrib/hbnf/tests/datecnfg.prg | 6 +- harbour/contrib/hbnf/tests/menuto.prg | 41 + harbour/contrib/hbnf/tests/metaph.prg | 2 +- harbour/contrib/hbnf/tests/ontick.prg | 4 +- harbour/contrib/hbnf/tests/savearr.prg | 2 +- harbour/contrib/hbnf/tests/tbwhile.prg | 2 +- harbour/contrib/hbnf/vertmenu.prg | 12 +- harbour/contrib/hbnf/vidcur.prg | 6 +- harbour/contrib/hbnf/video1.c | 12 +- harbour/contrib/hbnf/video2.prg | 2 +- harbour/contrib/hbnf/wda.prg | 6 +- harbour/contrib/hbnf/workdays.prg | 8 +- harbour/contrib/hbnf/woy.prg | 6 +- harbour/contrib/hbnf/xbox.prg | 8 +- harbour/contrib/hbnf/year.prg | 2 +- harbour/contrib/hbodbc/browodbc.prg | 50 +- harbour/contrib/hbodbc/tests/odbcdemo.prg | 24 +- harbour/contrib/hbodbc/tests/testodbc.prg | 6 +- harbour/contrib/hbodbc/todbc.prg | 201 +- harbour/contrib/hboslib/core.prg | 6 +- harbour/contrib/hbpgsql/tests/async.prg | 8 +- harbour/contrib/hbpgsql/tests/cache.prg | 147 +- harbour/contrib/hbpgsql/tests/dbf2pg.prg | 28 +- harbour/contrib/hbpgsql/tests/simple.prg | 78 +- harbour/contrib/hbpgsql/tests/stress.prg | 7 +- harbour/contrib/hbpgsql/tests/test.prg | 14 +- harbour/contrib/hbpgsql/tpostgre.prg | 104 +- harbour/contrib/hbrun/hbrun.hbp | 3 + harbour/contrib/hbsms/sms.prg | 10 + harbour/contrib/hbsqlit3/hdbcsqlt.prg | 2 +- harbour/contrib/hbsqlit3/tests/blob.prg | 5 +- harbour/contrib/hbsqlit3/tests/hdbctest.prg | 8 +- harbour/contrib/hbsqlit3/tests/metadata.prg | 2 +- harbour/contrib/hbsqlit3/tests/sl3_test.prg | 14 +- harbour/contrib/hbssl/tests/pem.prg | 7 +- harbour/contrib/hbssl/tests/test.prg | 1 + harbour/contrib/hbtinymt/tests/test32.prg | 3 +- harbour/contrib/hbtinymt/tests/test64.prg | 3 +- harbour/contrib/hbtip/cgi.prg | 29 +- harbour/contrib/hbtip/client.prg | 39 +- harbour/contrib/hbtip/credent.prg | 2 + harbour/contrib/hbtip/encb64.prg | 11 +- harbour/contrib/hbtip/encoder.prg | 5 + harbour/contrib/hbtip/encqp.prg | 6 + harbour/contrib/hbtip/encurl.prg | 4 + harbour/contrib/hbtip/ftpcli.prg | 54 +- harbour/contrib/hbtip/httpcli.prg | 82 +- harbour/contrib/hbtip/log.prg | 1 + harbour/contrib/hbtip/mail.prg | 62 +- harbour/contrib/hbtip/popcli.prg | 29 +- harbour/contrib/hbtip/sendmail.prg | 12 +- harbour/contrib/hbtip/sessid.prg | 9 +- harbour/contrib/hbtip/smtpcli.prg | 16 +- harbour/contrib/hbtip/tests/base64.prg | 2 +- harbour/contrib/hbtip/tests/dbtohtml.prg | 1 - harbour/contrib/hbtip/tests/dnldftp.prg | 4 +- harbour/contrib/hbtip/tests/ftpadv.prg | 4 +- harbour/contrib/hbtip/tests/gmail.prg | 41 +- harbour/contrib/hbtip/tests/httpadv.prg | 4 +- harbour/contrib/hbtip/tests/loadhtml.prg | 12 +- harbour/contrib/hbtip/tests/tipmmail.prg | 28 +- harbour/contrib/hbtip/tests/tiptest.prg | 2 +- harbour/contrib/hbtip/tests/upld_ftp.prg | 4 +- harbour/contrib/hbtip/thtml.prg | 37 +- harbour/contrib/hbtip/url.prg | 15 +- harbour/contrib/hbtpathy/telepath.prg | 145 +- harbour/contrib/hbtpathy/tests/testtp.prg | 2 + harbour/contrib/hbunix/tests/testpid.prg | 4 +- harbour/contrib/hbwin/axfunc.prg | 1 + harbour/contrib/hbwin/oleauto.prg | 12 +- harbour/contrib/hbwin/tests/dlg.prg | 8 +- harbour/contrib/hbwin/tests/dlg.rc | 6 +- harbour/contrib/hbwin/tests/olesrv1.prg | 16 +- harbour/contrib/hbwin/tests/olesrv2.prg | 11 +- harbour/contrib/hbwin/tests/olesrv3.prg | 4 +- harbour/contrib/hbwin/tests/olesrv4.prg | 20 +- harbour/contrib/hbwin/tests/oletst1.prg | 12 +- harbour/contrib/hbwin/tests/oletst2.prg | 8 +- harbour/contrib/hbwin/tests/oletst3.prg | 10 +- harbour/contrib/hbwin/tests/oletst4.prg | 16 +- harbour/contrib/hbwin/tests/pdfcreat.prg | 4 +- harbour/contrib/hbwin/tests/testax.prg | 15 +- harbour/contrib/hbwin/tests/testcom1.prg | 8 +- harbour/contrib/hbwin/tests/testcom2.prg | 12 +- harbour/contrib/hbwin/tests/testcopy.prg | 19 +- harbour/contrib/hbwin/tests/testdir.prg | 6 +- harbour/contrib/hbwin/tests/testgdi.prg | 1 + harbour/contrib/hbwin/tests/testmapi.prg | 44 +- harbour/contrib/hbwin/tests/testprn.prg | 25 +- harbour/contrib/hbwin/tests/testprn2.prg | 3 +- harbour/contrib/hbwin/tests/testprn3.prg | 1 + harbour/contrib/hbwin/tests/testprn4.prg | 1 + harbour/contrib/hbwin/tests/testreg.prg | 7 +- harbour/contrib/hbwin/tests/testrpc.prg | 4 +- harbour/contrib/hbwin/tests/testsim.prg | 6 +- harbour/contrib/hbwin/tests/testsvc.prg | 8 +- harbour/contrib/hbwin/tests/testwmtx.prg | 1 + harbour/contrib/hbwin/win_os.prg | 2 + harbour/contrib/hbwin/win_reg.prg | 13 +- harbour/contrib/hbwin/win_tbmp.prg | 9 +- harbour/contrib/hbwin/win_tcom.prg | 2 + harbour/contrib/hbwin/win_tprn.prg | 115 +- harbour/contrib/hbxdiff/tests/test.prg | 5 +- harbour/contrib/hbxdiff/tests/test2.prg | 4 +- harbour/contrib/hbxdiff/tests/test3.prg | 4 +- harbour/contrib/hbxpp/dbfuncsx.prg | 3 +- harbour/contrib/hbxpp/runshell.prg | 48 +- harbour/contrib/hbxpp/tbrowsex.prg | 13 +- harbour/contrib/hbxpp/tests/opover.prg | 3 + harbour/contrib/hbxpp/tests/testdll.prg | 67 +- harbour/contrib/hbxpp/thfuncx.prg | 8 +- harbour/contrib/hbxpp/xppop.prg | 6 + harbour/contrib/hbzebra/tests/testcair.prg | 12 +- harbour/contrib/hbzebra/tests/testhpdf.prg | 10 +- harbour/contrib/hbzebra/tests/testwin.prg | 43 +- harbour/contrib/hbziparc/doc/en/hbziparc.txt | 164 +- harbour/contrib/hbziparc/tests/unzipa.prg | 4 +- harbour/contrib/hbziparc/tests/zipa.prg | 25 +- harbour/contrib/hbziparc/ziparc.prg | 36 +- harbour/contrib/make.hb | 123 +- harbour/contrib/rddads/doc/en/adsfuncs.txt | 220 +- harbour/contrib/rddads/doc/en/readme.txt | 68 +- harbour/contrib/rddads/tests/datad.prg | 4 +- harbour/contrib/rddads/tests/testmg.prg | 3 +- harbour/contrib/xhb/cstruct.prg | 50 +- harbour/contrib/xhb/decode.prg | 4 +- harbour/contrib/xhb/dirrec.prg | 4 +- harbour/contrib/xhb/diskhb.prg | 5 +- harbour/contrib/xhb/dumpvar.prg | 14 +- harbour/contrib/xhb/hbcomprs.prg | 15 +- harbour/contrib/xhb/hblog.prg | 8 +- harbour/contrib/xhb/hblognet.prg | 2 +- harbour/contrib/xhb/htjlist.prg | 6 +- harbour/contrib/xhb/htmutil.prg | 10 +- harbour/contrib/xhb/regexrpl.prg | 2 +- harbour/contrib/xhb/sprintf.prg | 15 +- harbour/contrib/xhb/stream.prg | 18 +- harbour/contrib/xhb/tests/compress.prg | 6 +- harbour/contrib/xhb/tests/decode.prg | 1 + harbour/contrib/xhb/tests/dll.prg | 2 + harbour/contrib/xhb/tests/xml1.prg | 3 +- harbour/contrib/xhb/tfile.prg | 14 +- harbour/contrib/xhb/tframe.prg | 10 +- harbour/contrib/xhb/thtm.prg | 10 +- harbour/contrib/xhb/traceprg.prg | 9 +- harbour/contrib/xhb/trpc.prg | 35 +- harbour/contrib/xhb/trpccli.prg | 6 +- harbour/contrib/xhb/ttable.prg | 52 +- harbour/contrib/xhb/xcstr.prg | 16 +- harbour/contrib/xhb/xdbmodst.prg | 6 +- harbour/contrib/xhb/xhbcomp.prg | 12 +- harbour/contrib/xhb/xhberr.prg | 16 +- harbour/contrib/xhb/xhbfunp.prg | 2 +- harbour/contrib/xhb/xhbmemo.prg | 189 +- harbour/contrib/xhb/xhbmt.prg | 85 +- harbour/contrib/xhb/xhbole.prg | 36 +- harbour/contrib/xhb/xhbtedit.prg | 104 +- harbour/contrib/xhb/xhbver.prg | 3 +- harbour/contrib/xhb/xhw32prn.prg | 30 +- harbour/doc/en/browse.txt | 6 +- harbour/doc/en/cmdline.txt | 50 +- harbour/doc/en/compiler.txt | 246 +- harbour/doc/en/garbage.txt | 36 +- harbour/doc/en/gnulice.txt | 118 +- harbour/doc/en/harbext.txt | 56 +- harbour/doc/en/hb_apigt.txt | 1570 +++++----- harbour/doc/en/hb_apird.txt | 2704 ++++++++--------- harbour/doc/en/hbflock.txt | 26 +- harbour/doc/en/idle.txt | 18 +- harbour/doc/en/macro.txt | 14 +- harbour/doc/en/memvar2.txt | 22 +- harbour/doc/en/readme.txt | 50 +- harbour/doc/en/sayget.txt | 54 +- harbour/doc/en/string.txt | 14 +- harbour/doc/en/strotype.txt | 34 +- harbour/doc/en/subcodes.txt | 152 +- harbour/doc/en/tbrowse.txt | 148 +- harbour/doc/en/var.txt | 16 +- harbour/extras/gfspell/spell.prg | 2687 ++++++++-------- harbour/extras/gfspell/spellc.c | 214 +- harbour/extras/gtwvw/tests/cbtest1.prg | 12 +- harbour/extras/gtwvw/tests/cbtest6.prg | 32 +- harbour/extras/gtwvw/tests/drawimg.prg | 46 +- harbour/extras/gtwvw/tests/ebtest7.prg | 142 +- harbour/extras/gtwvw/tests/inpfocus.prg | 55 +- harbour/extras/gtwvw/tests/maincoor.prg | 4 +- harbour/extras/gtwvw/tests/maximize.prg | 15 +- harbour/extras/gtwvw/tests/prog0.prg | 19 +- harbour/extras/gtwvw/tests/prog1.prg | 16 +- harbour/extras/gtwvw/tests/prog2.prg | 39 +- harbour/extras/gtwvw/tests/wvwmouse.prg | 166 +- .../gtwvw/tests/wvwtest9.mft} | 27 +- harbour/extras/gtwvw/tests/wvwtest9.prg | 222 +- harbour/extras/gtwvw/tests/wvwtest9.rc | 2 +- harbour/extras/gtwvw/tests/wvwtest9.xml | 23 - harbour/extras/guestbk/guestbk.prg | 2 +- harbour/extras/guestbk/testcgi.prg | 2 +- harbour/extras/hbdoc/genbase.prg | 7 +- harbour/extras/hbdoc/genhtml.prg | 60 +- harbour/extras/hbdoc/gentxt.prg | 30 +- harbour/extras/hbdoc/genxml.prg | 17 +- harbour/extras/hbdoc/hbdoc.prg | 69 +- harbour/extras/hbdoc/tmplates.prg | 25 +- harbour/extras/hbvpdf/hbvpdf.prg | 2183 ++++++------- harbour/extras/hbvpdf/tests/pdf_demo.prg | 26 +- harbour/extras/hbxlsxml/xlsxml_s.prg | 5 +- harbour/extras/hbxlsxml/xlsxml_y.prg | 2 +- harbour/extras/httpsrv/cgifunc.prg | 555 ++-- harbour/extras/httpsrv/cookie.prg | 56 +- harbour/extras/httpsrv/modules/cookie.prg | 7 +- .../extras/httpsrv/modules/showcounter.prg | 10 +- .../extras/httpsrv/modules/tableservletdb.prg | 18 +- harbour/extras/httpsrv/session.prg | 347 ++- harbour/extras/httpsrv/uhttpd.prg | 1180 +++---- harbour/extras/rddado/adordd.prg | 24 +- harbour/extras/rddado/tests/access1.prg | 2 +- harbour/extras/rddado/tests/access2.prg | 9 +- harbour/extras/rddado/tests/mysql3.prg | 2 +- harbour/extras/superlib/hbsuper.prg | 10 + harbour/include/harbour.hbx | 28 +- harbour/package/harb_win.mft | 9 +- harbour/package/harbour.rb | 2 +- harbour/package/mpkg_src_nightly.sh | 4 +- harbour/package/mpkg_win_nightly.bat | 2 +- harbour/package/updt_web_nightly.sh | 2 +- harbour/src/common/hbver.c | 15 +- harbour/src/compiler/cmdcheck.c | 10 +- harbour/src/compiler/harbour.y | 8 +- harbour/src/compiler/harbour.yyc | 8 +- harbour/src/debug/dbgbrwsr.prg | 19 +- harbour/src/debug/dbgentry.c | 44 +- harbour/src/debug/dbghelp.prg | 1409 ++++----- harbour/src/debug/dbgtarr.prg | 23 +- harbour/src/debug/dbgthsh.prg | 41 +- harbour/src/debug/dbgtinp.prg | 37 +- harbour/src/debug/dbgtmenu.prg | 87 +- harbour/src/debug/dbgtmitm.prg | 10 +- harbour/src/debug/dbgtobj.prg | 42 +- harbour/src/debug/dbgtwin.prg | 23 +- harbour/src/debug/dbgwa.prg | 106 +- harbour/src/debug/debugger.prg | 431 +-- harbour/src/debug/tbrwtext.prg | 12 +- harbour/src/rdd/dbdelim.prg | 6 +- harbour/src/rdd/dbfntx/dbfntx0.prg | 92 - harbour/src/rdd/dbjoin.prg | 12 +- harbour/src/rdd/dbstrux.prg | 35 +- harbour/src/rdd/hbsix/sxcompat.prg | 163 +- harbour/src/rdd/hbsix/sxini.prg | 13 +- harbour/src/rdd/hbsix/sxtrig.prg | 8 +- harbour/src/rdd/usrrdd/rdds/arrayrdd.prg | 287 +- harbour/src/rdd/usrrdd/rdds/dbtcdx.prg | 5 +- harbour/src/rdd/usrrdd/rdds/fptcdx.prg | 5 +- harbour/src/rdd/usrrdd/rdds/hscdx.prg | 4 +- harbour/src/rdd/usrrdd/rdds/logrdd.prg | 132 +- harbour/src/rdd/usrrdd/rdds/rlcdx.prg | 4 +- harbour/src/rdd/usrrdd/rdds/smtcdx.prg | 5 +- harbour/src/rdd/usrrdd/rdds/vfpcdx.prg | 2 + harbour/src/rtl/achoice.prg | 16 +- harbour/src/rtl/alert.prg | 18 +- harbour/src/rtl/altd.prg | 2 +- harbour/src/rtl/browse.prg | 56 +- harbour/src/rtl/cdpapi.c | 8 +- harbour/src/rtl/cdpdet.prg | 83 +- harbour/src/rtl/checkbox.prg | 26 +- harbour/src/rtl/color53.prg | 74 +- harbour/src/rtl/dbedit.prg | 47 +- harbour/src/rtl/devoutp.prg | 2 +- harbour/src/rtl/dircmd.prg | 38 +- harbour/src/rtl/dirscan.prg | 10 +- harbour/src/rtl/errsys.prg | 7 +- harbour/src/rtl/getlist.prg | 1 + harbour/src/rtl/getsys.prg | 22 +- harbour/src/rtl/getsys53.prg | 5 + harbour/src/rtl/getsyshb.prg | 3 +- harbour/src/rtl/gui.prg | 10 +- harbour/src/rtl/hbadler.c | 8 +- harbour/src/rtl/hbdoc.prg | 45 +- harbour/src/rtl/hbfilehi.prg | 35 +- harbour/src/rtl/hbi18n2.prg | 168 +- harbour/src/rtl/hbini.prg | 40 +- harbour/src/rtl/hbsocket.c | 12 +- harbour/src/rtl/input.prg | 1 + harbour/src/rtl/langcomp.prg | 8 +- harbour/src/rtl/libname.prg | 3 +- harbour/src/rtl/listbox.prg | 59 +- harbour/src/rtl/memoedit.prg | 31 +- harbour/src/rtl/memvarbl.prg | 6 +- harbour/src/rtl/memvarhb.prg | 27 +- harbour/src/rtl/menusys.prg | 4 +- harbour/src/rtl/menuto.prg | 36 +- harbour/src/rtl/objfunc.prg | 21 +- harbour/src/rtl/profiler.prg | 44 +- harbour/src/rtl/pushbtn.prg | 20 +- harbour/src/rtl/radiobtn.prg | 29 +- harbour/src/rtl/radiogrp.prg | 21 +- harbour/src/rtl/readkey.prg | 1 + harbour/src/rtl/savebuff.prg | 12 +- harbour/src/rtl/scrollbr.prg | 29 +- harbour/src/rtl/sha1.c | 10 +- harbour/src/rtl/tbrowse.prg | 173 +- harbour/src/rtl/tbrowsys.prg | 43 +- harbour/src/rtl/tclass.prg | 35 +- harbour/src/rtl/teditor.prg | 42 +- harbour/src/rtl/tget.prg | 83 +- harbour/src/rtl/tgetint.prg | 16 +- harbour/src/rtl/tgetlist.prg | 19 +- harbour/src/rtl/tlabel.prg | 26 +- harbour/src/rtl/tmenuitm.prg | 4 +- harbour/src/rtl/tmenusys.prg | 16 +- harbour/src/rtl/tobject.prg | 7 +- harbour/src/rtl/tpersist.prg | 18 +- harbour/src/rtl/tpopup.prg | 66 +- harbour/src/rtl/tpopuphb.prg | 1 + harbour/src/rtl/treport.prg | 288 +- harbour/src/rtl/tscalar.prg | 58 +- harbour/src/rtl/tsymbol.prg | 4 +- harbour/src/rtl/ttopbar.prg | 62 +- harbour/src/rtl/valtoexp.prg | 15 +- harbour/src/rtl/wait.prg | 3 +- harbour/src/vm/classes.c | 16 +- harbour/src/vm/dynsym.c | 62 +- harbour/src/vm/fm.c | 44 +- harbour/src/vm/garbage.c | 60 +- harbour/src/vm/hvm.c | 96 +- harbour/tests/ac_test.prg | 44 +- harbour/tests/arrindex.prg | 4 +- harbour/tests/base64.prg | 16 +- harbour/tests/begin.prg | 8 +- harbour/tests/boxtest.prg | 10 +- harbour/tests/cdow.prg | 6 +- harbour/tests/codebl.prg | 12 +- harbour/tests/codebloc.prg | 8 +- harbour/tests/dates3.prg | 18 +- harbour/tests/db_brows.prg | 208 +- harbour/tests/dbevalts.prg | 1 + harbour/tests/delimtst.prg | 4 +- harbour/tests/destruct.prg | 2 +- harbour/tests/dirtest.prg | 11 +- harbour/tests/dynobj.prg | 2 +- harbour/tests/dynsym.prg | 17 +- harbour/tests/files.prg | 8 +- harbour/tests/fortest.prg | 7 +- harbour/tests/funcarr.prg | 4 +- harbour/tests/function.cfm | 2 +- harbour/tests/gfx.prg | 26 +- harbour/tests/gtkeys.prg | 10 +- harbour/tests/gtwin.prg | 8 +- harbour/tests/gtxfnt.prg | 9 + harbour/tests/hbdocext.hb | 5 +- harbour/tests/hbdoctst.prg | 4 +- harbour/tests/hsxtest.prg | 2 +- harbour/tests/inherit.prg | 2 +- harbour/tests/initexit.prg | 1 + harbour/tests/langapi.prg | 8 +- harbour/tests/langmsg.prg | 8 +- harbour/tests/libname.prg | 22 +- harbour/tests/lnlenli1.prg | 168 +- harbour/tests/mathtest.prg | 2 +- harbour/tests/memory.prg | 28 +- harbour/tests/memvar.prg | 4 +- harbour/tests/mousetst.prg | 20 +- harbour/tests/newrdd.prg | 38 +- harbour/tests/onidle.prg | 2 +- harbour/tests/osshell.prg | 10 +- harbour/tests/parexpr.prg | 3 +- harbour/tests/parseini.prg | 10 +- harbour/tests/round.prg | 11 +- harbour/tests/rto_get.prg | 2 - harbour/tests/scroll.prg | 2 +- harbour/tests/sdf_test.prg | 6 +- harbour/tests/server.prg | 3 +- harbour/tests/set_test.prg | 7 +- harbour/tests/setkeys.prg | 6 +- harbour/tests/speed.prg | 2 +- harbour/tests/speedstr.prg | 73 +- harbour/tests/stripdoc.hb | 1 + harbour/tests/stripeol.hb | 2 + harbour/tests/usrrdd/exarr.prg | 18 +- harbour/tests/usrrdd/exfcm.prg | 12 +- harbour/tests/usrrdd/exlog.prg | 6 +- harbour/tests/vmasort.prg | 7 +- harbour/tests/wcecon.prg | 9 +- harbour/tests/wvt_fs.prg | 24 +- harbour/tests/wvtext.prg | 14 +- harbour/utils/hbi18n/hbi18n.prg | 117 +- harbour/utils/hbmk2/examples/plug_bis.hb | 24 +- harbour/utils/hbmk2/examples/plug_tpl.hb | 3 + harbour/utils/hbmk2/hbmk2.prg | 1165 ++++--- harbour/website/changelog.html | 2 +- harbour/website/faq/harbour.html | 2 +- harbour/website/faq/harbour1.html | 2 +- harbour/website/faq/harbour10.html | 2 +- harbour/website/faq/harbour11.html | 2 +- harbour/website/faq/harbour12.html | 2 +- harbour/website/faq/harbour13.html | 2 +- harbour/website/faq/harbour14.html | 2 +- harbour/website/faq/harbour15.html | 2 +- harbour/website/faq/harbour16.html | 2 +- harbour/website/faq/harbour17.html | 6 +- harbour/website/faq/harbour18.html | 2 +- harbour/website/faq/harbour19.html | 2 +- harbour/website/faq/harbour2.html | 2 +- harbour/website/faq/harbour20.html | 2 +- harbour/website/faq/harbour21.html | 2 +- harbour/website/faq/harbour22.html | 2 +- harbour/website/faq/harbour23.html | 2 +- harbour/website/faq/harbour24.html | 2 +- harbour/website/faq/harbour25.html | 2 +- harbour/website/faq/harbour26.html | 2 +- harbour/website/faq/harbour27.html | 4 +- harbour/website/faq/harbour28.html | 2 +- harbour/website/faq/harbour29.html | 2 +- harbour/website/faq/harbour3.html | 2 +- harbour/website/faq/harbour30.html | 2 +- harbour/website/faq/harbour31.html | 2 +- harbour/website/faq/harbour32.html | 2 +- harbour/website/faq/harbour33.html | 2 +- harbour/website/faq/harbour34.html | 2 +- harbour/website/faq/harbour35.html | 2 +- harbour/website/faq/harbour36.html | 2 +- harbour/website/faq/harbour37.html | 2 +- harbour/website/faq/harbour38.html | 2 +- harbour/website/faq/harbour39.html | 2 +- harbour/website/faq/harbour4.html | 2 +- harbour/website/faq/harbour40.html | 2 +- harbour/website/faq/harbour41.html | 2 +- harbour/website/faq/harbour42.html | 2 +- harbour/website/faq/harbour43.html | 2 +- harbour/website/faq/harbour44.html | 2 +- harbour/website/faq/harbour45.html | 2 +- harbour/website/faq/harbour46.html | 2 +- harbour/website/faq/harbour47.html | 2 +- harbour/website/faq/harbour48.html | 2 +- harbour/website/faq/harbour49.html | 2 +- harbour/website/faq/harbour5.html | 2 +- harbour/website/faq/harbour50.html | 2 +- harbour/website/faq/harbour51.html | 2 +- harbour/website/faq/harbour52.html | 2 +- harbour/website/faq/harbour53.html | 2 +- harbour/website/faq/harbour54.html | 2 +- harbour/website/faq/harbour55.html | 2 +- harbour/website/faq/harbour56.html | 2 +- harbour/website/faq/harbour57.html | 2 +- harbour/website/faq/harbour58.html | 2 +- harbour/website/faq/harbour59.html | 2 +- harbour/website/faq/harbour6.html | 2 +- harbour/website/faq/harbour60.html | 2 +- harbour/website/faq/harbour61.html | 2 +- harbour/website/faq/harbour62.html | 2 +- harbour/website/faq/harbour63.html | 2 +- harbour/website/faq/harbour7.html | 2 +- harbour/website/faq/harbour8.html | 2 +- harbour/website/faq/harbour9.html | 2 +- harbour/website/faq/harbour_toc.html | 2 +- harbour/website/faq/index.html | 2 +- harbour/website/index.html | 2 +- harbour/website/menu/harbour-menu.js | 4 +- harbour/website/samples/array16.prg.html | 2 +- harbour/website/samples/arreval.prg.html | 2 +- harbour/website/samples/begin.prg.html | 2 +- harbour/website/samples/byref.prg.html | 2 +- harbour/website/samples/codebl.prg.html | 2 +- harbour/website/samples/codebloc.prg.html | 2 +- harbour/website/samples/dates3.prg.html | 2 +- harbour/website/samples/dates4.prg.html | 2 +- harbour/website/samples/dosshell.prg.html | 2 +- harbour/website/samples/foreach.prg.html | 2 +- harbour/website/samples/function.cfm.html | 4 +- harbour/website/samples/hello.prg.html | 2 +- harbour/website/samples/initexit.prg.html | 2 +- harbour/website/samples/longdev.prg.html | 2 +- harbour/website/samples/mousetst.prg.html | 2 +- harbour/website/samples/onidle.prg.html | 2 +- harbour/website/samples/parseini.ini.html | 2 +- harbour/website/samples/parseini.prg.html | 2 +- harbour/website/samples/switch.prg.html | 2 +- harbour/website/samples/testbrdb.prg.html | 2 +- harbour/website/samples/testbrw.prg.html | 2 +- harbour/website/samples/testcgi.prg.html | 2 +- harbour/website/samples/testhtml.prg.html | 2 +- harbour/website/samples/testidle.prg.html | 2 +- harbour/website/samples/tstmacro.prg.html | 2 +- 858 files changed, 19680 insertions(+), 17448 deletions(-) create mode 100644 harbour/contrib/hbnf/tests/menuto.prg rename harbour/{contrib/hbwin/tests/dlg.xml => extras/gtwvw/tests/wvwtest9.mft} (56%) delete mode 100644 harbour/extras/gtwvw/tests/wvwtest9.xml delete mode 100644 harbour/src/rdd/dbfntx/dbfntx0.prg diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2eb9d735c5..ef154e0769 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,266 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-31 13:25 UTC+0200 Viktor Szakats (harbour syenar.net) + * include/harbour.hbx + * fixes/changes to some function names + + * config/hb_c.cfg + + updated to do better vertical aligment in + structs, var declarations and assignments + ; TODO: move this to /bin folder and add to 'install'-ed + file list, rename to 'harbour.ucf' + + * src/debug/*.prg + * src/rdd/*.prg + * src/rdd/hbsix/*.prg + * src/rdd/usrrdd/rdds/*.prg + * src/rtl/*.prg + * src/vm/*.prg + * utils/hbi18n/hbi18n.prg + * utils/hbmk2/hbmk2.prg + * utils/hbmk2/examples/*.hb + * contrib/hbblat/blatcls.prg + * contrib/gtwvg/*.prg + * contrib/gtwvg/tests/*.prg + * contrib/hbblink/*.prg + * contrib/hbcairo/tests/*.prg + * contrib/hbcomm/*.prg + * contrib/hbcomm/tests/*.prg + * contrib/hbcups/tests/*.prg + * contrib/hbcurl/tests/*.prg + * contrib/hbexpat/*.prg + * contrib/hbexpat/tests/*.prg + * contrib/hbfbird/*.prg + * contrib/hbfbird/tests/*.prg + * contrib/hbfoxpro/*.prg + * contrib/hbfship/*.prg + * contrib/hbgd/*.prg + * contrib/hbgd/tests/*.prg + * contrib/hbgs/tests/*.prg + * contrib/hbhpdf/*.prg + * contrib/hbhpdf/tests/*.prg + * contrib/hbhttpd/*.prg + * contrib/hbhttpd/tests/*.prg + * contrib/hblzf/tests/*.prg + * contrib/hbmagic/tests/*.prg + * contrib/hbmisc/*.prg + * contrib/hbmisc/tests/*.prg + * contrib/hbct/*.prg + * contrib/hbct/tests/*.prg + * contrib/hbmlzo/tests/*.prg + * contrib/hbmxml/*.prg + * contrib/hbmxml/tests/*.prg + * contrib/hbmysql/*.prg + * contrib/hbmysql/tests/*.prg + * contrib/hboslib/*.prg + * contrib/hbsms/*.prg + * contrib/hbtinymt/tests/*.prg + * contrib/hbtpathy/*.prg + * contrib/hbtpathy/tests/*.prg + * contrib/hbunix/tests/*.prg + * contrib/hbxdiff/tests/*.prg + * contrib/hbzebra/tests/*.prg + * contrib/hbziparc/*.prg + * contrib/hbziparc/tests/*.prg + * contrib/rddads/*.prg + * contrib/rddads/tests/*.prg + * contrib/hbodbc/*.prg + * contrib/hbodbc/tests/*.prg + * contrib/hbpgsql/*.prg + * contrib/hbpgsql/tests/*.prg + * contrib/hbsqlit3/*.prg + * contrib/hbsqlit3/tests/*.prg + * contrib/hbwin/*.prg + * contrib/hbwin/tests/*.prg + * contrib/hbxpp/*.prg + * contrib/hbxpp/tests/*.prg + * contrib/hbxhb/*.prg + * contrib/hbxhb/tests/*.prg + * contrib/hbnetio/*.prg + * contrib/hbnetio/utils/hbnetio/*.hb + * contrib/hbnetio/utils/hbnetio/*.prg + * contrib/hbtip/*.prg + * contrib/hbtip/tests/*.prg + * tests/usrrdd/*.prg + * tests/funcarr.prg + * extras/gfspell/spell.prg + * extras/gtwvw/tests/*.prg + * extras/guestbk/*.prg + * extras/hbdoc/*.prg + * extras/rddado/*.prg + * extras/rddado/tests/*.prg + * extras/hbxlsxml/*.prg + * extras/httpsrv/*.prg + * extras/httpsrv/modules/*.prg + * extras/hbsuper/*.prg + * extras/hbvpdf/*.prg + * extras/hbvpdf/tests/*.prg + * tests/*.prg (except some which are well formatted but in different/fast-typing style) + * tests/*.hb + * bin/*.hb + * contrib/*.hb + * config/*.hb + * some manual formatting to better be able to verify + changes made by hbformat and be friendlier with hbformat. + * most files reformatted with hbformat using Maurizio's + patch, with mostly minor manual corrections and verification. + All hbformat changes for revised one-by-one. + ! __DIR(): fixed to be unicode compatible + ! __hbdoc_ToSource(): make sure to not generate line ending + spaces in output. + + hbmk2/hbrun: HBMK_WITH_GTXWC built-time option to include + GTXWC. Useful for hbrun. + * hbct tests: change to not use [] as string delimiter + + added full prototypes to Array class declaration + + ; NOTE: Only these were not or not fully formatted: + contrib/hbnetio/tests/*.prg + tests/hbpptest/*.prg + tests/mt/*.prg + tests/multifnc/*.prg + tests/rddtest/*.prg + utils/hbmk2/hbmk2.prg (for the most part) + src/rtl/tbrowse.prg (for the most part) + utils/hbtest/*.prg + *.ch, *.c, *.h + + * src/rtl/cdpapihb.c + * src/rtl/hbadler.c + * src/rtl/hbsocket.c + * src/rtl/sha1.c + * src/vm/classes.c + * src/vm/dynsym.c + * src/vm/garbage.c + * src/debug/dbgentry.c + * do not end macros with ';' to avoid uncrustify warning + and wrong formatting as a consequence + + * src/compiler/cmdcheck.c + * minor changes for uncrustify-friendliness + + * contrib/hbformat/utils/hbfmtcls.prg + * contrib/hbformat/utils/hbformat.prg + % optimizations in hbformat.prg + ! fixed mask/filename handling to be + multiplatform in hbformat.prg + + added 'HBXList=' hbformat.ini parameter allowing + to add any .hbx file for proper function name + casing. + ! fixed progress bar to display correctly + + * tests/speedstr.prg + ! fixed to run as intended in unicode code + * hbformatted + + - contrib/hbwin/tests/dlg.xml + * contrib/hbwin/tests/dlg.rc + - extras/gtwvw/tests/wvwtest9.xml + + extras/gtwvw/tests/wvwtest9.mft + * extras/gtwvw/tests/wvwtest9.rc + * renamed manifest to have .mft extension + % deleted unnecessary manifest + * "Win32 API" -> "Windows API" + ! deleted CPU arch from manifest + + * package/harb_win.mft + * formatting + + * src/common/hbver.c + + added version detection for win 8 and win server 2012 + * minor formatting/code cleanup + + * tests/gfx.prg + * updated to run in script mode. + ; TOFIX: it doesn't draw anything with GTWVT + + * tests/gfx.prg + * tests/gtwin.prg + * tests/gtxfnt.prg + * tests/wvt_fs.prg + * tests/wvtext.prg + + support for GTXWC when run as script + + * doc/en/*.txt + * contrib/hbct/doc/en/*.txt + * contrib/hbgd/doc/en/*.txt + * contrib/hbgt/doc/en/*.txt + * contrib/hbmisc/doc/en/*.txt + * contrib/hbnf/doc/en/*.txt + * contrib/hbziparc/doc/en/*.txt + * contrib/rddads/doc/en/*.txt + ! fixed few broken tags reported by Carlos + % deleted line ending spaces + * some minor formatting + + * contrib/hbnf/*.c + * contrib/hbnf/*.h + * extras/gfspell/spellc.c + * uncrustified with updated hb_c.cfg + + * contrib/hbnf/*.prg + * contrib/hbnf/tests/*.prg + * hbformatted with Mauriozo's patch. + * a few manual corrections (avoiding #translates, using hb_ColorIndex()) + in general and to make hbformat happy. + + + contrib/hbnf/tests/menuto.prg + + added sample code for MENU TO (adatped from docs) + + - src/rdd/dbfntx/dbfntx0.prg + - deleted unused file with no enabled code in it + + * contrib/hbtip/tests/dbtohtml.prg + * contrib/hbtip/tests/loadhtml.prg + * contrib/hbtip/tests/tipmmail.prg + * minor cleanups + + * contrib/hbtip/thtml.prg + ! fixed typo due to s&r + % use hb_memowrit() + + * src/rtl/tbrowse.prg + * conditional code sorted to be hbformat friendly + * some formatting + + * INSTALL + * package/harbour.rb + * package/mpkg_src_nightly.sh + * package/mpkg_win_nightly.bat + * package/updt_web_nightly.sh + * website/changelog.html + * website/faq/harbour17.html + * website/faq/harbour27.html + * website/index.html + * website/menu/harbour-menu.js + * updated repository URL to new sf.net one + + * tests/function.cfm + * contrib/hbhttpd/tests/tpl/_main.tpl + * contrib/hbtip/tests/tipmmail.prg + * website/faq/*.html + * website/samples/*.html + * use utf-8 in html and email + + * contrib/hbrun/hbrun.hbp + + support for HBMK_WITH_GTXWC + + * tests/rto_get.prg + * tests/onidle.prg + * tests/mousetst.prg + * tests/wcecon.prg + * tests/vmasort.prg + - contrib/hbnf/tests/metaph.prg + * minor cleanups + + * contrib/hbmysql/tests/test.prg + * contrib/hbmysql/tests/dbf2mysq.prg + % minor optimization, deleted outdated comment/line + + * src/compiler/harbour.yyc + * src/compiler/harbour.y + * minor formatting + 2012-10-30 08:59 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * harbour/contrib/xhb/filestat.c ! fixed resource leak in FILESTATS() function caused by wrong close diff --git a/harbour/INSTALL b/harbour/INSTALL index 81ba6014c1..6c0f92224a 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -1266,7 +1266,7 @@ HARBOUR You'll need Subversion (SVN) version control software installed on your system, and issue this command: - svn co https://harbour-project.svn.sourceforge.net/svnroot/harbour-project/trunk/harbour + svn co https://svn.code.sf.net/p/harbour-project/code/trunk/harbour harbour You can get subsequent updates using this command: svn update @@ -1808,16 +1808,13 @@ HARBOUR http://groups.google.com/group/harbour-devel/ Development Timeline: - http://sourceforge.net/apps/trac/harbour-project/timeline/ + https://github.com/svn2github/harbour/commits/master Bug Tracker: - http://sourceforge.net/tracker/?group_id=681 + http://sourceforge.net/p/harbour-project/bugs/ Source Repository Browser: - http://harbour-project.svn.sourceforge.net/viewvc/harbour-project/ - - Source Repository Checkout (anonymous) [needs Subversion]: - svn co https://harbour-project.svn.sourceforge.net/svnroot/harbour-project/trunk/harbour + http://sourceforge.net/p/harbour-project/code/ CA-Cl*pper 5.3 online documentation: http://x-hacker.org/ng/53guide/ @@ -1827,9 +1824,9 @@ HARBOUR Particularly: Comparing Harbour to xHarbour: - http://harbour-project.svn.sourceforge.net/svnroot/harbour-project/trunk/harbour/doc/xhb-diff.txt + http://svn.code.sf.net/p/harbour-project/code/trunk/harbour/doc/xhb-diff.txt ChangeLog: - http://harbour-project.svn.sourceforge.net/svnroot/harbour-project/trunk/harbour/ChangeLog + http://svn.code.sf.net/p/harbour-project/code/trunk/harbour/ChangeLog [ Copyright (c) 2009-2012 Viktor Szakats (harbour syenar.net) diff --git a/harbour/bin/3rdpatch.hb b/harbour/bin/3rdpatch.hb index cea854d6fd..81dbc852a0 100755 --- a/harbour/bin/3rdpatch.hb +++ b/harbour/bin/3rdpatch.hb @@ -220,9 +220,9 @@ #include "directry.ch" #if defined( _TRACE ) - #define TRACE( str ) OutStd( "T: " + str + hb_eol() ) +# define TRACE( str ) OutStd( "T: " + str + hb_eol() ) #else - #define TRACE( str ) +# define TRACE( str ) #endif #define ONEARG_KW 2 /* one-arg line keyword */ @@ -280,19 +280,19 @@ PROCEDURE Main( ... ) FOR EACH cArg IN hb_AParams() SWITCH cArg - CASE "-rediff" - lRediff := .T. - EXIT - CASE "-validate" - lValidateOnly := .T. - EXIT - CASE "-h" - CASE "-help" - CASE "--help" - CASE "/?" - Usage( 0 ) - OTHERWISE - Usage( 1 ) + CASE "-rediff" + lRediff := .T. + EXIT + CASE "-validate" + lValidateOnly := .T. + EXIT + CASE "-h" + CASE "-help" + CASE "--help" + CASE "/?" + Usage( 0 ) + OTHERWISE + Usage( 1 ) ENDSWITCH NEXT @@ -323,7 +323,7 @@ PROCEDURE Main( ... ) /* Process one-arg keywords */ IF aRegexMatch[ ONEARG_KW ] == "DIFF" cDiffFile := iif( Empty( AllTrim( aRegexMatch[ ONEARG_ARG ] ) ), NIL, ; - AllTrim( aRegexMatch[ ONEARG_ARG ] ) ) + AllTrim( aRegexMatch[ ONEARG_ARG ] ) ) ELSEIF aRegexMatch[ ONEARG_KW ] == "URL" cArchiveURL := AllTrim( aRegexMatch[ ONEARG_ARG ] ) ENDIF @@ -334,7 +334,7 @@ PROCEDURE Main( ... ) /* Do not allow implicit destination with non-flat source spec */ IF Empty( aRegexMatch[ TWOARG_ARG1 ] ) .AND. "/" $ aRegexMatch[ TWOARG_ARG2 ] OutStd( hb_StrFormat( "E: Non-flat source spec with implicit " + ; - "destination, offending line %d:%s:", nMemoLine, hb_eol() ) ) + "destination, offending line %d:%s:", nMemoLine, hb_eol() ) ) OutStd( aRegexMatch[ 1 ] + hb_eol() ) ErrorLevel( 2 ) QUIT @@ -342,7 +342,7 @@ PROCEDURE Main( ... ) /* Do not allow tree spec in the destination ever */ IF "/" $ aRegexMatch[ TWOARG_ARG2 ] OutStd( hb_StrFormat( "E: Non-flat destination, offending line %d:%s", ; - nMemoLine, hb_eol() ) ) + nMemoLine, hb_eol() ) ) OutStd( aRegexMatch[ 1 ] + hb_eol() ) ErrorLevel( 2 ) QUIT @@ -355,8 +355,8 @@ PROCEDURE Main( ... ) /* The destination argument must fit in the 8+3 scheme */ IF Len( hb_FNameName( aRegexMatch[ TWOARG_ARG2 ] ) ) > 8 .OR. ; Len( hb_FNameExt( aRegexMatch[ TWOARG_ARG2 ] ) ) > 4 - OutStd( hb_StrFormat( "E: Destination does not fit 8+3, offending "+ ; - "line %d:%s", nMemoLine, hb_eol() ) ) + OutStd( hb_StrFormat( "E: Destination does not fit 8+3, offending " + ; + "line %d:%s", nMemoLine, hb_eol() ) ) OutStd( aRegexMatch[ 1 ] + hb_eol() ) ErrorLevel( 2 ) QUIT @@ -368,16 +368,16 @@ PROCEDURE Main( ... ) */ AAdd( s_aChangeMap, { ; iif( Empty( aRegexMatch[ TWOARG_ARG1 ] ), ; - aRegexMatch[ TWOARG_ARG2 ], ; - aRegexMatch[ TWOARG_ARG1 ] ), aRegexMatch[ TWOARG_ARG2 ] ; - } ) + aRegexMatch[ TWOARG_ARG2 ], ; + aRegexMatch[ TWOARG_ARG1 ] ), aRegexMatch[ TWOARG_ARG2 ] ; + } ) /* If this is the first MAP entry, treat the original part as the * source tree root indicator */ IF Len( s_aChangeMap ) == 1 cTopIndicator := s_aChangeMap[ 1 ][ FN_ORIG ] IF "/" $ cTopIndicator OutStd( hb_StrFormat( "E: First `MAP' entry is not flat, offending " + ; - "line %d:%s", nMemoLine, hb_eol() ) ) + "line %d:%s", nMemoLine, hb_eol() ) ) OutStd( aRegexMatch[ 1 ] + hb_eol() ) ErrorLevel( 2 ) QUIT @@ -405,9 +405,9 @@ PROCEDURE Main( ... ) cCWD := hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() - #if defined( _CURDIR ) - cRoot := cCWD + hb_ps() - #endif +#if defined( _CURDIR ) + cRoot := cCWD + hb_ps() +#endif FClose( hb_FTempCreateEx( @s_cTempDir, cRoot, hb_FNameName( hb_ProgName() ) + "_" ) ) FErase( s_cTempDir ) @@ -452,7 +452,7 @@ PROCEDURE Main( ... ) ELSE /* Create the `pristine tree' */ hb_FCopy( CombinePath( s_cSourceRoot, aOneMap[ FN_ORIG ] ), ; - CombinePath( s_cTempDir, cThisComponent + ".orig", aOneMap[ FN_HB ] ) ) + CombinePath( s_cTempDir, cThisComponent + ".orig", aOneMap[ FN_HB ] ) ) /* Munch the file, applying the appropriate xforms */ hb_FileTran( CombinePath( s_cTempDir, cThisComponent + ".orig", aOneMap[ FN_HB ] ) ) @@ -462,12 +462,12 @@ PROCEDURE Main( ... ) IF lRediff hb_FCopy( aOneMap[ FN_HB ], ; - CombinePath( s_cTempDir, cThisComponent, aOneMap[ FN_HB ] ) ) + CombinePath( s_cTempDir, cThisComponent, aOneMap[ FN_HB ] ) ) ELSE /* Copy it to `our tree' */ - hb_FCopy( CombinePath( s_cTempDir, cThisComponent + ".orig", aOneMap[ FN_HB ] ),; - CombinePath( s_cTempDir, cThisComponent, aOneMap[ FN_HB ] ) ) + hb_FCopy( CombinePath( s_cTempDir, cThisComponent + ".orig", aOneMap[ FN_HB ] ), ; + CombinePath( s_cTempDir, cThisComponent, aOneMap[ FN_HB ] ) ) ENDIF ENDIF @@ -477,9 +477,9 @@ PROCEDURE Main( ... ) IF ! lRediff /* If we have a local diff, and are not to re-create it, apply */ cCommand := hb_StrFormat( "%s --no-backup-if-mismatch -d %s -p 1 -i %s", ; - s_aTools[ "patch" ], ; - CombinePath( s_cTempDir, cThisComponent ), ; - CombinePath( cCWD, cDiffFile ) ) + s_aTools[ "patch" ], ; + CombinePath( s_cTempDir, cThisComponent ), ; + CombinePath( cCWD, cDiffFile ) ) TRACE( "Running " + cCommand ) nRunResult := hb_processRun( cCommand, , @cStdOut, @cStdErr, .F. ) SaveLog( "patch", cStdOut, cStdErr ) @@ -491,7 +491,7 @@ PROCEDURE Main( ... ) /* Re-create the diff */ cCommand := hb_StrFormat( "%s -urN %s %s", ; - s_aTools[ "diff" ], cThisComponent + ".orig", cThisComponent ) + s_aTools[ "diff" ], cThisComponent + ".orig", cThisComponent ) DirChange( s_cTempDir ) TRACE( "Running " + cCommand ) @@ -556,6 +556,7 @@ STATIC PROCEDURE SetupTools() /* Look for g$tool first, only attempt raw name if it isn't found * Helps non-GNU userland systems with GNU tools installed. * Only several of the tools are known to have GNU variants. */ + FOR EACH cPathComp IN hb_ATokens( hb_GetEnv( "PATH" ), hb_osPathListSeparator() ) FOR EACH cTool IN hb_HKeys( s_aTools ) IF cTool $ "patch|diff|tar" .AND. hb_FileExists( CombinePath( cPathComp, "g" + cTool ) + cExeExt ) @@ -641,33 +642,33 @@ STATIC FUNCTION FetchAndExtract( cArchiveURL ) * pick one of these, refrain from the more exotic ones. */ LOCAL aActionMap := { ; - '.tar.gz|.tgz' => { ; - 'Extractor' => 'gzip', ; - 'ExtractorArgs' => '-d', ; - 'ExtractedFile' => '.tar', ; - 'Archiver' => 'tar', ; - 'ArchiverArgs' => '--force-local -xvf' ; + ".tar.gz|.tgz" => { ; + "Extractor" => "gzip", ; + "ExtractorArgs" => "-d", ; + "ExtractedFile" => ".tar", ; + "Archiver" => "tar", ; + "ArchiverArgs" => "--force-local -xvf" ; }, ; - '.tar.bz2|.tbz|.tbz2' => { ; - 'Extractor' => 'bzip2', ; - 'ExtractorArgs' => '-d', ; - 'ExtractedFile' => '.tar', ; - 'Archiver' => 'tar', ; - 'ArchiverArgs' => '--force-local -xvf' ; + ".tar.bz2|.tbz|.tbz2" => { ; + "Extractor" => "bzip2", ; + "ExtractorArgs" => "-d", ; + "ExtractedFile" => ".tar", ; + "Archiver" => "tar", ; + "ArchiverArgs" => "--force-local -xvf" ; }, ; - '.tar.xz|.txz' => { ; - 'Extractor' => 'xz', ; - 'ExtractorArgs' => '-d', ; - 'ExtractedFile' => '.tar', ; - 'Archiver' => 'tar', ; - 'ArchiverArgs' => '--force-local -xvf' ; + ".tar.xz|.txz" => { ; + "Extractor" => "xz", ; + "ExtractorArgs" => "-d", ; + "ExtractedFile" => ".tar", ; + "Archiver" => "tar", ; + "ArchiverArgs" => "--force-local -xvf" ; }, ; - '.zip' => { ; - 'Extractor' => NIL, ; - 'ExtractorArgs' => NIL, ; - 'ExtractedFile' => NIL, ; - 'Archiver' => 'unzip', ; - 'ArchiverArgs' => '' ; + ".zip" => { ; + "Extractor" => NIL, ; + "ExtractorArgs" => NIL, ; + "ExtractedFile" => NIL, ; + "Archiver" => "unzip", ; + "ArchiverArgs" => "" ; } ; } @@ -682,16 +683,16 @@ STATIC FUNCTION FetchAndExtract( cArchiveURL ) FOR EACH cFrag IN hb_ATokens( cPattern, "|" ) IF At( cFrag, cFileName ) != 0 cMatchedPattern := cFrag - cExtractor := aActionMap[ cPattern ][ 'Extractor' ] - cExtractorArgs := aActionMap[ cPattern ][ 'ExtractorArgs' ] - cExtractedFileName := iif( aActionMap[ cPattern ][ 'ExtractedFile' ] == NIL, ; + cExtractor := aActionMap[ cPattern ][ "Extractor" ] + cExtractorArgs := aActionMap[ cPattern ][ "ExtractorArgs" ] + cExtractedFileName := iif( aActionMap[ cPattern ][ "ExtractedFile" ] == NIL, ; NIL, ; Left( cFileName, Len( cFileName ) - ; Len( cMatchedPattern ) ) + ; - aActionMap[ cPattern ][ 'ExtractedFile' ] ; + aActionMap[ cPattern ][ "ExtractedFile" ] ; ) - cArchiver := aActionMap[ cPattern ][ 'Archiver' ] - cArchiverArgs := aActionMap[ cPattern ][ 'ArchiverArgs' ] + cArchiver := aActionMap[ cPattern ][ "Archiver" ] + cArchiverArgs := aActionMap[ cPattern ][ "ArchiverArgs" ] EXIT ENDIF NEXT @@ -699,7 +700,7 @@ STATIC FUNCTION FetchAndExtract( cArchiveURL ) IF cArchiver == NIL OutStd( "E: Can not find archiver for `" + ; - hb_FNameNameExt( cArchiveURL ) + "'" + hb_eol() ) + hb_FNameNameExt( cArchiveURL ) + "'" + hb_eol() ) RETURN .F. ENDIF @@ -709,7 +710,7 @@ STATIC FUNCTION FetchAndExtract( cArchiveURL ) RETURN .F. ENDIF cCommand := hb_StrFormat( "%s -L -# -o %s %s", s_aTools[ "curl" ], ; - CombinePath( s_cTempDir, cFileName ), FNameEscape( cArchiveURL ) ) + CombinePath( s_cTempDir, cFileName ), FNameEscape( cArchiveURL ) ) TRACE( "Running " + cCommand ) nResult := hb_processRun( cCommand, , , @cStdErr, .F. ) SaveLog( "fetch", cStdOut, cStdErr ) @@ -725,7 +726,7 @@ STATIC FUNCTION FetchAndExtract( cArchiveURL ) RETURN .F. ENDIF cCommand := hb_StrFormat( "%s " + cExtractorArgs + " %s", ; - cExtractor, CombinePath( s_cTempDir, cFileName ) ) + cExtractor, CombinePath( s_cTempDir, cFileName ) ) TRACE( "Running " + cCommand ) nResult := hb_processRun( cCommand, , @cStdOut, @cStdErr, .F. ) SaveLog( "extract", cStdOut, cStdErr ) @@ -743,7 +744,7 @@ STATIC FUNCTION FetchAndExtract( cArchiveURL ) RETURN .F. ENDIF cCommand := hb_StrFormat( "%s " + cArchiverArgs + " %s", ; - cArchiver, CombinePath( s_cTempDir, cExtractedFileName ) ) + cArchiver, CombinePath( s_cTempDir, cExtractedFileName ) ) TRACE( "Running " + cCommand ) cCWD := hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() DirChange( CombinePath( s_cTempDir, "root" ) ) @@ -834,19 +835,20 @@ STATIC FUNCTION hb_FileTran( cFileName ) /* Local-style includes */ cTransformedContent := StrTran( cTransformedContent, ; - Chr( 34 ) + cChangeFrom + Chr( 34 ), ; - Chr( 34 ) + cChangeTo + Chr( 34 ) ) + Chr( 34 ) + cChangeFrom + Chr( 34 ), ; + Chr( 34 ) + cChangeTo + Chr( 34 ) ) /* System-style include */ cTransformedContent := StrTran( cTransformedContent, ; - "<" + cChangeFrom + ">", ; - "<" + cChangeTo + ">" ) + "<" + cChangeFrom + ">", ; + "<" + cChangeTo + ">" ) NEXT RETURN hb_MemoWrit( cFileName, cTransformedContent ) STATIC FUNCTION FNameEscape( cFileName ) + #if defined( __PLATFORM__UNIX ) RETURN cFileName #else diff --git a/harbour/bin/commit.hb b/harbour/bin/commit.hb index e3f5f2cb38..f94b5ddcf7 100644 --- a/harbour/bin/commit.hb +++ b/harbour/bin/commit.hb @@ -48,7 +48,7 @@ PROCEDURE Main() LOCAL cOldLang IF Empty( aChanges ) - OutStd( hb_progname() + ": no changes" + hb_eol() ) + OutStd( hb_ProgName() + ": no changes" + hb_eol() ) RETURN ENDIF @@ -62,12 +62,12 @@ PROCEDURE Main() nOffset := hb_UTCOffset() - cLogNew := hb_StrFormat( "%1$s UTC%2$s%3$02d%4$02d %5$s",; - hb_TToC( hb_DateTime(), "YYYY-MM-DD", "HH:MM" ),; - iif( nOffset < 0, "-", "+" ),; - Int( nOffset / 3600 ),; - Int( ( ( nOffset / 3600 ) - Int( nOffset / 3600 ) ) * 60 ),; - cMyName ) + hb_eol() + cLogNew := hb_StrFormat( "%1$s UTC%2$s%3$02d%4$02d %5$s", ; + hb_TToC( hb_DateTime(), "YYYY-MM-DD", "HH:MM" ), ; + iif( nOffset < 0, "-", "+" ), ; + Int( nOffset / 3600 ), ; + Int( ( ( nOffset / 3600 ) - Int( nOffset / 3600 ) ) * 60 ), ; + cMyName ) + hb_eol() FOR EACH cLine IN aChanges cLogNew += cLine + hb_eol() @@ -108,6 +108,7 @@ STATIC FUNCTION VCSDetect() RETURN "" STATIC FUNCTION DoctorChanges( cVCS, aChanges ) + LOCAL cLine LOCAL cStart LOCAL aNew := {} @@ -180,23 +181,25 @@ STATIC FUNCTION DoctorChanges( cVCS, aChanges ) STATIC FUNCTION Shell() + LOCAL cShell - #if defined( __PLATFORM__UNIX ) - cShell := hb_GetEnv( "SHELL" ) - #else - cShell := hb_GetEnv( "COMSPEC" ) - #endif +#if defined( __PLATFORM__UNIX ) + cShell := hb_GetEnv( "SHELL" ) +#else + cShell := hb_GetEnv( "COMSPEC" ) +#endif IF ! Empty( cShell ) - #if ! defined( __PLATFORM__UNIX ) - cShell := cShell + " /c" - #endif +#if ! defined( __PLATFORM__UNIX ) + cShell := cShell + " /c" +#endif ENDIF RETURN cShell STATIC FUNCTION Changes( cVCS ) + LOCAL cStdOut := "" DO CASE diff --git a/harbour/bin/find.hb b/harbour/bin/find.hb index bccb4f0e04..4e2b113ca7 100644 --- a/harbour/bin/find.hb +++ b/harbour/bin/find.hb @@ -35,6 +35,7 @@ PROCEDURE Main( cContains ) RETURN STATIC PROCEDURE WalkDir( cDir, cContains ) + LOCAL aFile FOR EACH aFile IN Directory( cDir + hb_osFileMask(), "D" ) @@ -49,6 +50,7 @@ STATIC PROCEDURE WalkDir( cDir, cContains ) RETURN STATIC PROCEDURE ProcessFile( cFileName, cContains ) + LOCAL cDynamic LOCAL lFirst := .T. @@ -65,6 +67,7 @@ STATIC PROCEDURE ProcessFile( cFileName, cContains ) RETURN STATIC FUNCTION __hb_extern_get_exception_list( cInputName ) + LOCAL cFile LOCAL pRegex LOCAL tmp diff --git a/harbour/config/hb_c.cfg b/harbour/config/hb_c.cfg index 42e7e9a6e7..a864e76f2a 100644 --- a/harbour/config/hb_c.cfg +++ b/harbour/config/hb_c.cfg @@ -11,13 +11,13 @@ indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs align_with_tabs = false # use tabs to align -align_on_tabstop = TRUE # align on tabstops +align_on_tabstop = false # align on tabstops input_tab_size = 8 # original tab size output_tab_size = 3 # new tab size indent_columns = output_tab_size indent_switch_case = indent_columns indent_label = 2 # pos: absolute col, neg: relative column - +utf8_bom = remove # ignore/add/remove/force # # inter-symbol newlines @@ -37,7 +37,7 @@ nl_brace_else = force # "} else" vs "} \n else" - cuddle else nl_func_var_def_blk = 1 nl_fcall_brace = force # "list_for_each() {" vs "list_for_each()\n{" nl_fdef_brace = force # "int foo() {" vs "int foo()\n{" -# nl_after_return = TRUE; +# nl_after_return = true; # nl_before_case = 1 @@ -553,18 +553,24 @@ sp_endif_cmt = ignore # ignore/add/remove/force # align_enum_equ_span = 4 # '=' in enum definition -# align_nl_cont = TRUE -align_var_def_span = 3 -# align_var_def_inline = TRUE -# align_var_def_star = FALSE -# align_var_def_colon = TRUE -align_assign_span = 3 +# align_nl_cont = true +# align_var_def_inline = true +# align_var_def_star = false +# align_var_def_colon = true +align_var_struct_thresh = 8 +align_var_struct_span = 1 +align_var_struct_gap = 1 +align_var_def_thresh = 8 +align_var_def_span = 1 +align_var_def_gap = 1 +align_assign_thresh = 8 +align_assign_span = 1 align_struct_init_span = 3 # align stuff in a structure init '= { }' align_right_cmt_span = 3 -align_pp_define_span = 8; -# align_pp_define_gap = 4; +align_pp_define_span = 8 +align_pp_define_gap = 2 -# cmt_star_cont = FALSE +# cmt_star_cont = false # indent_brace = 0 diff --git a/harbour/config/postinst.hb b/harbour/config/postinst.hb index 8d2cc66fd4..bae777a3db 100644 --- a/harbour/config/postinst.hb +++ b/harbour/config/postinst.hb @@ -19,6 +19,7 @@ #include "fileio.ch" PROCEDURE Main( ... ) + LOCAL nErrorLevel := 0 LOCAL aFile @@ -121,11 +122,12 @@ PROCEDURE Main( ... ) OutStd( "! Copying *nix man files..." + hb_eol() ) IF hb_DirBuild( PathSepToSelf( GetEnvC( "HB_INSTALL_MAN" ) ) + hb_ps() + "man1" ) - FOR EACH tmp IN { "src/main/harbour.1" ,; - "src/pp/hbpp.1" ,; - "utils/hbmk2/hbmk2.1" ,; - "utils/hbtest/hbtest.1" ,; - "contrib/hbrun/hbrun.1" } + FOR EACH tmp IN { ; + "src/main/harbour.1", ; + "src/pp/hbpp.1", ; + "utils/hbmk2/hbmk2.1", ; + "utils/hbtest/hbtest.1", ; + "contrib/hbrun/hbrun.1" } mk_hb_FCopy( tmp, GetEnvC( "HB_INSTALL_MAN" ) + hb_ps() + "man1" + hb_ps(), .T. ) NEXT ELSE @@ -157,8 +159,7 @@ PROCEDURE Main( ... ) mk_hb_FLinkSym( "harbour" + hb_ps() + cDynVersionFull, PathSepToSelf( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + ".." + hb_ps() + cDynVersionFull ) CASE GetEnvC( "HB_INSTALL_DYN" ) == "/usr/local/harbour/lib" - /* TOFIX: Rewrite this in .prg */ - #if 0 + /* TOFIX: Rewrite this in .prg: ld="/usr/lib" if [ -n "${HB_INST_PKGPREF}" ] || [ -w $ld ] then @@ -166,7 +167,7 @@ PROCEDURE Main( ... ) ln -sf ../local/harbour/lib/$l ${HB_INST_PKGPREF}$ld/$ll ln -sf ../local/harbour/lib/$l ${HB_INST_PKGPREF}$ld/$l fi - #endif + */ ENDCASE ENDIF @@ -180,8 +181,8 @@ PROCEDURE Main( ... ) FOR EACH tmp IN Directory( "utils" + hb_ps() + hb_osFileMask(), "D" ) IF "D" $ tmp[ F_ATTR ] .AND. !( tmp[ F_NAME ] == "." ) .AND. !( tmp[ F_NAME ] == ".." ) FOR EACH aFile IN Directory( "utils" + hb_ps() + tmp[ F_NAME ] + hb_ps() + "*.po" ) - mk_hbl( "utils" + hb_ps() + tmp[ F_NAME ] + hb_ps() + aFile[ F_NAME ],; - PathSepToSelf( GetEnvC( "HB_INSTALL_BIN" ) ) + hb_ps() + hb_FNameExtSet( aFile[ F_NAME ], ".hbl" ) ) + mk_hbl( "utils" + hb_ps() + tmp[ F_NAME ] + hb_ps() + aFile[ F_NAME ], ; + PathSepToSelf( GetEnvC( "HB_INSTALL_BIN" ) ) + hb_ps() + hb_FNameExtSet( aFile[ F_NAME ], ".hbl" ) ) NEXT ENDIF NEXT @@ -217,11 +218,11 @@ PROCEDURE Main( ... ) cOldDir := hb_cwd( GetEnvC( "HB_INSTALL_PKG_ROOT" ) ) - mk_hb_processRun( PathSepToSelf( GetEnvC( "HB_DIR_ZIP" ) ) + "zip" +; - " -q -9 -X -r -o" +; - " " + FNameEscape( tmp ) +; - " . -i " + FNameEscape( GetEnvC( "HB_PKGNAME" ) + hb_ps() + "*" ) +; - " -x *.tds -x *.exp" ) + mk_hb_processRun( PathSepToSelf( GetEnvC( "HB_DIR_ZIP" ) ) + "zip" + ; + " -q -9 -X -r -o" + ; + " " + FNameEscape( tmp ) + ; + " . -i " + FNameEscape( GetEnvC( "HB_PKGNAME" ) + hb_ps() + "*" ) + ; + " -x *.tds -x *.exp" ) hb_cwd( cOldDir ) @@ -231,9 +232,9 @@ PROCEDURE Main( ... ) OutStd( "! Making Harbour .exe install package: '" + tmp + "'" + hb_eol() ) - mk_hb_processRun( PathSepToSelf( GetEnvC( "HB_DIR_NSIS" ) ) + "makensis.exe" +; - " -V2" +; - " " + FNameEscape( StrTran( "package/mpkg_win.nsi", "/", hb_ps() ) ) ) + mk_hb_processRun( PathSepToSelf( GetEnvC( "HB_DIR_NSIS" ) ) + "makensis.exe" + ; + " -V2" + ; + " " + FNameEscape( StrTran( "package/mpkg_win.nsi", "/", hb_ps() ) ) ) ENDIF ELSE cBin_Tar := "tar" @@ -261,18 +262,19 @@ PROCEDURE Main( ... ) FErase( cTar_Path ) cOwner := "root" - cGroup := iif( GetEnvC( "HB_PLATFORM" ) == "darwin" .OR. ; - GetEnvC( "HB_PLATFORM" ) == "bsd", "wheel", "root" ) + cGroup := iif( ; + GetEnvC( "HB_PLATFORM" ) == "darwin" .OR. ; + GetEnvC( "HB_PLATFORM" ) == "bsd", "wheel", "root" ) cOldDir := hb_cwd( GetEnvC( "HB_INSTALL_PKG_ROOT" ) ) /* TODO: Add support for non-GNU non-BSD tar (which gets the data from stdio) */ - mk_hb_processRun( cBin_Tar +; - " czvf" +; - " " + FNameEscape( cTar_Path ) +; - iif( lGNU_Tar, " --owner=" + cOwner + " --group=" + cGroup, "" ) +; - " ." ) + mk_hb_processRun( cBin_Tar + ; + " czvf" + ; + " " + FNameEscape( cTar_Path ) + ; + iif( lGNU_Tar, " --owner=" + cOwner + " --group=" + cGroup, "" ) + ; + " ." ) hb_cwd( cOldDir ) @@ -334,6 +336,7 @@ PROCEDURE Main( ... ) RETURN STATIC FUNCTION mk_hbl( cIn, cOut ) + LOCAL cErrorMsg LOCAL aTrans @@ -352,6 +355,7 @@ STATIC FUNCTION mk_hbl( cIn, cOut ) RETURN .F. STATIC FUNCTION mk_hbd_core( cDirSource, cDirDest ) + LOCAL cName := "harbour" LOCAL tmp @@ -388,9 +392,10 @@ STATIC FUNCTION PathSepToSelf( cFileName ) /* Like hb_FCopy(), but accepts dir as target and can set attributes */ STATIC PROCEDURE mk_hb_FCopy( cSrc, cDst, l644 ) + LOCAL cDir, cName, cExt - IF ! hb_isLogical( l644 ) + IF ! HB_ISLOGICAL( l644 ) l644 := .F. ENDIF @@ -434,6 +439,7 @@ STATIC FUNCTION EndsWith( cString, cEnd ) RETURN Right( cString, Len( cEnd ) ) == cEnd STATIC FUNCTION query_stdout( cName ) + LOCAL cStdOut LOCAL cStdErr LOCAL nRetVal @@ -443,6 +449,7 @@ STATIC FUNCTION query_stdout( cName ) RETURN iif( nRetVal == 0, AllTrim( StrTran( cStdOut, Chr( 10 ), " " ) ), "" ) STATIC FUNCTION query_rpm( cName, cID ) + LOCAL cResult := query_stdout( "rpm -q --queryformat='.%{VERSION}' " + cName ) RETURN iif( Empty( cResult ), "", cID + AllTrim( StrTran( StrTran( cResult, Chr( 10 ), " " ), "." ) ) ) @@ -450,6 +457,7 @@ STATIC FUNCTION query_rpm( cName, cID ) /* Please add your distro suffix if it not belong to the one recognized below and remember that order checking can be important */ STATIC FUNCTION unix_name() + LOCAL tmp DO CASE @@ -469,6 +477,7 @@ STATIC FUNCTION unix_name() RETURN StrTran( Lower( query_stdout( "uname -s" ) ), " ", "_" ) STATIC FUNCTION mk_extern_core() + LOCAL aExtern IF GetEnvC( "HB_REBUILD_EXTERN" ) == "yes" .AND. ; @@ -492,6 +501,7 @@ STATIC FUNCTION mk_extern_core() RETURN .F. STATIC FUNCTION GetEnvC( cEnvVar ) + STATIC s_hEnvCache := { => } IF cEnvVar $ s_hEnvCache @@ -507,6 +517,7 @@ STATIC FUNCTION GetEnvC( cEnvVar ) #define _HB_SELF_SUFFIX "__" STATIC FUNCTION __hb_extern_get_list( cInputName ) + LOCAL aExtern := NIL LOCAL hExtern @@ -573,6 +584,7 @@ STATIC FUNCTION __hb_extern_get_list( cInputName ) RETURN aExtern STATIC PROCEDURE __hb_extern_get_exception_list( cInputName, /* @ */ aInclude, /* @ */ aExclude, /* @ */ hDynamic ) + LOCAL cFile LOCAL pRegex LOCAL tmp @@ -602,6 +614,7 @@ STATIC PROCEDURE __hb_extern_get_exception_list( cInputName, /* @ */ aInclude, / RETURN STATIC FUNCTION __hb_extern_gen( aFuncList, cOutputName ) + LOCAL aExtern LOCAL cExtern LOCAL tmp @@ -613,9 +626,10 @@ STATIC FUNCTION __hb_extern_gen( aFuncList, cOutputName ) LOCAL cSelfName := _HB_SELF_PREFIX + Upper( hb_FNameName( cOutputName ) ) + _HB_SELF_SUFFIX LOCAL cLine := "/* " + Replicate( "-", 68 ) + hb_eol() - LOCAL cHelp := " * Syntax: // HB_FUNC_INCLUDE " + hb_eol() +; - " * // HB_FUNC_EXCLUDE " + hb_eol() +; - " */" + hb_eol() + LOCAL cHelp := ; + " * Syntax: // HB_FUNC_INCLUDE " + hb_eol() + ; + " * // HB_FUNC_EXCLUDE " + hb_eol() + ; + " */" + hb_eol() __hb_extern_get_exception_list( cOutputName, @aInclude, @aExclude, @hDynamic ) diff --git a/harbour/contrib/gtwvg/class.prg b/harbour/contrib/gtwvg/class.prg index b96945fccf..febeb21d22 100644 --- a/harbour/contrib/gtwvg/class.prg +++ b/harbour/contrib/gtwvg/class.prg @@ -298,7 +298,7 @@ METHOD wvtDialog:Create() IF !Empty( ::aObjects[ i ]:aPaint ) FOR j := 1 TO Len( ::aObjects[ i ]:aPaint ) wvg_SetPaint( ::cPaintBlockID, ::nPaintID++, ; - ::aObjects[ i ]:aPaint[ j,1 ], ::aObjects[ i ]:aPaint[ j,2 ] ) + ::aObjects[ i ]:aPaint[ j, 1 ], ::aObjects[ i ]:aPaint[ j, 2 ] ) NEXT ENDIF NEXT @@ -345,17 +345,17 @@ METHOD wvtDialog:Destroy() SetColor( ::cOldColor ) SetCursor( ::nOldCursor ) - IF ::oldMenuHandle != nil .AND. ::oldMenuHandle != 0 + IF ::oldMenuHandle != NIL .AND. ::oldMenuHandle != 0 Wvt_SetMenu( ::oldMenuHandle ) ENDIF SetKey( Wvt_SetMenuKeyEvent(), ::oldMenuBlock ) RestScreen( 0, 0, MaxRow(), MaxCol(), ::cScreen ) - Wvt_RestScreen( 0, 0 , MaxRow(), MaxCol(), ::aWvtScreen ) + Wvt_RestScreen( 0, 0, MaxRow(), MaxCol(), ::aWvtScreen ) wvg_PurgePaint( ::cPaintBlockID ) WvtSetPaint( ::aOldPnt ) Wvt_SetGui( ::lGui ) - RETURN nil + RETURN NIL // @@ -441,7 +441,7 @@ METHOD wvtDialog:Inkey() ::MouseOver() IF ::nObjOver == 0 Wvt_SetPointer( WVT_IDC_ARROW ) - ELSEIF ::oObjOver:nPointer != nil .AND. ::oObjOver:lActive + ELSEIF ::oObjOver:nPointer != NIL .AND. ::oObjOver:lActive Wvt_SetPointer( ::oObjOver:nPointer ) ELSE Wvt_SetPointer( WVT_IDC_ARROW ) @@ -771,7 +771,7 @@ CREATE CLASS WvtObject VAR hFont VAR aPopup INIT {} - VAR hPopup INIT nil + VAR hPopup INIT NIL VAR nPopupItemID INIT 700000 VAR nMRow INIT 0 @@ -958,7 +958,7 @@ METHOD WvtObject:Destroy() ::hPopup := nil ENDIF - RETURN Nil + RETURN NIL // @@ -973,9 +973,9 @@ METHOD WvtObject:CreatePopup() ASize( ::aPopup[ i ], 3 ) nID := ::nPopupItemID++ - ::aPopup[ i,3 ] := nID + ::aPopup[ i, 3 ] := nID - Wvt_AppendMenu( ::hPopup, MF_ENABLED + MF_STRING, nID, ::aPopup[ i,1 ] ) + Wvt_AppendMenu( ::hPopup, MF_ENABLED + MF_STRING, nID, ::aPopup[ i, 1 ] ) NEXT ENDIF @@ -996,8 +996,8 @@ METHOD WvtObject:ShowPopup() IF ( n := AScan( ::aPopup, {| e_ | e_[ 3 ] == nRet } ) ) > 0 lRet := .T. - IF HB_ISBLOCK( ::aPopup[ n,2 ] ) - Eval( ::aPopup[ n,2 ] ) + IF HB_ISBLOCK( ::aPopup[ n, 2 ] ) + Eval( ::aPopup[ n, 2 ] ) ENDIF ENDIF ENDIF @@ -1064,7 +1064,7 @@ METHOD WvtBrowse:Create() ::nTop := ::oBrw:nTop - 2 ::nLeft := ::oBrw:nLeft - 2 ::nBottom := iif( ::lHSBar, ::oBrw:nBottom, ::oBrw:nBottom + 1 ) - ::nRight := iif( ::lVSBar, ::oBrw:nRight , ::oBrw:nRight + 2 ) + ::nRight := iif( ::lVSBar, ::oBrw:nRight , ::oBrw:nRight + 2 ) #else ::nTop := ::oBrw:nTop ::nLeft := ::oBrw:nLeft @@ -1278,7 +1278,7 @@ METHOD WvtBrowse:SaveSettings() METHOD WvtBrowse:RestSettings() - IF ::xSettings != nil .AND. HB_ISBLOCK( ::bRestSettings ) + IF ::xSettings != NIL .AND. HB_ISBLOCK( ::bRestSettings ) Eval( ::bRestSettings, self ) ENDIF @@ -1294,12 +1294,12 @@ METHOD WvtBrowse:PaintBlock( nPaintObj ) CASE 1 bBlock := {|| Wvt_DrawBoxRaised( b:nTop - 2, b:nLeft - 2, b:nBottom + 1, b:nRight + 2 ) } - AAdd( ::aPaint, { bBlock, { WVT_BLOCK_BOX, b:nTop - 3,b:nLeft - 3,b:nBottom + 2,b:nRight + 3 } } ) + AAdd( ::aPaint, { bBlock, { WVT_BLOCK_BOX, b:nTop - 3, b:nLeft - 3, b:nBottom + 2, b:nRight + 3 } } ) EXIT CASE 2 bBlock := {|| Wvt_DrawBoxRecessed( b:nTop, b:nLeft, b:nBottom, b:nRight ) } - AAdd( ::aPaint, { bBlock, { WVT_BLOCK_BOX, b:nTop - 1,b:nLeft - 1,b:nBottom + 1,b:nRight + 1 } } ) + AAdd( ::aPaint, { bBlock, { WVT_BLOCK_BOX, b:nTop - 1, b:nLeft - 1, b:nBottom + 1, b:nRight + 1 } } ) EXIT CASE 3 @@ -1374,10 +1374,10 @@ METHOD WvtStatusBar:PaintBlock() LOCAL a_ := {}, nPanels - AEval( ::aPanels, {| o | AAdd( a_,o:nTop ) , AAdd( a_,o:nLeft ), ; + AEval( ::aPanels, {| o | AAdd( a_, o:nTop ), AAdd( a_, o:nLeft ), ; AAdd( a_, o:nBottom ), AAdd( a_, o:nRight ) } ) - a_[ len( a_ ) ]++ + a_[ Len( a_ ) ]++ nPanels := Len( ::aPanels ) ::bPaint := {|| Wvt_DrawStatusBar( nPanels, a_ ) } @@ -1414,7 +1414,7 @@ METHOD WvtStatusBar:SetPanels( aPanels ) FOR i := Len( ::aPanels ) - 1 TO 1 STEP - 1 oPanel := ::aPanels[ i ] - oPanel:nRight := ::aPanels[ i+1 ]:nLeft + oPanel:nRight := ::aPanels[ i + 1 ]:nLeft oPanel:cColor := ::cColor NEXT @@ -1471,7 +1471,7 @@ METHOD WvtStatusBar:Refresh() ::aPanels[ i ]:Refresh() NEXT - RETURN nil + RETURN NIL // // @@ -2232,7 +2232,7 @@ METHOD WvtPushButton:PaintButton() METHOD WvtPushButton:LeftDown() - Wvt_DrawToolButtonState( ::nTop, ::nLeft, ::nBottom, ::nRight, { 0, 0, 0, 0 } , 2 ) + Wvt_DrawToolButtonState( ::nTop, ::nLeft, ::nBottom, ::nRight, { 0, 0, 0, 0 }, 2 ) RETURN .T. @@ -2296,16 +2296,16 @@ METHOD WvtGets:Create() FOR i := 1 TO Len( ::aGetList ) - __defaultNIL( @::aGetList[ i,7 ], "N/W*,N/W*,,,N/GR*" ) - __defaultNIL( @::aGetList[ i,5 ], {|| .T. } ) - __defaultNIL( @::aGetList[ i,6 ], {|| .T. } ) + __defaultNIL( @::aGetList[ i, 7 ], "N/W*,N/W*,,,N/GR*" ) + __defaultNIL( @::aGetList[ i, 5 ], {|| .T. } ) + __defaultNIL( @::aGetList[ i, 6 ], {|| .T. } ) - AAdd( ::GetList, Get():New( ::aGetList[ i,1 ], ::aGetList[ i,2 ], {| v | iif( PCount() == 0, ::aGetList[ i,3 ], ::aGetList[ i,3 ] := v ) }, "::aGetList[ i, 3 ]", ::aGetList[ i,7 ] ) ) + AAdd( ::GetList, Get():New( ::aGetList[ i, 1 ], ::aGetList[ i, 2 ], {| v | iif( PCount() == 0, ::aGetList[ i, 3 ], ::aGetList[ i, 3 ] := v ) }, "::aGetList[ i, 3 ]", ::aGetList[ i, 7 ] ) ) ::GetList[ i ]:Display() ::PaintBlock( i ) NEXT - setPos( nCurRow, nCurCol ) + SetPos( nCurRow, nCurCol ) ::Super:Create() ::Dehilite() @@ -2318,13 +2318,13 @@ METHOD WvtGets:PaintBlock( nIndex ) LOCAL nLen, bPaint - nLen := Len( Transform( ::aGetList[ nIndex,3 ], ::aGetList[ nIndex,4 ] ) ) + nLen := Len( Transform( ::aGetList[ nIndex, 3 ], ::aGetList[ nIndex, 4 ] ) ) - bPaint := {|| Wvt_DrawBoxGet( ::aGetList[ nIndex,1 ], ::aGetList[ nIndex,2 ], nLen ) } + bPaint := {|| Wvt_DrawBoxGet( ::aGetList[ nIndex, 1 ], ::aGetList[ nIndex, 2 ], nLen ) } AAdd( ::aPaint, { bPaint, ; - { WVT_BLOCK_GETS, ::aGetList[ nIndex,1 ] - 1, ::aGetList[ nIndex,2 ] - 1, ; - ::aGetList[ nIndex,1 ] - 1, ::aGetList[ nIndex,2 ] + nLen } } ) + { WVT_BLOCK_GETS, ::aGetList[ nIndex, 1 ] - 1, ::aGetList[ nIndex, 2 ] - 1, ; + ::aGetList[ nIndex, 1 ] - 1, ::aGetList[ nIndex, 2 ] + nLen } } ) RETURN Self @@ -2479,13 +2479,13 @@ METHOD wvtScrollbar:New( oParent, nID, nTop, nLeft, nBottom, nRight ) METHOD wvtScrollbar:Create() - IF ::nTop == nil .OR. ::nLeft == nil - RETURN nil + IF ::nTop == NIL .OR. ::nLeft == nil + RETURN NIL ENDIF IF ::nBarType == WVT_SCROLLBAR_VERT __defaultNIL( @::nBottom, ::nTop + 5 ) - __defaultNIL( @::nRight , ::nLeft + 1 ) + __defaultNIL( @::nRight, ::nLeft + 1 ) ::nRight := ::nLeft + 1 ::nBottom := Max( 7, ::nBottom ) @@ -2516,7 +2516,7 @@ METHOD wvtScrollbar:Create() ::bBtnRightBottom := ; {|| Wvt_DrawScrollButton( ::nBtn2Top, ::nBtn2Left, ::nBtn2Bottom, ::nBtn2Right, ::aPxlBtnBtm, 3 ) } ::bBtnScroll := ; - {|| Wvt_DrawScrollThumbVert( ::nSTop , ::nSLeft , ::nSBottom, ::nSRight, ::aPxlScroll, ; + {|| Wvt_DrawScrollThumbVert( ::nSTop, ::nSLeft, ::nSBottom, ::nSRight, ::aPxlScroll, ; ::nThumbPos ) } ::bBtnLeftTopDep := ; {|| Wvt_DrawScrollButton( ::nBtn1Top, ::nBtn1Left, ::nBtn1Bottom, ::nBtn1Right, ::aPxlBtnTop, 1, .T. ) } @@ -2525,7 +2525,7 @@ METHOD wvtScrollbar:Create() ELSE __defaultNIL( @::nBottom, ::nTop ) - __defaultNIL( @::nRight , ::nLeft + 11 ) + __defaultNIL( @::nRight, ::nLeft + 11 ) ::nBottom := ::nTop ::nRight := Max( 11, ::nRight ) @@ -3029,7 +3029,7 @@ METHOD WvtBanner:Destroy() WVG_DeleteObject( ::oLabel:hFont ) - RETURN nil + RETURN NIL // @@ -3380,7 +3380,7 @@ METHOD wvtMenu:Destroy() IF !Wvt_DestroyMenu( ::hMenu ) #if 0 - Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:Destroy()", "Destroy menu FAILED", {},__FILE__ ) ) + Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:Destroy()", "Destroy menu FAILED", {}, __FILE__ ) ) #endif ENDIF ::hMenu := 0 @@ -3404,13 +3404,13 @@ METHOD wvtMenu:AddItem( cCaption, bAction ) aItem := { MF_SEPARATOR, 0, 0, NIL } ELSE #if 0 - Throw( ErrorNew( "wvtMenu", 3101, "wvtMenu:AddItem()", "Argument Error", { cCaption, bAction },__FILE__ ) ) + Throw( ErrorNew( "wvtMenu", 3101, "wvtMenu:AddItem()", "Argument Error", { cCaption, bAction }, __FILE__ ) ) #endif ENDIF - IF !Wvt_AppendMenu( ::hMenu, aItem[WVT_MENU_TYPE], aItem[WVT_MENU_IDENTIFIER], aItem[WVT_MENU_CAPTION] ) + IF !Wvt_AppendMenu( ::hMenu, aItem[ WVT_MENU_TYPE ], aItem[ WVT_MENU_IDENTIFIER ], aItem[ WVT_MENU_CAPTION ] ) #if 0 - Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:AddItem()", "Add menu item", { cCaption, bAction },__FILE__ ) ) + Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:AddItem()", "Add menu item", { cCaption, bAction }, __FILE__ ) ) #endif ENDIF @@ -3441,15 +3441,15 @@ METHOD wvtMenu:DelItem( nItemNum ) LOCAL lResult := .F. IF nItemNum > 0 .AND. nItemNum <= ::NumItems() - IF ::aItems[ nItemNum,WVT_MENU_TYPE ] == MF_POPUP - ::aItems[ nItemNum,WVT_MENU_MENUOBJ ]:Destroy() + IF ::aItems[ nItemNum, WVT_MENU_TYPE ] == MF_POPUP + ::aItems[ nItemNum, WVT_MENU_MENUOBJ ]:Destroy() ENDIF - IF ( lResult := Wvt_DeleteMenu( ::hMenu, nItemNum - 1,MF_BYPOSITION ) ) /* Remember ZERO base */ + IF ( lResult := Wvt_DeleteMenu( ::hMenu, nItemNum - 1, MF_BYPOSITION ) ) /* Remember ZERO base */ hb_ADel( ::aItems, nItemNum, .T. ) ELSE #if 0 - Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:DelItem()", "Delete menu item FAILED", { nItemNum },__FILE__ ) ) + Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:DelItem()", "Delete menu item FAILED", { nItemNum }, __FILE__ ) ) #endif ENDIF ENDIF @@ -3507,9 +3507,9 @@ METHOD wvtMenu:FindMenuItemById( nId ) IF !Empty( nId ) x := ::NumItems() DO WHILE x > 0 .AND. Empty( aResult ) - IF ::aItems[ x,WVT_MENU_TYPE ] == MF_POPUP - aResult := ::aItems[ x,WVT_MENU_MENUOBJ ]:FindMenuItemById( nId ) - ELSEIF ::aItems[ x,WVT_MENU_IDENTIFIER ] == nId + IF ::aItems[ x, WVT_MENU_TYPE ] == MF_POPUP + aResult := ::aItems[ x, WVT_MENU_MENUOBJ ]:FindMenuItemById( nId ) + ELSEIF ::aItems[ x, WVT_MENU_IDENTIFIER ] == nId aResult := ::aItems[ x ] ENDIF x-- @@ -3641,7 +3641,7 @@ METHOD TBrowseWVG:SetVisible() nColPos := aCol[ _TBCI_COLPOS ] IF aCol[ _TBCI_SEPWIDTH ] > 0 - nColPos += Int( aCol[ _TBCI_SEPWIDTH ]/2 ) + nColPos += Int( aCol[ _TBCI_SEPWIDTH ] / 2 ) ENDIF AAdd( ::aColumnsSep, nColPos ) diff --git a/harbour/contrib/gtwvg/crt.prg b/harbour/contrib/gtwvg/crt.prg index 03c466066a..a9d2c8987f 100644 --- a/harbour/contrib/gtwvg/crt.prg +++ b/harbour/contrib/gtwvg/crt.prg @@ -397,7 +397,7 @@ METHOD WvgCrt:destroy() IF ! ::isGT IF ::lModal - hb_gtInfo( HB_GTI_ENABLE , ::pGTp ) + hb_gtInfo( HB_GTI_ENABLE, ::pGTp ) hb_gtSelect( ::pGTp ) hb_gtInfo( HB_GTI_SETFOCUS, ::pGTp ) ENDIF diff --git a/harbour/contrib/gtwvg/drawarea.prg b/harbour/contrib/gtwvg/drawarea.prg index fd511245fa..89b8cdaf36 100644 --- a/harbour/contrib/gtwvg/drawarea.prg +++ b/harbour/contrib/gtwvg/drawarea.prg @@ -140,7 +140,7 @@ METHOD WvgDrawingArea:handleEvent( nMessage, aNM ) ENDIF IF HB_ISNUMERIC( ::hBrushBG ) WVG_SetBkMode( aNM[ 1 ], 1 ) - WVG_FillRect( aNM[ 1 ], { 0, 0, ::currentSize()[1], ::currentSize()[2] }, ::hBrushBG ) + WVG_FillRect( aNM[ 1 ], { 0, 0, ::currentSize()[ 1 ], ::currentSize()[ 2 ] }, ::hBrushBG ) RETURN EVENT_HANDELLED ENDIF diff --git a/harbour/contrib/gtwvg/htmlview.prg b/harbour/contrib/gtwvg/htmlview.prg index 2a7c755714..1ca6592c40 100644 --- a/harbour/contrib/gtwvg/htmlview.prg +++ b/harbour/contrib/gtwvg/htmlview.prg @@ -185,7 +185,7 @@ METHOD WvgHTMLViewer:xBeforeNavigate( cURL, Flags, TFName, PData, Headers ) IF PCount() >= 1 .AND. HB_ISBLOCK( ::sl_beforeNavigate ) Eval( ::sl_beforeNavigate, cURL, NIL, Self ) - RETURN nil + RETURN NIL ENDIF RETURN Self diff --git a/harbour/contrib/gtwvg/listbox.prg b/harbour/contrib/gtwvg/listbox.prg index f3e7ffac88..cfe0c5f4d8 100644 --- a/harbour/contrib/gtwvg/listbox.prg +++ b/harbour/contrib/gtwvg/listbox.prg @@ -146,7 +146,7 @@ METHOD WvgListBox:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::wvgWindow:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) ::style := WS_CHILD + WS_OVERLAPPED + WS_TABSTOP + WS_CLIPSIBLINGS + LBS_NOINTEGRALHEIGHT + LBS_WANTKEYBOARDINPUT - ::exStyle := WS_EX_CLIENTEDGE //+ WS_EX_LEFT + WS_EX_LTRREADING + WS_EX_RIGHTSCROLLBAR + ::exStyle := WS_EX_CLIENTEDGE // + WS_EX_LEFT + WS_EX_LTRREADING + WS_EX_RIGHTSCROLLBAR ::className := "LISTBOX" ::objType := objTypeListBox diff --git a/harbour/contrib/gtwvg/menubar.prg b/harbour/contrib/gtwvg/menubar.prg index d6717d0859..b4c9a06210 100644 --- a/harbour/contrib/gtwvg/menubar.prg +++ b/harbour/contrib/gtwvg/menubar.prg @@ -217,7 +217,7 @@ METHOD WvgMenuBar:destroy() IF !WVG_DestroyMenu( ::hMenu ) #if 0 - Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:Destroy()", "Destroy menu FAILED", {},__FILE__ ) ) + Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:Destroy()", "Destroy menu FAILED", {}, __FILE__ ) ) #endif ENDIF @@ -255,7 +255,7 @@ METHOD WvgMenuBar:delItem( nItemNum ) hb_ADel( ::aMenuItems, nItemNum, .T. ) ELSE #if 0 - Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:DelItem()", "Delete menu item FAILED", { nItemNum },__FILE__ ) ) + Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:DelItem()", "Delete menu item FAILED", { nItemNum }, __FILE__ ) ) #endif ENDIF ENDIF @@ -319,7 +319,7 @@ METHOD WvgMenuBar:putItem( aItem, nPos, lInsert ) CASE "O" cCaption := iif( bAction == NIL, xCaption:title, bAction ) - aItem := { MF_POPUP , xCaption:hMenu , cCaption, xCaption, nStyle, nAttrib } + aItem := { MF_POPUP, xCaption:hMenu, cCaption, xCaption, nStyle, nAttrib } EXIT CASE "N" /* Resource ID */ @@ -379,7 +379,7 @@ METHOD WvgMenuBar:findMenuItemById( nId ) DO WHILE x > 0 .AND. Empty( aResult ) IF ::aMenuItems[ x, WVT_MENU_TYPE ] == MF_POPUP - aResult := ::aMenuItems[ x,WVT_MENU_MENUOBJ ]:findMenuItemById( nId ) + aResult := ::aMenuItems[ x, WVT_MENU_MENUOBJ ]:findMenuItemById( nId ) ELSEIF ::aMenuItems[ x, WVT_MENU_IDENTIFIER ] == nId aResult := { x, ::aMenuItems[ x, WVT_MENU_ACTION ], ::sl_itemSelected, Self } @@ -401,10 +401,10 @@ METHOD WvgMenuBar:findMenuPosById( nId ) x := ::numItems() DO WHILE x > 0 .AND. Empty( nPos ) - IF ::aMenuItems[ x,WVT_MENU_TYPE ] == MF_POPUP - nPos := ::aMenuItems[ x,WVT_MENU_MENUOBJ ]:findMenuPosById( nId ) + IF ::aMenuItems[ x, WVT_MENU_TYPE ] == MF_POPUP + nPos := ::aMenuItems[ x, WVT_MENU_MENUOBJ ]:findMenuPosById( nId ) - ELSEIF ::aMenuItems[ x,WVT_MENU_IDENTIFIER ] == nId + ELSEIF ::aMenuItems[ x, WVT_MENU_IDENTIFIER ] == nId nPos := x ENDIF diff --git a/harbour/contrib/gtwvg/paint.prg b/harbour/contrib/gtwvg/paint.prg index 41db821eac..67a92cb802 100644 --- a/harbour/contrib/gtwvg/paint.prg +++ b/harbour/contrib/gtwvg/paint.prg @@ -75,7 +75,7 @@ FUNCTION Wvt_Paint() /* Call this function from this funtion */ WvtPaintObjects() - RETURN nil + RETURN NIL #endif @@ -93,31 +93,31 @@ FUNCTION WvtPaintObjects() FOR i := 1 TO nBlocks lExe := .T. - IF aBlocks[ i,3 ] != nil .AND. !Empty( aBlocks[ i,3 ] ) + IF aBlocks[ i, 3 ] != NIL .AND. !Empty( aBlocks[ i, 3 ] ) /* Check parameters against tlbr_ depending upon the * type of object and attributes contained in aAttr */ DO CASE - CASE aBlocks[ i,3,1 ] == WVT_BLOCK_GRID_V - b := aBlocks[ i,3,6 ] + CASE aBlocks[ i, 3, 1 ] == WVT_BLOCK_GRID_V + b := aBlocks[ i, 3, 6 ] IF Len( b:aColumnsSep ) == 0 lExe := .F. ELSE nLeft := b:aColumnsSep[ 1 ] - nRight := b:aColumnsSep[ len( b:aColumnsSep ) ] - IF !( tlbr_[ 1 ] <= aBlocks[ i,3,4 ] .AND. ; /* top < bottom */ - tlbr_[ 3 ] >= aBlocks[ i,3,2 ] .AND. ; /* bootm > top */ + nRight := b:aColumnsSep[ Len( b:aColumnsSep ) ] + IF !( tlbr_[ 1 ] <= aBlocks[ i, 3, 4 ] .AND. ; /* top < bottom */ + tlbr_[ 3 ] >= aBlocks[ i, 3, 2 ] .AND. ; /* bootm > top */ tlbr_[ 2 ] <= nRight + 1 .AND. ; /* left < right */ tlbr_[ 4 ] >= nLeft - 2 ) /* right > left */ lExe := .F. ENDIF ENDIF - CASE aBlocks[ i,3,1 ] == WVT_BLOCK_GETS - IF !( tlbr_[ 1 ] <= aBlocks[ i,3,4 ] .AND. ; /* top < bott */ - tlbr_[ 3 ] >= aBlocks[ i,3,2 ] .AND. ; /* bootm > top */ - tlbr_[ 2 ] <= aBlocks[ i,3,5 ] .AND. ; /* left < righ */ - tlbr_[ 4 ] >= aBlocks[ i,3,3 ] ) /* right > left */ + CASE aBlocks[ i, 3, 1 ] == WVT_BLOCK_GETS + IF !( tlbr_[ 1 ] <= aBlocks[ i, 3, 4 ] .AND. ; /* top < bott */ + tlbr_[ 3 ] >= aBlocks[ i, 3, 2 ] .AND. ; /* bootm > top */ + tlbr_[ 2 ] <= aBlocks[ i, 3, 5 ] .AND. ; /* left < righ */ + tlbr_[ 4 ] >= aBlocks[ i, 3, 3 ] ) /* right > left */ lExe := .F. ENDIF @@ -125,17 +125,17 @@ FUNCTION WvtPaintObjects() /* If refreshing rectangle's top is less than objects' bottom */ /* and left is less than objects' right */ /* */ - IF !( tlbr_[ 1 ] <= aBlocks[ i,3,4 ] .AND. ; /* top <= bottom */ - tlbr_[ 3 ] >= aBlocks[ i,3,2 ] .AND. ; /* bootm >= top */ - tlbr_[ 2 ] <= aBlocks[ i,3,5 ] .AND. ; /* left < right */ - tlbr_[ 4 ] >= aBlocks[ i,3,3 ] ) /* right > left */ + IF !( tlbr_[ 1 ] <= aBlocks[ i, 3, 4 ] .AND. ; /* top <= bottom */ + tlbr_[ 3 ] >= aBlocks[ i, 3, 2 ] .AND. ; /* bootm >= top */ + tlbr_[ 2 ] <= aBlocks[ i, 3, 5 ] .AND. ; /* left < right */ + tlbr_[ 4 ] >= aBlocks[ i, 3, 3 ] ) /* right > left */ lExe := .F. ENDIF ENDCASE ENDIF IF lExe - Eval( aBlocks[ i,2 ] ) + Eval( aBlocks[ i, 2 ] ) ENDIF NEXT ENDIF @@ -171,16 +171,16 @@ FUNCTION wvg_SetPaint( cID, nAction, xData, aAttr ) IF xData != nil IF ( n := AScan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0 IF ( n1 := AScan( t_paint_[ n, 2 ], {| e_ | e_[ 1 ] == nAction } ) ) > 0 - oldData := t_paint_[ n,2,n1,2 ] - t_paint_[ n,2,n1,2 ] := xData - t_paint_[ n,2,n1,3 ] := aAttr + oldData := t_paint_[ n, 2, n1, 2 ] + t_paint_[ n, 2, n1, 2 ] := xData + t_paint_[ n, 2, n1, 3 ] := aAttr ELSE - AAdd( t_paint_[ n,2 ], { nAction, xData, aAttr } ) + AAdd( t_paint_[ n, 2 ], { nAction, xData, aAttr } ) ENDIF ELSE AAdd( t_paint_, { cID, {} } ) n := Len( t_paint_ ) - AAdd( t_paint_[ n,2 ], { nAction, xData, aAttr } ) + AAdd( t_paint_[ n, 2 ], { nAction, xData, aAttr } ) ENDIF ENDIF @@ -193,7 +193,7 @@ FUNCTION wvg_GetPaint( cID ) LOCAL n IF ( n := AScan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0 - RETURN t_paint_[ n,2 ] + RETURN t_paint_[ n, 2 ] ENDIF RETURN {} @@ -206,8 +206,8 @@ FUNCTION wvg_DelPaint( cID, nAction ) IF ( n := AScan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0 IF ( n1 := AScan( t_paint_[ n, 2 ], {| e_ | e_[ 1 ] == nAction } ) ) > 0 - xData := t_paint_[ n,2,n1,2 ] - t_paint_[ n,2,n1,2 ] := {|| .T. } + xData := t_paint_[ n, 2, n1, 2 ] + t_paint_[ n, 2, n1, 2 ] := {|| .T. } ENDIF ENDIF @@ -250,7 +250,7 @@ FUNCTION wvg_InsertPaint( cID, aPaint, lSet ) WvtSetPaint( aPaint ) ENDIF - RETURN nil + RETURN NIL // // @@ -338,17 +338,17 @@ FUNCTION Wvt_MakeDlgTemplate( nTop, nLeft, nRows, nCols, aOffSet, cTitle, nStyle + DS_3DLOOK ENDIF - AAdd( aDlg[ 1 ] , iif( Empty( nHelpId ), 0, nHelpId ) ) - AAdd( aDlg[ 1 ] , iif( Empty( nExStyle ), 0, nExStyle ) ) - AAdd( aDlg[ 1 ] , nStyle ) - AAdd( aDlg[ 1 ] , 0 ) - AAdd( aDlg[ 1 ] , nX ) - AAdd( aDlg[ 1 ] , nY ) - AAdd( aDlg[ 1 ] , nW ) - AAdd( aDlg[ 1 ] , nH ) - AAdd( aDlg[ 1 ] , 0 ) - AAdd( aDlg[ 1 ] , 0 ) - AAdd( aDlg[ 1 ] , iif( HB_ISSTRING( cTitle ), cTitle, "" ) ) + AAdd( aDlg[ 1 ], iif( Empty( nHelpId ), 0, nHelpId ) ) + AAdd( aDlg[ 1 ], iif( Empty( nExStyle ), 0, nExStyle ) ) + AAdd( aDlg[ 1 ], nStyle ) + AAdd( aDlg[ 1 ], 0 ) + AAdd( aDlg[ 1 ], nX ) + AAdd( aDlg[ 1 ], nY ) + AAdd( aDlg[ 1 ], nW ) + AAdd( aDlg[ 1 ], nH ) + AAdd( aDlg[ 1 ], 0 ) + AAdd( aDlg[ 1 ], 0 ) + AAdd( aDlg[ 1 ], iif( HB_ISSTRING( cTitle ), cTitle, "" ) ) IF hb_bitAnd( nStyle, DS_SETFONT ) == DS_SETFONT AAdd( aDlg[ 1 ], iif( HB_ISNUMERIC( nPointSize ), nPointSize, 8 ) ) @@ -408,19 +408,19 @@ FUNCTION Wvt_AddDlgItem( aDlg, nTop, nLeft, nRows, nCols, aOffSet, ; nH := nRows ENDIF - aDlg[ 1,4 ]++ /* item count */ + aDlg[ 1, 4 ]++ /* item count */ - AAdd( aDlg[ 2 ] , iif( HB_ISNUMERIC( nHelpId ), nHelpId , 0 ) ) - AAdd( aDlg[ 3 ] , iif( HB_ISNUMERIC( nExStyle ), nExStyle, 0 ) ) - AAdd( aDlg[ 4 ] , iif( HB_ISNUMERIC( nStyle ), nStyle , WS_CHILD + WS_VISIBLE ) ) - AAdd( aDlg[ 5 ] , nX ) - AAdd( aDlg[ 6 ] , nY ) - AAdd( aDlg[ 7 ] , nW ) - AAdd( aDlg[ 8 ] , nH ) - AAdd( aDlg[ 9 ] , cnId ) - AAdd( aDlg[ 10 ] , cnDlgClass ) - AAdd( aDlg[ 11 ] , iif( HB_ISSTRING( cText ), cText, iif( HB_ISNUMERIC( cText ), cText, "" ) ) ) - AAdd( aDlg[ 12 ] , 0 ) + AAdd( aDlg[ 2 ], iif( HB_ISNUMERIC( nHelpId ), nHelpId, 0 ) ) + AAdd( aDlg[ 3 ], iif( HB_ISNUMERIC( nExStyle ), nExStyle, 0 ) ) + AAdd( aDlg[ 4 ], iif( HB_ISNUMERIC( nStyle ), nStyle, WS_CHILD + WS_VISIBLE ) ) + AAdd( aDlg[ 5 ], nX ) + AAdd( aDlg[ 6 ], nY ) + AAdd( aDlg[ 7 ], nW ) + AAdd( aDlg[ 8 ], nH ) + AAdd( aDlg[ 9 ], cnId ) + AAdd( aDlg[ 10 ], cnDlgClass ) + AAdd( aDlg[ 11 ], iif( HB_ISSTRING( cText ), cText, iif( HB_ISNUMERIC( cText ), cText, "" ) ) ) + AAdd( aDlg[ 12 ], 0 ) RETURN aDlg @@ -438,9 +438,9 @@ FUNCTION Wvt_CreateDialog( acnDlg, lOnTop, cbDlgProc, ncIcon, nTimerTicks, hMenu nDlgMode := iif( cType == "C", 0, iif( cType == "N", 1, 2 ) ) IF cType == "A" - xTemplate := Wvt__MakeDlgTemplate( acnDlg[ 1 ] , acnDlg[ 2 ] , acnDlg[ 3 ] , acnDlg[ 4 ] , ; - acnDlg[ 5 ] , acnDlg[ 6 ] , acnDlg[ 7 ] , acnDlg[ 8 ] , ; - acnDlg[ 9 ] , acnDlg[ 10 ] , acnDlg[ 11 ] , acnDlg[ 12 ] ) + xTemplate := Wvt__MakeDlgTemplate( acnDlg[ 1 ], acnDlg[ 2 ], acnDlg[ 3 ], acnDlg[ 4 ], ; + acnDlg[ 5 ], acnDlg[ 6 ], acnDlg[ 7 ], acnDlg[ 8 ], ; + acnDlg[ 9 ], acnDlg[ 10 ], acnDlg[ 11 ], acnDlg[ 12 ] ) ELSE xTemplate := acnDlg ENDIF @@ -481,9 +481,9 @@ FUNCTION Wvt_DialogBox( acnDlg, cbDlgProc, hWndParent ) nDlgMode := iif( cType == "C", 0, iif( cType == "N", 1, 2 ) ) IF cType == "A" - xTemplate := Wvt__MakeDlgTemplate( acnDlg[ 1 ] , acnDlg[ 2 ] , acnDlg[ 3 ] , acnDlg[ 4 ] , ; - acnDlg[ 5 ] , acnDlg[ 6 ] , acnDlg[ 7 ] , acnDlg[ 8 ] , ; - acnDlg[ 9 ] , acnDlg[ 10 ] , acnDlg[ 11 ] , acnDlg[ 12 ] ) + xTemplate := Wvt__MakeDlgTemplate( acnDlg[ 1 ], acnDlg[ 2 ], acnDlg[ 3 ], acnDlg[ 4 ], ; + acnDlg[ 5 ], acnDlg[ 6 ], acnDlg[ 7 ], acnDlg[ 8 ], ; + acnDlg[ 9 ], acnDlg[ 10 ], acnDlg[ 11 ], acnDlg[ 12 ] ) ELSE xTemplate := acnDlg ENDIF @@ -517,7 +517,7 @@ FUNCTION WVT_GetOpenFileName( hWnd, cPath, cTitle, acFilter, nFlags, cInitDir, c HB_SYMBOL_UNUSED( hWnd ) - __defaultNIL( @cPath , "" ) + __defaultNIL( @cPath, "" ) __defaultNIL( @nFlags, OFN_EXPLORER + OFN_NOCHANGEDIR ) /* WIN_GETOPENFILENAME( [[@]], [], [], [],; diff --git a/harbour/contrib/gtwvg/statbar.prg b/harbour/contrib/gtwvg/statbar.prg index 0a37f31186..d104a8ae46 100644 --- a/harbour/contrib/gtwvg/statbar.prg +++ b/harbour/contrib/gtwvg/statbar.prg @@ -245,7 +245,7 @@ METHOD WvgStatusBar:addItem( cCaption, xImage, cDLL, nStyle, cKey, nMode ) IF lSuccess AAdd( ::aItems, oPanel ) ELSE - RETURN nil + RETURN NIL ENDIF RETURN oPanel diff --git a/harbour/contrib/gtwvg/static.prg b/harbour/contrib/gtwvg/static.prg index c59ceeb8d2..fc4fd4d8a9 100644 --- a/harbour/contrib/gtwvg/static.prg +++ b/harbour/contrib/gtwvg/static.prg @@ -250,7 +250,7 @@ METHOD WvgStatic:handleEvent( nMessage, aNM ) IF HB_ISBLOCK( ::sl_resize ) Eval( ::sl_resize, NIL, NIL, self ) ENDIF - AEval( ::aChildren, {|o| o:handleEvent( HB_GTE_RESIZED, { 0, 0, 0, 0, 0 } ) } ) + AEval( ::aChildren, {| o | o:handleEvent( HB_GTE_RESIZED, { 0, 0, 0, 0, 0 } ) } ) RETURN EVENT_HANDELLED CASE nMessage == HB_GTE_CTLCOLOR diff --git a/harbour/contrib/gtwvg/syswnd.prg b/harbour/contrib/gtwvg/syswnd.prg index 5db9227737..10396292fa 100644 --- a/harbour/contrib/gtwvg/syswnd.prg +++ b/harbour/contrib/gtwvg/syswnd.prg @@ -358,33 +358,33 @@ METHOD wndProc( hWnd, nMessage, nwParam, nlParam ) CLASS WvgFontDialog WVG_SetWindowText( ::hWnd, ::title ) ENDIF IF ! ::buttonCancel - WVG_EnableWindow( WVG_GetDlgItem( ::hWnd,IDCANCEL ), .F. ) + WVG_EnableWindow( WVG_GetDlgItem( ::hWnd, IDCANCEL ), .F. ) ENDIF IF ! ::buttonApply - WVG_EnableWindow( WVG_GetDlgItem( ::hWnd,1026 ), .F. ) + WVG_EnableWindow( WVG_GetDlgItem( ::hWnd, 1026 ), .F. ) ENDIF IF ! ::buttonHelp - WVG_EnableWindow( WVG_GetDlgItem( ::hWnd,1038 ), .F. ) + WVG_EnableWindow( WVG_GetDlgItem( ::hWnd, 1038 ), .F. ) ENDIF IF ! ::strikeOut - WVG_EnableWindow( WVG_GetDlgItem( ::hWnd,1040 ), .F. ) + WVG_EnableWindow( WVG_GetDlgItem( ::hWnd, 1040 ), .F. ) ENDIF IF ! ::underscore - WVG_EnableWindow( WVG_GetDlgItem( ::hWnd,1041 ), .F. ) + WVG_EnableWindow( WVG_GetDlgItem( ::hWnd, 1041 ), .F. ) ENDIF IF ! ::name - WVG_EnableWindow( WVG_GetDlgItem( ::hWnd,1136 ), .F. ) + WVG_EnableWindow( WVG_GetDlgItem( ::hWnd, 1136 ), .F. ) ENDIF IF ! ::style - WVG_EnableWindow( WVG_GetDlgItem( ::hWnd,1137 ), .F. ) + WVG_EnableWindow( WVG_GetDlgItem( ::hWnd, 1137 ), .F. ) ENDIF IF ! ::size - WVG_EnableWindow( WVG_GetDlgItem( ::hWnd,1138 ), .F. ) + WVG_EnableWindow( WVG_GetDlgItem( ::hWnd, 1138 ), .F. ) ENDIF IF ::aPos[ 1 ] > 0 .OR. ::aPos[ 2 ] > 0 aRect := WVG_GetWindowRect( ::hWnd ) - WVG_MoveWindow( ::hWnd, ::aPos[ 1 ], ::aPos[ 2 ], aRect[3] - aRect[1], aRect[4] - aRect[2], .F. ) + WVG_MoveWindow( ::hWnd, ::aPos[ 1 ], ::aPos[ 2 ], aRect[ 3 ] - aRect[ 1 ], aRect[ 4 ] - aRect[ 2 ], .F. ) ENDIF RETURN 1 @@ -625,7 +625,7 @@ METHOD createFont() CLASS WvgFont aFont := Wvg_FontCreate( ::aFontInfo ) IF Empty( aFont[ 1 ] ) - RETURN nil + RETURN NIL ENDIF ::hFont := aFont[ 15 ] diff --git a/harbour/contrib/gtwvg/tests/activex.prg b/harbour/contrib/gtwvg/tests/activex.prg index a44b9dbc1e..5925930dc2 100644 --- a/harbour/contrib/gtwvg/tests/activex.prg +++ b/harbour/contrib/gtwvg/tests/activex.prg @@ -32,7 +32,7 @@ FUNCTION ExecuteActiveX( nActiveX, xParam ) HB_SYMBOL_UNUSED( xParam ) HB_SYMBOL_UNUSED( oCom ) -//--------------------------- Dialog -------------------------------\\ + // --------------------------- Dialog -------------------------------\\ #if 1 oCrt := WvgDialog():new( , , { 30, 30 }, { 800, 600 }, , .T. ) oCrt:closable := .T. @@ -47,13 +47,13 @@ FUNCTION ExecuteActiveX( nActiveX, xParam ) oDA := oCrt:drawingArea - //--------------------------- Menu --------------------------------\\ + // --------------------------- Menu --------------------------------\\ ActiveXBuildMenu( oCrt, @oStatic, @oStatic2 ) - //--------------------------- ToolBar -----------------------------\\ + // --------------------------- ToolBar -----------------------------\\ oTBar := BuildWvgToolBar( oDA, nActiveX ) - //--------------------------- StatusBar ---------------------------\\ + // --------------------------- StatusBar ---------------------------\\ oSBar := WvgStatusBar():new( oDA ):create( , , , , , .T. ) oSBar:panelClick := {| oPanel | WVG_MessageBox( , oPanel:caption ) } oPanel := oSBar:getItem( 1 ) @@ -63,17 +63,17 @@ FUNCTION ExecuteActiveX( nActiveX, xParam ) oPanel2 := oSBar:addItem() oPanel2:caption := 'Click on any part!' - //--------------------------- Static ------------------------------\\ + // --------------------------- Static ------------------------------\\ oStatic := WvgStatic():new( oDA ) oStatic:type := WVGSTATIC_TYPE_TEXT oStatic:options := WVGSTATIC_TEXT_CENTER oStatic:caption := Chr( 13 ) + 'Implemented Xbase++ Parts' - oStatic:create( , , { 0, oTBar:currentSize()[2] + 3 }, { 120, oCrt:currentSize()[2] - ; - oTBar:currentSize()[2] - oSBar:currentSize()[2] - 4 }, , .T. ) - oStatic:setColorBG( RGB( 198,198,198 ) ) + oStatic:create( , , { 0, oTBar:currentSize()[ 2 ] + 3 }, { 120, oCrt:currentSize()[ 2 ] - ; + oTBar:currentSize()[ 2 ] - oSBar:currentSize()[ 2 ] - 4 }, , .T. ) + oStatic:setColorBG( RGB( 198, 198, 198 ) ) #if 0 // panel - //--------------------------- Static + Radio + Checkbox ----------\\ + // --------------------------- Static + Radio + Checkbox ----------\\ oStatic2 := WvgStatic():New( oCrt, , { 150, 150 }, { 500, 310 }, , .F. ) // oStatic2:type := WVGSTATIC_TYPE_RAISEDBOX //BGNDFRAME oStatic2:exStyle += WS_EX_WINDOWEDGE @@ -99,21 +99,21 @@ FUNCTION ExecuteActiveX( nActiveX, xParam ) oCheck := WvgCheckBox():New( oStatic2, , { 10, 70 }, { 100, 15 }, , .T. ) oCheck:caption := 'Checkbox A' oCheck:create() - oCheck:selected := {| m1, m2, o | m1 := m1, m2 := m2, WVG_MessageBox( , iif( o:getData(), 'I am selected','I am not selected' ) ) } + oCheck:selected := {| m1, m2, o | m1 := m1, m2 := m2, WVG_MessageBox( , iif( o:getData(), 'I am selected', 'I am not selected' ) ) } // Create first 3State button, passing the position to :create() oXbp := Wvg3State():new( oStatic2 ) oXbp:caption := "3 State A" oXbp:create( , , { 10, 100 }, { 100, 15 } ) // Determine current state using mp1 - oXbp:selected := {| m1, m2, oBtn | m2 := m2, oBtn := oBtn, oPanel1:caption := "3State A [" + aState[ m1+1 ] + "]" } + oXbp:selected := {| m1, m2, oBtn | m2 := m2, oBtn := oBtn, oPanel1:caption := "3State A [" + aState[ m1 + 1 ] + "]" } // Create second 3State Button, passing the position to :new() oXbp := Wvg3State():new( oStatic2, , { 10, 125 }, { 100, 15 } ) oXbp:caption := "3 State B" oXbp:create( oStatic2 ) // Determine current state using :getData() - oXbp:selected := {| m1, m2, oBtn | m1 := m1, m2 := m2, WVG_MessageBox( , "3State B", aState[ oBtn:getData()+1 ] ) } + oXbp:selected := {| m1, m2, oBtn | m1 := m1, m2 := m2, WVG_MessageBox( , "3State B", aState[ oBtn:getData() + 1 ] ) } // Create first SLE, specify position using :create() // On :typeOut set the focus to the second SLE @@ -132,7 +132,7 @@ FUNCTION ExecuteActiveX( nActiveX, xParam ) oXbp:tabStop := .T. oXbp:bufferLength := 15 oXbp:dataLink := {| x | iif( x == NIL, cVarB, cVarB := x ) } - oXbp:create( ) + oXbp:create() oXbp:setData() oXbp:killInputFocus := {| x, y, oSLE | x := x, y := y, oSLE:getData(), oPanel:caption := "cVarB =" + cVarB } @@ -149,11 +149,11 @@ FUNCTION ExecuteActiveX( nActiveX, xParam ) oMLE:setData() #endif - //--------------------------- ListBox -----------------------------\\ + // --------------------------- ListBox -----------------------------\\ oListBox := WvgListBox():new() oListBox:create( oStatic, , { 5, 55 }, { 107, 380 } ) - oListBox:setColorFG( RGB( 218,61,34 ) ) + oListBox:setColorFG( RGB( 218, 61, 34 ) ) AAdd( aParts, 'XbpDialog' ) AAdd( aParts, 'XbpMenuBar' ) @@ -175,22 +175,22 @@ FUNCTION ExecuteActiveX( nActiveX, xParam ) oListBox:itemSelected := {|| WVG_MessageBox( , oListBox:getCurItem() ) } oListBox:setData( 3 ) - //--------------------------- PushButton --------------------------\\ + // --------------------------- PushButton --------------------------\\ oXbp := WvgPushButton():new( oStatic ) oXbp:caption := "Hide" oXbp:create( , , { 20, 440 }, { 80, 30 } ) oXbp:activate := {|| oStatic:hide(), oCrt:sendMessage( WM_SIZE, 0, 0 ) } - //--------------------------- TreeView ---------------------------\\ - oTree := WvgTreeView():new( oDA, , { oCrt:currentSize()[1] - 160, oTBar:currentSize()[2] + 3 }, ; - { 160, oCrt:currentSize()[2] - ; - oTBar:currentSize()[2] - oSBar:currentSize()[2] - 4 }, , .T. ) + // --------------------------- TreeView ---------------------------\\ + oTree := WvgTreeView():new( oDA, , { oCrt:currentSize()[ 1 ] - 160, oTBar:currentSize()[ 2 ] + 3 }, ; + { 160, oCrt:currentSize()[ 2 ] - ; + oTBar:currentSize()[ 2 ] - oSBar:currentSize()[ 2 ] - 4 }, , .T. ) oTree:hasLines := .T. oTree:hasButtons := .T. oTree:alwaysShowSelection := .T. oTree:create() - oTree:setColorBG( RGB( 120,15,240 ) ) - oTree:setColorFG( RGB( 15,240,120 ) ) + oTree:setColorBG( RGB( 120, 15, 240 ) ) + oTree:setColorFG( RGB( 15, 240, 120 ) ) oTree:itemSelected := {| oItem | iif( oItem != NIL, WVG_MessageBox( , oItem:caption ), NIL ) } oItem1 := oTree:rootItem:addItem( "First level A" ) @@ -212,16 +212,16 @@ FUNCTION ExecuteActiveX( nActiveX, xParam ) oTree:setData( oItem2 ) - //--------------------------- Misc Config ------------------------\\ - oTBar:buttonClick := {| oBtn | iif( oBtn:caption == 'Hide' , oStatic:hide(), NIL ), ; - iif( oBtn:caption == 'Show' , oStatic:show(), NIL ), ; + // --------------------------- Misc Config ------------------------\\ + oTBar:buttonClick := {| oBtn | iif( oBtn:caption == 'Hide', oStatic:hide(), NIL ), ; + iif( oBtn:caption == 'Show', oStatic:show(), NIL ), ; iif( oBtn:caption == 'Tools', oStatic2:show():toFront(), NIL ), ; iif( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ), ; oPanel2:caption := "Button [ " + oBtn:caption + " ] clicked!" } oDA:resize := {|| ResizeDialog( oCrt, oTBar, oSBar, oStatic, oCom, oTree ) } #if 1 - //--------------------------- Active-X ---------------------------\\ + // --------------------------- Active-X ---------------------------\\ oCom := BuildActiveXControl( nActiveX, oDA ) IF HB_ISOBJECT( oCom ) oCrt:sendMessage( WM_SIZE, 0, 0 ) @@ -257,16 +257,16 @@ STATIC FUNCTION ResizeDialog( oCrt, oTBar, oSBar, oStatic, oCom, oTree ) // aTree := oTree:currentSize() // aCom := oCom:currentSize() - nT := aTBar[2] - nH := aCrt[2] - aTBar[2] - aSBar[2] + nT := aTBar[ 2 ] + nH := aCrt[ 2 ] - aTBar[ 2 ] - aSBar[ 2 ] IF oStatic:isVisible oStatic:setPosAndSize( { 0, nT + 3 }, { 120, nH - 4 }, .T. ) - oCom:setPosAndSize( { 120, nT }, { aCrt[1] - 120 - 150, nH }, .T. ) - oTree:setPosAndSize( { aCrt[1] - 150, nT }, { 150, nH }, .T. ) + oCom:setPosAndSize( { 120, nT }, { aCrt[ 1 ] - 120 - 150, nH }, .T. ) + oTree:setPosAndSize( { aCrt[ 1 ] - 150, nT }, { 150, nH }, .T. ) ELSE - oCom:setPosAndSize( { 0, nT }, { aCrt[1] - 150, nH }, .T. ) - oTree:setPosAndSize( { aCrt[1] - 150, nT }, { 150, nH }, .T. ) + oCom:setPosAndSize( { 0, nT }, { aCrt[ 1 ] - 150, nH }, .T. ) + oTree:setPosAndSize( { aCrt[ 1 ] - 150, nT }, { 150, nH }, .T. ) ENDIF RETURN 1 @@ -343,16 +343,16 @@ STATIC FUNCTION BuildActiveXControl( nActiveX, oDA ) oCom:CLSID := 'AnalogClockControl.AnalogClock' oCom:Id := 5 - oCom:mapEvent( evDblClk, {|| oCom:Value := Seconds()/86400 , ; + oCom:mapEvent( evDblClk, {|| oCom:Value := Seconds() / 86400, ; oCom:BackColor := RGB( 0, 140, 210 ), ; - oCom:Refresh() , ; - oCom:ShowSecondsHand := .T. , ; - oCom:Hands3D := .T. , ; - oCom:Refresh() , ; - oCom:showAboutBox() ; + oCom:Refresh(), ; + oCom:ShowSecondsHand := .T., ; + oCom:Hands3D := .T., ; + oCom:Refresh(), ; + oCom:showAboutBox() ; } ) - oCom:mapEvent( evBtnUp, {| nBtn | iif( nBtn == 2, oCom:oParent:sendMessage( WM_CLOSE,0,0 ), NIL ) } ) + oCom:mapEvent( evBtnUp, {| nBtn | iif( nBtn == 2, oCom:oParent:sendMessage( WM_CLOSE, 0, 0 ), NIL ) } ) CASE nActiveX == 3 hb_gtInfo( HB_GTI_WINTITLE, 'file://' + hb_DirBase() + 'myharu.pdf' ) @@ -399,13 +399,13 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam ) ELSEIF nActiveX == 5 oCom:loadMultiPage( hb_DirBase() + 'myharu.pdf', 2 ) - oCom:addGradientBorder( 10, RGB( 12,20,233 ), RGB( 100,255,20 ), 0 ) + oCom:addGradientBorder( 10, RGB( 12, 20, 233 ), RGB( 100, 255, 20 ), 0 ) oCom:drawText( 10, 10, 'Vouch' ) - //oCom:emboss( 3,0 ) + // oCom:emboss( 3,0 ) oCom:copy2ClipBoard() oCom:view := 11 - oCom:setBackGroundColor( rgb( 225,225,225 ) ) - //oCom:rotate90() + oCom:setBackGroundColor( rgb( 225, 225, 225 ) ) + // oCom:rotate90() ENDIF @@ -413,7 +413,7 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam ) nKey := Inkey() IF nActiveX == 2 - oCom:Value := Seconds()/86400 + oCom:Value := Seconds() / 86400 ENDIF IF nKey == K_F12 @@ -421,7 +421,7 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam ) oCom:Navigate( 'www.vouch.info' ) ELSEIF nActiveX == 11 - //oCom:document( 0 ):InnerHTML := "

Stream Test

This HTML content in a document." + // oCom:document( 0 ):InnerHTML := "

Stream Test

This HTML content in a document." ELSEIF nActiveX == 4 oCom:RMCBackColor := 23456142 @@ -445,7 +445,7 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam ) DO CASE CASE s_nTurn == 1 hb_gtInfo( HB_GTI_WINTITLE, 'RMChart [ Next:F11 ] ' + 'Stacked Bars' ) - //SetMode( 30,100 ) + // SetMode( 30,100 ) sData += "00003600|00004450|000051|000061|000073|00008-6972|00009412|00011Tahoma|100011|10" sData += "0035|1000410|10005-5|10006-5|1000911|100101|100111|100181|100200|1002150000|1002" @@ -466,7 +466,7 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam ) CASE s_nTurn == 2 hb_gtInfo( HB_GTI_WINTITLE, 'RMChart [ Next:F11 ] ' + 'Floating Bars' ) - //SetMode( 20,90 ) + // SetMode( 20,90 ) sData += "00003550|00004300|000051|000073|00008-2894893|00009412|00011Tahoma|100011|100035" sData += "|100045|10005-5|10006-5|1000911|100101|100111|100131|100181|100201|1002113|10022" @@ -481,7 +481,7 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam ) CASE s_nTurn == 3 hb_gtInfo( HB_GTI_WINTITLE, 'RMChart [ Next:F11 ] ' + 'Four Regions' ) - //SetMode( 40,120 ) + // SetMode( 40,120 ) sData += "00003700|00004500|000054|000061|000071|00008-984833|00009412|00011Tahoma|100011|" sData += "100032|100042|10005348|10006248|1000910|100101|100111|100181|100200|10021100|100" @@ -514,7 +514,7 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam ) CASE s_nTurn == 4 hb_gtInfo( HB_GTI_WINTITLE, 'RMChart [ Next:F11 ] ' + '10 Biggest Companies' ) - //SetMode( 25,90 ) + // SetMode( 25,90 ) sData += "00003670|00004450|000051|000061|000071|00008-10185235|00009412|00011Tahoma|10001" sData += "1|100035|1000410|10005-5|10006-5|1000912|100101|100111|100131|100181|10020100000" @@ -532,7 +532,7 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam ) CASE s_nTurn == 5 hb_gtInfo( HB_GTI_WINTITLE, 'RMChart [ Next:F11 ] ' + 'Grouped Bars' ) - //SetMode( 25,80 ) + // SetMode( 25,80 ) sData += "00003600|00004450|000051|000061|000075|00008-2|00009412|00010paper.jpg|00011Taho" sData += "ma|100011|100035|100045|10005-5|10006-5|1000910|100101|100111|100181|100200|1002" @@ -545,7 +545,7 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam ) CASE s_nTurn == 6 hb_gtInfo( HB_GTI_WINTITLE, 'RMChart [ Next:F11 ] ' + 'Flow Chart' ) - //SetMode( 30,50 ) + // SetMode( 30,50 ) sData += "00003305|00004400|000051|00008-984833|00009412|00011Tahoma|100011|100035|100045|" sData += "10005-5|10006-5|10180\7C|010011|010051|010072|010081|0101050|0101125|01012100|01" @@ -659,10 +659,10 @@ STATIC FUNCTION MyFunction( nMode ) WVG_MessageBox( , "Button clicked!" ) CASE nMode == 101 // Charge - Eval( {|| Tone( 523,2 ), Tone( 698,2 ), Tone( 880,2 ), Tone( 1046,4 ), Tone( 880,2 ), Tone( 1046,8 ) } ) + Eval( {|| Tone( 523, 2 ), Tone( 698, 2 ), Tone( 880, 2 ), Tone( 1046, 4 ), Tone( 880, 2 ), Tone( 1046, 8 ) } ) CASE nMode == 102 // NannyBoo - AEval( { { 196,2 }, { 196,2 }, { 164,2 }, { 220,2 }, { 196,4 }, { 164,4 } }, {| a | Tone( a[ 1 ], a[ 2 ] ) } ) + AEval( { { 196, 2 }, { 196, 2 }, { 164, 2 }, { 220, 2 }, { 196, 4 }, { 164, 4 } }, {| a | Tone( a[ 1 ], a[ 2 ] ) } ) CASE nMode == 103 // BADKEY Tone( 480, 0.25 ) diff --git a/harbour/contrib/gtwvg/tests/cuigdlgs.prg b/harbour/contrib/gtwvg/tests/cuigdlgs.prg index 464e3ace87..8b0aa82135 100644 --- a/harbour/contrib/gtwvg/tests/cuigdlgs.prg +++ b/harbour/contrib/gtwvg/tests/cuigdlgs.prg @@ -23,10 +23,10 @@ PROCEDURE ExecGCUI() IF hb_mtvm() - hb_threadStart( {| oCrt | oCrt := WvgCrt():New( , , { 2,4 }, { 20,81 }, , .T. ) , ; + hb_threadStart( {| oCrt | oCrt := WvgCrt():New( , , { 2, 4 }, { 20, 81 }, , .T. ), ; oCrt:icon := GetResource( "dia_excl.ico" ), ; oCrt:create(), ; - GCUIConsole( oCrt ) , ; + GCUIConsole( oCrt ), ; oCrt:destroy() } ) ENDIF @@ -39,7 +39,7 @@ PROCEDURE ExecGCUI() PROCEDURE GCUIConsole( oCrt ) LOCAL dDate := Date() - LOCAL cName := PadR( 'Some Usefule Name' , 35 ) + LOCAL cName := PadR( 'Some Usefule Name', 35 ) LOCAL cAdd1 := PadR( 'Linda Goldman Avenue', 35 ) LOCAL cAdd2 := PadR( 'Excellent Street' , 35 ) LOCAL cAdd3 := PadR( 'Suit #415' , 35 ) @@ -63,22 +63,22 @@ PROCEDURE GCUIConsole( oCrt ) @ 3, nColGet GET dDate ; WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 1 ) ) } ; - Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,0,0 ) ), .T. } + VALID {|| Wvg_SetGObjData( hTxt, 6, RGB( 255, 0, 0 ) ), .T. } @ 6, nColGet GET cName ; WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 2 ) ) } ; - Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,255,0 ) ), ; + VALID {|| Wvg_SetGObjData( hTxt, 6, RGB( 255, 255, 0 ) ), ; Wvg_SetGObjState( hBoxR, 3 ), .T. } @ 9, nColGet GET cAdd1 ; WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 3 ) ) } ; - Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,0,255 ) ), .T. } + VALID {|| Wvg_SetGObjData( hTxt, 6, RGB( 255, 0, 255 ) ), .T. } @ 11, nColGet GET cAdd2 ; WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 4 ) ) } ; - Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,255,255 ) ), ; + VALID {|| Wvg_SetGObjData( hTxt, 6, RGB( 255, 255, 255 ) ), ; Wvg_SetGObjState( hBoxR, 1 ), .T. } @ 13, nColGet GET cAdd3 ; - WHEN {|| Wvg_SetGObjData( hTxt, 6, RGB( 198,21,140 ) ), .T. } + WHEN {|| Wvg_SetGObjData( hTxt, 6, RGB( 198, 21, 140 ) ), .T. } @ 16, nColGet GET nSlry PICTURE "@Z 9999999.99" ; - WHEN {|| Wvg_SetGObjData( hTxt, 6, RGB( 0,0,0 ) ), .T. } + WHEN {|| Wvg_SetGObjData( hTxt, 6, RGB( 0, 0, 0 ) ), .T. } // The only additional calls to render your console GUI // diff --git a/harbour/contrib/gtwvg/tests/demowvg.prg b/harbour/contrib/gtwvg/tests/demowvg.prg index 076a3ebc85..e4422a1042 100644 --- a/harbour/contrib/gtwvg/tests/demowvg.prg +++ b/harbour/contrib/gtwvg/tests/demowvg.prg @@ -68,6 +68,7 @@ STATIC s_paint_ := { { "", {} } } // EXIT PROCEDURE CleanHandles() + LOCAL obj FOR EACH obj IN SetFonts() @@ -144,15 +145,15 @@ PROCEDURE Main() AAdd( aBlocks, {|| Wvt_SetIcon( GetResource( "vr_1.ico" ) ) } ) AAdd( aBlocks, {|| Wvt_SetTitle( "Vouch" ) } ) - AAdd( aBlocks, {|| Wvt_DrawLabel( 1,40, cLabel,6,, rgb(255,255,255 ), rgb(198,198,198 ), "Arial", 26, , , , , .T., .T. ) } ) + AAdd( aBlocks, {|| Wvt_DrawLabel( 1, 40, cLabel, 6,, rgb( 255, 255, 255 ), rgb( 198, 198, 198 ), "Arial", 26, , , , , .T., .T. ) } ) AAdd( aBlocks, {|| Wvt_DrawBoxRaised( nTop, nLft, nBtm, nRgt ) } ) AAdd( aBlocks, {|| Wvt_DrawBoxRecessed( 7, 61, 13, 70 ) } ) AAdd( aBlocks, {|| Wvt_DrawBoxGroup( 15, 59, 18, 72 ) } ) AAdd( aBlocks, {|| Wvt_DrawBoxGroup( 5, 6, 19, 44 ) } ) - AAdd( aBlocks, {|| Wvt_DrawImage( 8,62,12,69, IMAGE_VOUCH ) } ) + AAdd( aBlocks, {|| Wvt_DrawImage( 8, 62, 12, 69, IMAGE_VOUCH ) } ) AAdd( aBlocks, {|| Wvt_DrawBoxRecessed( 7, 48, 13, 55 ) } ) - AAdd( aBlocks, {|| Wvt_DrawLine( MaxRow() - 2,0,MaxRow() - 2,MaxCol(),WVT_LINE_HORZ,WVT_LINE_RECESSED,WVT_LINE_BOTTOM ) } ) - AAdd( aBlocks, {|| Wvt_DrawLine( MaxRow() - 1,41,MaxRow(),41,WVT_LINE_VERT,WVT_LINE_RECESSED,WVT_LINE_CENTER ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( MaxRow() - 2, 0, MaxRow() - 2, MaxCol(), WVT_LINE_HORZ, WVT_LINE_RECESSED, WVT_LINE_BOTTOM ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( MaxRow() - 1, 41, MaxRow(), 41, WVT_LINE_VERT, WVT_LINE_RECESSED, WVT_LINE_CENTER ) } ) AAdd( aBlocks, {|| AEval( GetList, {| oGet | Wvt_DrawBoxGet( oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } ) AAdd( aBlocks, {|| Wvt_Mouse( -1000001 ) } ) @@ -218,9 +219,9 @@ PROCEDURE WvtConsoleGets( nMode ) hb_default( @nMode, 0 ) IF hb_mtvm() - hb_threadStart( {| oCrt | hb_gtReload( 'WVT' ) , ; + hb_threadStart( {| oCrt | hb_gtReload( 'WVT' ), ; oCrt := hb_gtSelect(), ; - iif( nMode == 0, WvtNextGetsConsole(), GoogleMap() ) , ; + iif( nMode == 0, WvtNextGetsConsole(), GoogleMap() ), ; oCrt := NIL } ) ENDIF @@ -267,7 +268,7 @@ PROCEDURE WvtNextGetsConsole() PROCEDURE WvtNextGets() IF hb_mtvm() - hb_threadStart( {|| hb_gtReload( 'WVG' ), Wvt_setFont( 'Terminal',20 ), ; + hb_threadStart( {|| hb_gtReload( 'WVG' ), Wvt_setFont( 'Terminal', 20 ), ; hb_clear(), Wvt_ShowWindow( SW_RESTORE ), WvtNextGets_X() } ) ELSE WvtNextGets_X() @@ -307,21 +308,21 @@ PROCEDURE WvtNextGets_X() Wvt_SetPalette( aNewPalette ) AAdd( aBlocks, {|| Wvt_SetTitle( "Wvt Gets 2nd Window with Different Palette" ) } ) - AAdd( aBlocks, {|| Wvt_DrawLine( MaxRow() - 1,0,MaxRow() - 1,MaxCol() ) } ) - AAdd( aBlocks, {|| Wvt_SetBrush( 0, rgb( 32,255,100 ) ) } ) - AAdd( aBlocks, {|| Wvt_DrawEllipse( 6,50,10,58 ) } ) - AAdd( aBlocks, {|| Wvt_SetBrush( 2, rgb( 255,255,100 ),1 ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( MaxRow() - 1, 0, MaxRow() - 1, MaxCol() ) } ) + AAdd( aBlocks, {|| Wvt_SetBrush( 0, rgb( 32, 255, 100 ) ) } ) + AAdd( aBlocks, {|| Wvt_DrawEllipse( 6, 50, 10, 58 ) } ) + AAdd( aBlocks, {|| Wvt_SetBrush( 2, rgb( 255, 255, 100 ), 1 ) } ) AAdd( aBlocks, {|| Wvt_DrawRectangle( 11, 50, 13, 58 ) } ) AAdd( aBlocks, {|| Wvt_DrawBoxGroupRaised( 5, 6, 19, 72 ) } ) AAdd( aBlocks, {|| AEval( GetList, {| oGet | Wvt_DrawBoxGet( oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } ) - AAdd( aBlocks, {|| Wvt_DrawButton( 21, 6,22, 9,"New" ,"vouch1.bmp" ) } ) - AAdd( aBlocks, {|| Wvt_DrawButton( 21,11,22,14,"Browse","vouch1.bmp", 1, rgb( 255,255,255 ) ) } ) - AAdd( aBlocks, {|| Wvt_DrawButton( 21,16,22,19, ,"vouch1.bmp" ) } ) - AAdd( aBlocks, {|| Wvt_DrawButton( 21,21,22,24,"Data",, 0, rgb( 100,22,241 ), rgb( 198,198,198 ) ) } ) - AAdd( aBlocks, {|| Wvt_DrawButton( 21,26,22,29,"Flat",IMAGE_VR,2 ) } ) - AAdd( aBlocks, {|| Wvt_DrawButton( 21,31,22,34,"Outline",IMAGE_VR,3 ) } ) - AAdd( aBlocks, {|| Wvt_DrawButton( 22,36,22,41,"Data",, 0, rgb( 100,22,241 ), rgb( 198,198,198 ) ) } ) + AAdd( aBlocks, {|| Wvt_DrawButton( 21, 6, 22, 9, "New","vouch1.bmp" ) } ) + AAdd( aBlocks, {|| Wvt_DrawButton( 21, 11, 22, 14, "Browse", "vouch1.bmp", 1, rgb( 255, 255, 255 ) ) } ) + AAdd( aBlocks, {|| Wvt_DrawButton( 21, 16, 22, 19, , "vouch1.bmp" ) } ) + AAdd( aBlocks, {|| Wvt_DrawButton( 21, 21, 22, 24, "Data",, 0, rgb( 100, 22, 241 ), rgb( 198, 198, 198 ) ) } ) + AAdd( aBlocks, {|| Wvt_DrawButton( 21, 26, 22, 29, "Flat", IMAGE_VR, 2 ) } ) + AAdd( aBlocks, {|| Wvt_DrawButton( 21, 31, 22, 34, "Outline", IMAGE_VR, 3 ) } ) + AAdd( aBlocks, {|| Wvt_DrawButton( 22, 36, 22, 41, "Data",, 0, rgb( 100, 22, 241 ), rgb( 198, 198, 198 ) ) } ) aLastPaint := WvtSetBlocks( aBlocks ) @@ -416,10 +417,10 @@ FUNCTION WvtLines() CLS - AAdd( aBlocks, {|| Wvt_DrawLine( 0, 0, 0, nCols, WVT_LINE_HORZ, WVT_LINE_RAISED , WVT_LINE_CENTER ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( 0, 0, 0, nCols, WVT_LINE_HORZ, WVT_LINE_RAISED, WVT_LINE_CENTER ) } ) AAdd( aBlocks, {|| Wvt_DrawLine( 1, 0, 1, nCols, WVT_LINE_HORZ, WVT_LINE_RECESSED, WVT_LINE_TOP ) } ) - AAdd( aBlocks, {|| Wvt_DrawLine( 2, 0, 2, nCols, WVT_LINE_HORZ, WVT_LINE_PLAIN , WVT_LINE_CENTER, WVT_LINE_SOLID, 4, Rgb( 255,255,255 ) ) } ) - AAdd( aBlocks, {|| Wvt_DrawLine( 3, 0, 3, nCols, WVT_LINE_HORZ, WVT_LINE_RAISED , WVT_LINE_CENTER, WVT_LINE_DASH , 0, Rgb( 255,0,0 ) ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( 2, 0, 2, nCols, WVT_LINE_HORZ, WVT_LINE_PLAIN, WVT_LINE_CENTER, WVT_LINE_SOLID, 4, Rgb( 255, 255, 255 ) ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( 3, 0, 3, nCols, WVT_LINE_HORZ, WVT_LINE_RAISED, WVT_LINE_CENTER, WVT_LINE_DASH, 0, Rgb( 255, 0, 0 ) ) } ) AAdd( aBlocks, {|| Wvt_DrawLine( 4, 0, 4, nCols, WVT_LINE_HORZ, WVT_LINE_RECESSED, WVT_LINE_BOTTOM ) } ) @ 0, 1 SAY "Center Raised" @@ -431,14 +432,14 @@ FUNCTION WvtLines() @ nRows, 0 SAY PadC( "Press ESC to Quit", nCols + 1 ) COLOR "GR+/W" - AAdd( aBlocks, {|| Wvt_DrawLine( 11, 5,nRows - 2, 5, WVT_LINE_VERT, WVT_LINE_RAISED , WVT_LINE_CENTER ) } ) - AAdd( aBlocks, {|| Wvt_DrawLine( 11, 6,nRows - 2, 6, WVT_LINE_VERT, WVT_LINE_RECESSED, WVT_LINE_CENTER ) } ) - AAdd( aBlocks, {|| Wvt_DrawLine( 11, 7,nRows - 2, 7, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_LEFT ) } ) - AAdd( aBlocks, {|| Wvt_DrawLine( 11, 8,nRows - 2, 8, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_CENTER ) } ) - AAdd( aBlocks, {|| Wvt_DrawLine( 11, 9,nRows - 2, 9, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_RIGHT ) } ) - AAdd( aBlocks, {|| Wvt_DrawLine( 11,10,nRows - 2,10, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_CENTER, WVT_LINE_DOT, 0, RGB( 0,0,255 ) ) } ) - AAdd( aBlocks, {|| Wvt_DrawLine( 11,11,nRows - 2,11, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_CENTER, WVT_LINE_DASH, 0, RGB( 255,0,0 ) ) } ) - AAdd( aBlocks, {|| Wvt_DrawLine( 11,12,nRows - 2,12, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_CENTER, WVT_LINE_DASHDOT, 0, RGB( 0,255,0 ) ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( 11, 5, nRows - 2, 5, WVT_LINE_VERT, WVT_LINE_RAISED, WVT_LINE_CENTER ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( 11, 6, nRows - 2, 6, WVT_LINE_VERT, WVT_LINE_RECESSED, WVT_LINE_CENTER ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( 11, 7, nRows - 2, 7, WVT_LINE_VERT, WVT_LINE_PLAIN, WVT_LINE_LEFT ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( 11, 8, nRows - 2, 8, WVT_LINE_VERT, WVT_LINE_PLAIN, WVT_LINE_CENTER ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( 11, 9, nRows - 2, 9, WVT_LINE_VERT, WVT_LINE_PLAIN, WVT_LINE_RIGHT ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( 11, 10, nRows - 2, 10, WVT_LINE_VERT, WVT_LINE_PLAIN, WVT_LINE_CENTER, WVT_LINE_DOT, 0, RGB( 0, 0, 255 ) ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( 11, 11, nRows - 2, 11, WVT_LINE_VERT, WVT_LINE_PLAIN, WVT_LINE_CENTER, WVT_LINE_DASH, 0, RGB( 255, 0, 0 ) ) } ) + AAdd( aBlocks, {|| Wvt_DrawLine( 11, 12, nRows - 2, 12, WVT_LINE_VERT, WVT_LINE_PLAIN, WVT_LINE_CENTER, WVT_LINE_DASHDOT, 0, RGB( 0, 255, 0 ) ) } ) WvtSetBlocks( aBlocks ) diff --git a/harbour/contrib/gtwvg/tests/demowvg1.prg b/harbour/contrib/gtwvg/tests/demowvg1.prg index a32d2940fb..d9caf04e73 100644 --- a/harbour/contrib/gtwvg/tests/demowvg1.prg +++ b/harbour/contrib/gtwvg/tests/demowvg1.prg @@ -209,7 +209,7 @@ FUNCTION DoModalDialog() oCrt:Create() oCrt:show() - AAdd( aPaint, { "Box_V" , {|| Wvt_DrawBoxRaised( 1, 2, 11, 47 ) }, NIL, { WVT_BLOCK_BOX, 0, 0, MaxRow(), MaxCol() } } ) + AAdd( aPaint, { "Box_V", {|| Wvt_DrawBoxRaised( 1, 2, 11, 47 ) }, NIL, { WVT_BLOCK_BOX, 0, 0, MaxRow(), MaxCol() } } ) WvtSetPaint( aPaint ) SetColor( 'N/W' ) diff --git a/harbour/contrib/gtwvg/tests/demoxbp.prg b/harbour/contrib/gtwvg/tests/demoxbp.prg index a9533f50bb..598de06768 100644 --- a/harbour/contrib/gtwvg/tests/demoxbp.prg +++ b/harbour/contrib/gtwvg/tests/demoxbp.prg @@ -35,7 +35,7 @@ PROCEDURE Main() LOCAL aState := { "not selected", "selected", "undefined" } LOCAL aParts := {} - //--------------------------- Dialog -------------------------------\\ + // --------------------------- Dialog -------------------------------\\ oCrt := WvgDialog():new( , , { 30, 30 }, { 900, 600 }, , .T. ) oCrt:closable := .T. oCrt:icon := "vr_1.ico" @@ -45,13 +45,13 @@ PROCEDURE Main() oDA := oCrt:drawingArea - //--------------------------- Menu --------------------------------\\ + // --------------------------- Menu --------------------------------\\ ActiveXBuildMenuXbp( oCrt, @oStatic, @oStatic2 ) - //--------------------------- ToolBar -----------------------------\\ + // --------------------------- ToolBar -----------------------------\\ oTBar := ActiveXBuildToolBarXbp( oDA ) - //--------------------------- StatusBar ---------------------------\\ + // --------------------------- StatusBar ---------------------------\\ oSBar := WvgStatusBar():new( oCrt ):create( , , , , , .T. ) oSBar:panelClick := {| oPanel | WVG_MessageBox( , oPanel:caption ) } oPanel := oSBar:getItem( 1 ) @@ -61,21 +61,21 @@ PROCEDURE Main() oPanel2 := oSBar:addItem() oPanel2:caption := 'Click on any part!' - //--------------------------- Static ------------------------------\\ + // --------------------------- Static ------------------------------\\ oStatic := WvgStatic():new( oDA ) oStatic:type := WVGSTATIC_TYPE_TEXT oStatic:options := WVGSTATIC_TEXT_CENTER oStatic:caption := Chr( 13 ) + 'Implemented Xbase++ Parts' - oStatic:create( , , { 0, oTBar:currentSize()[2] + 3 }, { 120, oCrt:currentSize()[2] - ; - oTBar:currentSize()[2] - oSBar:currentSize()[2] - 4 }, , .T. ) - oStatic:setColorBG( RGB( 200,200,200 ) ) + oStatic:create( , , { 0, oTBar:currentSize()[ 2 ] + 3 }, { 120, oCrt:currentSize()[ 2 ] - ; + oTBar:currentSize()[ 2 ] - oSBar:currentSize()[ 2 ] - 4 }, , .T. ) + oStatic:setColorBG( RGB( 200, 200, 200 ) ) - //--------------------------- ListBox -----------------------------\\ + // --------------------------- ListBox -----------------------------\\ oListBox := WvgListBox():new() oListBox:create( oStatic, , { 5, 55 }, { 107, 380 } ) - oListBox:setColorFG( RGB( 218,61,34 ) ) + oListBox:setColorFG( RGB( 218, 61, 34 ) ) // oListBox:setColorBG( RGB( 250,244,182 ) ) AAdd( aParts, 'XbpDialog' ) @@ -105,23 +105,23 @@ PROCEDURE Main() oListBox:itemSelected := {|| WVG_MessageBox( , oListBox:getCurItem() ) } oListBox:setData( 3 ) // show selected 'XbpToolBar' - //--------------------------- PushButton --------------------------\\ + // --------------------------- PushButton --------------------------\\ oXbp := WvgPushButton():new( oStatic ) oXbp:caption := "Hide" oXbp:create( , , { 20, 440 }, { 80, 30 } ) oXbp:activate := {|| oStatic:hide(), oCrt:sendMessage( WM_SIZE, 0, 0 ) } - //--------------------------- TreeView ---------------------------\\ + // --------------------------- TreeView ---------------------------\\ - oTree := WvgTreeView():new( oDA, , { oCrt:currentSize()[1] - 160, oTBar:currentSize()[2] + 3 }, ; - { 160, oCrt:currentSize()[2] - ; - oTBar:currentSize()[2] - oSBar:currentSize()[2] - 4 }, , .T. ) + oTree := WvgTreeView():new( oDA, , { oCrt:currentSize()[ 1 ] - 160, oTBar:currentSize()[ 2 ] + 3 }, ; + { 160, oCrt:currentSize()[ 2 ] - ; + oTBar:currentSize()[ 2 ] - oSBar:currentSize()[ 2 ] - 4 }, , .T. ) oTree:hasLines := .T. oTree:hasButtons := .T. oTree:alwaysShowSelection := .T. oTree:create() - oTree:setColorBG( RGB( 120,15,240 ) ) - oTree:setColorFG( RGB( 15,240,120 ) ) + oTree:setColorBG( RGB( 120, 15, 240 ) ) + oTree:setColorFG( RGB( 15, 240, 120 ) ) oTree:itemSelected := {| oItem | iif( oItem != NIL, WVG_MessageBox( , oItem:caption ), NIL ) } oItem1 := oTree:rootItem:addItem( "First level A" ) @@ -143,7 +143,7 @@ PROCEDURE Main() oTree:setData( oItem2 ) - //--------------------------- Active-X ---------------------------\\ + // --------------------------- Active-X ---------------------------\\ hb_gtInfo( HB_GTI_WINTITLE, 'http://www.harbour.vouch.info' ) #if 0 oCom := WvgActiveXControl():New( oDA, , { 0, 0 }, { 100, 100 }, , .T. ) @@ -162,19 +162,19 @@ PROCEDURE Main() oAddr:border := .T. cNavigate := 'http://www.harbour.vouch.info' oAddr:dataLink := {| x | iif( x == NIL, cNavigate, cNavigate := x ) } - oAddr:setColorFG( RGB( 0,0,255 ) ) - oAddr:setColorBG( RGB( 0,255,255 ) ) - oAddr:create( oDA, , { 120, oTBar:currentSize()[2] }, { 500, 20 }, , .T. ) + oAddr:setColorFG( RGB( 0, 0, 255 ) ) + oAddr:setColorBG( RGB( 0, 255, 255 ) ) + oAddr:create( oDA, , { 120, oTBar:currentSize()[ 2 ] }, { 500, 20 }, , .T. ) oAddr:setData() oAddr:killInputFocus := {| m1, m2, oS | m1 := m1, m2 := m2, oS:getData(), oCom:navigate( cNavigate ) } - //----------------- Panel : Static + Radio + Checkbox ----------\\ + // ----------------- Panel : Static + Radio + Checkbox ----------\\ oStatic2 := WvgStatic():New( oDA, , { 150, 150 }, { 500, 310 }, , .F. ) -// oStatic2:type := WVGSTATIC_TYPE_RAISEDBOX //BGNDFRAME + // oStatic2:type := WVGSTATIC_TYPE_RAISEDBOX //BGNDFRAME oStatic2:exStyle += WS_EX_WINDOWEDGE -// oStatic2:options := WVGSTATIC_FRAMETHICK + // oStatic2:options := WVGSTATIC_FRAMETHICK oStatic2:create() - oStatic2:setColorBG( RGB( 175,175,175 ) ) + oStatic2:setColorBG( RGB( 175, 175, 175 ) ) oXbp := WvgPushButton():new( oStatic2 ) oXbp:caption := "Hide" @@ -195,21 +195,21 @@ PROCEDURE Main() oCheck := WvgCheckBox():New( oStatic2, , { 10, 70 }, { 100, 15 }, , .T. ) oCheck:caption := 'Checkbox A' oCheck:create() - oCheck:selected := {| m1, m2, o | m1 := m1, m2 := m2, WVG_MessageBox( , iif( o:getData(), 'I am selected','I am not selected' ) ) } + oCheck:selected := {| m1, m2, o | m1 := m1, m2 := m2, WVG_MessageBox( , iif( o:getData(), 'I am selected', 'I am not selected' ) ) } // Create first 3State button, passing the position to :create() oXbp := Wvg3State():new() oXbp:caption := "3 State A" oXbp:create( oStatic2, , { 10, 100 }, { 100, 15 } ) // Determine current state using mp1 - oXbp:selected := {| m1, m2, oBtn | m2 := m2, oBtn := oBtn, oPanel1:caption := "3State A [" + aState[ m1+1 ] + "]" } + oXbp:selected := {| m1, m2, oBtn | m2 := m2, oBtn := oBtn, oPanel1:caption := "3State A [" + aState[ m1 + 1 ] + "]" } // Create second 3State Button, passing the position to :new() oXbp := Wvg3State():new( oStatic2, , { 10, 125 }, { 100, 15 } ) oXbp:caption := "3 State B" oXbp:create( oStatic2 ) // Determine current state using :getData() - oXbp:selected := {| m1, m2, oBtn | m1 := m1, m2 := m2, WVG_MessageBox( , "3State B", aState[ oBtn:getData()+1 ] ) } + oXbp:selected := {| m1, m2, oBtn | m1 := m1, m2 := m2, WVG_MessageBox( , "3State B", aState[ oBtn:getData() + 1 ] ) } // Create first SLE, specify position using :create() // On :typeOut set the focus to the second SLE @@ -244,7 +244,7 @@ PROCEDURE Main() // Copy text from LOCAL variable into edit buffer via :dataLink oMLE:setData() - //--------------------------- Misc Config ------------------------\\ + // --------------------------- Misc Config ------------------------\\ oTBar:buttonClick := {| oBtn | iif( oBtn:caption == 'Hide' , oStatic:hide(), NIL ), ; iif( oBtn:caption == 'Show' , oStatic:show(), NIL ), ; iif( oBtn:caption == 'Tools' , oStatic2:show():toFront(), NIL ), ; @@ -278,19 +278,19 @@ STATIC FUNCTION ResizeDialogXbp( oCrt, oTBar, oSBar, oStatic, oCom, oTree, oAddr aTBar := oTBar:currentSize() aSBar := oSBar:currentSize() - nT := aTBar[2] - nH := aCrt[2] - aTBar[2] - aSBar[2] + nT := aTBar[ 2 ] + nH := aCrt[ 2 ] - aTBar[ 2 ] - aSBar[ 2 ] IF oStatic:isVisible oStatic:setPosAndSize( { 0, nT + 3 }, { 120, nH - 4 }, .T. ) - oAddr:setPosAndSize( { 120, nT + 2 }, { aCrt[1] - 120 - 150, 20 }, .T. ) - oCom:setPosAndSize( { 120, nT + 2 + 20 }, { aCrt[1] - 120 - 150, nH - 20 }, .T. ) - oTree:setPosAndSize( { aCrt[1] - 150, nT }, { 150, nH }, .T. ) + oAddr:setPosAndSize( { 120, nT + 2 }, { aCrt[ 1 ] - 120 - 150, 20 }, .T. ) + oCom:setPosAndSize( { 120, nT + 2 + 20 }, { aCrt[ 1 ] - 120 - 150, nH - 20 }, .T. ) + oTree:setPosAndSize( { aCrt[ 1 ] - 150, nT }, { 150, nH }, .T. ) ELSE - oAddr:setPosAndSize( { 0, nT + 2 }, { aCrt[1] - 150, 20 }, .T. ) - oCom:setPosAndSize( { 0, nT + 2 + 20 }, { aCrt[1] - 150, nH - 20 }, .T. ) - oTree:setPosAndSize( { aCrt[1] - 150, nT }, { 150, nH }, .T. ) + oAddr:setPosAndSize( { 0, nT + 2 }, { aCrt[ 1 ] - 150, 20 }, .T. ) + oCom:setPosAndSize( { 0, nT + 2 + 20 }, { aCrt[ 1 ] - 150, nH - 20 }, .T. ) + oTree:setPosAndSize( { aCrt[ 1 ] - 150, nT }, { 150, nH }, .T. ) ENDIF @@ -344,7 +344,7 @@ STATIC FUNCTION ActiveXBuildToolBarXbp( oCrt ) LOCAL oTBar - oTBar := WvgToolBar():new( oCrt , , { 0, 0 }, { 0, 0 }, , .T. ) + oTBar := WvgToolBar():new( oCrt, , { 0, 0 }, { 0, 0 }, , .T. ) oTBar:style := WVGTOOLBAR_STYLE_FLAT @@ -362,11 +362,11 @@ STATIC FUNCTION ActiveXBuildToolBarXbp( oCrt ) oTBar:addItem( "New" , hb_DirBase() + 'v_new.bmp' ) oTBar:addItem( "Select" , hb_DirBase() + 'v_selct1.bmp' ) - oTBar:addItem( ) + oTBar:addItem() oTBar:addItem( "FontDlg" , hb_DirBase() + 'v_calend.bmp' ) oTBar:addItem( "Tools" , hb_DirBase() + 'v_lock.bmp' ) oTBar:addItem( "Index" , hb_DirBase() + 'v_index.bmp' ) - oTBar:addItem( ) + oTBar:addItem() oTBar:addItem( "Show" , hb_DirBase() + 'v_clclt.bmp' ) oTBar:addItem( "Hide" , hb_DirBase() + 'v_notes1.bmp' ) @@ -380,21 +380,21 @@ STATIC FUNCTION MyFunctionXbp( nMode ) DO CASE CASE nMode == 1 - Tone( MUSIC_WAITON[1], 1 ) - Tone( MUSIC_WAITON[2], 1 ) + Tone( MUSIC_WAITON[ 1 ], 1 ) + Tone( MUSIC_WAITON[ 2 ], 1 ) CASE nMode == 2 - Tone( MUSIC_WAITON[2], 1 ) - Tone( MUSIC_WAITON[1], 1 ) + Tone( MUSIC_WAITON[ 2 ], 1 ) + Tone( MUSIC_WAITON[ 1 ], 1 ) CASE nMode == 3 WVG_MessageBox( , "Button clicked!" ) CASE nMode == 101 // Charge - Eval( {|| Tone( 523,2 ), Tone( 698,2 ), Tone( 880,2 ), Tone( 1046,4 ), Tone( 880,2 ), Tone( 1046,8 ) } ) + Eval( {|| Tone( 523, 2 ), Tone( 698, 2 ), Tone( 880, 2 ), Tone( 1046, 4 ), Tone( 880, 2 ), Tone( 1046, 8 ) } ) CASE nMode == 102 // NannyBoo - AEval( { { 196,2 }, { 196,2 }, { 164,2 }, { 220,2 }, { 196,4 }, { 164,4 } }, {| a | Tone( a[1],a[2] ) } ) + AEval( { { 196, 2 }, { 196, 2 }, { 164, 2 }, { 220, 2 }, { 196, 4 }, { 164, 4 } }, {| a | Tone( a[ 1 ], a[ 2 ] ) } ) CASE nMode == 103 // BADKEY Tone( 480, 0.25 ) diff --git a/harbour/contrib/gtwvg/tests/dyndlgs.prg b/harbour/contrib/gtwvg/tests/dyndlgs.prg index a5aea499da..4efc0e96c9 100644 --- a/harbour/contrib/gtwvg/tests/dyndlgs.prg +++ b/harbour/contrib/gtwvg/tests/dyndlgs.prg @@ -190,20 +190,20 @@ FUNCTION DynDlgProc( hDlg, nMsg, wParam, lParam ) EXIT CASE WM_CTLCOLOREDIT - IF ( WVG_GetDlgItem( hDlg,ID_MLE ) == lParam ) - WVG_SetTextColor( wParam, RGB( 0,0,255 ) ) - WVG_SetBkColor( wParam, RGB( 255,255,200 ) ) + IF ( WVG_GetDlgItem( hDlg, ID_MLE ) == lParam ) + WVG_SetTextColor( wParam, RGB( 0, 0, 255 ) ) + WVG_SetBkColor( wParam, RGB( 255, 255, 200 ) ) RETURN 1 - ELSEIF ( WVG_GetDlgItem( hDlg,ID_EDT_TEXT ) == lParam ) - WVG_SetTextColor( wParam, RGB( 255,255,255 ) ) - WVG_SetBkColor( wParam, RGB( 10,200,45 ) ) + ELSEIF ( WVG_GetDlgItem( hDlg, ID_EDT_TEXT ) == lParam ) + WVG_SetTextColor( wParam, RGB( 255, 255, 255 ) ) + WVG_SetBkColor( wParam, RGB( 10, 200, 45 ) ) RETURN 1 ENDIF EXIT CASE WM_CTLCOLORSTATIC - IF ( WVG_GetDlgItem( hDlg,ID_STA_TEXT ) == lParam ) - WVG_SetTextColor( wParam, RGB( 255,255,255 ) ) + IF ( WVG_GetDlgItem( hDlg, ID_STA_TEXT ) == lParam ) + WVG_SetTextColor( wParam, RGB( 255, 255, 255 ) ) RETURN 1 ENDIF EXIT diff --git a/harbour/contrib/gtwvg/tests/modal.prg b/harbour/contrib/gtwvg/tests/modal.prg index c4a4189e93..1571976d86 100644 --- a/harbour/contrib/gtwvg/tests/modal.prg +++ b/harbour/contrib/gtwvg/tests/modal.prg @@ -85,9 +85,9 @@ FUNCTION Just_Alert( cMsg, aOpt ) [ ] ; INTO < oCrt > ; => ; - < oCrt > := CreateOCrt( < nTop > , < nLeft > , < nBottom > , < nRight > , < ttl > , < icon > , ; - < .lModal. > , < .lRowCols. > , < .lHidden. > , < .lCenter. > , ; - < nRow > , < nCol > , < .lNoTitleBar. > ) + := CreateOCrt( , , , , , , ; + <.lModal.>, <.lRowCols.>, <.lHidden.>, <.lCenter.>, ; + , , <.lNoTitleBar.> ) // @@ -100,7 +100,7 @@ FUNCTION DialogAlert( cCaption, aText_, aButtons_, sel, aMessage_, nTop, nTime ) LOCAL maxRow := MaxRow() LOCAL nBtnCol_ LOCAL pal_ := { "w+/n", "w/r", "n/w", "n/bg", "r/bg", "N/W", "n/B", "w+/B" } - LOCAL aTrg_ , x_ := {} + LOCAL aTrg_, x_ := {} hb_default( @cCaption , "Your Attention Please!" ) hb_default( @aButtons_ , { "OK" } ) @@ -146,7 +146,7 @@ FUNCTION DialogAlert( cCaption, aText_, aButtons_, sel, aMessage_, nTop, nTime ) aTrg_ := Array( Len( aButtons_ ) ) FOR i := 1 TO Len( aButtons_ ) - aTrg_[i] := Upper( SubStr( aButtons_[ i ], 1, 1 ) ) + aTrg_[ i ] := Upper( SubStr( aButtons_[ i ], 1, 1 ) ) NEXT // Create a new Window @@ -164,7 +164,7 @@ FUNCTION DialogAlert( cCaption, aText_, aButtons_, sel, aMessage_, nTop, nTime ) nBtnCol_[ 1 ] := Int( ( nColRqd - nColBut ) / 2 ) + 3 IF Len( aButtons_ ) > 1 FOR i := 2 TO Len( aButtons_ ) - nBtnCol_[ i ] := nBtnCol_[ i-1 ] + Len( aButtons_[ i-1 ] ) + 3 + 4 + nBtnCol_[ i ] := nBtnCol_[ i - 1 ] + Len( aButtons_[ i - 1 ] ) + 3 + 4 NEXT ENDIF @@ -196,7 +196,7 @@ FUNCTION DialogAlert( cCaption, aText_, aButtons_, sel, aMessage_, nTop, nTime ) NEXT SetColor( pal_[ DLG_CLR_HILITE ] ) - @ nBtnRow, nBtnCol_[ sel ] SAY " " + aButtons_[sel] + " " + @ nBtnRow, nBtnCol_[ sel ] SAY " " + aButtons_[ sel ] + " " SetColor( pal_[ DLG_CLR_HISEL ] ) @ nBtnRow, nBtnCol_[ sel ] + 2 SAY SubStr( aButtons_[ sel ], 1, 1 ) @@ -263,13 +263,13 @@ FUNCTION DialogAlert( cCaption, aText_, aButtons_, sel, aMessage_, nTop, nTime ) DispBegin() FOR i := 1 TO Len( aButtons_ ) SetColor( pal_[ DLG_CLR_BTN ] ) - @ nBtnRow, nBtnCol_[ i ] SAY " " + aButtons_[i] + " " - SetColor( pal_[ DLG_CLR_TRG] ) - @ nBtnRow, nBtnCol_[i] + 2 SAY SubStr( aButtons_[i], 1, 1 ) + @ nBtnRow, nBtnCol_[ i ] SAY " " + aButtons_[ i ] + " " + SetColor( pal_[ DLG_CLR_TRG ] ) + @ nBtnRow, nBtnCol_[ i ] + 2 SAY SubStr( aButtons_[ i ], 1, 1 ) NEXT IF sel > 0 SetColor( pal_[ DLG_CLR_HILITE ] ) - @ nBtnRow, nBtnCol_[sel] SAY " " + aButtons_[ sel ] + " " + @ nBtnRow, nBtnCol_[ sel ] SAY " " + aButtons_[ sel ] + " " SetColor( pal_[ DLG_CLR_HISEL ] ) @ nBtnRow, nBtnCol_[ sel ] + 2 SAY SubStr( aButtons_[ sel ], 1, 1 ) ENDIF @@ -295,7 +295,7 @@ FUNCTION CreateOCrt( nT, nL, nB, nR, cTitle, xIcon, lModal, lRowCols, lHidden, ; hb_default( @lCenter , .F. ) hb_default( @lNoTitleBar , .F. ) - aPos := iif( lCenter, { -1, -1 }, iif( nRow == NIL, { nT, nL }, { nRow,nCol } ) ) + aPos := iif( lCenter, { -1, -1 }, iif( nRow == NIL, { nT, nL }, { nRow, nCol } ) ) oCrt := WvgCrt():new( , , aPos, { nB - nT, nR - nL }, , !lHidden ) oCrt:lModal := lModal diff --git a/harbour/contrib/gtwvg/tests/tbrowser.prg b/harbour/contrib/gtwvg/tests/tbrowser.prg index 2bcdf6ed74..cc97feaa7e 100644 --- a/harbour/contrib/gtwvg/tests/tbrowser.prg +++ b/harbour/contrib/gtwvg/tests/tbrowser.prg @@ -42,7 +42,7 @@ FUNCTION WvtMyBrowse() IF hb_mtvm() - hb_threadStart( {| oCrt | oCrt := WvgCrt():new( , , { -1, -2 }, { 34,69 }, , .T. ), ; + hb_threadStart( {| oCrt | oCrt := WvgCrt():new( , , { -1, -2 }, { 34, 69 }, , .T. ), ; oCrt:resizeMode := HB_GTI_RESIZEMODE_ROWS, ; oCrt:icon := GetResource( "dia_excl.ico" ), ; oCrt:create(), ; @@ -61,8 +61,8 @@ FUNCTION WvtMyBrowse() FUNCTION ExecBrowser( oCrt ) - LOCAL nKey, bBlock, oBrowse , aLastPaint, i, pGT - LOCAL cFileIndex, cFileDbf, cRDD, nIndex, oTBar, cScr, info_ //, oLB + LOCAL nKey, bBlock, oBrowse, aLastPaint, i, pGT + LOCAL cFileIndex, cFileDbf, cRDD, nIndex, oTBar, cScr, info_ // , oLB LOCAL lEnd := .F. LOCAL aBlocks := {} LOCAL nTop := 4 @@ -534,7 +534,7 @@ STATIC FUNCTION BrwBuildButtons( oCrt, oBrw ) oPB:create( , , { {|| -MaxRow() }, -nOff }, { -1, -aW[ i ] } ) ENDIF oPB:activate := aAct[ i ] - oPB:setColorFG( RGB( 0,255,0 ) ) + oPB:setColorFG( RGB( 0, 255, 0 ) ) oPB:tooltipText := aPmt[ i ] nOff += aW[ i ] + nG @@ -605,7 +605,7 @@ STATIC FUNCTION BrwBuildToolBar( oCrt ) oTBar:style := WVGTOOLBAR_STYLE_FLAT oTBar:borderStyle := WVGFRAME_RECT - oTBar:buttonWidth := 40 //28 + oTBar:buttonWidth := 40 // 28 oTBar:buttonHeight := 26 oTBar:imageWidth := 26 @@ -793,11 +793,11 @@ STATIC FUNCTION TBNext() LOCAL nSaveRecNum := RecNo() LOCAL lMoved := .T. - IF EOF() + IF Eof() lMoved := .F. ELSE dbSkip( 1 ) - IF EOF() + IF Eof() lMoved := .F. dbGoto( nSaveRecNum ) ENDIF @@ -814,7 +814,7 @@ STATIC FUNCTION TBPrev() dbSkip( -1 ) - IF BOF() + IF Bof() dbGoto( nSaveRecNum ) lMoved := .F. ENDIF @@ -1032,7 +1032,7 @@ FUNCTION ConfigBrowser( aFields, cUseAlias, aTLBR, cDesc, oParent, cColorSpec, n FOR i := 1 TO Len( aFields ) bBlock := VouBlockField( aFields[ i ] ) - oBrowse:AddColumn( TBColumnNew( info_[ aFields[ i ],1 ], bBlock ) ) + oBrowse:AddColumn( TBColumnNew( info_[ aFields[ i ], 1 ], bBlock ) ) NEXT oBrowse:configure() diff --git a/harbour/contrib/gtwvg/tests/utils.prg b/harbour/contrib/gtwvg/tests/utils.prg index b8ee421b4a..c2926f14da 100644 --- a/harbour/contrib/gtwvg/tests/utils.prg +++ b/harbour/contrib/gtwvg/tests/utils.prg @@ -48,23 +48,23 @@ // -THREAD STATIC t_keys_ := { , , , , , , , , , , , , , , , , , , , } -THREAD STATIC t_pic_ := { , , , , , , , , , , , , , , , , , , , } +THREAD STATIC t_keys_ := {, , , , , , , , , , , , , , , , , , , } +THREAD STATIC t_pic_ := {, , , , , , , , , , , , , , , , , , , } // FUNCTION WvtSetKeys( lSet ) IF lSet - t_keys_[ 2 ] := SetKey( K_F2, {|| WvtNextGets() } ) - t_keys_[ 3 ] := SetKey( K_F3, {|| WvtWindowExpand( 1 ) } ) - t_keys_[ 4 ] := SetKey( K_F4, {|| WvtWindowExpand( -1 ) } ) - t_keys_[ 5 ] := SetKey( K_F5, {|| WvtMyBrowse() } ) - t_keys_[ 6 ] := SetKey( K_F6, {|| Wvt_Minimize() } ) - t_keys_[ 7 ] := SetKey( K_F7, {|| WvtPartialScreen() } ) - t_keys_[ 8 ] := SetKey( K_F8, {|| WvtLines() } ) - t_keys_[ 9 ] := SetKey( K_F9, {|| Wvt_ChooseFont() } ) - t_keys_[ 10] := SetKey( K_F10, {|| Wvt_ChooseColor() } ) + t_keys_[ 2 ] := SetKey( K_F2, {|| WvtNextGets() } ) + t_keys_[ 3 ] := SetKey( K_F3, {|| WvtWindowExpand( 1 ) } ) + t_keys_[ 4 ] := SetKey( K_F4, {|| WvtWindowExpand( -1 ) } ) + t_keys_[ 5 ] := SetKey( K_F5, {|| WvtMyBrowse() } ) + t_keys_[ 6 ] := SetKey( K_F6, {|| Wvt_Minimize() } ) + t_keys_[ 7 ] := SetKey( K_F7, {|| WvtPartialScreen() } ) + t_keys_[ 8 ] := SetKey( K_F8, {|| WvtLines() } ) + t_keys_[ 9 ] := SetKey( K_F9, {|| Wvt_ChooseFont() } ) + t_keys_[ 10 ] := SetKey( K_F10, {|| Wvt_ChooseColor() } ) ELSE SetKey( K_F2, t_keys_[ 2 ] ) SetKey( K_F3, t_keys_[ 3 ] ) @@ -74,7 +74,7 @@ FUNCTION WvtSetKeys( lSet ) SetKey( K_F7, t_keys_[ 7 ] ) SetKey( K_F8, t_keys_[ 8 ] ) SetKey( K_F9, t_keys_[ 9 ] ) - SetKey( K_F10, t_keys_[ 10] ) + SetKey( K_F10, t_keys_[ 10 ] ) ENDIF RETURN NIL @@ -352,7 +352,7 @@ FUNCTION BuildWvgToolBar( oDA, nActiveX ) oTBar:style := WVGTOOLBAR_STYLE_FLAT oTBar:borderStyle := WVGFRAME_RECT - oTBar:buttonWidth := 40 //28 + oTBar:buttonWidth := 40 // 28 oTBar:buttonHeight := 26 oTBar:imageWidth := 26 @@ -490,7 +490,7 @@ FUNCTION Popups( nID, lDestroy ) FUNCTION DispStatusMsg( cMsg ) - Wvt_DrawLabel( MaxRow(), 60, cMsg, 6, , 0, rgb( 198,198,198 ), "Arial", 18, , 900 ) + Wvt_DrawLabel( MaxRow(), 60, cMsg, 6, , 0, rgb( 198, 198, 198 ), "Arial", 18, , 900 ) RETURN .T. diff --git a/harbour/contrib/gtwvg/tests/wvtcls.prg b/harbour/contrib/gtwvg/tests/wvtcls.prg index 3d13c61d7a..f660765bb2 100644 --- a/harbour/contrib/gtwvg/tests/wvtcls.prg +++ b/harbour/contrib/gtwvg/tests/wvtcls.prg @@ -33,11 +33,11 @@ FUNCTION DialogWvgClassesOne( nMode ) bBlock := {| oCrt | ; oCrt := WvgCrt():New( , , { -1, -1 }, { 54, 184 }, , .F. ), ; oCrt:fontName := 'Courier', ; - oCrt:fontHeight := 13 , ; - oCrt:fontWidth := 0 , ; - oCrt:Create() , ; - MyDialogOne( oCrt ) , ; - oCrt:destroy() ; + oCrt:fontHeight := 13, ; + oCrt:fontWidth := 0, ; + oCrt:Create(), ; + MyDialogOne( oCrt ), ; + oCrt:destroy() ; } hb_threadStart( bBlock ) ENDIF @@ -133,14 +133,14 @@ STATIC FUNCTION MyDialogOne( oCrt ) oTBar := WvtToolbar():New( oDlg, 103, 0, 0, 2 ) oTBar:lFloating := .F. oTBar:Tooltip := "Toolbar" - oTBar:AddButton( aImg_[ 1 ], {|| oImg:SetImage( aImg_[ 1 ] ) } , "Lock" ) - oTBar:AddButton( aImg_[ 2 ], {|| oImg:SetImage( aImg_[ 2 ] ), oText:SetText( "Harbour" ) } , "New" ) - oTBar:AddButton( aImg_[ 3 ], {|| oImg:SetImage( aImg_[ 3 ] ) } , "Calculator" ) + oTBar:AddButton( aImg_[ 1 ], {|| oImg:SetImage( aImg_[ 1 ] ) }, "Lock" ) + oTBar:AddButton( aImg_[ 2 ], {|| oImg:SetImage( aImg_[ 2 ] ), oText:SetText( "Harbour" ) }, "New" ) + oTBar:AddButton( aImg_[ 3 ], {|| oImg:SetImage( aImg_[ 3 ] ) }, "Calculator" ) oTBar:AddButton() - oTBar:AddButton( aImg_[ 5 ], {|| oImg:SetImage( aImg_[ 5 ] ) } , "Restore" ) - oTBar:AddButton( aImg_[ 4 ], {|| oImg:SetImage( aImg_[ 4 ] ), oText:SetText( "Vouch" ) } , "Calendar" ) - oTBar:AddButton( aImg_[ 6 ], {|| oImg:SetImage( aImg_[ 6 ] ) } , "Notes" ) - oTBar:AddButton( aImg_[ 7 ], {|| oImg:SetImage( aImg_[ 7 ] ) } , "Press to Send Browse on Top" ) + oTBar:AddButton( aImg_[ 5 ], {|| oImg:SetImage( aImg_[ 5 ] ) }, "Restore" ) + oTBar:AddButton( aImg_[ 4 ], {|| oImg:SetImage( aImg_[ 4 ] ), oText:SetText( "Vouch" ) }, "Calendar" ) + oTBar:AddButton( aImg_[ 6 ], {|| oImg:SetImage( aImg_[ 6 ] ) }, "Notes" ) + oTBar:AddButton( aImg_[ 7 ], {|| oImg:SetImage( aImg_[ 7 ] ) }, "Press to Send Browse on Top" ) oTBar:AddButton() oDlg:AddObject( oTBar ) @@ -188,8 +188,8 @@ STATIC FUNCTION MyDialogOne( oCrt ) oDlg:AddObject( oCon ) nGetCol := 158 - bBlock := {|| oCon:Say( 12, 148, "Name" , "N/W" ), ; - oCon:Say( 14, 148, "Date" , "N/W" ), ; + bBlock := {|| oCon:Say( 12, 148, "Name", "N/W" ), ; + oCon:Say( 14, 148, "Date", "N/W" ), ; oCon:Say( 16, 148, "Amount", "N/W" ) } oGet := WvtGets():New( oDlg, 210, 9, oDlg:MaxCol() - 40, 18, oDlg:MaxCol() - 2 ) @@ -235,7 +235,7 @@ STATIC FUNCTION MyDialogOne( oCrt ) oTBx:nTextColor := RGB( 255, 255, 255 ) oTBx:nTextColorHoverOn := RGB( 0, 0, 255 ) oTBx:aPopup := {} - AAdd( oTBx:aPopup, { "Getsome" , {|| .T. } } ) + AAdd( oTBx:aPopup, { "Getsome", {|| .T. } } ) AAdd( oTBx:aPopup, { "Getsome2", {|| .T. } } ) oDlg:AddObject( oTBx ) @@ -343,7 +343,7 @@ FUNCTION DialogWvgClassesTwo() g_oMenuBar := WvtMenu():new():create() oMenu := wvtMenu():new():create() oMenu:Caption := "Miscellaneous" - oMenu:AddItem( "Progressbar", {|| ExeProgBar( oPBar,oPBar1,oPBar2,oPBar3, oPBar4 ) } ) + oMenu:AddItem( "Progressbar", {|| ExeProgBar( oPBar, oPBar1, oPBar2, oPBar3, oPBar4 ) } ) oMenu:AddItem( "-" ) oMenu:AddItem( "Exit", {|| Wvt_Keyboard( K_ESC ) } ) g_oMenuBar:addItem( "", oMenu ) diff --git a/harbour/contrib/gtwvg/tests/xbp.prg b/harbour/contrib/gtwvg/tests/xbp.prg index 4f302d03ce..778777a387 100644 --- a/harbour/contrib/gtwvg/tests/xbp.prg +++ b/harbour/contrib/gtwvg/tests/xbp.prg @@ -33,7 +33,7 @@ FUNCTION demoxbp() LOCAL aState := { "not selected", "selected", "undefined" } LOCAL aParts := {} - //--------------------------- Dialog -------------------------------\\ + // --------------------------- Dialog -------------------------------\\ oCrt := WvgDialog():new( , , { 30, 30 }, { 900, 600 }, , .T. ) oCrt:closable := .T. oCrt:icon := GetResource( "vr_1.ico" ) @@ -43,13 +43,13 @@ FUNCTION demoxbp() oDA := oCrt:drawingArea - //--------------------------- Menu --------------------------------\\ + // --------------------------- Menu --------------------------------\\ ActiveXBuildMenuXbp( oCrt, @oStatic, @oStatic2 ) - //--------------------------- ToolBar -----------------------------\\ + // --------------------------- ToolBar -----------------------------\\ oTBar := ActiveXBuildToolBarXbp( oDA ) - //--------------------------- StatusBar ---------------------------\\ + // --------------------------- StatusBar ---------------------------\\ oSBar := WvgStatusBar():new( oCrt ):create( , , , , , .T. ) oSBar:panelClick := {| oPanel | WVG_MessageBox( , oPanel:caption ) } oPanel := oSBar:getItem( 1 ) @@ -59,7 +59,7 @@ FUNCTION demoxbp() oPanel2 := oSBar:addItem() oPanel2:caption := 'Click on any part!' - //--------------------------- Static ------------------------------\\ + // --------------------------- Static ------------------------------\\ oStatic := WvgStatic():new( oDA ) oStatic:type := WVGSTATIC_TYPE_TEXT oStatic:options := WVGSTATIC_TEXT_CENTER @@ -67,13 +67,13 @@ FUNCTION demoxbp() oStatic:create( , , { 0, oTBar:currentSize()[ 2 ] + 3 }, { 120, oCrt:currentSize()[ 2 ] - ; oTBar:currentSize()[ 2 ] - oSBar:currentSize()[ 2 ] - 4 }, , .T. ) - oStatic:setColorBG( RGB( 200,200,200 ) ) + oStatic:setColorBG( RGB( 200, 200, 200 ) ) - //--------------------------- ListBox -----------------------------\\ + // --------------------------- ListBox -----------------------------\\ oListBox := WvgListBox():new() oListBox:create( oStatic, , { 5, 55 }, { 107, 380 } ) - oListBox:setColorFG( RGB( 218,61,34 ) ) + oListBox:setColorFG( RGB( 218, 61, 34 ) ) // oListBox:setColorBG( RGB( 250,244,182 ) ) AAdd( aParts, 'XbpDialog' ) @@ -103,13 +103,13 @@ FUNCTION demoxbp() oListBox:itemSelected := {|| WVG_MessageBox( , oListBox:getCurItem() ) } oListBox:setData( 3 ) // show selected 'XbpToolBar' - //--------------------------- PushButton --------------------------\\ + // --------------------------- PushButton --------------------------\\ oXbp := WvgPushButton():new( oStatic ) oXbp:caption := "Hide" oXbp:create( , , { 20, 440 }, { 80, 30 } ) oXbp:activate := {|| oStatic:hide(), oCrt:sendMessage( WM_SIZE, 0, 0 ) } - //--------------------------- TreeView ---------------------------\\ + // --------------------------- TreeView ---------------------------\\ oTree := WvgTreeView():new( oDA, , { oCrt:currentSize()[ 1 ] - 160, oTBar:currentSize()[ 2 ] + 3 }, ; { 160, oCrt:currentSize()[ 2 ] - ; @@ -118,8 +118,8 @@ FUNCTION demoxbp() oTree:hasButtons := .T. oTree:alwaysShowSelection := .T. oTree:create() - oTree:setColorBG( RGB( 120,15,240 ) ) - oTree:setColorFG( RGB( 15,240,120 ) ) + oTree:setColorBG( RGB( 120, 15, 240 ) ) + oTree:setColorFG( RGB( 15, 240, 120 ) ) oTree:itemSelected := {| oItem | iif( oItem != NIL, WVG_MessageBox( , oItem:caption ), NIL ) } oItem1 := oTree:rootItem:addItem( "First level A" ) @@ -141,7 +141,7 @@ FUNCTION demoxbp() oTree:setData( oItem2 ) - //--------------------------- Active-X ---------------------------\\ + // --------------------------- Active-X ---------------------------\\ hb_gtInfo( HB_GTI_WINTITLE, 'http://www.harbour.vouch.info' ) #if 0 oCom := WvgActiveXControl():New( oDA, , { 0, 0 }, { 100, 100 }, , .T. ) @@ -161,19 +161,19 @@ FUNCTION demoxbp() oAddr:border := .T. cNavigate := 'http://www.harbour.vouch.info' oAddr:dataLink := {| x | iif( x == NIL, cNavigate, cNavigate := x ) } - oAddr:setColorFG( RGB( 0,0,255 ) ) - oAddr:setColorBG( RGB( 0,255,255 ) ) + oAddr:setColorFG( RGB( 0, 0, 255 ) ) + oAddr:setColorBG( RGB( 0, 255, 255 ) ) oAddr:create( oDA, , { 120, oTBar:currentSize()[ 2 ] }, { 500, 20 }, , .T. ) oAddr:setData() oAddr:killInputFocus := {| m1, m2, oS | m1 := m1, m2 := m2, oS:getData(), oCom:navigate( cNavigate ) } - //----------------- Panel : Static + Radio + Checkbox ----------\\ + // ----------------- Panel : Static + Radio + Checkbox ----------\\ oStatic2 := WvgStatic():New( oDA, , { 150, 150 }, { 500, 310 }, , .F. ) -// oStatic2:type := WVGSTATIC_TYPE_RAISEDBOX //BGNDFRAME + // oStatic2:type := WVGSTATIC_TYPE_RAISEDBOX //BGNDFRAME oStatic2:exStyle += WS_EX_WINDOWEDGE -// oStatic2:options := WVGSTATIC_FRAMETHICK + // oStatic2:options := WVGSTATIC_FRAMETHICK oStatic2:create() - oStatic2:setColorBG( RGB( 175,175,175 ) ) + oStatic2:setColorBG( RGB( 175, 175, 175 ) ) oXbp := WvgPushButton():new( oStatic2 ) oXbp:caption := "Hide" @@ -194,21 +194,21 @@ FUNCTION demoxbp() oCheck := WvgCheckBox():New( oStatic2, , { 10, 70 }, { 100, 15 }, , .T. ) oCheck:caption := 'Checkbox A' oCheck:create() - oCheck:selected := {| m1, m2, o | m1 := m1, m2 := m2, WVG_MessageBox( , iif( o:getData(), 'I am selected','I am not selected' ) ) } + oCheck:selected := {| m1, m2, o | m1 := m1, m2 := m2, WVG_MessageBox( , iif( o:getData(), 'I am selected', 'I am not selected' ) ) } // Create first 3State button, passing the position to :create() oXbp := Wvg3State():new() oXbp:caption := "3 State A" oXbp:create( oStatic2, , { 10, 100 }, { 100, 15 } ) // Determine current state using mp1 - oXbp:selected := {| m1, m2, oBtn | m2 := m2, oBtn := oBtn, oPanel1:caption := "3State A [" + aState[ m1+1 ] + "]" } + oXbp:selected := {| m1, m2, oBtn | m2 := m2, oBtn := oBtn, oPanel1:caption := "3State A [" + aState[ m1 + 1 ] + "]" } // Create second 3State Button, passing the position to :new() oXbp := Wvg3State():new( oStatic2, , { 10, 125 }, { 100, 15 } ) oXbp:caption := "3 State B" oXbp:create( oStatic2 ) // Determine current state using :getData() - oXbp:selected := {| m1, m2, oBtn | m1 := m1, m2 := m2, WVG_MessageBox( , "3State B", aState[ oBtn:getData()+1 ] ) } + oXbp:selected := {| m1, m2, oBtn | m1 := m1, m2 := m2, WVG_MessageBox( , "3State B", aState[ oBtn:getData() + 1 ] ) } // Create first SLE, specify position using :create() // On :typeOut set the focus to the second SLE @@ -243,10 +243,10 @@ FUNCTION demoxbp() // Copy text from LOCAL variable into edit buffer via :dataLink oMLE:setData() - //--------------------------- Misc Config ------------------------\\ - oTBar:buttonClick := {| oBtn | iif( oBtn:caption == 'Hide' , oStatic:hide(), NIL ), ; - iif( oBtn:caption == 'Show' , oStatic:show(), NIL ), ; - iif( oBtn:caption == 'Tools' , oStatic2:show():toFront(), NIL ), ; + // --------------------------- Misc Config ------------------------\\ + oTBar:buttonClick := {| oBtn | iif( oBtn:caption == 'Hide', oStatic:hide(), NIL ), ; + iif( oBtn:caption == 'Show', oStatic:show(), NIL ), ; + iif( oBtn:caption == 'Tools', oStatic2:show():toFront(), NIL ), ; iif( oBtn:caption == 'FontDlg', ExeFontDialogXbp( oCrt ), NIL ), ; iif( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ), ; oPanel2:caption := "Button [ " + oBtn:caption + " ] clicked!" } @@ -343,7 +343,7 @@ STATIC FUNCTION ActiveXBuildToolBarXbp( oCrt ) LOCAL oTBar - oTBar := WvgToolBar():new( oCrt , , { 0, 0 }, { 0, 0 }, , .T. ) + oTBar := WvgToolBar():new( oCrt, , { 0, 0 }, { 0, 0 }, , .T. ) oTBar:style := WVGTOOLBAR_STYLE_FLAT @@ -361,11 +361,11 @@ STATIC FUNCTION ActiveXBuildToolBarXbp( oCrt ) oTBar:addItem( "New" , hb_DirBase() + 'v_new.bmp' ) oTBar:addItem( "Select" , hb_DirBase() + 'v_selct1.bmp' ) - oTBar:addItem( ) + oTBar:addItem() oTBar:addItem( "FontDlg" , hb_DirBase() + 'v_calend.bmp' ) oTBar:addItem( "Tools" , hb_DirBase() + 'v_lock.bmp' ) oTBar:addItem( "Index" , hb_DirBase() + 'v_index.bmp' ) - oTBar:addItem( ) + oTBar:addItem() oTBar:addItem( "Show" , hb_DirBase() + 'v_clclt.bmp' ) oTBar:addItem( "Hide" , hb_DirBase() + 'v_notes1.bmp' ) @@ -388,10 +388,10 @@ STATIC FUNCTION MyFunctionXbp( nMode ) WVG_MessageBox( , "Button clicked!" ) CASE nMode == 101 // Charge - Eval( {|| Tone( 523,2 ), Tone( 698,2 ), Tone( 880,2 ), Tone( 1046,4 ), Tone( 880,2 ), Tone( 1046,8 ) } ) + Eval( {|| Tone( 523, 2 ), Tone( 698, 2 ), Tone( 880, 2 ), Tone( 1046, 4 ), Tone( 880, 2 ), Tone( 1046, 8 ) } ) CASE nMode == 102 // NannyBoo - AEval( { { 196,2 }, { 196,2 }, { 164,2 }, { 220,2 }, { 196,4 }, { 164,4 } }, {| a | Tone( a[ 1 ], a[ 2 ] ) } ) + AEval( { { 196, 2 }, { 196, 2 }, { 164, 2 }, { 220, 2 }, { 196, 4 }, { 164, 4 } }, {| a | Tone( a[ 1 ], a[ 2 ] ) } ) CASE nMode == 103 // BADKEY Tone( 480, 0.25 ) diff --git a/harbour/contrib/gtwvg/toolbar.prg b/harbour/contrib/gtwvg/toolbar.prg index 63cd35497a..49fdda3f7e 100644 --- a/harbour/contrib/gtwvg/toolbar.prg +++ b/harbour/contrib/gtwvg/toolbar.prg @@ -229,7 +229,7 @@ METHOD WvgToolBar:handleEvent( nMessage, aNM ) IF ::isParentCrt() ::oParent:setFocus() ENDIF - Eval( ::sl_lbClick, ::aItems[ nObj,2 ], NIL, Self ) + Eval( ::sl_lbClick, ::aItems[ nObj, 2 ], NIL, Self ) ENDIF ENDIF @@ -253,14 +253,14 @@ METHOD WvgToolBar:destroy() IF ( nItems := Len( ::aItems ) ) > 0 FOR i := 1 TO nItems - IF ::aItems[ i,2 ]:image != NIL - WVG_DeleteObject( ::aItems[ i,2 ]:image ) + IF ::aItems[ i, 2 ]:image != NIL + WVG_DeleteObject( ::aItems[ i, 2 ]:image ) ENDIF - IF ::aItems[ i,2 ]:disabledImage != NIL - WVG_DeleteObject( ::aItems[ i,2 ]:disabledImage ) + IF ::aItems[ i, 2 ]:disabledImage != NIL + WVG_DeleteObject( ::aItems[ i, 2 ]:disabledImage ) ENDIF - IF ::aItems[ i,2 ]:hotImage != NIL - WVG_DeleteObject( ::aItems[ i,2 ]:hotImage ) + IF ::aItems[ i, 2 ]:hotImage != NIL + WVG_DeleteObject( ::aItems[ i, 2 ]:hotImage ) ENDIF NEXT ENDIF @@ -351,7 +351,7 @@ METHOD WvgToolBar:addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nS ::SendToolbarMessage( TB_SETBUTTONSIZE, ::buttonWidth, ::buttonHeight ) #if 0 - SendMessage( hWndTB, TB_SETPADDING, ( WPARAM ) 0, ( LPARAM ) MAKELPARAM( 10,10 ) ); + SendMessage( hWndTB, TB_SETPADDING, ( WPARAM ) 0, ( LPARAM ) MAKELPARAM( 10, 10 ) ); ::sendToolbarMessage( TB_SETPADDING, 10, 10 ) #endif ::sendToolbarMessage( TB_AUTOSIZE ) diff --git a/harbour/contrib/gtwvg/wnd.prg b/harbour/contrib/gtwvg/wnd.prg index 06df0388b8..2fe1c67b2d 100644 --- a/harbour/contrib/gtwvg/wnd.prg +++ b/harbour/contrib/gtwvg/wnd.prg @@ -619,12 +619,12 @@ METHOD WvgWindow:isDerivedFrom( cClassORoObject ) /* Compares without Xbp or Wvg prefixes */ IF HB_ISSTRING( cClassORoObject ) - IF Upper( SubStr( cClassORoObject,4 ) ) == Upper( SubStr( cCls,4 ) ) + IF Upper( SubStr( cClassORoObject, 4 ) ) == Upper( SubStr( cCls, 4 ) ) lTrue := .T. ENDIF ELSEIF HB_ISOBJECT( cClassORoObject ) - IF Upper( SubStr( cClassORoObject:className,4 ) ) == Upper( SubStr( cCls,4 ) ) + IF Upper( SubStr( cClassORoObject:className, 4 ) ) == Upper( SubStr( cCls, 4 ) ) lTrue := .T. ENDIF ENDIF @@ -698,7 +698,7 @@ METHOD WvgWindow:setFontCompoundName( xFont ) ENDIF IF ( n := At( ".", cFont ) ) > 0 - nPoint := Val( SubStr( cFont,1,n - 1 ) ) + nPoint := Val( SubStr( cFont, 1, n - 1 ) ) cFont := SubStr( cFont, n + 1 ) ELSE nPoint := 0 diff --git a/harbour/contrib/hbblat/blatcls.prg b/harbour/contrib/hbblat/blatcls.prg index 91304724c8..d2e414aacc 100644 --- a/harbour/contrib/hbblat/blatcls.prg +++ b/harbour/contrib/hbblat/blatcls.prg @@ -68,8 +68,10 @@ CREATE CLASS HBBlat EXPORTED: // Installation - VAR lSaveSettings AS LOGICAL INIT .F. // store common settings to the Windows Registry. Takes the - // same parameters as -install, and is only for SMTP settings. + VAR lSaveSettings AS LOGICAL INIT .F. + + // store common settings to the Windows Registry. Takes the + // same parameters as -install, and is only for SMTP settings. METHOD SaveSettings( ... ) INLINE ::Install( "SMTP", ... ) //VAR lInstall AS LOGICAL INIT .F. METHOD Install( cService, cServerAddress, cSenderEmailAddress, nTries, nPort, cProfile, cUsername, cPassword ) VIRTUAL // TODO @@ -207,6 +209,7 @@ CREATE CLASS HBBlat ENDCLASS METHOD Send() CLASS HBBlat + ::Check() IF ::nError == BLAT_SUCCESS @@ -227,7 +230,7 @@ METHOD PROCEDURE Check() CLASS HBBlat // Not using registry, so every parameter has to be explicity set // No control apart from existence - IF !::lChecked + IF ! ::lChecked ::cCommand := "" @@ -238,7 +241,7 @@ METHOD PROCEDURE Check() CLASS HBBlat ::nError := BLAT_ERR_MISSING_TO ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_TO ) AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -249,11 +252,11 @@ METHOD PROCEDURE Check() CLASS HBBlat // tofile - optional IF HB_ISSTRING( ::cTOFile ) - IF !hb_FileExists( ::cTOFile ) + IF ! hb_FileExists( ::cTOFile ) ::nError := BLAT_ERR_MISSING_TOFILE ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_TOFILE ) + ": " + ::cToFile AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -268,11 +271,11 @@ METHOD PROCEDURE Check() CLASS HBBlat // ccfile - optional IF HB_ISSTRING( ::cCCFile ) - IF !hb_FileExists( ::cCCFile ) + IF ! hb_FileExists( ::cCCFile ) ::nError := BLAT_ERR_MISSING_CCFILE ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_CCFILE ) + ": " + ::cCCFile AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -287,11 +290,11 @@ METHOD PROCEDURE Check() CLASS HBBlat // bccfile - optional IF HB_ISSTRING( ::cBCCFile ) - IF !hb_FileExists( ::cBCCFile ) + IF ! hb_FileExists( ::cBCCFile ) ::nError := BLAT_ERR_MISSING_BCCFILE ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_BCCFILE ) + ": " + ::cBCCFile AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -321,11 +324,11 @@ METHOD PROCEDURE Check() CLASS HBBlat // cSubjectFile - optional IF HB_ISSTRING( ::cSubjectFile ) - IF !hb_FileExists( ::cSubjectFile ) + IF ! hb_FileExists( ::cSubjectFile ) ::nError := BLAT_ERR_MISSING_SUBJECTFILE ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_SUBJECTFILE ) + ": " + ::cSubjectFile AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -335,11 +338,11 @@ METHOD PROCEDURE Check() CLASS HBBlat // bodyfile - optional IF HB_ISSTRING( ::cBodyFile ) - IF !hb_FileExists( ::cBodyFile ) + IF ! hb_FileExists( ::cBodyFile ) ::nError := BLAT_ERR_MISSING_BODYFILE ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_BODYFILE ) + ": " + ::cBodyFile AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -352,18 +355,18 @@ METHOD PROCEDURE Check() CLASS HBBlat ::nError := BLAT_ERR_MISSING_BODY ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_BODY ) AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE IF HB_ISSTRING( ::cBody ) ::cCommand += ' -body "' + ::cBody + '"' ELSE - IF !hb_FileExists( ::cBodyFile ) + IF ! hb_FileExists( ::cBodyFile ) ::nError := BLAT_ERR_MISSING_BODYFILE ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_BODYFILE ) + ": " + ::cBodyFile AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -374,11 +377,11 @@ METHOD PROCEDURE Check() CLASS HBBlat // cSignatureFile IF HB_ISSTRING( ::cSignatureFile ) - IF !hb_FileExists( ::cSignatureFile ) + IF ! hb_FileExists( ::cSignatureFile ) ::nError := BLAT_ERR_MISSING_SIGNATUREFILE ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_SIGNATUREFILE ) + ": " + ::cSignatureFile AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -388,11 +391,11 @@ METHOD PROCEDURE Check() CLASS HBBlat // cTagFile IF HB_ISSTRING( ::cTagFile ) - IF !hb_FileExists( ::cTagFile ) + IF ! hb_FileExists( ::cTagFile ) ::nError := BLAT_ERR_MISSING_TAGFILE ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_TAGFILE ) + ": " + ::cTagFile AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -402,11 +405,11 @@ METHOD PROCEDURE Check() CLASS HBBlat // cPostScriptumFile - optional IF HB_ISSTRING( ::cPostScriptumFile ) - IF !hb_FileExists( ::cPostScriptumFile ) + IF ! hb_FileExists( ::cPostScriptumFile ) ::nError := BLAT_ERR_MISSING_PSFILE ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_PSFILE ) + ": " + ::cPostScriptumFile AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -431,7 +434,7 @@ METHOD PROCEDURE Check() CLASS HBBlat ::nError := BLAT_ERR_MISSING_SERVERSMTP ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_SERVERSMTP ) AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -463,7 +466,7 @@ METHOD PROCEDURE Check() CLASS HBBlat ::nError := BLAT_ERR_MISSING_FROM ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_FROM ) AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -569,7 +572,7 @@ METHOD PROCEDURE Check() CLASS HBBlat // No Blat Home Page // Add only if ::lNoBlatXHeader is .F. - IF !::lNoBlatXHeader + IF ! ::lNoBlatXHeader IF ::lNoBlatHomePage ::cCommand += " -noh" ENDIF @@ -602,14 +605,14 @@ METHOD PROCEDURE Check() CLASS HBBlat // cDSN IF HB_ISSTRING( ::cDSN ) - IF ( "n" $ Lower( ::cDSN ) .OR. "s" $ Lower( ::cDSN ) .OR. ; - "f" $ Lower( ::cDSN ) .OR. "d" $ Lower( ::cDSN ) ) + IF "n" $ Lower( ::cDSN ) .OR. "s" $ Lower( ::cDSN ) .OR. ; + "f" $ Lower( ::cDSN ) .OR. "d" $ Lower( ::cDSN ) ::cCommand += " -dsn " + ::cDSN ELSE ::nError := BLAT_ERR_WRONG_DSN ::cError := ::TranslateBlatError( BLAT_ERR_WRONG_DSN ) + ": " + ::cDSN AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ENDIF @@ -640,7 +643,7 @@ METHOD PROCEDURE Check() CLASS HBBlat // Attachment and encoding options -------- // Attach Binary Files - IF !Empty( ::aAttachBinFiles ) + IF ! Empty( ::aAttachBinFiles ) IF HB_ISSTRING( ::cAttachBinFiles ) ::cAttachBinFiles += "," ELSE @@ -653,7 +656,7 @@ METHOD PROCEDURE Check() CLASS HBBlat ENDIF // Attach Text Files - IF !Empty( ::aAttachTextFiles ) + IF ! Empty( ::aAttachTextFiles ) IF HB_ISSTRING( ::cAttachTextFiles ) ::cAttachTextFiles += "," ELSE @@ -666,7 +669,7 @@ METHOD PROCEDURE Check() CLASS HBBlat ENDIF // Attach INLINE Files - IF !Empty( ::aAttachInlineFiles ) + IF ! Empty( ::aAttachInlineFiles ) IF HB_ISSTRING( ::cAttachInlineFiles ) ::cAttachInlineFiles += "," ELSE @@ -679,7 +682,7 @@ METHOD PROCEDURE Check() CLASS HBBlat ENDIF // Attach Html Embedded Files - IF !Empty( ::aHtmlEmbeddedFiles ) + IF ! Empty( ::aHtmlEmbeddedFiles ) IF HB_ISSTRING( ::cHtmlEmbeddedFiles ) ::cHtmlEmbeddedFiles += "," ELSE @@ -693,11 +696,11 @@ METHOD PROCEDURE Check() CLASS HBBlat // cAttachListBinFile - optional IF HB_ISSTRING( ::cAttachListBinFile ) - IF !hb_FileExists( ::cAttachListBinFile ) + IF ! hb_FileExists( ::cAttachListBinFile ) ::nError := BLAT_ERR_MISSING_ATTACHLISTBINFILE ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_ATTACHLISTBINFILE ) + ": " + ::cAttachListBinFile AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -707,11 +710,11 @@ METHOD PROCEDURE Check() CLASS HBBlat // cAttachListTextFile - optional IF HB_ISSTRING( ::cAttachListTextFile ) - IF !hb_FileExists( ::cAttachListTextFile ) + IF ! hb_FileExists( ::cAttachListTextFile ) ::nError := BLAT_ERR_MISSING_ATTACHLISTTEXTFILE ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_ATTACHLISTTEXTFILE ) + ": " + ::cAttachListTextFile AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -721,11 +724,11 @@ METHOD PROCEDURE Check() CLASS HBBlat // cAttachListEmbeddedFile - optional IF HB_ISSTRING( ::cAttachListEmbeddedFile ) - IF !hb_FileExists( ::cAttachListEmbeddedFile ) + IF ! hb_FileExists( ::cAttachListEmbeddedFile ) ::nError := BLAT_ERR_MISSING_ATTACHLISTEMBEDDEDFILE ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_ATTACHLISTEMBEDDEDFILE ) + ": " + ::cAttachListEmbeddedFile AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -765,11 +768,11 @@ METHOD PROCEDURE Check() CLASS HBBlat // cAlternateTextFile - optional IF HB_ISSTRING( ::cAlternateTextFile ) - IF !hb_FileExists( ::cAlternateTextFile ) + IF ! hb_FileExists( ::cAlternateTextFile ) ::nError := BLAT_ERR_MISSING_ALTERNATETEXTFILE ::cError := ::TranslateBlatError( BLAT_ERR_MISSING_ALTERNATETEXTFILE ) + ": " + ::cAlternateTextFile AAdd( ::aErrors, { ::nError, ::cError } ) - IF !::lIgnoreErrors + IF ! ::lIgnoreErrors RETURN ENDIF ELSE @@ -898,8 +901,6 @@ METHOD PROCEDURE Check() CLASS HBBlat ENDIF - //-------------------------------------------------- - // Check done ::lChecked := .T. @@ -908,9 +909,11 @@ METHOD PROCEDURE Check() CLASS HBBlat RETURN METHOD GetCommand() CLASS HBBlat - IF !::lChecked + + IF ! ::lChecked ::Check() ENDIF + RETURN ::cCommand METHOD Error() CLASS HBBlat @@ -929,32 +932,32 @@ METHOD BlatErrorString() CLASS HBBlat RETURN ::cBlatError METHOD TranslateBlatError( nErr ) CLASS HBBlat + LOCAL cError, nPos // TODO: add function that returns language error array LOCAL aErrors := { ; - { BLAT_ERR_UNKNONW , BLAT_TEXT_ERR_UNKNOWN } ,; - { BLAT_SUCCESS , BLAT_TEXT_SUCCESS } ,; - { BLAT_ERR_MESSAGE_NOT_ACCEPTED , BLAT_TEXT_ERR_MESSAGE_NOT_ACCEPTED } ,; - { BLAT_ERR_MISSING_FROM , BLAT_TEXT_ERR_MISSING_FROM } ,; - { BLAT_ERR_MISSING_TO , BLAT_TEXT_ERR_MISSING_TO } ,; - { BLAT_ERR_MISSING_TOFILE , BLAT_TEXT_ERR_MISSING_TOFILE } ,; - { BLAT_ERR_MISSING_BODY , BLAT_TEXT_ERR_MISSING_BODY } ,; - { BLAT_ERR_MISSING_BODYFILE , BLAT_TEXT_ERR_MISSING_BODYFILE } ,; - { BLAT_ERR_MISSING_SERVERSMTP , BLAT_TEXT_ERR_MISSING_SERVERSMTP } ,; - { BLAT_ERR_MISSING_SUBJECTFILE , BLAT_TEXT_ERR_MISSING_SUBJECTFILE } ,; - { BLAT_ERR_MISSING_CCFILE , BLAT_TEXT_ERR_MISSING_CCFILE } ,; - { BLAT_ERR_MISSING_BCCFILE , BLAT_TEXT_ERR_MISSING_BCCFILE } ,; - { BLAT_ERR_MISSING_PSFILE , BLAT_TEXT_ERR_MISSING_PSFILE } ,; - { BLAT_ERR_MISSING_ATTACHLISTBINFILE , BLAT_TEXT_ERR_MISSING_ATTACHLISTBINFILE } ,; - { BLAT_ERR_MISSING_ATTACHLISTTEXTFILE , BLAT_TEXT_ERR_MISSING_ATTACHLISTTEXTFILE } ,; - { BLAT_ERR_MISSING_ATTACHLISTEMBEDDEDFILE , BLAT_TEXT_ERR_MISSING_ATTACHLISTEMBEDDEDFILE } ,; - { BLAT_ERR_MISSING_ALTERNATETEXTFILE , BLAT_TEXT_ERR_MISSING_ALTERNATETEXTFILE } ,; - { BLAT_ERR_MISSING_SIGNATUREFILE , BLAT_TEXT_ERR_MISSING_SIGNATUREFILE } ,; - { BLAT_ERR_MISSING_TAGFILE , BLAT_TEXT_ERR_MISSING_TAGFILE } ,; - { BLAT_ERR_WRONG_DSN , BLAT_TEXT_ERR_WRONG_DSN } ,; - { BLAT_ERR_LOGICAL_EXPECTED , BLAT_TEXT_ERR_LOGICAL_EXPECTED } ,; - { BLAT_ERR_STRING_EXPECTED , BLAT_TEXT_ERR_STRING_EXPECTED } ; - } + { BLAT_ERR_UNKNONW , BLAT_TEXT_ERR_UNKNOWN }, ; + { BLAT_SUCCESS , BLAT_TEXT_SUCCESS }, ; + { BLAT_ERR_MESSAGE_NOT_ACCEPTED , BLAT_TEXT_ERR_MESSAGE_NOT_ACCEPTED }, ; + { BLAT_ERR_MISSING_FROM , BLAT_TEXT_ERR_MISSING_FROM }, ; + { BLAT_ERR_MISSING_TO , BLAT_TEXT_ERR_MISSING_TO }, ; + { BLAT_ERR_MISSING_TOFILE , BLAT_TEXT_ERR_MISSING_TOFILE }, ; + { BLAT_ERR_MISSING_BODY , BLAT_TEXT_ERR_MISSING_BODY }, ; + { BLAT_ERR_MISSING_BODYFILE , BLAT_TEXT_ERR_MISSING_BODYFILE }, ; + { BLAT_ERR_MISSING_SERVERSMTP , BLAT_TEXT_ERR_MISSING_SERVERSMTP }, ; + { BLAT_ERR_MISSING_SUBJECTFILE , BLAT_TEXT_ERR_MISSING_SUBJECTFILE }, ; + { BLAT_ERR_MISSING_CCFILE , BLAT_TEXT_ERR_MISSING_CCFILE }, ; + { BLAT_ERR_MISSING_BCCFILE , BLAT_TEXT_ERR_MISSING_BCCFILE }, ; + { BLAT_ERR_MISSING_PSFILE , BLAT_TEXT_ERR_MISSING_PSFILE }, ; + { BLAT_ERR_MISSING_ATTACHLISTBINFILE , BLAT_TEXT_ERR_MISSING_ATTACHLISTBINFILE }, ; + { BLAT_ERR_MISSING_ATTACHLISTTEXTFILE , BLAT_TEXT_ERR_MISSING_ATTACHLISTTEXTFILE }, ; + { BLAT_ERR_MISSING_ATTACHLISTEMBEDDEDFILE , BLAT_TEXT_ERR_MISSING_ATTACHLISTEMBEDDEDFILE }, ; + { BLAT_ERR_MISSING_ALTERNATETEXTFILE , BLAT_TEXT_ERR_MISSING_ALTERNATETEXTFILE }, ; + { BLAT_ERR_MISSING_SIGNATUREFILE , BLAT_TEXT_ERR_MISSING_SIGNATUREFILE }, ; + { BLAT_ERR_MISSING_TAGFILE , BLAT_TEXT_ERR_MISSING_TAGFILE }, ; + { BLAT_ERR_WRONG_DSN , BLAT_TEXT_ERR_WRONG_DSN }, ; + { BLAT_ERR_LOGICAL_EXPECTED , BLAT_TEXT_ERR_LOGICAL_EXPECTED }, ; + { BLAT_ERR_STRING_EXPECTED , BLAT_TEXT_ERR_STRING_EXPECTED } } nPos := AScan( aErrors, {| e | e[ 1 ] == nErr }, 2 ) IF nPos == 0 @@ -981,6 +984,7 @@ METHOD TranslateBlatError( nErr ) CLASS HBBlat RETURN cError STATIC FUNCTION ArrayToString( aArray ) + LOCAL cString := "" LOCAL nLen := Len( aArray ) LOCAL cElem diff --git a/harbour/contrib/hbblink/blinker.prg b/harbour/contrib/hbblink/blinker.prg index e782eb5536..189759771c 100644 --- a/harbour/contrib/hbblink/blinker.prg +++ b/harbour/contrib/hbblink/blinker.prg @@ -67,29 +67,38 @@ THREAD STATIC t_nErrorMaj := 0 THREAD STATIC t_nErrorMin := 0 PROCEDURE HB_BLIVERNUM( cString ) + IF HB_ISSTRING( cString ) s_cSerialNum := cString ENDIF + RETURN PROCEDURE HB_BLIDEMDTE( dDate ) + IF HB_ISDATE( dDate ) s_cDemoDate := DToS( dDate ) ENDIF + RETURN PROCEDURE HB_BLIDEMMIN( nValue ) + IF HB_ISNUMERIC( nValue ) s_nDemoMinutes := nValue ENDIF + RETURN FUNCTION BLIDBGHAN( nValue ) + STATIC s_nDebugHandle := 1 LOCAL nOldValue := s_nDebugHandle + IF HB_ISNUMERIC( nValue ) s_nDebugHandle := nValue ENDIF + RETURN nOldValue FUNCTION BLIDEMDTE() @@ -99,14 +108,19 @@ FUNCTION BLIDEMDTEBAS() RETURN s_cDemoDate FUNCTION BLIDEMMIN( nValue ) + LOCAL nOldValue := s_nDemoMinutes + IF HB_ISNUMERIC( nValue ) s_nDemoMinutes := nValue ENDIF + RETURN nOldValue PROCEDURE BLIDISFRG( fhnd ) + HB_SYMBOL_UNUSED( fhnd ) + RETURN FUNCTION BLIERRNUM() @@ -127,27 +141,36 @@ FUNCTION BLIFUNHAN( pLib, cFunction ) RETURN hb_hrbGetFunSym( pLib, cFunction ) FUNCTION BLIFUNCAL( ... ) + LOCAL aParams := hb_AParams() LOCAL pFunction + IF Len( aParams ) > 0 pFunction := ATail( aParams ) ASize( aParams, Len( aParams ) - 1 ) - RETURN hb_hrbDo( pFunction, hb_arrayToParams( aParams ) ) + RETURN hb_hrbDo( pFunction, hb_ArrayToParams( aParams ) ) ENDIF + RETURN NIL PROCEDURE BLILIBFRE( pLib ) - hb_hrbUnLoad( pLib ) + + hb_hrbUnload( pLib ) + RETURN PROCEDURE BLILIBOVR( lValue ) + IF HB_ISLOGICAL( lValue ) s_lLibOverrides := lValue ENDIF + RETURN PROCEDURE BLILSTFRG( fhnd ) + HB_SYMBOL_UNUSED( fhnd ) + RETURN FUNCTION BLIMEMAVL() @@ -157,15 +180,20 @@ FUNCTION BLIMEMSIZ() RETURN Memory( HB_MEM_CHAR ) FUNCTION BLIMEMBLK( nBlockSize ) + HB_SYMBOL_UNUSED( nBlockSize ) + RETURN Memory( HB_MEM_CHAR ) FUNCTION BLIMEMPAK( nValue ) + STATIC s_nGCFrequency := 0 LOCAL nOldValue := s_nDemoMinutes + IF HB_ISNUMERIC( nValue ) s_nGCFrequency := nValue ENDIF + RETURN nOldValue FUNCTION BLIMEMUSE() @@ -184,7 +212,9 @@ FUNCTION BLIOVLSIZ() RETURN 0 PROCEDURE BLIOVLSUS( nValue ) + HB_SYMBOL_UNUSED( nValue ) + RETURN FUNCTION BLIPTRDEC( nPointer, nValue ) @@ -200,16 +230,19 @@ FUNCTION BLISERNUMBAS() RETURN s_cSerialNum FUNCTION BLISTRFRG( cString ) + HB_SYMBOL_UNUSED( cString ) + RETURN "" FUNCTION BLIVERNUM() RETURN 700 FUNCTION BLICPUREL() - RETURN hb_releaseCPU() + RETURN hb_ReleaseCPU() FUNCTION BLIMGRSTS( nParam ) + SWITCH nParam CASE BliCacheLoc ; RETURN BliCacheNone CASE BliCacheSize ; RETURN 0 @@ -221,32 +254,45 @@ FUNCTION BLIMGRSTS( nParam ) CASE BliRealMemAvail ; RETURN Memory( HB_MEM_CHAR ) CASE BliVirMemAvail ; RETURN 0 ENDSWITCH + RETURN 0 FUNCTION SWPADDENV( nBytes ) + HB_SYMBOL_UNUSED( nBytes ) + RETURN 32768 FUNCTION SWPADDSTR( cPID, cString ) + HB_SYMBOL_UNUSED( cPID ) HB_SYMBOL_UNUSED( cString ) + RETURN 1 FUNCTION SWPADDSTRBAS( cPID, cString ) + HB_SYMBOL_UNUSED( cPID ) HB_SYMBOL_UNUSED( cString ) + RETURN 1 FUNCTION SWPCURDIR( lValue ) + HB_SYMBOL_UNUSED( lValue ) + RETURN .T. FUNCTION SWPDISMSG( lValue ) + HB_SYMBOL_UNUSED( lValue ) + RETURN .F. FUNCTION SWPEMS320( lValue ) + HB_SYMBOL_UNUSED( lValue ) + RETURN .F. FUNCTION SWPERRLEV() @@ -259,75 +305,100 @@ FUNCTION SWPERRMIN() RETURN t_nErrorMin FUNCTION SWPFREEMS( nLimitKB ) + HB_SYMBOL_UNUSED( nLimitKB ) + RETURN 0 FUNCTION SWPUSEEMS( lValue ) + HB_SYMBOL_UNUSED( lValue ) + RETURN .F. FUNCTION SWPFREXMS( nLimitKB ) + HB_SYMBOL_UNUSED( nLimitKB ) + RETURN 0 FUNCTION SWPUSEXMS( lValue ) + HB_SYMBOL_UNUSED( lValue ) + RETURN .F. FUNCTION SWPUSEUMB( lValue ) + HB_SYMBOL_UNUSED( lValue ) + RETURN .F. FUNCTION SWPGETKEY( lValue ) + HB_SYMBOL_UNUSED( lValue ) + RETURN .F. FUNCTION SWPGETPID( cIDString ) + HB_SYMBOL_UNUSED( cIDString ) + RETURN .F. FUNCTION SWPVIDMDE( lValue ) + HB_SYMBOL_UNUSED( lValue ) + RETURN .F. FUNCTION SWPGETSTR() RETURN "" FUNCTION SWPKEYBRD( cKeyString ) + HB_SYMBOL_UNUSED( cKeyString ) + RETURN 0 FUNCTION SWPKEYBRDBAS( cKeyString ) + HB_SYMBOL_UNUSED( cKeyString ) + RETURN 0 FUNCTION SWPKEYCLR( nValue ) + HB_SYMBOL_UNUSED( nValue ) + RETURN 0 FUNCTION SWPNOBOOT( lValue ) + HB_SYMBOL_UNUSED( lValue ) + RETURN .F. FUNCTION SWPRUNCMD( cCommand, nMem, cRunPath, cTempPath ) + LOCAL cShell HB_SYMBOL_UNUSED( nMem ) HB_SYMBOL_UNUSED( cRunPath ) HB_SYMBOL_UNUSED( cTempPath ) - #if defined( __PLATFORM__UNIX ) - cShell := hb_GetEnv( "SHELL" ) - #else - cShell := hb_GetEnv( "COMSPEC" ) - #endif +#if defined( __PLATFORM__UNIX ) + cShell := hb_GetEnv( "SHELL" ) +#else + cShell := hb_GetEnv( "COMSPEC" ) +#endif IF ! Empty( cShell ) - #if defined( __PLATFORM__UNIX ) - cCommand := cShell + " " + cCommand - #else - cCommand := cShell + " /c " + cCommand - #endif +#if defined( __PLATFORM__UNIX ) + cCommand := cShell + " " + cCommand +#else + cCommand := cShell + " /c " + cCommand +#endif ENDIF t_nErrorLevel := hb_run( cCommand ) @@ -335,6 +406,7 @@ FUNCTION SWPRUNCMD( cCommand, nMem, cRunPath, cTempPath ) RETURN .T. FUNCTION SWPSETENV( cString ) + LOCAL cPair LOCAL tmp @@ -350,17 +422,25 @@ FUNCTION SWPSETENV( cString ) RETURN .T. FUNCTION SWPSETPID( cIDString ) + HB_SYMBOL_UNUSED( cIDString ) + RETURN .T. FUNCTION SWPSETPIDBAS( cIDString ) + HB_SYMBOL_UNUSED( cIDString ) + RETURN .T. FUNCTION SWPSETSTR( cString ) + HB_SYMBOL_UNUSED( cString ) + RETURN .T. FUNCTION SWPSETSTRBAS( cString ) + HB_SYMBOL_UNUSED( cString ) + RETURN .T. diff --git a/harbour/contrib/hbcairo/tests/fancytxt.prg b/harbour/contrib/hbcairo/tests/fancytxt.prg index 2dcac9a108..d9e81d80b3 100644 --- a/harbour/contrib/hbcairo/tests/fancytxt.prg +++ b/harbour/contrib/hbcairo/tests/fancytxt.prg @@ -6,8 +6,8 @@ #include "hbcairo.ch" - PROCEDURE Main() + LOCAL hSurface hSurface := cairo_pdf_surface_create( "fancytxt.pdf", 566.9, 793.7 ) // 200x280 mm in pt @@ -18,10 +18,12 @@ PROCEDURE Main() draw( hSurface ) cairo_surface_write_to_png( hSurface, "fancytxt.png" ) cairo_surface_destroy( hSurface ) -RETURN + + RETURN -PROC draw( hSurface ) +PROCEDURE draw( hSurface ) + LOCAL hCairo, hPath hCairo := cairo_create( hSurface ) @@ -61,18 +63,19 @@ PROC draw( hSurface ) cairo_show_page( hCairo ) cairo_destroy( hCairo ) -RETURN + RETURN -PROC map_path_onto( hCairo, hPath ) +PROCEDURE map_path_onto( hCairo, hPath ) + LOCAL hCurrentPath, aLengths, hIterator, nI, aPoints hCurrentPath := cairo_copy_path( hCairo ) aLengths := path_lengths( hPath ) hIterator := cairo_path_iterator_create( hCurrentPath ) DO WHILE cairo_path_iterator_next( hIterator ) != NIL - IF LEN( aPoints := cairo_path_iterator_get_points( hIterator ) ) > 0 - FOR nI := 1 TO LEN( aPoints ) + IF Len( aPoints := cairo_path_iterator_get_points( hIterator ) ) > 0 + FOR nI := 1 TO Len( aPoints ) transform_point( @aPoints[ nI, 1 ], @aPoints[ nI, 2 ], hPath, aLengths ) NEXT cairo_path_iterator_set_points( hIterator, aPoints ) @@ -80,10 +83,12 @@ PROC map_path_onto( hCairo, hPath ) ENDDO cairo_path_iterator_destroy( hIterator ) cairo_append_path( hCairo, hCurrentPath ) -RETURN + + RETURN -STATIC PROC transform_point( nX, nY, hPath, aLengths ) +STATIC PROCEDURE transform_point( nX, nY, hPath, aLengths ) + LOCAL hIterator, nI, nNX, nNY, nDX, nDY, nRatio, nType, aLast, aPoints, nK1, nK2 nNX := nX @@ -107,34 +112,36 @@ STATIC PROC transform_point( nX, nY, hPath, aLengths ) IF nType == CAIRO_PATH_MOVE_TO ELSEIF nType == CAIRO_PATH_LINE_TO nRatio := nNX / aLengths[ nI ] - nX := aLast[ 1 ] * (1 - nRatio) + aPoints[ 1, 1 ] * nRatio - nY := aLast[ 2 ] * (1 - nRatio) + aPoints[ 1, 2 ] * nRatio + nX := aLast[ 1 ] * ( 1 - nRatio ) + aPoints[ 1, 1 ] * nRatio + nY := aLast[ 2 ] * ( 1 - nRatio ) + aPoints[ 1, 2 ] * nRatio - nDX := -(aLast[ 1 ] - aPoints[ 1, 1 ]) - nDY := -(aLast[ 2 ] - aPoints[ 1, 2 ]) + nDX := -( aLast[ 1 ] - aPoints[ 1, 1 ] ) + nDY := -( aLast[ 2 ] - aPoints[ 1, 2 ] ) nRatio := nNY / aLengths[ nI ] nX += -nDY * nRatio nY += nDX * nRatio ELSEIF nType == CAIRO_PATH_CURVE_TO - nX := aLast[ 1 ] * (1 - nRatio)^3 + 3 * aPoints[ 1, 1 ] * (1 - nRatio)^2 * nRatio + 3 * aPoints[ 2, 1 ] * (1 - nRatio) * nRatio^2 + aPoints[ 3, 1 ] * nRatio^3 - nY := aLast[ 2 ] * (1 - nRatio)^3 + 3 * aPoints[ 1, 2 ] * (1 - nRatio)^2 * nRatio + 3 * aPoints[ 2, 2 ] * (1 - nRatio) * nRatio^2 + aPoints[ 3, 2 ] * nRatio^3 + nX := aLast[ 1 ] * ( 1 - nRatio ) ^ 3 + 3 * aPoints[ 1, 1 ] * ( 1 - nRatio ) ^ 2 * nRatio + 3 * aPoints[ 2, 1 ] * ( 1 - nRatio ) * nRatio ^ 2 + aPoints[ 3, 1 ] * nRatio ^ 3 + nY := aLast[ 2 ] * ( 1 - nRatio ) ^ 3 + 3 * aPoints[ 1, 2 ] * ( 1 - nRatio ) ^ 2 * nRatio + 3 * aPoints[ 2, 2 ] * ( 1 - nRatio ) * nRatio ^ 2 + aPoints[ 3, 2 ] * nRatio ^ 3 - nK1 := 1 - 4 * nRatio + 3 * nRatio^2 - nK2 := 2 * nRatio - 3 * nRatio^2 + nK1 := 1 - 4 * nRatio + 3 * nRatio ^ 2 + nK2 := 2 * nRatio - 3 * nRatio ^ 2 - nDX := -3 * aLast[ 1 ] * (1 - nRatio)^2 + 3 * aPoints[ 1, 1 ] * nK1 + 3 * aPoints[ 2, 1 ] * nK2 + 3 * aPoints[ 3, 1 ] * nRatio^2 - nDY := -3 * aLast[ 2 ] * (1 - nRatio)^2 + 3 * aPoints[ 1, 2 ] * nK1 + 3 * aPoints[ 2, 2 ] * nK2 + 3 * aPoints[ 3, 2 ] * nRatio^2 + nDX := -3 * aLast[ 1 ] * ( 1 - nRatio ) ^ 2 + 3 * aPoints[ 1, 1 ] * nK1 + 3 * aPoints[ 2, 1 ] * nK2 + 3 * aPoints[ 3, 1 ] * nRatio ^ 2 + nDY := -3 * aLast[ 2 ] * ( 1 - nRatio ) ^ 2 + 3 * aPoints[ 1, 2 ] * nK1 + 3 * aPoints[ 2, 2 ] * nK2 + 3 * aPoints[ 3, 2 ] * nRatio ^ 2 - nRatio := nNY / SQRT( nDX * nDX + nDY * nDY ) + nRatio := nNY / Sqrt( nDX * nDX + nDY * nDY ) nX += -nDY * nRatio nY += nDX * nRatio ENDIF cairo_path_iterator_destroy( hIterator ) -RETURN + + RETURN STATIC FUNC path_lengths( hPath ) + LOCAL hIterator, nType, aLast, aRet, aPoints, nLen aRet := {} @@ -149,20 +156,22 @@ STATIC FUNC path_lengths( hPath ) aLast := aPoints[ 1 ] ELSEIF nType == CAIRO_PATH_CURVE_TO nLen := curve_length( aLast[ 1 ], aLast[ 2 ], aPoints[ 1, 1 ], aPoints[ 1, 2 ], ; - aPoints[ 2, 1 ], aPoints[ 2, 2 ], aPoints[ 3, 1 ], aPoints[ 3, 2 ] ) + aPoints[ 2, 1 ], aPoints[ 2, 2 ], aPoints[ 3, 1 ], aPoints[ 3, 2 ] ) aLast := aPoints[ 3 ] ENDIF - AADD( aRet, nLen ) + AAdd( aRet, nLen ) ENDDO cairo_path_iterator_destroy( hIterator ) -RETURN aRet + + RETURN aRet STATIC FUNC distance( nX1, nY1, nX2, nY2 ) -RETURN sqrt( (nX1-nX2)^2 + (nY1-nY2)^2 ) + RETURN Sqrt( ( nX1 - nX2 ) ^ 2 + ( nY1 - nY2 ) ^ 2 ) STATIC FUNC curve_length( nX1, nY1, nX2, nY2, nX3, nY3, nX4, nY4 ) + LOCAL nLength := 0, hSurface, hCairo, hPath, hIterator, nType, aLast, aPoints hSurface := cairo_image_surface_create( CAIRO_FORMAT_A8, 0, 0 ) @@ -183,4 +192,5 @@ STATIC FUNC curve_length( nX1, nY1, nX2, nY2, nX3, nY3, nX4, nY4 ) cairo_path_destroy( hPath ) cairo_destroy( hCairo ) cairo_surface_destroy( hSurface ) -RETURN nLength + + RETURN nLength diff --git a/harbour/contrib/hbcairo/tests/glyphdbg.prg b/harbour/contrib/hbcairo/tests/glyphdbg.prg index bc9f8a560b..c73f60fe12 100644 --- a/harbour/contrib/hbcairo/tests/glyphdbg.prg +++ b/harbour/contrib/hbcairo/tests/glyphdbg.prg @@ -7,6 +7,7 @@ #include "hbcairo.ch" PROCEDURE Main() + LOCAL hSurface, hCairo hSurface := cairo_pdf_surface_create( "glyphdbg.pdf", 566.9, 793.7 ) // 200x280 mm in pt @@ -27,15 +28,17 @@ PROCEDURE Main() cairo_show_page( hCairo ) cairo_destroy( hCairo ) cairo_surface_destroy( hSurface ) -RETURN + + RETURN -PROC path_debug( hCairo, nTolerance ) +PROCEDURE path_debug( hCairo, nTolerance ) + LOCAL hPath, hIterator, nType, aPoints cairo_save( hCairo ) - IF EMPTY( nTolerance ) + IF Empty( nTolerance ) hPath := cairo_copy_path( hCairo ) ELSE cairo_save( hCairo ) @@ -81,4 +84,5 @@ PROC path_debug( hCairo, nTolerance ) cairo_stroke( hCairo ) cairo_path_destroy( hPath ) cairo_restore( hCairo ) -RETURN + + RETURN diff --git a/harbour/contrib/hbcairo/tests/hellow.prg b/harbour/contrib/hbcairo/tests/hellow.prg index c587af2cfd..5dc8b97242 100644 --- a/harbour/contrib/hbcairo/tests/hellow.prg +++ b/harbour/contrib/hbcairo/tests/hellow.prg @@ -11,9 +11,10 @@ REQUEST HB_CODEPAGE_LTWIN PROCEDURE Main() + LOCAL hSurface, hCairo, nI - HB_CDPSELECT("LTWIN") + hb_cdpSelect( "LTWIN" ) hSurface := cairo_pdf_surface_create( "hellow.pdf", 566.9, 793.7 ) // 200x280 mm in pt hCairo := cairo_create( hSurface ) @@ -26,7 +27,7 @@ PROCEDURE Main() cairo_set_line_width( hCairo, 1 ) FOR nI := 1 TO 10 - cairo_set_source_rgb( hCairo, HB_RANDOM(), HB_RANDOM(), HB_RANDOM() ) + cairo_set_source_rgb( hCairo, hb_Random(), hb_Random(), hb_Random() ) cairo_rectangle( hCairo, 100 + nI * 5, 50 + nI * 5, 100, 70 ) cairo_stroke( hCairo ) NEXT @@ -41,4 +42,5 @@ PROCEDURE Main() cairo_show_page( hCairo ) cairo_destroy( hCairo ) cairo_surface_destroy( hSurface ) -RETURN + + RETURN diff --git a/harbour/contrib/hbcairo/tests/lightning.prg b/harbour/contrib/hbcairo/tests/lightning.prg index bb32c614e0..7109d28c60 100644 --- a/harbour/contrib/hbcairo/tests/lightning.prg +++ b/harbour/contrib/hbcairo/tests/lightning.prg @@ -6,8 +6,8 @@ #include "hbcairo.ch" - PROCEDURE Main() + LOCAL hSurface, hCairo, nI hSurface := cairo_pdf_surface_create( "lightning.pdf", 566.9, 793.7 ) // 200x280 mm in pt @@ -15,18 +15,20 @@ PROCEDURE Main() // 20 pages FOR nI := 1 TO 20 - cairo_set_source_rgb( hCairo, 0, 0, 0 ) - cairo_paint( hCairo ) - cairo_set_source_rgb( hCairo, 1, 0.7, 1 ) - DrawLightning( hCairo, 250, 50, 700, 3 ) - cairo_show_page( hCairo ) + cairo_set_source_rgb( hCairo, 0, 0, 0 ) + cairo_paint( hCairo ) + cairo_set_source_rgb( hCairo, 1, 0.7, 1 ) + DrawLightning( hCairo, 250, 50, 700, 3 ) + cairo_show_page( hCairo ) NEXT cairo_destroy( hCairo ) cairo_surface_destroy( hSurface ) -RETURN + + RETURN -PROC DrawLightning( hCairo, nX, nY, nLen, nW, nInit ) +PROCEDURE DrawLightning( hCairo, nX, nY, nLen, nW, nInit ) + LOCAL nI, nK, nW0, nX2 cairo_move_to( hCairo, nX, nY ) @@ -36,29 +38,30 @@ PROC DrawLightning( hCairo, nX, nY, nLen, nW, nInit ) ENDIF nK := 0 FOR nI := 1 TO nLen - // AR(1) process - nInit := nInit * 0.9 + (hb_random() - 0.5) - // ARIMA(1, 1, 0) process - nK += nInit - // ARIMA(1, 1, 0) + white noise - nX2 := nX + nK + hb_random() - cairo_line_to( hCairo, nX2, nI + nY ) - nW -= 0.003 - IF nW < nW0 - 0.1 - cairo_set_line_width( hCairo, nW0 ) - cairo_stroke( hCairo ) - cairo_move_to( hCairo, nX2, nI + nY ) - nW0 := nW - ENDIF - // Branch - IF ABS(nInit) > 1.6 - cairo_set_line_width( hCairo, nW0 ) - cairo_stroke( hCairo ) - DrawLightning( hCairo, nX2, nI + nY, INT((nLen - nI) / 2), nW / 2, nInit * 0.5 ) - nInit *= -0.3 - cairo_move_to( hCairo, nX2, nI + nY ) - ENDIF + // AR(1) process + nInit := nInit * 0.9 + ( hb_Random() - 0.5 ) + // ARIMA(1, 1, 0) process + nK += nInit + // ARIMA(1, 1, 0) + white noise + nX2 := nX + nK + hb_Random() + cairo_line_to( hCairo, nX2, nI + nY ) + nW -= 0.003 + IF nW < nW0 - 0.1 + cairo_set_line_width( hCairo, nW0 ) + cairo_stroke( hCairo ) + cairo_move_to( hCairo, nX2, nI + nY ) + nW0 := nW + ENDIF + // Branch + IF Abs( nInit ) > 1.6 + cairo_set_line_width( hCairo, nW0 ) + cairo_stroke( hCairo ) + DrawLightning( hCairo, nX2, nI + nY, Int( ( nLen - nI ) / 2 ), nW / 2, nInit * 0.5 ) + nInit *= -0.3 + cairo_move_to( hCairo, nX2, nI + nY ) + ENDIF NEXT cairo_set_line_width( hCairo, nW0 ) cairo_stroke( hCairo ) -RETURN + + RETURN diff --git a/harbour/contrib/hbcairo/tests/table.prg b/harbour/contrib/hbcairo/tests/table.prg index f516587c80..af37da14c7 100644 --- a/harbour/contrib/hbcairo/tests/table.prg +++ b/harbour/contrib/hbcairo/tests/table.prg @@ -6,20 +6,20 @@ #include "hbcairo.ch" - PROCEDURE Main() + LOCAL hSurface, hCairo FIELD CODE, NAME, RESIDENTS // Create database - DBCREATE( "country", {{"CODE", "C", 3, 0}, {"NAME", "C", 30, 0}, {"RESIDENTS", "N", 10, 0}},, .T. ) - DBAPPEND(); CODE := "LTU"; NAME := "Lithuania"; RESIDENTS := 3369600 - DBAPPEND(); CODE := "USA"; NAME := "United States of America"; RESIDENTS := 305397000 - DBAPPEND(); CODE := "POR"; NAME := "Portugal"; RESIDENTS := 10617600 - DBAPPEND(); CODE := "POL"; NAME := "Poland"; RESIDENTS := 38115967 - DBAPPEND(); CODE := "AUS"; NAME := "Australia"; RESIDENTS := 21446187 - DBAPPEND(); CODE := "FRA"; NAME := "France"; RESIDENTS := 64473140 - DBAPPEND(); CODE := "RUS"; NAME := "Russia"; RESIDENTS := 141900000 + dbCreate( "country", { { "CODE", "C", 3, 0 }, { "NAME", "C", 30, 0 }, { "RESIDENTS", "N", 10, 0 } },, .T. ) + dbAppend(); CODE := "LTU"; NAME := "Lithuania"; RESIDENTS := 3369600 + dbAppend(); CODE := "USA"; NAME := "United States of America"; RESIDENTS := 305397000 + dbAppend(); CODE := "POR"; NAME := "Portugal"; RESIDENTS := 10617600 + dbAppend(); CODE := "POL"; NAME := "Poland"; RESIDENTS := 38115967 + dbAppend(); CODE := "AUS"; NAME := "Australia"; RESIDENTS := 21446187 + dbAppend(); CODE := "FRA"; NAME := "France"; RESIDENTS := 64473140 + dbAppend(); CODE := "RUS"; NAME := "Russia"; RESIDENTS := 141900000 // Draw hSurface := cairo_pdf_surface_create( "table.pdf", 566.9, 793.7 ) // 200x280 mm in pt @@ -32,16 +32,18 @@ PROCEDURE Main() cairo_move_to( hCairo, 50, 50 ) cairo_show_text( hCairo, "Table of countries" ) - draw_table( hCairo, 50, 75, {{"Code", "CODE"}, {"Country", "NAME"}, {"Residents", "RESIDENTS"}} ) + draw_table( hCairo, 50, 75, { { "Code", "CODE" }, { "Country", "NAME" }, { "Residents", "RESIDENTS" } } ) cairo_show_page( hCairo ) cairo_destroy( hCairo ) cairo_surface_destroy( hSurface ) - DBCLOSEALL() -RETURN + dbCloseAll() + + RETURN -STATIC PROC draw_table( hCairo, nX, nY, aCol ) +STATIC PROCEDURE draw_table( hCairo, nX, nY, aCol ) + LOCAL nI, aWidth, nDX, nW, xValue cairo_save( hCairo ) @@ -50,61 +52,61 @@ STATIC PROC draw_table( hCairo, nX, nY, aCol ) cairo_set_source_rgb( hCairo, 0, 0, 0 ) cairo_set_line_width( hCairo, 1 ) - DBGOTOP() - aWidth := ARRAY( LEN( aCol ) ) - FOR nI := 1 TO LEN( aCol ) - aWidth[ nI ] := cairo_text_extents( hCairo, REPLICATE( "9", FIELDLEN( FIELDPOS( aCol[ nI, 2 ] ) ) ) )[ 5 ] - aWidth[ nI ] := MAX( aWidth[ nI ], cairo_text_extents( hCairo, aCol[ nI, 1 ] )[ 5 ] ) + 20 + dbGoTop() + aWidth := Array( Len( aCol ) ) + FOR nI := 1 TO Len( aCol ) + aWidth[ nI ] := cairo_text_extents( hCairo, Replicate( "9", FieldLen( FieldPos( aCol[ nI, 2 ] ) ) ) )[ 5 ] + aWidth[ nI ] := Max( aWidth[ nI ], cairo_text_extents( hCairo, aCol[ nI, 1 ] )[ 5 ] ) + 20 NEXT nW := 0 - AEVAL( aWidth, {| X | nW += X } ) + AEval( aWidth, {| X | nW += X } ) cairo_move_to( hCairo, nX, nY ) cairo_rel_line_to( hCairo, nW, 0 ) cairo_stroke( hCairo ) nDX := nX - FOR nI := 1 TO LEN( aCol ) - cairo_move_to( hCairo, nDX + aWidth[ nI ] / 2, nY + 10 ) - show_text_center( hCairo, aCol[ nI, 1 ] ) - nDX += aWidth[ nI ] - IF nI < LEN( aCol ) - cairo_move_to( hCairo, nDX, nY ) - cairo_rel_line_to( hCairo, 0, 13 ) - cairo_stroke( hCairo ) - ENDIF + FOR nI := 1 TO Len( aCol ) + cairo_move_to( hCairo, nDX + aWidth[ nI ] / 2, nY + 10 ) + show_text_center( hCairo, aCol[ nI, 1 ] ) + nDX += aWidth[ nI ] + IF nI < Len( aCol ) + cairo_move_to( hCairo, nDX, nY ) + cairo_rel_line_to( hCairo, 0, 13 ) + cairo_stroke( hCairo ) + ENDIF NEXT nY += 13 cairo_move_to( hCairo, nX, nY ) cairo_rel_line_to( hCairo, nW, 0 ) cairo_stroke( hCairo ) - DO WHILE ! EOF() + DO WHILE ! Eof() nDX := nX - FOR nI := 1 TO LEN( aCol ) - xValue := FIELDGET( FIELDPOS( aCol[ nI, 2 ] ) ) - SWITCH VALTYPE( xValue ) - CASE "C" - cairo_move_to( hCairo, nDX + 10, nY + 10 ) - cairo_show_text( hCairo, xValue ) - EXIT - CASE "N" - cairo_move_to( hCairo, nDX + aWidth[ nI ] - 10, nY + 10 ) - show_text_right( hCairo, STR( xValue ) ) - EXIT - CASE "D" - cairo_move_to( hCairo, nDX + 10, nY + 10 ) - show_text_right( hCairo, DTOC( xValue ) ) - EXIT - ENDSWITCH - nDX += aWidth[ nI ] - IF nI < LEN( aCol ) - cairo_move_to( hCairo, nDX, nY ) - cairo_rel_line_to( hCairo, 0, 13 ) - cairo_stroke( hCairo ) - ENDIF + FOR nI := 1 TO Len( aCol ) + xValue := FieldGet( FieldPos( aCol[ nI, 2 ] ) ) + SWITCH ValType( xValue ) + CASE "C" + cairo_move_to( hCairo, nDX + 10, nY + 10 ) + cairo_show_text( hCairo, xValue ) + EXIT + CASE "N" + cairo_move_to( hCairo, nDX + aWidth[ nI ] - 10, nY + 10 ) + show_text_right( hCairo, Str( xValue ) ) + EXIT + CASE "D" + cairo_move_to( hCairo, nDX + 10, nY + 10 ) + show_text_right( hCairo, DToC( xValue ) ) + EXIT + ENDSWITCH + nDX += aWidth[ nI ] + IF nI < Len( aCol ) + cairo_move_to( hCairo, nDX, nY ) + cairo_rel_line_to( hCairo, 0, 13 ) + cairo_stroke( hCairo ) + ENDIF NEXT - DBSKIP() + dbSkip() nY += 13 ENDDO cairo_move_to( hCairo, nX, nY ) @@ -112,16 +114,21 @@ STATIC PROC draw_table( hCairo, nX, nY, aCol ) cairo_stroke( hCairo ) cairo_restore( hCairo ) -RETURN + + RETURN -STATIC PROC show_text_right( hCairo, cText ) +STATIC PROCEDURE show_text_right( hCairo, cText ) + cairo_rel_move_to( hCairo, - cairo_text_extents( hCairo, cText )[ 5 ], 0 ) cairo_show_text( hCairo, cText ) -RETURN + + RETURN -STATIC PROC show_text_center( hCairo, cText ) +STATIC PROCEDURE show_text_center( hCairo, cText ) + cairo_rel_move_to( hCairo, -0.5 * cairo_text_extents( hCairo, cText )[ 5 ], 0 ) cairo_show_text( hCairo, cText ) -RETURN + + RETURN diff --git a/harbour/contrib/hbcomm/comm.prg b/harbour/contrib/hbcomm/comm.prg index bbb6e20a31..2689dfab7e 100644 --- a/harbour/contrib/hbcomm/comm.prg +++ b/harbour/contrib/hbcomm/comm.prg @@ -56,6 +56,7 @@ STATIC s_hPort := { => } STATIC s_hbcomm_mutex := hb_mutexCreate() FUNCTION INIT_PORT( cPort, nBaud, nData, nParity, nStop, nBufferSize ) + LOCAL nPort LOCAL cOldPortName LOCAL cParity @@ -98,7 +99,7 @@ FUNCTION INIT_PORT( cPort, nBaud, nData, nParity, nStop, nBufferSize ) IF hb_comInit( nPort, nBaud, cParity, nData, nStop ) s_hPort[ nPort ] := cOldPortName - hb_mutexUnLock( s_hbcomm_mutex ) + hb_mutexUnlock( s_hbcomm_mutex ) RETURN nPort ELSE hb_comClose( nPort ) @@ -109,7 +110,7 @@ FUNCTION INIT_PORT( cPort, nBaud, nData, nParity, nStop, nBufferSize ) hb_comSetDevice( nPort, cOldPortName ) ENDIF - hb_mutexUnLock( s_hbcomm_mutex ) + hb_mutexUnlock( s_hbcomm_mutex ) RETURN 0 @@ -127,11 +128,14 @@ FUNCTION ISWORKING( nPort ) [vszakats] */ /* Fetch chars into */ FUNCTION INCHR( nPort, nCount, /* @ */ cData ) + cData := iif( HB_ISNUMERIC( nCount ), Space( nCount ), "" ) + RETURN hb_comRecv( nPort, @cData, nCount ) /* Send out characters. Returns .T. if successful. */ FUNCTION OUTCHR( nPort, cData ) + LOCAL nLen DO WHILE hb_BLen( cData ) > 0 @@ -158,6 +162,7 @@ FUNCTION OUTBUFSIZE( nPort ) /* Close port and clear handle */ FUNCTION UNINT_PORT( nPort ) + LOCAL lRetVal := .F. hb_mutexLock( s_hbcomm_mutex ) @@ -173,6 +178,6 @@ FUNCTION UNINT_PORT( nPort ) ENDIF ENDIF - hb_mutexUnLock( s_hbcomm_mutex ) + hb_mutexUnlock( s_hbcomm_mutex ) RETURN lRetVal diff --git a/harbour/contrib/hbcomm/tests/test.prg b/harbour/contrib/hbcomm/tests/test.prg index 19eab5d054..1f9414f855 100644 --- a/harbour/contrib/hbcomm/tests/test.prg +++ b/harbour/contrib/hbcomm/tests/test.prg @@ -18,6 +18,7 @@ STATIC s_nHandle STATIC s_lConnected := .F. PROCEDURE Main() + LOCAL nOption DO WHILE .T. @@ -45,6 +46,7 @@ PROCEDURE Main() RETURN STATIC PROCEDURE FConnect() + LOCAL cCom := "COM1" LOCAL nBaudeRate := 19200 LOCAL nDatabits := 8 @@ -65,11 +67,14 @@ STATIC PROCEDURE FConnect() RETURN STATIC PROCEDURE FDisconnect() + s_lConnected := .F. UNINT_PORT( s_nHandle ) + RETURN STATIC PROCEDURE FSend() + LOCAL cToSend ACCEPT "Enter string to send: " TO cToSend @@ -83,6 +88,7 @@ STATIC PROCEDURE FSend() RETURN STATIC PROCEDURE FReceive() + LOCAL cReceive LOCAL nSize diff --git a/harbour/contrib/hbct/doc/en/addascii.txt b/harbour/contrib/hbct/doc/en/addascii.txt index 39951d3cf7..d6e40878b9 100644 --- a/harbour/contrib/hbct/doc/en/addascii.txt +++ b/harbour/contrib/hbct/doc/en/addascii.txt @@ -39,7 +39,7 @@ $EXAMPLES$ // Add 32 to the ASCII value of the character at the last position // in the string - + ? addascii( "SmitH", 32 ) // --> "Smith" $TESTS$ addascii( "0000", 1, 1 ) == "1000" diff --git a/harbour/contrib/hbct/doc/en/atadjust.txt b/harbour/contrib/hbct/doc/en/atadjust.txt index 6ee3479a1d..78b71abf7f 100644 --- a/harbour/contrib/hbct/doc/en/atadjust.txt +++ b/harbour/contrib/hbct/doc/en/atadjust.txt @@ -30,9 +30,9 @@ $DESCRIPTION$ $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/color.txt b/harbour/contrib/hbct/doc/en/color.txt index ee33f89248..a3d6946acc 100644 --- a/harbour/contrib/hbct/doc/en/color.txt +++ b/harbour/contrib/hbct/doc/en/color.txt @@ -8,19 +8,19 @@ $CATEGORY$ CT3 video functions $ONELINER$ - + $SYNTAX$ - + $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -30,7 +30,7 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -40,17 +40,17 @@ $CATEGORY$ CT3 video functions $ONELINER$ - + $SYNTAX$ COLORTON( ) -> $ARGUMENTS$ Designates the alphanumeric color attribute that is converted in NN/NN or CC/CC form. - + $RETURNS$ COLORTON() returns a number that corresponds to the combined numeric color attribute. - + $DESCRIPTION$ COLOR TO (N)umeric The function changes an alphanumeric color attribute from NN/NN or @@ -58,22 +58,22 @@ values are useful with the CA-Cl*pper Tools functions STRSCREEN(), SCREENMIX(), SCREENATTR(), and the CA-Cl*pper commands SAVE/RESTORE SCREEN. - + TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -83,42 +83,42 @@ $CATEGORY$ HBCT video functions $ONELINER$ - + $SYNTAX$ NTOCOLOR( , [] ) -> $ARGUMENTS$ Designates the value for the combined numeric color attributes. - + If designated as .F. or if the parameter is omitted, NTOCOLOR() returns a string with a numeric color code. When designated as .T., NTOCOLOR() returns a string with the CA-Cl*pper alpha color coding. - + $RETURNS$ NTOCOLOR() returns the designated color attribute in the NN/NN or CC/CC form. - + $DESCRIPTION$ NTOCOLOR() converts a color attribute returned from another function in numeric form, into the alphanumeric data format. Use this attribute in conjunction with the CA-Cl*pper SET COLOR TO command. - + TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -132,15 +132,15 @@ $SYNTAX$ ENHANCED() -> $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -164,15 +164,15 @@ $SYNTAX$ STANDARD() -> $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -196,15 +196,15 @@ $SYNTAX$ UNSELECTED() -> $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/count.txt b/harbour/contrib/hbct/doc/en/count.txt index 4c5dcf10ca..4a94ec9c26 100644 --- a/harbour/contrib/hbct/doc/en/count.txt +++ b/harbour/contrib/hbct/doc/en/count.txt @@ -12,15 +12,15 @@ $SYNTAX$ COUNTLEFT( , [] ) -> nCount $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -44,15 +44,15 @@ $SYNTAX$ COUNTRIGHT( , [] ) -> nCount $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/ct.txt b/harbour/contrib/hbct/doc/en/ct.txt index c9192e268a..b4a3650ba7 100644 --- a/harbour/contrib/hbct/doc/en/ct.txt +++ b/harbour/contrib/hbct/doc/en/ct.txt @@ -22,9 +22,9 @@ idea to call it once again explicitly somewhere at the beginning of your program to check the initialization. $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -34,7 +34,7 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -58,9 +58,9 @@ to call it explicitly somewhere at the end of your program to make sure that the deinitialization takes place. $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -70,6 +70,6 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbct/doc/en/ctc.txt b/harbour/contrib/hbct/doc/en/ctc.txt index 789159a370..afd8f77646 100644 --- a/harbour/contrib/hbct/doc/en/ctc.txt +++ b/harbour/contrib/hbct/doc/en/ctc.txt @@ -29,9 +29,9 @@ The last is the default behaviour and switches any argument error throwing off. $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -41,7 +41,7 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -62,9 +62,9 @@ The CTCINIT() function initializes the C source part of the CT3 library. Do not call this function directly. $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -95,9 +95,9 @@ The CTCEXIT() function uninitializes the C part of the CT3 library. Do not call this function directly. $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/ctmath.txt b/harbour/contrib/hbct/doc/en/ctmath.txt index 1aba52068c..59a20de65b 100644 --- a/harbour/contrib/hbct/doc/en/ctmath.txt +++ b/harbour/contrib/hbct/doc/en/ctmath.txt @@ -19,9 +19,9 @@ Be aware that calls to this functions do _NOT_ affect the calculation precision of the math functions at the moment. $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -31,7 +31,7 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -45,16 +45,16 @@ $SYNTAX$ GETPREC() -> nDigits $ARGUMENTS$ - + $RETURNS$ nDigits digit count between 1 and 16 $DESCRIPTION$ Be aware that calls to this functions do _NOT_ affect the calculation precision of the math functions at the moment. $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -64,6 +64,6 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbct/doc/en/ctmath2.txt b/harbour/contrib/hbct/doc/en/ctmath2.txt index 27f36de9f9..bac27b8590 100644 --- a/harbour/contrib/hbct/doc/en/ctmath2.txt +++ b/harbour/contrib/hbct/doc/en/ctmath2.txt @@ -107,7 +107,7 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -142,7 +142,7 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -181,6 +181,6 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbct/doc/en/ctpad.txt b/harbour/contrib/hbct/doc/en/ctpad.txt index 95846a5510..ee30c9bfc3 100644 --- a/harbour/contrib/hbct/doc/en/ctpad.txt +++ b/harbour/contrib/hbct/doc/en/ctpad.txt @@ -12,15 +12,15 @@ $SYNTAX$ PADLEFT( , , [] ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -44,15 +44,15 @@ $SYNTAX$ PADRIGHT( , , [] ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/ctstr.txt b/harbour/contrib/hbct/doc/en/ctstr.txt index 3503242f09..ca6fe43a4c 100644 --- a/harbour/contrib/hbct/doc/en/ctstr.txt +++ b/harbour/contrib/hbct/doc/en/ctstr.txt @@ -21,7 +21,7 @@ Within the CT3 functions, the following functions do not change the length of a string passed as parameter while transforming this string: - + ADDASCII() BLANK() CHARADD() CHARAND() CHARMIRR() CHARNOT() CHAROR() CHARRELREP() CHARREPL() @@ -31,18 +31,18 @@ REPLALL() REPLLEFT() REPLRIGHT() TOKENLOWER() TOKENUPPER() WORDREPL() WORDSWAP() - + Thus, these functions allow to pass the string by reference [@] to the function so that it may not be necessary to return the transformed string. By calling CSETREF (.T.), the above mentioned functions return the value .F. instead of the transformed string if the string is passed by reference to the function. The switch is turned off (.F.) by default. - + $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -81,18 +81,18 @@ current state of the switch $DESCRIPTION$ CSETATMUPA determines how the following CT3 string functions - + ATNUM() AFTERATNUM() BEFORATNUM() ATREPL() NUMAT() ATADJUST() WORDTOCHAR() WORDREPL() - + perform their work. See the respective function documentation for a further description how the switch influences these functions. - + $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -134,27 +134,27 @@ $DESCRIPTION$ In the following CT3 functions, strings are compared on a character base: - + ATADJUST() ATNUM() AFTERATNUM() BEFOREATNUM() ATREPL() NUMAT() STRDIFF() - + With the SETATLIKE function, one can determine when characters are considered to match within these functions. If CT_SETATLIKE_WILDCARD is set (e.g. "?"), then "?" matches every other character. - + can be one of the following values that are defined in ct.ch - + Definition | Value ----------------------|------ CT_SETATLIKE_EXACT | 0 CT_SETATLIKE_WILDCARD | 1 - + $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -166,6 +166,6 @@ $FILES$ Header is ct.ch, library is libct. $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbct/doc/en/datetime.txt b/harbour/contrib/hbct/doc/en/datetime.txt index 1e2ca79e87..575cc00677 100644 --- a/harbour/contrib/hbct/doc/en/datetime.txt +++ b/harbour/contrib/hbct/doc/en/datetime.txt @@ -12,15 +12,15 @@ $SYNTAX$ BOM( [] ) -> dDateBeginOfMonth $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -44,15 +44,15 @@ $SYNTAX$ EOM( [] ) -> dDateEndOfMonth $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -76,15 +76,15 @@ $SYNTAX$ BOQ( [] ) -> dDateBeginOfQuarter $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -108,15 +108,15 @@ $SYNTAX$ EOQ( [] ) -> dDateEndOfQuarter $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -140,15 +140,15 @@ $SYNTAX$ BOY( [] ) -> dDateBeginOfYear $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -172,15 +172,15 @@ $SYNTAX$ EOY( [] ) -> dDateEndOfYear $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/dattime2.txt b/harbour/contrib/hbct/doc/en/dattime2.txt index 7d53010fa5..ff538ed3a6 100644 --- a/harbour/contrib/hbct/doc/en/dattime2.txt +++ b/harbour/contrib/hbct/doc/en/dattime2.txt @@ -12,15 +12,15 @@ $SYNTAX$ CTODOW( ) -> nOrdinal $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -44,15 +44,15 @@ $SYNTAX$ CTOMONTH( ) -> nOrdinal $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -76,17 +76,17 @@ $SYNTAX$ DMY( [][, ] ) -> cDateString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ Returns the date as a string in DD Month YY format. If lmode is TRUE, a "." is inserted after the DD TODO: add further documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -110,17 +110,17 @@ $SYNTAX$ MDY( [] ) -> cDateString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ Returns the date as a string in Month DD, YY or Month DD, YYYY If dDate is NULL, the system date is used TODO: add further documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -144,15 +144,15 @@ $SYNTAX$ ADDMONTH( [,] ) -> dShiftedDate $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -162,7 +162,7 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -176,17 +176,17 @@ $SYNTAX$ DMY( [] ) -> nDayOfYear $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ Determines the day of the year for a specific date if dDate is invalid, returns 0 TODO: add further documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -196,7 +196,7 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -210,15 +210,15 @@ $SYNTAX$ ISLEAP( [] ) -> lIsLeap $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add further documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -228,7 +228,7 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -242,17 +242,17 @@ $SYNTAX$ DAYSTOMONTH( , ) -> nDaysToMonth $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ lLeap is FALSE for a non-leap year but TRUE if it is. If so and nMonth is greater than 2, ndays is incremented TODO: add further documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -276,15 +276,15 @@ $SYNTAX$ DAYSINMONTH (, ) -> nDaysInMonth $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -308,17 +308,17 @@ $SYNTAX$ QUARTER( [] ) -> nQuarter $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ Returns a number equal to the quarter in which ddate falls. If ddate is empty, the system date is employed. TODO: add further documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -328,7 +328,7 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -342,18 +342,18 @@ $SYNTAX$ LASTDAYOM( [] ) -> nDaysInMonth $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ can be a date or a month number. If empty uses the system date. If nMonth is a 2, lastdayom() will not know if it is a leap year or not. If dDate is invalid, returns 0 TODO: add further documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -377,15 +377,15 @@ $SYNTAX$ NTOCDOW( ) -> cDay $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -409,15 +409,15 @@ $SYNTAX$ NTOCMONTH( ) -> cMonth $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -441,9 +441,9 @@ $SYNTAX$ WEEK( [][, ] ) -> nWeek $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ Returns the calendar week a number. If no date is specified, the system date is used. An empty date via hb_SToD("") @@ -457,9 +457,9 @@ will be calculated TODO: add further documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -469,6 +469,6 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbct/doc/en/dattime3.txt b/harbour/contrib/hbct/doc/en/dattime3.txt index 5f6075b097..3a48415c64 100644 --- a/harbour/contrib/hbct/doc/en/dattime3.txt +++ b/harbour/contrib/hbct/doc/en/dattime3.txt @@ -24,9 +24,9 @@ the parameter in 1/100th seconds. Subsequently, the function can be implemented without a parameter for additional loop conditions. It returns .T., as long as the designated time span has not yet run out. - + Note - + The function notes the status of the internal timer at initialization. From that point on, the initialization should always precede the respective DO WHILE; otherwise, the time delay is @@ -34,13 +34,13 @@ is taken into account. $EXAMPLES$ Run a loop for 5 seconds: - + WAITPERIOD( 500 ) // Initialization, 5 seconds DO WHILE .AND. .AND. WAITPERIOD() *... ENDDO $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -50,7 +50,7 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -74,9 +74,9 @@ check time inputs was unavoidable up to now. TIMEVALID() permits Complete checking of a time designation. You can use this FUNCTION effectively with a VALID clause within a READ mask. - + Note - + Note the format for time designations. There must always be two digits for hours, minutes, seconds, and hundredths; otherwise, the time it is regarded as invalid. Valid examples are "12", @@ -88,21 +88,21 @@ $EXAMPLES$ Using the VALID clause with TRIM, all valid times are accepted, even IF no seconds or minutes are specIFied: - + cBegin := SPACE( 11 ) @ 5, 10 SAY "Please input time for beginning work:"; GET cBegin VALID TIMEVALID( RTRIM( cBegin ) ) READ - + Using a VALID clause without TRIM, hours and minutes must be specified, so that TIMEVALID() can confirm a valid time: - + cBegin := SPACE( 5 ) @ 5, 10 SAY "Please input time for beginning work:"; GET cBegin VALID TIMEVALID( cBegin ) READ $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -128,7 +128,7 @@ $ARGUMENTS$ Designates a character string that contains the time that is to become the system time. - + Designates whether the time should also be set in the CMOS-RAM of an AT. The default is do not write to CMOS-RAM. Note that in Windows platform this adjust is automatic, therefore this parameter is @@ -142,19 +142,19 @@ $EXAMPLES$ Set the system time in each case; but the hardware clock only on an AT: - + cNewTime := "10:20:00" IF ISAT() SETTIME( cNewTime, .T. ) ELSE SETTIME( cNewTime ) ENDIF - + Or, more compactly: - + SETTIME( cNewTime, ISAT() ) $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -179,7 +179,7 @@ SETDATE( , [] ) --> lSet $ARGUMENTS$ Designates which date to use to set the system date. - + Designates whether the date should also be set in the CMOS- RAM of an AT. The default is do not write (.F.). Note that in Windows plataform this adjust is automatic, therefore this parameter is without @@ -193,19 +193,19 @@ $EXAMPLES$ Set the system date in each case; but the hardware clock only on an AT: - + dNewDate := SToD( "19910730" ) IF ISAT() SETDATE( dNewDate, .T. ) ELSE SETDATE( dNewDate ) ENDIF - + Or, more compactly: - + SETDATE( dNewDate, ISAT() ) $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/exponent.txt b/harbour/contrib/hbct/doc/en/exponent.txt index d306368e22..b157d97aa0 100644 --- a/harbour/contrib/hbct/doc/en/exponent.txt +++ b/harbour/contrib/hbct/doc/en/exponent.txt @@ -18,19 +18,19 @@ $DESCRIPTION$ This function supplements EXPONENT() to return the mantissa of the number. - + Note: The mantissa value can be 0 or in the range of 1 to 2. - + The following calculation reproduces the original value: - + MANTISSA( ) * 2 ^ EXPONENT( ) = - + TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -61,23 +61,23 @@ $DESCRIPTION$ This function supplements MANTISSA() to return the exponent of the number. - + Values > 1 or values < -1 return a positive number 0 to 1023. - + Values < 1 or values > -1 return a negative number -1 to -1023. - + The EXPONENT( 0 ), return 0. - + The following calculation reproduces the original value: - + 2^EXPONENT() * MANTISSA() = - + TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/finan.txt b/harbour/contrib/hbct/doc/en/finan.txt index 053a3848e4..a8054e2d60 100644 --- a/harbour/contrib/hbct/doc/en/finan.txt +++ b/harbour/contrib/hbct/doc/en/finan.txt @@ -36,7 +36,7 @@ $EXAMPLES$ // Payment of 1000 per year for 10 years at a interest rate // of 5 per cent per year - + ? fv( 1000, 0.05, 10 ) // --> 12577.893 $TESTS$ fv( 1000, 0.00, 10 ) == 10000.0 @@ -87,7 +87,7 @@ // at a interest rate of 0.5% per month (6% per year), so instead // of 6000 Dollars (the amount you will pay back) the bank will pay // you - + ? pv( 100, 0.005, 60 ) // --> 5172.56 $TESTS$ pv( 100, 0.0, 60 ) == 6000.0 @@ -136,7 +136,7 @@ // You get a loan of 5172.56 at a interest rate of 0.5% per // month (6% per year). // For 5 years, you have to pay back every month - + ? payment( 5172.56, 0.005, 60 ) // --> 100.00 $TESTS$ payment( 5172.56, 0.0, 60 ) == 86.21 @@ -180,7 +180,7 @@ debt in period = ((debt in period -1)-)*(1+/100) -> has to be 0, so = -log(1-*(/100)/)/log(1+/100)) - + Note, however that in the case of nPayment <= *(/100), one would need infinite time to pay the loan back. The functions does then return -1. @@ -188,9 +188,9 @@ // You get a loan of 5172.56 at a interest rate of 0.5% per // month (6% per year). // You can afford to pay 100 back every month, so you need - + ? periods( 5172.56, 100, 0.005 ) // --> 60.0 - + // months to cancel the loan. $TESTS$ periods( 5172.56, 100, 0.005 ) == 60.0 @@ -227,18 +227,18 @@ RATE() calculates the rate of interest per period for the given loan, payment per periods and number of periods. This is done with the same equation used in the PAYMENT() or PERIODS() function: - + = *(/100)/(1-(1+/100)^(-)) - + However, this equation can not be solved for in a "closed" manner, i.e. = ..., so that the result can only be estimated. $EXAMPLES$ // You get a loan of 5172.56, pay 100 back every month for // 5 years (60 months). The effective interest rate per // period (=month) is - + ? rate( 5172.56, 100, 60 ) // --> 0.005 - + $TESTS$ rate( 5172.56, 100, 60.0 ) == 0.005 rate( 6000.0, 100, 60.0 ) == 0.0 diff --git a/harbour/contrib/hbct/doc/en/ftoc.txt b/harbour/contrib/hbct/doc/en/ftoc.txt index d397b7b8f7..470ec85c31 100644 --- a/harbour/contrib/hbct/doc/en/ftoc.txt +++ b/harbour/contrib/hbct/doc/en/ftoc.txt @@ -8,32 +8,32 @@ $CATEGORY$ CT3 number and bit manipulation functions $ONELINER$ - + $SYNTAX$ FTOC( ) --> cFloatingPointNumber - + $ARGUMENTS$ Designate any Harbour number. - + $RETURNS$ FTOC() return a string with the size of DOUBLE. ATTENTION: different implementations or platforms of Harbour, they could produce different format in the string returned by FTOC(). - + $DESCRIPTION$ Harbour internal numbers in Floating Point are stored in data type DOUBLE. FTOC() returns these bits as an string. In this way, numbers con be saved more compactly. - + TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ @@ -49,33 +49,33 @@ $CATEGORY$ CT3 number and bit manipulation functions $ONELINER$ - + $SYNTAX$ CTOF( ) --> nFloatingPointNumber - + $ARGUMENTS$ Designate a string that contains a Harbour number in flotaing point format. ATTENTION: different implementations or platforms of Harbour, they could produce different format in the string returned by FTOC(). - + $RETURNS$ CTOF() return the floating point number that corresponds to the string passed. - + $DESCRIPTION$ Character strings created with FTOC() or XTOC() are convert into Harbour floating point number - + TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ diff --git a/harbour/contrib/hbct/doc/en/justify.txt b/harbour/contrib/hbct/doc/en/justify.txt index a0f15a6dec..f51c0b1756 100644 --- a/harbour/contrib/hbct/doc/en/justify.txt +++ b/harbour/contrib/hbct/doc/en/justify.txt @@ -12,15 +12,15 @@ $SYNTAX$ JUSTLEFT( <[@]cString>, [|] ) -> cJustifiedString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -44,15 +44,15 @@ $SYNTAX$ JUSTRIGHT( <[@]cString>, [|] ) -> cJustifiedString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/keyset.txt b/harbour/contrib/hbct/doc/en/keyset.txt index d916e3cae1..c59d67ed94 100644 --- a/harbour/contrib/hbct/doc/en/keyset.txt +++ b/harbour/contrib/hbct/doc/en/keyset.txt @@ -8,29 +8,29 @@ $CATEGORY$ CT3 switch and state functions $ONELINER$ - + $SYNTAX$ KSETINS( [] ) -> lOldSwitch $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ DOS $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -40,29 +40,29 @@ $CATEGORY$ CT3 switch and state functions $ONELINER$ - + $SYNTAX$ KSETCAPS( [] ) -> lOldSwitch $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ DOS $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -72,29 +72,29 @@ $CATEGORY$ CT3 switch and state functions $ONELINER$ - + $SYNTAX$ KSETNUM( [] ) -> lOldSwitch $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ DOS $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -104,28 +104,28 @@ $CATEGORY$ CT3 switch and state functions $ONELINER$ - + $SYNTAX$ KSETSCROLL( [] ) -> lOldSwitch $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ DOS $FILES$ Library is libct. $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbct/doc/en/misc1.txt b/harbour/contrib/hbct/doc/en/misc1.txt index 919bc66e31..6807f7ec43 100644 --- a/harbour/contrib/hbct/doc/en/misc1.txt +++ b/harbour/contrib/hbct/doc/en/misc1.txt @@ -8,21 +8,21 @@ $CATEGORY$ CT3 miscellaneous functions $ONELINER$ - + $SYNTAX$ XTOC( ) --> cValue - + $ARGUMENTS$ Designate an expression of some of the following data type: NUMBER, CHARACTER, DATE, LOGICAL. - + $RETURNS$ XTOC() return a string with the representation of data type of expValue. - + $DESCRIPTION$ Each data type always returns a string with a particular fixed length: - + ----------------------------------------------------------- Data Type Result Length Similar function ----------------------------------------------------------- @@ -31,16 +31,16 @@ Date 8 DTOS() String Unchanged ----------------------------------------------------------- - + TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ diff --git a/harbour/contrib/hbct/doc/en/num1.txt b/harbour/contrib/hbct/doc/en/num1.txt index adf9559d68..8b39b06f39 100644 --- a/harbour/contrib/hbct/doc/en/num1.txt +++ b/harbour/contrib/hbct/doc/en/num1.txt @@ -98,9 +98,9 @@ INFINITY() returns the largest floating point number available in the system. For platform independance, this is set to DBL_MAX. $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -110,6 +110,6 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbct/doc/en/numat.txt b/harbour/contrib/hbct/doc/en/numat.txt index 765aa1e449..4f8c758a9a 100644 --- a/harbour/contrib/hbct/doc/en/numat.txt +++ b/harbour/contrib/hbct/doc/en/numat.txt @@ -12,15 +12,15 @@ $SYNTAX$ NUMAT( , , [] ) --> nCount $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/numconv.txt b/harbour/contrib/hbct/doc/en/numconv.txt index 979646b356..e257fcf14e 100644 --- a/harbour/contrib/hbct/doc/en/numconv.txt +++ b/harbour/contrib/hbct/doc/en/numconv.txt @@ -8,23 +8,23 @@ $CATEGORY$ CT3 number and bit manipulation functions $ONELINER$ - + $SYNTAX$ NTOC( [, ][,][,] ) -> $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ @@ -40,23 +40,23 @@ $CATEGORY$ CT3 number and bit manipulation functions $ONELINER$ - + $SYNTAX$ CTON( [, ][,] ) -> $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ @@ -72,23 +72,23 @@ $CATEGORY$ CT3 number and bit manipulation functions $ONELINER$ - + $SYNTAX$ BITTOC( , [,] ) -> $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ @@ -104,23 +104,23 @@ $CATEGORY$ CT3 number and bit manipulation functions $ONELINER$ - + $SYNTAX$ CTOBIT( , ) -> $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ diff --git a/harbour/contrib/hbct/doc/en/pos1.txt b/harbour/contrib/hbct/doc/en/pos1.txt index ba8ceb7734..18775821d5 100644 --- a/harbour/contrib/hbct/doc/en/pos1.txt +++ b/harbour/contrib/hbct/doc/en/pos1.txt @@ -12,15 +12,15 @@ $SYNTAX$ POSALPHA( , [], [] ) -> nPosition $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -44,15 +44,15 @@ $SYNTAX$ POSLOWER( , [], [] ) -> nPosition $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -77,15 +77,15 @@ POSRANGE( , , , [], [] ) -> nPosition $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -109,15 +109,15 @@ $SYNTAX$ POSUPPER( , [], [] ) -> nPosition $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/pos2.txt b/harbour/contrib/hbct/doc/en/pos2.txt index 8a9e2a56b5..f23a5e8b15 100644 --- a/harbour/contrib/hbct/doc/en/pos2.txt +++ b/harbour/contrib/hbct/doc/en/pos2.txt @@ -12,15 +12,15 @@ $SYNTAX$ POSCHAR( <[@]cString>, , [] ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -44,15 +44,15 @@ $SYNTAX$ POSDEL( , [], ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -76,15 +76,15 @@ $SYNTAX$ POSINS( , , [] ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -108,15 +108,15 @@ $SYNTAX$ POSREPL( <[@]cString>, , [] ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/posdiff.txt b/harbour/contrib/hbct/doc/en/posdiff.txt index c0800a3d99..4c2a4bed09 100644 --- a/harbour/contrib/hbct/doc/en/posdiff.txt +++ b/harbour/contrib/hbct/doc/en/posdiff.txt @@ -12,15 +12,15 @@ $SYNTAX$ POSDIFF( , , [] ) -> nPosition $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -44,15 +44,15 @@ $SYNTAX$ POSEQUAL( , , [], [] ) -> nPosition $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/print.txt b/harbour/contrib/hbct/doc/en/print.txt index 724e249626..c5795b8692 100644 --- a/harbour/contrib/hbct/doc/en/print.txt +++ b/harbour/contrib/hbct/doc/en/print.txt @@ -8,29 +8,29 @@ $CATEGORY$ CT3 printer functions $ONELINER$ - + $SYNTAX$ PRINTSTAT( [] ) -> nState $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ DOS $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -40,28 +40,28 @@ $CATEGORY$ CT3 printer functions $ONELINER$ - + $SYNTAX$ PRINTREADY( [] ) -> lPrinterReady $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ DOS $FILES$ Library is libct. $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbct/doc/en/range.txt b/harbour/contrib/hbct/doc/en/range.txt index e675857542..7b24558169 100644 --- a/harbour/contrib/hbct/doc/en/range.txt +++ b/harbour/contrib/hbct/doc/en/range.txt @@ -12,9 +12,9 @@ $SYNTAX$ RANGEREM( , , ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ @@ -50,9 +50,9 @@ RANGEREPL( , , <[@]cString>, ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ diff --git a/harbour/contrib/hbct/doc/en/relation.txt b/harbour/contrib/hbct/doc/en/relation.txt index 0974d904dc..d7d2afed11 100644 --- a/harbour/contrib/hbct/doc/en/relation.txt +++ b/harbour/contrib/hbct/doc/en/relation.txt @@ -13,15 +13,15 @@ CHARRELA( , , , ) -> nPosition $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -47,15 +47,15 @@ , <[@]cString2>, ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/remove.txt b/harbour/contrib/hbct/doc/en/remove.txt index 0e497f85b7..6e6faaae7c 100644 --- a/harbour/contrib/hbct/doc/en/remove.txt +++ b/harbour/contrib/hbct/doc/en/remove.txt @@ -12,15 +12,15 @@ $SYNTAX$ REMALL( , [] ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -44,15 +44,15 @@ $SYNTAX$ REMLEFT( , [] ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -76,15 +76,15 @@ $SYNTAX$ REMRIGHT( , [] ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/replace.txt b/harbour/contrib/hbct/doc/en/replace.txt index 9d89700124..14e89508d2 100644 --- a/harbour/contrib/hbct/doc/en/replace.txt +++ b/harbour/contrib/hbct/doc/en/replace.txt @@ -12,15 +12,15 @@ $SYNTAX$ REPLALL( , , [] ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -44,15 +44,15 @@ $SYNTAX$ REPLLEFT( , , [] ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -76,15 +76,15 @@ $SYNTAX$ REPLRIGHT( , , [] ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/screen1.txt b/harbour/contrib/hbct/doc/en/screen1.txt index 5d27dfe93b..856f12a0ba 100644 --- a/harbour/contrib/hbct/doc/en/screen1.txt +++ b/harbour/contrib/hbct/doc/en/screen1.txt @@ -8,39 +8,39 @@ $CATEGORY$ CT3 video functions $ONELINER$ - + $SYNTAX$ SCREENATTR( [],[] ) -> $ARGUMENTS$ Designates the line from which to determine the attribute. The default is the cursor line. - + Designates the column from which to determine the attribute. The default is the cursor column. - + $RETURNS$ SCREENATTR() returns the attribute at the designated position. - + $DESCRIPTION$ SCREENATTR() returns the current screen attribute at and . You can query targeted attributes this way and save them to use later, or process them later with INVERTATTR(). - + TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -50,29 +50,29 @@ $CATEGORY$ CT3 video functions $ONELINER$ - + $SYNTAX$ SCREENMIX( , , [], [] ) -> $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -82,7 +82,7 @@ $CATEGORY$ CT3 video functions $ONELINER$ - + $SYNTAX$ SAYSCREEN( , [], [] ) -> $ARGUMENTS$ @@ -95,13 +95,13 @@ Outputs a string at specified coordinates without changing character attributes. $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ @@ -117,19 +117,19 @@ $CATEGORY$ CT3 video functions $ONELINER$ - + $SYNTAX$ - + $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -139,7 +139,7 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -149,7 +149,7 @@ $CATEGORY$ CT3 video functions $ONELINER$ - + $SYNTAX$ UNTEXTWIN( , , , , , @@ -180,19 +180,19 @@ Replaces an area of characters from a region of the screen TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -202,7 +202,7 @@ $CATEGORY$ CT3 video functions $ONELINER$ - + $SYNTAX$ CHARWIN( , , , , [], [] ) --> @@ -223,19 +223,19 @@ Exchanges particular characters in a screen area. TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -245,7 +245,7 @@ $CATEGORY$ CT3 video functions $ONELINER$ - + $SYNTAX$ COLORWIN( [], [], [], [], [], [] ) --> cNull @@ -268,19 +268,19 @@ Exchanges particular attributes in a screen area TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -290,7 +290,7 @@ $CATEGORY$ CT video functions (Harbour extension) $ONELINER$ - + $SYNTAX$ SCREENTEXT( , , , ) $ARGUMENTS$ @@ -304,19 +304,19 @@ Returns string with characters taken from given screen region. TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -326,7 +326,7 @@ $CATEGORY$ CT3 video functions $ONELINER$ - + $SYNTAX$ COLORREPL( [], [] ) --> cNull $ARGUMENTS$ @@ -340,18 +340,18 @@ Exchanges particular screen attributes TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ - + $PLATFORMS$ All $FILES$ Library is libct. $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbct/doc/en/strdiff.txt b/harbour/contrib/hbct/doc/en/strdiff.txt index 6853c681fa..45a8230066 100644 --- a/harbour/contrib/hbct/doc/en/strdiff.txt +++ b/harbour/contrib/hbct/doc/en/strdiff.txt @@ -25,24 +25,24 @@ This distance is a measure for the number of single character replace/insert/delete operations (so called "point mutations") required to transform into and its value will be the smallest sum of the penalty points of the required operations. - + Be aware that this function is both quite time - O(len(cString1)*len(cString2)) - and memory consuming - O((len(cString1)+1)*(len(cString2)+1)*sizeof(int)) - so keep the strings as short as possible. E.g., on common 32 bit systems (sizeof(int) == 4), calling strdiff() with two strings of 1024 bytes in length will consume 4 MB of memory. To not impose unneeded restrictions, the function will only check if (len(cString1)+1)*(len(cString2)+1)*sizeof(int) <= UINT_MAX, although allocing UINT_MAX bytes will not work on most systems. If this simple check fails, -1 is returned. - + Also, be aware that there can be an overflow when the penalty points are summed up: Assuming that the number of transformation operations is in the order of max(len(cString1),len(cString2)), the penalty point sum, that is internally stored in an "int" variable, is in the order of (max(len(cString1),len(cString2))*max(nReplacementPenalty,nDeletionPenalty,nInsertionPentaly). The STRDIFF() does not do an overflow check due to time performance reasons. Future versions of STRDIFF() could use a type different to "int" to store the penalty point sum to save memory or to avoid overflows. - + The function is aware of the settings done by SETATLIKE(), that means that the wildchar character is considered equal to ALL characters. - + $EXAMPLES$ ? strdiff( "ABC", "ADC" ) // 3, one character replaced ? strdiff( "ABC", "AEC" ) // 3, dito diff --git a/harbour/contrib/hbct/doc/en/strswap.txt b/harbour/contrib/hbct/doc/en/strswap.txt index b3521ea036..7b1c4fc05b 100644 --- a/harbour/contrib/hbct/doc/en/strswap.txt +++ b/harbour/contrib/hbct/doc/en/strswap.txt @@ -12,15 +12,15 @@ $SYNTAX$ STRSWAP( <[@]cString1>, <[@]cString2> ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -30,6 +30,6 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbct/doc/en/tab.txt b/harbour/contrib/hbct/doc/en/tab.txt index db96df691b..59a2dbb945 100644 --- a/harbour/contrib/hbct/doc/en/tab.txt +++ b/harbour/contrib/hbct/doc/en/tab.txt @@ -26,11 +26,11 @@ should be ignored as a newline indicator, default is .F. (functions uses Chr(141)) $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ tabexpand("-"+Chr(9)+"!") == "- !" tabexpand("----"+Chr(9) +"!") == "---- !" @@ -78,13 +78,13 @@ should be ignored as a newline indicator, default is .F. (functions uses Chr(141)) $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/token1.txt b/harbour/contrib/hbct/doc/en/token1.txt index 5452d15035..41b3b95e32 100644 --- a/harbour/contrib/hbct/doc/en/token1.txt +++ b/harbour/contrib/hbct/doc/en/token1.txt @@ -144,13 +144,13 @@ $SYNTAX$ NUMTOKEN( , [], [] ) -> nTokenCount $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $TESTS$ numtoken( "Hello, World!" ) == 2 numtoken( "This is good. See you! How do you do?", ".!?" ) == 3 @@ -319,7 +319,7 @@ $EXAMPLES$ see TOKEN() function $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/token2.txt b/harbour/contrib/hbct/doc/en/token2.txt index a93d696160..ce5c187967 100644 --- a/harbour/contrib/hbct/doc/en/token2.txt +++ b/harbour/contrib/hbct/doc/en/token2.txt @@ -35,24 +35,24 @@ This information is created in the process of tokenization of the string - equal to the one used in the TOKEN() function with the help of the and parameters. - + This token environment can be very useful when large strings have to be tokenized since the tokenization has to take place only once whereas the TOKEN() function must always start the tokenizing process from scratch. - + Unlike CTIII, this function provides two mechanisms of storing the resulting token environment. If a variable is passed by reference as 4th parameter, the token environment is stored in this variable, otherwise the global token environment is used. Do not modify the token environment string directly ! - + Additionally, a counter is stored in the token environment, so that the tokens can successivly be obtained. This counter is first set to 1. When the TOKENINIT() function is called without a string a tokenize, the counter of either the global environment or the environment given by reference in the 4th parameter is rewind to 1. - + Additionally, unlike CTIII, tokeninit() does not need the string to be passed by reference, since one must provide the string in calls to TOKENNEXT() again. @@ -71,7 +71,7 @@ // not given by reference !!! tokeninit( ,,, @cTE1 ) // set counter in TE stored in cTE1 to 1 $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -108,13 +108,13 @@ in either the global token environment or the local one supplied by . Note that, is supplied, this 3rd parameter has always to be passed by reference. - + If the 2nd parameter, is given, TOKENNEXT() simply returns the th token without manipulating the TE counter. Otherwise the token pointed to by the TE counter is returned and the counter is incremented by one. Like this, a simple loop with TOKENEND() can be used to retrieve all tokens of a string successivly. - + Note that does not have to be the same used in TOKENINIT(), so that one can do a "correlational tokenization", i.e. tokenize a string as if it was another! E.G. using TOKENINIT() with the string @@ -129,7 +129,7 @@ ? tokennext( cString, 3 ) // get the 3rd token, counter will remain the same tokenexit() // free the memory used for the global TE $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -168,7 +168,7 @@ tokeninit( "a.b.c.d", ".", 1 ) // initialize global TE ? tokennum() // --> 4 $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -211,7 +211,7 @@ ? tokennext( "a.b.c.d" ) // get all tokens successivly ENDDO $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -236,7 +236,7 @@ $SYNTAX$ TOKENEXIT() -> lStaticEnvironmentReleased $ARGUMENTS$ - + $RETURNS$ .T., if global token environment is successfully released $DESCRIPTION$ @@ -252,7 +252,7 @@ ? tokennext( cString, 3 ) // get the 3rd token, counter will remain the same tokenexit() // free the memory used for the global TE $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -289,17 +289,17 @@ The TOKENAT() function is used to retrieve the start and end position of the tokens in a token environment. Note however that the position of last character of a token is given by tokenat (.T.)-1 !! - + If the 2nd parameter, is given, TOKENAT() returns the positions of the th token. Otherwise the token pointed to by the TE counter, i.e. the token that will be retrieved by TOKENNEXT() _NEXT_ is used. - + If the parameter <@cTokenEnvironment> is supplied (must be by reference), the information from this token environment is used, otherwise the global TE is used. $EXAMPLES$ - + $TESTS$ tokeninit( cString ) // initialize a TE DO WHILE ! tokenend() @@ -333,7 +333,7 @@ $SYNTAX$ SAVETOKEN() -> cStaticTokenEnvironment $ARGUMENTS$ - + $RETURNS$ a binary string encoding the global TE $DESCRIPTION$ @@ -342,9 +342,9 @@ Note however that the latter can now be solved with locally stored token environments. $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ @@ -377,9 +377,9 @@ of SAVETOKEN() or the value stored in the 4th parameter in a TOKENINIT() call. $EXAMPLES$ - + $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/trig.txt b/harbour/contrib/hbct/doc/en/trig.txt index 43580787d6..c9d3e29dbb 100644 --- a/harbour/contrib/hbct/doc/en/trig.txt +++ b/harbour/contrib/hbct/doc/en/trig.txt @@ -12,7 +12,7 @@ $SYNTAX$ PI() -> nPi $ARGUMENTS$ - + $RETURNS$ the math constant Pi with maximum precision available $DESCRIPTION$ @@ -22,10 +22,10 @@ $EXAMPLES$ // the diameter of a circle-like swimming pool is 3.4 meters, how // long is the perimeter ? - + ? Str( PI() * 3.4, 5, 3 ) + " meters" // --> 10.681 meters $TESTS$ - + $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/video.txt b/harbour/contrib/hbct/doc/en/video.txt index 15d2a6ef0f..67d99551fb 100644 --- a/harbour/contrib/hbct/doc/en/video.txt +++ b/harbour/contrib/hbct/doc/en/video.txt @@ -12,15 +12,15 @@ $SYNTAX$ CHARPIX() --> nHeight $ARGUMENTS$ - + $RETURNS$ Returns the number of scan lines per character. $DESCRIPTION$ Returns the number of scan lines per character. $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -30,7 +30,7 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ @@ -56,11 +56,11 @@ $RETURNS$ Returns .T. on success. $DESCRIPTION$ - + $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -84,15 +84,15 @@ $SYNTAX$ VIDEOTYPE() --> nMask $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: Finish documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -124,13 +124,13 @@ Number of characters to load. When .T., the function computes font height automatically. $RETURNS$ - + $DESCRIPTION$ TODO: Finish documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ @@ -140,6 +140,6 @@ $FILES$ Library is libct. $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbct/doc/en/wordtoch.txt b/harbour/contrib/hbct/doc/en/wordtoch.txt index 9294d0a174..7171720799 100644 --- a/harbour/contrib/hbct/doc/en/wordtoch.txt +++ b/harbour/contrib/hbct/doc/en/wordtoch.txt @@ -13,15 +13,15 @@ WORDTOCHAR( , , ) -> cString $ARGUMENTS$ - + $RETURNS$ - + $DESCRIPTION$ TODO: add documentation $EXAMPLES$ - + $TESTS$ - + $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/keysec.prg b/harbour/contrib/hbct/keysec.prg index fb735bfe24..7aca1f912c 100644 --- a/harbour/contrib/hbct/keysec.prg +++ b/harbour/contrib/hbct/keysec.prg @@ -75,7 +75,7 @@ FUNCTION KeySec( nKey, nTime, nCounter, lMode ) lMode := .F. ENDIF - nSeconds := hb_milliSeconds() + nSeconds := hb_MilliSeconds() t_hIdle := hb_idleAdd( {|| doKeySec( nKey, nTime, lMode, ; @nCounter, @nSeconds ) } ) RETURN .T. @@ -85,7 +85,7 @@ FUNCTION KeySec( nKey, nTime, nCounter, lMode ) STATIC PROCEDURE doKeySec( nKey, nTime, lMode, nCounter, nSeconds ) - LOCAL nSec := hb_milliSeconds() + LOCAL nSec := hb_MilliSeconds() IF lMode .AND. ! Empty( NextKey() ) nSeconds := nSec diff --git a/harbour/contrib/hbct/kxlat.prg b/harbour/contrib/hbct/kxlat.prg index 7ec12fc3be..b6028afec5 100644 --- a/harbour/contrib/hbct/kxlat.prg +++ b/harbour/contrib/hbct/kxlat.prg @@ -65,261 +65,261 @@ STATIC s_hTrs := { => } STATIC s_hMutex := hb_mutexCreate() STATIC sc_hCnv := { ; - KS_DISABLE => 0 ,; - KS_A => hb_keyCode( "A" ) ,; - KS_B => hb_keyCode( "B" ) ,; - KS_C => hb_keyCode( "C" ) ,; - KS_D => hb_keyCode( "D" ) ,; - KS_E => hb_keyCode( "E" ) ,; - KS_F => hb_keyCode( "F" ) ,; - KS_G => hb_keyCode( "G" ) ,; - KS_H => hb_keyCode( "H" ) ,; - KS_I => hb_keyCode( "I" ) ,; - KS_J => hb_keyCode( "J" ) ,; - KS_K => hb_keyCode( "K" ) ,; - KS_L => hb_keyCode( "L" ) ,; - KS_M => hb_keyCode( "M" ) ,; - KS_N => hb_keyCode( "N" ) ,; - KS_O => hb_keyCode( "O" ) ,; - KS_P => hb_keyCode( "P" ) ,; - KS_Q => hb_keyCode( "Q" ) ,; - KS_R => hb_keyCode( "R" ) ,; - KS_S => hb_keyCode( "S" ) ,; - KS_T => hb_keyCode( "T" ) ,; - KS_U => hb_keyCode( "U" ) ,; - KS_V => hb_keyCode( "V" ) ,; - KS_W => hb_keyCode( "W" ) ,; - KS_X => hb_keyCode( "X" ) ,; - KS_Y => hb_keyCode( "Y" ) ,; - KS_Z => hb_keyCode( "Z" ) ,; - KS_a => hb_keyCode( "a" ) ,; - KS_b => hb_keyCode( "b" ) ,; - KS_c => hb_keyCode( "c" ) ,; - KS_d => hb_keyCode( "d" ) ,; - KS_e => hb_keyCode( "e" ) ,; - KS_f => hb_keyCode( "f" ) ,; - KS_g => hb_keyCode( "g" ) ,; - KS_h => hb_keyCode( "h" ) ,; - KS_i => hb_keyCode( "i" ) ,; - KS_j => hb_keyCode( "j" ) ,; - KS_k => hb_keyCode( "k" ) ,; - KS_l => hb_keyCode( "l" ) ,; - KS_m => hb_keyCode( "m" ) ,; - KS_n => hb_keyCode( "n" ) ,; - KS_o => hb_keyCode( "o" ) ,; - KS_p => hb_keyCode( "p" ) ,; - KS_q => hb_keyCode( "q" ) ,; - KS_r => hb_keyCode( "r" ) ,; - KS_s => hb_keyCode( "s" ) ,; - KS_t => hb_keyCode( "t" ) ,; - KS_u => hb_keyCode( "u" ) ,; - KS_v => hb_keyCode( "v" ) ,; - KS_w => hb_keyCode( "w" ) ,; - KS_x => hb_keyCode( "x" ) ,; - KS_y => hb_keyCode( "y" ) ,; - KS_z => hb_keyCode( "z" ) ,; - KS_1 => hb_keyCode( "1" ) ,; - KS_2 => hb_keyCode( "2" ) ,; - KS_3 => hb_keyCode( "3" ) ,; - KS_4 => hb_keyCode( "4" ) ,; - KS_5 => hb_keyCode( "5" ) ,; - KS_6 => hb_keyCode( "6" ) ,; - KS_7 => hb_keyCode( "7" ) ,; - KS_8 => hb_keyCode( "8" ) ,; - KS_9 => hb_keyCode( "9" ) ,; - KS_0 => hb_keyCode( "0" ) ,; - KS_DOT => hb_keyCode( "." ) ,; - KS_COMMA => hb_keyCode( "," ) ,; - KS_CTRL_A => K_CTRL_A ,; - KS_CTRL_B => K_CTRL_B ,; - KS_CTRL_C => K_CTRL_C ,; - KS_CTRL_D => K_CTRL_D ,; - KS_CTRL_E => K_CTRL_E ,; - KS_CTRL_F => K_CTRL_F ,; - KS_CTRL_G => K_CTRL_G ,; - KS_CTRL_H => K_CTRL_H ,; - KS_CTRL_I => K_CTRL_I ,; - KS_CTRL_M => K_CTRL_M ,; - KS_CTRL_N => K_CTRL_N ,; - KS_CTRL_R => K_CTRL_R ,; - KS_CTRL_S => K_CTRL_S ,; - KS_CTRL_T => K_CTRL_T ,; - KS_CTRL_U => K_CTRL_U ,; - KS_CTRL_V => K_CTRL_V ,; - KS_CTRL_W => K_CTRL_W ,; - KS_CTRL_X => K_CTRL_X ,; - KS_CTRL_Y => K_CTRL_Y ,; - KS_CTRL_Z => K_CTRL_Z ,; - KS_ALT_A => K_ALT_A ,; - KS_ALT_B => K_ALT_B ,; - KS_ALT_C => K_ALT_C ,; - KS_ALT_D => K_ALT_D ,; - KS_ALT_E => K_ALT_E ,; - KS_ALT_F => K_ALT_F ,; - KS_ALT_G => K_ALT_G ,; - KS_ALT_H => K_ALT_H ,; - KS_ALT_I => K_ALT_I ,; - KS_ALT_J => K_ALT_J ,; - KS_ALT_K => K_ALT_K ,; - KS_ALT_L => K_ALT_L ,; - KS_ALT_M => K_ALT_M ,; - KS_ALT_N => K_ALT_N ,; - KS_ALT_O => K_ALT_O ,; - KS_ALT_P => K_ALT_P ,; - KS_ALT_Q => K_ALT_Q ,; - KS_ALT_R => K_ALT_R ,; - KS_ALT_S => K_ALT_S ,; - KS_ALT_T => K_ALT_T ,; - KS_ALT_U => K_ALT_U ,; - KS_ALT_V => K_ALT_V ,; - KS_ALT_W => K_ALT_W ,; - KS_ALT_X => K_ALT_X ,; - KS_ALT_Y => K_ALT_Y ,; - KS_ALT_Z => K_ALT_Z ,; - KS_ALT_1 => K_ALT_1 ,; - KS_ALT_2 => K_ALT_2 ,; - KS_ALT_3 => K_ALT_3 ,; - KS_ALT_4 => K_ALT_4 ,; - KS_ALT_5 => K_ALT_5 ,; - KS_ALT_6 => K_ALT_6 ,; - KS_ALT_7 => K_ALT_7 ,; - KS_ALT_8 => K_ALT_8 ,; - KS_ALT_9 => K_ALT_9 ,; - KS_ALT_0 => K_ALT_0 ,; - KS_F1 => K_F1 ,; - KS_F2 => K_F2 ,; - KS_F3 => K_F3 ,; - KS_F4 => K_F4 ,; - KS_F5 => K_F5 ,; - KS_F6 => K_F6 ,; - KS_F7 => K_F7 ,; - KS_F8 => K_F8 ,; - KS_F9 => K_F9 ,; - KS_F10 => K_F10 ,; - KS_F11 => K_F11 ,; - KS_F12 => K_F12 ,; - KS_SH_F1 => K_SH_F1 ,; - KS_SH_F2 => K_SH_F2 ,; - KS_SH_F3 => K_SH_F3 ,; - KS_SH_F4 => K_SH_F4 ,; - KS_SH_F5 => K_SH_F5 ,; - KS_SH_F6 => K_SH_F6 ,; - KS_SH_F7 => K_SH_F7 ,; - KS_SH_F8 => K_SH_F8 ,; - KS_SH_F9 => K_SH_F9 ,; - KS_SH_F10 => K_SH_F10 ,; - KS_SH_F11 => K_SH_F11 ,; - KS_SH_F12 => K_SH_F12 ,; - KS_CTRL_F1 => K_CTRL_F1 ,; - KS_CTRL_F2 => K_CTRL_F2 ,; - KS_CTRL_F3 => K_CTRL_F3 ,; - KS_CTRL_F4 => K_CTRL_F4 ,; - KS_CTRL_F5 => K_CTRL_F5 ,; - KS_CTRL_F6 => K_CTRL_F6 ,; - KS_CTRL_F7 => K_CTRL_F7 ,; - KS_CTRL_F8 => K_CTRL_F8 ,; - KS_CTRL_F9 => K_CTRL_F9 ,; - KS_CTRL_F10 => K_CTRL_F10 ,; - KS_CTRL_F11 => K_CTRL_F11 ,; - KS_CTRL_F12 => K_CTRL_F12 ,; - KS_ALT_F1 => K_ALT_F1 ,; - KS_ALT_F2 => K_ALT_F2 ,; - KS_ALT_F3 => K_ALT_F3 ,; - KS_ALT_F4 => K_ALT_F4 ,; - KS_ALT_F5 => K_ALT_F5 ,; - KS_ALT_F6 => K_ALT_F6 ,; - KS_ALT_F7 => K_ALT_F7 ,; - KS_ALT_F8 => K_ALT_F8 ,; - KS_ALT_F9 => K_ALT_F9 ,; - KS_ALT_F10 => K_ALT_F10 ,; - KS_ALT_F11 => K_ALT_F11 ,; - KS_ALT_F12 => K_ALT_F12 ,; - KS_BS => K_BS ,; - KS_ESC => K_ESC ,; - KS_TAB => K_TAB ,; - KS_SH_TAB => K_SH_TAB ,; - KS_ALT_BS => K_ALT_BS ,; - KS_ALT_ESC => K_ALT_ESC ,; - KS_ALT_TAB => K_ALT_TAB ,; - KS_ENTER => K_ENTER ,; - KS_CTRL_ENTER => K_CTRL_ENTER ,; - KS_ALT_ENTER => K_ALT_ENTER ,; - KS_PAD_ENTER => HB_KP_ENTER ,; - KS_PAD_CTRL_ENTER => HB_KP_CTRL_ENTER ,; - KS_PAD_ALT_ENTER => KP_ALT_ENTER ,; - KS_INS => K_INS ,; - KS_DEL => K_DEL ,; - KS_HOME => K_HOME ,; - KS_END => K_END ,; - KS_PGUP => K_PGUP ,; - KS_PGDN => K_PGDN ,; - KS_UP => K_UP ,; - KS_LEFT => K_LEFT ,; - KS_DOWN => K_DOWN ,; - KS_RIGHT => K_RIGHT ,; - KS_CTRL_INS => K_CTRL_INS ,; - KS_CTRL_DEL => K_CTRL_DEL ,; - KS_CTRL_HOME => K_CTRL_HOME ,; - KS_CTRL_END => K_CTRL_END ,; - KS_CTRL_PGUP => K_CTRL_PGUP ,; - KS_CTRL_PGDN => K_CTRL_PGDN ,; - KS_CTRL_UP => K_CTRL_UP ,; - KS_CTRL_LEFT => K_CTRL_LEFT ,; - KS_CTRL_DOWN => K_CTRL_DOWN ,; - KS_CTRL_RIGHT => K_CTRL_RIGHT ,; - KS_ALT_INS => K_ALT_INS ,; - KS_ALT_DEL => K_ALT_DEL ,; - KS_ALT_HOME => K_ALT_HOME ,; - KS_ALT_END => K_ALT_END ,; - KS_ALT_PGUP => K_ALT_PGUP ,; - KS_ALT_PGDN => K_ALT_PGDN ,; - KS_ALT_UP => K_ALT_UP ,; - KS_ALT_LEFT => K_ALT_LEFT ,; - KS_ALT_DOWN => K_ALT_DOWN ,; - KS_ALT_RIGHT => K_ALT_RIGHT ,; - KS_PAD_INS => HB_KP_INS ,; - KS_PAD_DEL => HB_KP_DEL ,; - KS_PAD_HOME => HB_KP_HOME ,; - KS_PAD_END => HB_KP_END ,; - KS_PAD_PGUP => HB_KP_PG_UP ,; - KS_PAD_PGDN => HB_KP_PG_DN ,; - KS_PAD_UP => HB_KP_UP ,; - KS_PAD_LEFT => HB_KP_LEFT ,; - KS_PAD_DOWN => HB_KP_DOWN ,; - KS_PAD_RIGHT => HB_KP_RIGHT ,; - KS_CTRL_PAD_INS => HB_KP_CTRL_INS ,; - KS_CTRL_PAD_DEL => HB_KP_CTRL_DEL ,; - KS_CTRL_PAD_HOME => HB_KP_CTRL_HOME ,; - KS_CTRL_PAD_END => HB_KP_CTRL_END ,; - KS_CTRL_PAD_PGUP => HB_KP_CTRL_PG_UP ,; - KS_CTRL_PAD_PGDN => HB_KP_CTRL_PG_DN ,; - KS_CTRL_PAD_UP => HB_KP_CTRL_UP ,; - KS_CTRL_PAD_LEFT => HB_KP_CTRL_LEFT ,; - KS_CTRL_PAD_DOWN => HB_KP_CTRL_DOWN ,; - KS_CTRL_PAD_RIGHT => HB_KP_CTRL_RIGHT ,; - KS_PAD_DIV => KP_ALT_SLASH ,; - KS_PAD_MUL => KP_ALT_ASTERISK ,; - KS_PAD_MINUS => KP_ALT_MINUS ,; - KS_PAD_PLUS => KP_ALT_PLUS ,; - KS_CTRL_PAD_DIV => KP_CTRL_SLASH ,; - KS_CTRL_PAD_MUL => KP_CTRL_ASTERISK ,; - KS_CTRL_PAD_MINUS => KP_CTRL_MINUS ,; - KS_CTRL_PAD_PLUS => KP_CTRL_PLUS ,; - KS_ALT_PAD_DIV => HB_KP_ALT_SLASH ,; - KS_ALT_PAD_MUL => HB_KP_ALT_STAR ,; - KS_ALT_PAD_MINUS => HB_KP_ALT_MINUS ,; - KS_ALT_PAD_PLUS => HB_KP_ALT_PLUS ,; - KS_PAD_1 => 0 ,; /* no Harbour equivalent */ - KS_PAD_2 => 0 ,; /* no Harbour equivalent */ - KS_PAD_3 => 0 ,; /* no Harbour equivalent */ - KS_PAD_4 => 0 ,; /* no Harbour equivalent */ - KS_PAD_5 => 0 ,; /* no Harbour equivalent */ - KS_PAD_6 => 0 ,; /* no Harbour equivalent */ - KS_PAD_7 => 0 ,; /* no Harbour equivalent */ - KS_PAD_8 => 0 ,; /* no Harbour equivalent */ - KS_PAD_9 => 0 ,; /* no Harbour equivalent */ - KS_PAD_0 => 0 ,; /* no Harbour equivalent */ - KS_PAD_DECIMAL => 0 } /* no Harbour equivalent */ + KS_DISABLE => 0 , ; + KS_A => hb_keyCode( "A" ) , ; + KS_B => hb_keyCode( "B" ) , ; + KS_C => hb_keyCode( "C" ) , ; + KS_D => hb_keyCode( "D" ) , ; + KS_E => hb_keyCode( "E" ) , ; + KS_F => hb_keyCode( "F" ) , ; + KS_G => hb_keyCode( "G" ) , ; + KS_H => hb_keyCode( "H" ) , ; + KS_I => hb_keyCode( "I" ) , ; + KS_J => hb_keyCode( "J" ) , ; + KS_K => hb_keyCode( "K" ) , ; + KS_L => hb_keyCode( "L" ) , ; + KS_M => hb_keyCode( "M" ) , ; + KS_N => hb_keyCode( "N" ) , ; + KS_O => hb_keyCode( "O" ) , ; + KS_P => hb_keyCode( "P" ) , ; + KS_Q => hb_keyCode( "Q" ) , ; + KS_R => hb_keyCode( "R" ) , ; + KS_S => hb_keyCode( "S" ) , ; + KS_T => hb_keyCode( "T" ) , ; + KS_U => hb_keyCode( "U" ) , ; + KS_V => hb_keyCode( "V" ) , ; + KS_W => hb_keyCode( "W" ) , ; + KS_X => hb_keyCode( "X" ) , ; + KS_Y => hb_keyCode( "Y" ) , ; + KS_Z => hb_keyCode( "Z" ) , ; + KS_a => hb_keyCode( "a" ) , ; + KS_b => hb_keyCode( "b" ) , ; + KS_c => hb_keyCode( "c" ) , ; + KS_d => hb_keyCode( "d" ) , ; + KS_e => hb_keyCode( "e" ) , ; + KS_f => hb_keyCode( "f" ) , ; + KS_g => hb_keyCode( "g" ) , ; + KS_h => hb_keyCode( "h" ) , ; + KS_i => hb_keyCode( "i" ) , ; + KS_j => hb_keyCode( "j" ) , ; + KS_k => hb_keyCode( "k" ) , ; + KS_l => hb_keyCode( "l" ) , ; + KS_m => hb_keyCode( "m" ) , ; + KS_n => hb_keyCode( "n" ) , ; + KS_o => hb_keyCode( "o" ) , ; + KS_p => hb_keyCode( "p" ) , ; + KS_q => hb_keyCode( "q" ) , ; + KS_r => hb_keyCode( "r" ) , ; + KS_s => hb_keyCode( "s" ) , ; + KS_t => hb_keyCode( "t" ) , ; + KS_u => hb_keyCode( "u" ) , ; + KS_v => hb_keyCode( "v" ) , ; + KS_w => hb_keyCode( "w" ) , ; + KS_x => hb_keyCode( "x" ) , ; + KS_y => hb_keyCode( "y" ) , ; + KS_z => hb_keyCode( "z" ) , ; + KS_1 => hb_keyCode( "1" ) , ; + KS_2 => hb_keyCode( "2" ) , ; + KS_3 => hb_keyCode( "3" ) , ; + KS_4 => hb_keyCode( "4" ) , ; + KS_5 => hb_keyCode( "5" ) , ; + KS_6 => hb_keyCode( "6" ) , ; + KS_7 => hb_keyCode( "7" ) , ; + KS_8 => hb_keyCode( "8" ) , ; + KS_9 => hb_keyCode( "9" ) , ; + KS_0 => hb_keyCode( "0" ) , ; + KS_DOT => hb_keyCode( "." ) , ; + KS_COMMA => hb_keyCode( "," ) , ; + KS_CTRL_A => K_CTRL_A , ; + KS_CTRL_B => K_CTRL_B , ; + KS_CTRL_C => K_CTRL_C , ; + KS_CTRL_D => K_CTRL_D , ; + KS_CTRL_E => K_CTRL_E , ; + KS_CTRL_F => K_CTRL_F , ; + KS_CTRL_G => K_CTRL_G , ; + KS_CTRL_H => K_CTRL_H , ; + KS_CTRL_I => K_CTRL_I , ; + KS_CTRL_M => K_CTRL_M , ; + KS_CTRL_N => K_CTRL_N , ; + KS_CTRL_R => K_CTRL_R , ; + KS_CTRL_S => K_CTRL_S , ; + KS_CTRL_T => K_CTRL_T , ; + KS_CTRL_U => K_CTRL_U , ; + KS_CTRL_V => K_CTRL_V , ; + KS_CTRL_W => K_CTRL_W , ; + KS_CTRL_X => K_CTRL_X , ; + KS_CTRL_Y => K_CTRL_Y , ; + KS_CTRL_Z => K_CTRL_Z , ; + KS_ALT_A => K_ALT_A , ; + KS_ALT_B => K_ALT_B , ; + KS_ALT_C => K_ALT_C , ; + KS_ALT_D => K_ALT_D , ; + KS_ALT_E => K_ALT_E , ; + KS_ALT_F => K_ALT_F , ; + KS_ALT_G => K_ALT_G , ; + KS_ALT_H => K_ALT_H , ; + KS_ALT_I => K_ALT_I , ; + KS_ALT_J => K_ALT_J , ; + KS_ALT_K => K_ALT_K , ; + KS_ALT_L => K_ALT_L , ; + KS_ALT_M => K_ALT_M , ; + KS_ALT_N => K_ALT_N , ; + KS_ALT_O => K_ALT_O , ; + KS_ALT_P => K_ALT_P , ; + KS_ALT_Q => K_ALT_Q , ; + KS_ALT_R => K_ALT_R , ; + KS_ALT_S => K_ALT_S , ; + KS_ALT_T => K_ALT_T , ; + KS_ALT_U => K_ALT_U , ; + KS_ALT_V => K_ALT_V , ; + KS_ALT_W => K_ALT_W , ; + KS_ALT_X => K_ALT_X , ; + KS_ALT_Y => K_ALT_Y , ; + KS_ALT_Z => K_ALT_Z , ; + KS_ALT_1 => K_ALT_1 , ; + KS_ALT_2 => K_ALT_2 , ; + KS_ALT_3 => K_ALT_3 , ; + KS_ALT_4 => K_ALT_4 , ; + KS_ALT_5 => K_ALT_5 , ; + KS_ALT_6 => K_ALT_6 , ; + KS_ALT_7 => K_ALT_7 , ; + KS_ALT_8 => K_ALT_8 , ; + KS_ALT_9 => K_ALT_9 , ; + KS_ALT_0 => K_ALT_0 , ; + KS_F1 => K_F1 , ; + KS_F2 => K_F2 , ; + KS_F3 => K_F3 , ; + KS_F4 => K_F4 , ; + KS_F5 => K_F5 , ; + KS_F6 => K_F6 , ; + KS_F7 => K_F7 , ; + KS_F8 => K_F8 , ; + KS_F9 => K_F9 , ; + KS_F10 => K_F10 , ; + KS_F11 => K_F11 , ; + KS_F12 => K_F12 , ; + KS_SH_F1 => K_SH_F1 , ; + KS_SH_F2 => K_SH_F2 , ; + KS_SH_F3 => K_SH_F3 , ; + KS_SH_F4 => K_SH_F4 , ; + KS_SH_F5 => K_SH_F5 , ; + KS_SH_F6 => K_SH_F6 , ; + KS_SH_F7 => K_SH_F7 , ; + KS_SH_F8 => K_SH_F8 , ; + KS_SH_F9 => K_SH_F9 , ; + KS_SH_F10 => K_SH_F10 , ; + KS_SH_F11 => K_SH_F11 , ; + KS_SH_F12 => K_SH_F12 , ; + KS_CTRL_F1 => K_CTRL_F1 , ; + KS_CTRL_F2 => K_CTRL_F2 , ; + KS_CTRL_F3 => K_CTRL_F3 , ; + KS_CTRL_F4 => K_CTRL_F4 , ; + KS_CTRL_F5 => K_CTRL_F5 , ; + KS_CTRL_F6 => K_CTRL_F6 , ; + KS_CTRL_F7 => K_CTRL_F7 , ; + KS_CTRL_F8 => K_CTRL_F8 , ; + KS_CTRL_F9 => K_CTRL_F9 , ; + KS_CTRL_F10 => K_CTRL_F10 , ; + KS_CTRL_F11 => K_CTRL_F11 , ; + KS_CTRL_F12 => K_CTRL_F12 , ; + KS_ALT_F1 => K_ALT_F1 , ; + KS_ALT_F2 => K_ALT_F2 , ; + KS_ALT_F3 => K_ALT_F3 , ; + KS_ALT_F4 => K_ALT_F4 , ; + KS_ALT_F5 => K_ALT_F5 , ; + KS_ALT_F6 => K_ALT_F6 , ; + KS_ALT_F7 => K_ALT_F7 , ; + KS_ALT_F8 => K_ALT_F8 , ; + KS_ALT_F9 => K_ALT_F9 , ; + KS_ALT_F10 => K_ALT_F10 , ; + KS_ALT_F11 => K_ALT_F11 , ; + KS_ALT_F12 => K_ALT_F12 , ; + KS_BS => K_BS , ; + KS_ESC => K_ESC , ; + KS_TAB => K_TAB , ; + KS_SH_TAB => K_SH_TAB , ; + KS_ALT_BS => K_ALT_BS , ; + KS_ALT_ESC => K_ALT_ESC , ; + KS_ALT_TAB => K_ALT_TAB , ; + KS_ENTER => K_ENTER , ; + KS_CTRL_ENTER => K_CTRL_ENTER , ; + KS_ALT_ENTER => K_ALT_ENTER , ; + KS_PAD_ENTER => HB_KP_ENTER , ; + KS_PAD_CTRL_ENTER => HB_KP_CTRL_ENTER , ; + KS_PAD_ALT_ENTER => KP_ALT_ENTER , ; + KS_INS => K_INS , ; + KS_DEL => K_DEL , ; + KS_HOME => K_HOME , ; + KS_END => K_END , ; + KS_PGUP => K_PGUP , ; + KS_PGDN => K_PGDN , ; + KS_UP => K_UP , ; + KS_LEFT => K_LEFT , ; + KS_DOWN => K_DOWN , ; + KS_RIGHT => K_RIGHT , ; + KS_CTRL_INS => K_CTRL_INS , ; + KS_CTRL_DEL => K_CTRL_DEL , ; + KS_CTRL_HOME => K_CTRL_HOME , ; + KS_CTRL_END => K_CTRL_END , ; + KS_CTRL_PGUP => K_CTRL_PGUP , ; + KS_CTRL_PGDN => K_CTRL_PGDN , ; + KS_CTRL_UP => K_CTRL_UP , ; + KS_CTRL_LEFT => K_CTRL_LEFT , ; + KS_CTRL_DOWN => K_CTRL_DOWN , ; + KS_CTRL_RIGHT => K_CTRL_RIGHT , ; + KS_ALT_INS => K_ALT_INS , ; + KS_ALT_DEL => K_ALT_DEL , ; + KS_ALT_HOME => K_ALT_HOME , ; + KS_ALT_END => K_ALT_END , ; + KS_ALT_PGUP => K_ALT_PGUP , ; + KS_ALT_PGDN => K_ALT_PGDN , ; + KS_ALT_UP => K_ALT_UP , ; + KS_ALT_LEFT => K_ALT_LEFT , ; + KS_ALT_DOWN => K_ALT_DOWN , ; + KS_ALT_RIGHT => K_ALT_RIGHT , ; + KS_PAD_INS => HB_KP_INS , ; + KS_PAD_DEL => HB_KP_DEL , ; + KS_PAD_HOME => HB_KP_HOME , ; + KS_PAD_END => HB_KP_END , ; + KS_PAD_PGUP => HB_KP_PG_UP , ; + KS_PAD_PGDN => HB_KP_PG_DN , ; + KS_PAD_UP => HB_KP_UP , ; + KS_PAD_LEFT => HB_KP_LEFT , ; + KS_PAD_DOWN => HB_KP_DOWN , ; + KS_PAD_RIGHT => HB_KP_RIGHT , ; + KS_CTRL_PAD_INS => HB_KP_CTRL_INS , ; + KS_CTRL_PAD_DEL => HB_KP_CTRL_DEL , ; + KS_CTRL_PAD_HOME => HB_KP_CTRL_HOME , ; + KS_CTRL_PAD_END => HB_KP_CTRL_END , ; + KS_CTRL_PAD_PGUP => HB_KP_CTRL_PG_UP , ; + KS_CTRL_PAD_PGDN => HB_KP_CTRL_PG_DN , ; + KS_CTRL_PAD_UP => HB_KP_CTRL_UP , ; + KS_CTRL_PAD_LEFT => HB_KP_CTRL_LEFT , ; + KS_CTRL_PAD_DOWN => HB_KP_CTRL_DOWN , ; + KS_CTRL_PAD_RIGHT => HB_KP_CTRL_RIGHT , ; + KS_PAD_DIV => KP_ALT_SLASH , ; + KS_PAD_MUL => KP_ALT_ASTERISK , ; + KS_PAD_MINUS => KP_ALT_MINUS , ; + KS_PAD_PLUS => KP_ALT_PLUS , ; + KS_CTRL_PAD_DIV => KP_CTRL_SLASH , ; + KS_CTRL_PAD_MUL => KP_CTRL_ASTERISK , ; + KS_CTRL_PAD_MINUS => KP_CTRL_MINUS , ; + KS_CTRL_PAD_PLUS => KP_CTRL_PLUS , ; + KS_ALT_PAD_DIV => HB_KP_ALT_SLASH , ; + KS_ALT_PAD_MUL => HB_KP_ALT_STAR , ; + KS_ALT_PAD_MINUS => HB_KP_ALT_MINUS , ; + KS_ALT_PAD_PLUS => HB_KP_ALT_PLUS , ; + KS_PAD_1 => 0 , ; /* no Harbour equivalent */ + KS_PAD_2 => 0 , ; /* no Harbour equivalent */ + KS_PAD_3 => 0 , ; /* no Harbour equivalent */ + KS_PAD_4 => 0 , ; /* no Harbour equivalent */ + KS_PAD_5 => 0 , ; /* no Harbour equivalent */ + KS_PAD_6 => 0 , ; /* no Harbour equivalent */ + KS_PAD_7 => 0 , ; /* no Harbour equivalent */ + KS_PAD_8 => 0 , ; /* no Harbour equivalent */ + KS_PAD_9 => 0 , ; /* no Harbour equivalent */ + KS_PAD_0 => 0 , ; /* no Harbour equivalent */ + KS_PAD_DECIMAL => 0 } /* no Harbour equivalent */ FUNCTION __hbct_key_c_to_n( cKey ) diff --git a/harbour/contrib/hbct/tests/addascii.prg b/harbour/contrib/hbct/tests/addascii.prg index 1526ea6a0e..42ec5c032c 100644 --- a/harbour/contrib/hbct/tests/addascii.prg +++ b/harbour/contrib/hbct/tests/addascii.prg @@ -62,10 +62,10 @@ PROCEDURE Main() ? // simple tests ? "Simple tests:" - ? [ This should be "1000": ] + addascii( "0000", 1, 1 ) - ? [ This should be "0001": ] + addascii( "0000", 1 ) - ? [ This should be "BAAA": ] + addascii( "AAAA", -255, 1 ) - ? [ This should be "AAAB": ] + addascii( "AAAA", -255 ) + ? ' This should be "1000": ' + addascii( "0000", 1, 1 ) + ? ' This should be "0001": ' + addascii( "0000", 1 ) + ? ' This should be "BAAA": ' + addascii( "AAAA", -255, 1 ) + ? ' This should be "AAAB": ' + addascii( "AAAA", -255 ) // csetref() tests ? @@ -96,7 +96,7 @@ PROCEDURE Main() ? " return value of addascii([AAAA],257,2,.T.) call('BBAA')..:", addascii( "AAAA", 257, 2, .T. ) ? " return value of addascii([AAAA],257,2,.F.) call('ABAA')..:", addascii( "AAAA", 257, 2, .F. ) ? " return value of addascii([AAAA],258,,.T.) call('AABC')...:", addascii( "AAAA", 258,, .T. ) - ? " return value of addascii([ABBA],-257,3,.T.) call('AAAA').:", addascii( "ABBA", -257,3, .T. ) + ? " return value of addascii([ABBA],-257,3,.T.) call('AAAA').:", addascii( "ABBA", -257, 3, .T. ) ? "End test of ADDASCII()" ? diff --git a/harbour/contrib/hbct/tests/afteratn.prg b/harbour/contrib/hbct/tests/afteratn.prg index 2b17360a2e..03d27706d7 100644 --- a/harbour/contrib/hbct/tests/afteratn.prg +++ b/harbour/contrib/hbct/tests/afteratn.prg @@ -69,38 +69,38 @@ PROCEDURE Main() // Some simple tests ? " Simple tests:" - ? [ afteratnum("..",cStr) should be "test!",] - ? [ and is "] + afteratnum( "..", cStr ) + ["] - ? [ afteratnum("..",cStr,2) should be ".is...a...test!",] - ? [ and is "] + afteratnum( "..", cStr, 2 ) + ["] - ? [ afteratnum("..",cStr,2,2) should be ".a...test!",] - ? [ and is "] + afteratnum( "..", cStr, 2, 2 ) + ["] + ? ' afteratnum("..",cStr) should be "test!",' + ? ' and is "' + afteratnum( "..", cStr ) + '"' + ? ' afteratnum("..",cStr,2) should be ".is...a...test!",' + ? ' and is "' + afteratnum( "..", cStr, 2 ) + '"' + ? ' afteratnum("..",cStr,2,2) should be ".a...test!",' + ? ' and is "' + afteratnum( "..", cStr, 2, 2 ) + '"' ? // Tests with CSetAtMuPa(.T.) ? " Multi-Pass tests" ? " Setting csetatmupa() to .T." csetatmupa( .T. ) - ? [ afteratnum("..",cStr) should be "test!",] - ? [ and is "] + afteratnum( "..", cStr ) + ["] - ? [ afteratnum("..",cStr,2) should be "This...is...a...test!",] - ? [ and is "] + afteratnum( "..", cStr, 2 ) + ["] - ? [ afteratnum("..",cStr,2,2) should be "is...a...test!",] - ? [ and is "] + afteratnum( "..", cStr, 2, 2 ) + ["] + ? ' afteratnum("..",cStr) should be "test!",' + ? ' and is "' + afteratnum( "..", cStr ) + '"' + ? ' afteratnum("..",cStr,2) should be "This...is...a...test!",' + ? ' and is "' + afteratnum( "..", cStr, 2 ) + '"' + ? ' afteratnum("..",cStr,2,2) should be "is...a...test!",' + ? ' and is "' + afteratnum( "..", cStr, 2, 2 ) + '"' ? " Setting csetatmupa() to .F." csetatmupa( .F. ) ? // Tests mit SetAtlike(1) ? " SetAtLike tests" - ? [ Setting setatlike(CT_SETATLIKE_WILDCARD, ".")] + ? ' Setting setatlike(CT_SETATLIKE_WILDCARD, ".")' setatlike( CT_SETATLIKE_WILDCARD, "." ) - ? [ afteratnum("..",cStr) should be "",] - ? [ and is "] + afteratnum( "..", cStr ) + ["] - ? [ afteratnum("..",cStr,2,2) should be "s...is...a...test!",] - ? [ and is "] + afteratnum( "..", cStr, 2, 2 ) + ["] - ? [ afteratnum("..",cStr,2,10) should be ".a...test!",] - ? [ and is "] + afteratnum( "..", cStr, 2, 10 ) + ["] + ? ' afteratnum("..",cStr) should be "",' + ? ' and is "' + afteratnum( "..", cStr ) + '"' + ? ' afteratnum("..",cStr,2,2) should be "s...is...a...test!",' + ? ' and is "' + afteratnum( "..", cStr, 2, 2 ) + '"' + ? ' afteratnum("..",cStr,2,10) should be ".a...test!",' + ? ' and is "' + afteratnum( "..", cStr, 2, 10 ) + '"' ? ? "End test of AFTERATNUM()" diff --git a/harbour/contrib/hbct/tests/asciisum.prg b/harbour/contrib/hbct/tests/asciisum.prg index a9204d5de6..e4628a8078 100644 --- a/harbour/contrib/hbct/tests/asciisum.prg +++ b/harbour/contrib/hbct/tests/asciisum.prg @@ -59,9 +59,9 @@ PROCEDURE Main() ? "Begin test of ASCIISUM()" ? - ? [ asciisum(replicate("A", 10000)) == 650000 ? --> ] + Str( asciisum( Replicate( "A", 10000 ) ) ) - ? [ asciisum("0123456789") == 525 ? --> ] + Str( asciisum( "0123456789" ) ) - ? [ asciisum(NIL) == 0 ? --> ] + Str( asciisum( NIL ) ) + ? ' asciisum(replicate("A", 10000)) == 650000 ? --> ' + Str( asciisum( Replicate( "A", 10000 ) ) ) + ? ' asciisum("0123456789") == 525 ? --> ' + Str( asciisum( "0123456789" ) ) + ? ' asciisum(NIL) == 0 ? --> ' + Str( asciisum( NIL ) ) ? ? "End test of ASCIISUM()" diff --git a/harbour/contrib/hbct/tests/ascpos.prg b/harbour/contrib/hbct/tests/ascpos.prg index 2afff60eab..490a12722b 100644 --- a/harbour/contrib/hbct/tests/ascpos.prg +++ b/harbour/contrib/hbct/tests/ascpos.prg @@ -59,9 +59,9 @@ PROCEDURE Main() ? "Begin test of ASCPOS()" ? - ? [ ascpos("0123456789") == 57 ? --> ] + Str( ascpos( "0123456789" ) ) - ? [ ascpos("0123456789",1) == 48 ? --> ] + Str( ascpos( "0123456789", 1 ) ) - ? [ ascpos("0123456789",11) == 0 ? --> ] + Str( ascpos( "0123456789", 11 ) ) + ? ' ascpos("0123456789") == 57 ? --> ' + Str( ascpos( "0123456789" ) ) + ? ' ascpos("0123456789",1) == 48 ? --> ' + Str( ascpos( "0123456789", 1 ) ) + ? ' ascpos("0123456789",11) == 0 ? --> ' + Str( ascpos( "0123456789", 11 ) ) ? ? "End test of ASCPOS()" diff --git a/harbour/contrib/hbct/tests/atnum.prg b/harbour/contrib/hbct/tests/atnum.prg index 5ff309fb29..f522b2c63b 100644 --- a/harbour/contrib/hbct/tests/atnum.prg +++ b/harbour/contrib/hbct/tests/atnum.prg @@ -69,38 +69,38 @@ PROCEDURE Main() // Some simple tests ? " Simple tests:" - ? [ atnum("..",cStr) should be 18,] - ? [ and is ], atnum( "..", cStr ) - ? [ atnum("..",cStr,2) should be 8,] - ? [ and is ], atnum( "..", cStr, 2 ) - ? [ atnum("..",cStr,2,2) should be 13,] - ? [ and is ], atnum( "..", cStr, 2, 2 ) + ? ' atnum("..",cStr) should be 18,' + ? ' and is ', atnum( "..", cStr ) + ? ' atnum("..",cStr,2) should be 8,' + ? ' and is ', atnum( "..", cStr, 2 ) + ? ' atnum("..",cStr,2,2) should be 13,' + ? ' and is ', atnum( "..", cStr, 2, 2 ) ? // Tests with CSetAtMuPa(.T.) ? " Multi-Pass tests" ? " Setting csetatmupa() to .T." csetatmupa( .T. ) - ? [ atnum("..",cStr) should be 18,] - ? [ and is ], atnum( "..", cStr ) - ? [ atnum("..",cStr,2) should be 2,] - ? [ and is ], atnum( "..", cStr, 2 ) - ? [ atnum("..",cStr,2,2) should be 9,] - ? [ and is ], atnum( "..", cStr, 2, 2 ) + ? ' atnum("..",cStr) should be 18,' + ? ' and is ', atnum( "..", cStr ) + ? ' atnum("..",cStr,2) should be 2,' + ? ' and is ', atnum( "..", cStr, 2 ) + ? ' atnum("..",cStr,2,2) should be 9,' + ? ' and is ', atnum( "..", cStr, 2, 2 ) ? " Setting csetatmupa() to .F." csetatmupa( .F. ) ? // Tests mit SetAtlike(1) ? " SetAtLike tests" - ? [ Setting setatlike(CT_SETATLIKE_WILDCARD, ".")] + ? ' Setting setatlike(CT_SETATLIKE_WILDCARD, ".")' setatlike( CT_SETATLIKE_WILDCARD, "." ) - ? [ atnum("..",cStr) should be 23,] - ? [ and is ], atnum( "..", cStr ) - ? [ atnum("..",cStr,2,2) should be 5,] - ? [ and is ], atnum( "..", cStr, 2, 2 ) - ? [ atnum("..",cStr,2,10) should be 13,] - ? [ and is ], atnum( "..", cStr, 2, 10 ) + ? ' atnum("..",cStr) should be 23,' + ? ' and is ', atnum( "..", cStr ) + ? ' atnum("..",cStr,2,2) should be 5,' + ? ' and is ', atnum( "..", cStr, 2, 2 ) + ? ' atnum("..",cStr,2,10) should be 13,' + ? ' and is ', atnum( "..", cStr, 2, 10 ) ? ? "End test of ATNUM()" diff --git a/harbour/contrib/hbct/tests/atrepl.prg b/harbour/contrib/hbct/tests/atrepl.prg index 1672953ad0..a7c0550e77 100644 --- a/harbour/contrib/hbct/tests/atrepl.prg +++ b/harbour/contrib/hbct/tests/atrepl.prg @@ -62,12 +62,12 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ atrepl("ABC", "ABCDABCDABC", "xx") == "xxDxxDxx" ? --> "] + atrepl( "ABC", "ABCDABCDABC", "xx" ) + ["] - ? [ atrepl("ABC", "ABCDABC", "ZYXW") == "ZYXWDZYXW" ? --> "] + atrepl( "ABC", "ABCDABC", "ZYXW" ) + ["] - ? [ atrepl("ABC", "ABCDABCDABC", "xx", 2) == "xxDxxDABC" ? --> "] + atrepl( "ABC", "ABCDABCDABC", "xx", 2 ) + ["] - ? [ atrepl("ABC", "ABCDABCDABC", "xx", 2, .T.) == "ABCDxxDABC" ? --> "] + atrepl( "ABC", "ABCDABCDABC", "xx", 2, .T. ) + ["] - ? [ atrepl("ABC", "ABCDABCDABC", "xx", 2, .T., 1) == "ABCDABCDxx" ? ] - ? [ --> "] + atrepl( "ABC", "ABCDABCDABC", "xx", 2, .T., 1 ) + ["] + ? ' atrepl("ABC", "ABCDABCDABC", "xx") == "xxDxxDxx" ? --> "' + atrepl( "ABC", "ABCDABCDABC", "xx" ) + '"' + ? ' atrepl("ABC", "ABCDABC", "ZYXW") == "ZYXWDZYXW" ? --> "' + atrepl( "ABC", "ABCDABC", "ZYXW" ) + '"' + ? ' atrepl("ABC", "ABCDABCDABC", "xx", 2) == "xxDxxDABC" ? --> "' + atrepl( "ABC", "ABCDABCDABC", "xx", 2 ) + '"' + ? ' atrepl("ABC", "ABCDABCDABC", "xx", 2, .T.) == "ABCDxxDABC" ? --> "' + atrepl( "ABC", "ABCDABCDABC", "xx", 2, .T. ) + '"' + ? ' atrepl("ABC", "ABCDABCDABC", "xx", 2, .T., 1) == "ABCDABCDxx" ? ' + ? ' --> "' + atrepl( "ABC", "ABCDABCDABC", "xx", 2, .T., 1 ) + '"' ? "End test of ATREPL()" ? diff --git a/harbour/contrib/hbct/tests/attoken.prg b/harbour/contrib/hbct/tests/attoken.prg index e70b4be5f3..7cb3b0b1da 100644 --- a/harbour/contrib/hbct/tests/attoken.prg +++ b/harbour/contrib/hbct/tests/attoken.prg @@ -53,7 +53,7 @@ */ #ifndef __HARBOUR__ - #define hb_ntos( n ) LTrim( Str( n ) ) +#define hb_ntos( n ) LTrim( Str( n ) ) #endif PROCEDURE Main() @@ -68,17 +68,17 @@ PROCEDURE Main() // Some simple tests ? " Simple tests:" - ? [ attoken("Hello, World!") == 8 ? ---------> ] + Str( attoken( "Hello, World!" ) ) - ? [ attoken("Hello, World!",,2) == 8 ? ------> ] + Str( attoken( "Hello, World!",, 2 ) ) - ? [ attoken("Hello, World!",,2,1) == 7 ? ----> ] + Str( attoken( "Hello, World!",, 2, 1 ) ) - ? [ attoken("Hello, World!"," ",2,1) == 8 ? -> ] + Str( attoken( "Hello, World!", " ", 2, 1 ) ) + ? ' attoken("Hello, World!") == 8 ? ---------> ' + Str( attoken( "Hello, World!" ) ) + ? ' attoken("Hello, World!",,2) == 8 ? ------> ' + Str( attoken( "Hello, World!",, 2 ) ) + ? ' attoken("Hello, World!",,2,1) == 7 ? ----> ' + Str( attoken( "Hello, World!",, 2, 1 ) ) + ? ' attoken("Hello, World!"," ",2,1) == 8 ? -> ' + Str( attoken( "Hello, World!", " ", 2, 1 ) ) ? - ? [ Tokenizing a string with skip width == 1 and ".!" as tokenizer list:] + ? ' Tokenizing a string with skip width == 1 and ".!" as tokenizer list:' ? " Value of cStr is:" + Chr( 34 ) + cStr + Chr( 34 ) ? FOR ni := 1 TO numtoken( cStr, ".!", 1 ) - ? [ Token #] + hb_ntos( ni ) + [("] + token( cStr, ".!", ni, 1 ) + [")] + ? ' Token #' + hb_ntos( ni ) + '("' + token( cStr, ".!", ni, 1 ) + '")' ? " starts at pos " + Str( npos := attoken( cStr, ".!", ni, 1 ), 3 ) + ; " and is " + iif( SubStr( cStr, npos, 1 ) $ ".!", "", "not " ) + "an empty token." NEXT diff --git a/harbour/contrib/hbct/tests/beforatn.prg b/harbour/contrib/hbct/tests/beforatn.prg index 6812d708c4..b45f648b78 100644 --- a/harbour/contrib/hbct/tests/beforatn.prg +++ b/harbour/contrib/hbct/tests/beforatn.prg @@ -69,38 +69,38 @@ PROCEDURE Main() // Some simple tests ? " Simple tests:" - ? [ beforatnum("..",cStr) should be "...This...is...a.",] - ? [ and is "] + beforatnum( "..", cStr ) + ["] - ? [ beforatnum("..",cStr,2) should be "...This",] - ? [ and is "] + beforatnum( "..", cStr, 2 ) + ["] - ? [ beforatnum("..",cStr,2,2) should be "...This...is",] - ? [ and is "] + beforatnum( "..", cStr, 2, 2 ) + ["] + ? ' beforatnum("..",cStr) should be "...This...is...a.",' + ? ' and is "' + beforatnum( "..", cStr ) + '"' + ? ' beforatnum("..",cStr,2) should be "...This",' + ? ' and is "' + beforatnum( "..", cStr, 2 ) + '"' + ? ' beforatnum("..",cStr,2,2) should be "...This...is",' + ? ' and is "' + beforatnum( "..", cStr, 2, 2 ) + '"' ? // Tests with CSetAtMuPa(.T.) ? " Multi-Pass tests" ? " Setting csetatmupa() to .T." csetatmupa( .T. ) - ? [ beforatnum("..",cStr) should be "...This...is...a.",] - ? [ and is "] + beforatnum( "..", cStr ) + ["] - ? [ beforatnum("..",cStr,2) should be ".",] - ? [ and is "] + beforatnum( "..", cStr, 2 ) + ["] - ? [ beforatnum("..",cStr,2,2) should be "...This.",] - ? [ and is "] + beforatnum( "..", cStr, 2, 2 ) + ["] + ? ' beforatnum("..",cStr) should be "...This...is...a.",' + ? ' and is "' + beforatnum( "..", cStr ) + '"' + ? ' beforatnum("..",cStr,2) should be ".",' + ? ' and is "' + beforatnum( "..", cStr, 2 ) + '"' + ? ' beforatnum("..",cStr,2,2) should be "...This.",' + ? ' and is "' + beforatnum( "..", cStr, 2, 2 ) + '"' ? " Setting csetatmupa() to .F." csetatmupa( .F. ) ? // Tests mit SetAtlike(1) ? " SetAtLike tests" - ? [ Setting setatlike(CT_SETATLIKE_WILDCARD, ".")] + ? ' Setting setatlike(CT_SETATLIKE_WILDCARD, ".")' setatlike( CT_SETATLIKE_WILDCARD, "." ) - ? [ beforatnum("..",cStr) should be "...This...is...a...tes",] - ? [ and is "] + beforatnum( "..", cStr ) + ["] - ? [ beforatnum("..",cStr,2,2) should be "...T",] - ? [ and is "] + beforatnum( "..", cStr, 2, 2 ) + ["] - ? [ beforatnum("..",cStr,2,10) should be "...This...is",] - ? [ and is "] + beforatnum( "..", cStr, 2, 10 ) + ["] + ? ' beforatnum("..",cStr) should be "...This...is...a...tes",' + ? ' and is "' + beforatnum( "..", cStr ) + '"' + ? ' beforatnum("..",cStr,2,2) should be "...T",' + ? ' and is "' + beforatnum( "..", cStr, 2, 2 ) + '"' + ? ' beforatnum("..",cStr,2,10) should be "...This...is",' + ? ' and is "' + beforatnum( "..", cStr, 2, 10 ) + '"' ? ? "End test of BEFORATNUM()" diff --git a/harbour/contrib/hbct/tests/charadd.prg b/harbour/contrib/hbct/tests/charadd.prg index ce1b50ba14..afd3a221a6 100644 --- a/harbour/contrib/hbct/tests/charadd.prg +++ b/harbour/contrib/hbct/tests/charadd.prg @@ -61,10 +61,10 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charadd("012345678", chr(1)) == "123456789" ? -> "] + charadd( "012345678", Chr( 1 ) ) + ["] - ? [ charadd("012345678", chr(1)+chr(2)) == "133557799" ? -> "] + charadd( "012345678", Chr( 1 ) + Chr( 2 ) ) + ["] - ? [ charadd("123456789", chr(255)) == "012345678" ? -> "] + charadd( "123456789", Chr( 255 ) ) + ["] - ? [ charadd("123456789", chr(255)+chr(254)) == "002244668" ? -> "] + charadd( "123456789", Chr( 255 ) + Chr( 254 ) ) + ["] + ? ' charadd("012345678", chr(1)) == "123456789" ? -> "' + charadd( "012345678", Chr( 1 ) ) + '"' + ? ' charadd("012345678", chr(1)+chr(2)) == "133557799" ? -> "' + charadd( "012345678", Chr( 1 ) + Chr( 2 ) ) + '"' + ? ' charadd("123456789", chr(255)) == "012345678" ? -> "' + charadd( "123456789", Chr( 255 ) ) + '"' + ? ' charadd("123456789", chr(255)+chr(254)) == "002244668" ? -> "' + charadd( "123456789", Chr( 255 ) + Chr( 254 ) ) + '"' ? "End test of CHARADD()" ? diff --git a/harbour/contrib/hbct/tests/charand.prg b/harbour/contrib/hbct/tests/charand.prg index 1983aecbf4..3a88900fcf 100644 --- a/harbour/contrib/hbct/tests/charand.prg +++ b/harbour/contrib/hbct/tests/charand.prg @@ -62,8 +62,8 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charand("012345678", chr(254)) == "002244668" ? --> "] + charand( "012345678", Chr( 254 ) ) + ["] - ? [ charand("012345678", chr(254)+chr(252)) == "002044648" ? --> "] + charand( "012345678", Chr( 254 ) + Chr( 252 ) ) + ["] + ? ' charand("012345678", chr(254)) == "002244668" ? --> "' + charand( "012345678", Chr( 254 ) ) + '"' + ? ' charand("012345678", chr(254)+chr(252)) == "002044648" ? --> "' + charand( "012345678", Chr( 254 ) + Chr( 252 ) ) + '"' ? "End test of CHARAND()" ? diff --git a/harbour/contrib/hbct/tests/chareven.prg b/harbour/contrib/hbct/tests/chareven.prg index ab8c2061e3..78aa26e43d 100644 --- a/harbour/contrib/hbct/tests/chareven.prg +++ b/harbour/contrib/hbct/tests/chareven.prg @@ -61,9 +61,9 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ chareven(" 1 2 3 4 5") == "12345" ? --> "] + chareven( " 1 2 3 4 5" ) + ["] - ? [ chareven(" 1 2 3 4 ") == "1234" ? --> "] + chareven( " 1 2 3 4 " ) + ["] - ? [ chareven(" ") == "" ? --> "] + chareven( " " ) + ["] + ? ' chareven(" 1 2 3 4 5") == "12345" ? --> "' + chareven( " 1 2 3 4 5" ) + '"' + ? ' chareven(" 1 2 3 4 ") == "1234" ? --> "' + chareven( " 1 2 3 4 " ) + '"' + ? ' chareven(" ") == "" ? --> "' + chareven( " " ) + '"' ? "End test of CHAREVEN()" ? diff --git a/harbour/contrib/hbct/tests/charhist.prg b/harbour/contrib/hbct/tests/charhist.prg index d6ecf033d3..2f36f8132a 100644 --- a/harbour/contrib/hbct/tests/charhist.prg +++ b/harbour/contrib/hbct/tests/charhist.prg @@ -63,10 +63,10 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charhist("Hello World !")] + "[109] == 3 ? --> ", charhist( "Hello World !" )[ 109 ] - ? [ aeval(charhist("Hello World !"), {| x | nTotal += x } ) ] + ? ' charhist("Hello World !")' + "'109' == 3 ? --> ", charhist( "Hello World !" )' 109 ' + ? ' aeval(charhist("Hello World !"), {| x | nTotal += x } ) ' AEval( charhist( "Hello World !" ), {| x | nTotal += x } ) - ? [ ==> nTotal == len("Hello World !") ? --> ], nTotal == Len( "Hello World !" ) + ? ' ==> nTotal == len("Hello World !") ? --> ', nTotal == Len( "Hello World !" ) ? "End test of CHARHIST()" ? diff --git a/harbour/contrib/hbct/tests/charlist.prg b/harbour/contrib/hbct/tests/charlist.prg index c98681b3e9..13f782f088 100644 --- a/harbour/contrib/hbct/tests/charlist.prg +++ b/harbour/contrib/hbct/tests/charlist.prg @@ -61,8 +61,8 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charlist("Hello World !") == "Helo Wrd!" ? -> "] + charlist( "Hello World !" ) + ["] - ? [ charlist(NIL) == "" ? -> "] + charlist( NIL ) + ["] + ? ' charlist("Hello World !") == "Helo Wrd!" ? -> "' + charlist( "Hello World !" ) + '"' + ? ' charlist(NIL) == "" ? -> "' + charlist( NIL ) + '"' ? "End test of CHARLIST()" ? diff --git a/harbour/contrib/hbct/tests/charmirr.prg b/harbour/contrib/hbct/tests/charmirr.prg index 9e68da2f52..ece294ea4c 100644 --- a/harbour/contrib/hbct/tests/charmirr.prg +++ b/harbour/contrib/hbct/tests/charmirr.prg @@ -61,9 +61,9 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charmirr("racecar") == "racecar" ? ----------> "] + charmirr( "racecar" ) + ["] - ? [ charmirr("racecar ", .T.) == "racecar " ? -> "] + charmirr( "racecar ", .T. ) + ["] - ? [ charmirr("racecar ", .F.) == " racecar" ? -> "] + charmirr( "racecar ", .F. ) + ["] + ? ' charmirr("racecar") == "racecar" ? ----------> "' + charmirr( "racecar" ) + '"' + ? ' charmirr("racecar ", .T.) == "racecar " ? -> "' + charmirr( "racecar ", .T. ) + '"' + ? ' charmirr("racecar ", .F.) == " racecar" ? -> "' + charmirr( "racecar ", .F. ) + '"' ? "End test of CHARMIRR()" ? diff --git a/harbour/contrib/hbct/tests/charmix.prg b/harbour/contrib/hbct/tests/charmix.prg index 00f7f0dee3..4621691e26 100644 --- a/harbour/contrib/hbct/tests/charmix.prg +++ b/harbour/contrib/hbct/tests/charmix.prg @@ -61,11 +61,11 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charmix("ABC", "123") == "A1B2C3" ? --> "] + charmix( "ABC", "123" ) + ["] - ? [ charmix("ABCDE", "12") == "A1B2C1D2E1" ? --> "] + charmix( "ABCDE", "12" ) + ["] - ? [ charmix("AB", "12345") == "A1B2" ? --> "] + charmix( "AB", "12345" ) + ["] - ? [ charmix("HELLO", " ") == "H E L L O " ? --> "] + charmix( "HELLO", " " ) + ["] - ? [ charmix("HELLO", "") == "HELLO" ? --> "] + charmix( "HELLO", "" ) + ["] + ? ' charmix("ABC", "123") == "A1B2C3" ? --> "' + charmix( "ABC", "123" ) + '"' + ? ' charmix("ABCDE", "12") == "A1B2C1D2E1" ? --> "' + charmix( "ABCDE", "12" ) + '"' + ? ' charmix("AB", "12345") == "A1B2" ? --> "' + charmix( "AB", "12345" ) + '"' + ? ' charmix("HELLO", " ") == "H E L L O " ? --> "' + charmix( "HELLO", " " ) + '"' + ? ' charmix("HELLO", "") == "HELLO" ? --> "' + charmix( "HELLO", "" ) + '"' ? ? "End test of CHARMIX()" diff --git a/harbour/contrib/hbct/tests/charnlst.prg b/harbour/contrib/hbct/tests/charnlst.prg index f0fab51beb..be587f5f44 100644 --- a/harbour/contrib/hbct/tests/charnlst.prg +++ b/harbour/contrib/hbct/tests/charnlst.prg @@ -62,8 +62,8 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charnolist(charnolist("Hello World !")) == " !HWdelor" ? -> "] + charnolist( charnolist( "Hello World !" ) ) + ["] - ? [ charnolist(charnolist(NIL)) == "" ? -> "] + charnolist( charnolist( NIL ) ) + ["] + ? ' charnolist(charnolist("Hello World !")) == " !HWdelor" ? -> "' + charnolist( charnolist( "Hello World !" ) ) + '"' + ? ' charnolist(charnolist(NIL)) == "" ? -> "' + charnolist( charnolist( NIL ) ) + '"' ? "End test of CHARNOLIST()" ? diff --git a/harbour/contrib/hbct/tests/charnot.prg b/harbour/contrib/hbct/tests/charnot.prg index 1e26c2ced6..02ad04469c 100644 --- a/harbour/contrib/hbct/tests/charnot.prg +++ b/harbour/contrib/hbct/tests/charnot.prg @@ -53,7 +53,7 @@ */ #ifndef __HARBOUR__ - #define hb_ntos( n ) LTrim( Str( n ) ) +#define hb_ntos( n ) LTrim( Str( n ) ) #endif PROCEDURE Main() @@ -68,10 +68,10 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charnot(chr(85)+chr(128)+chr(170)+chr(1)) == ] - ? [ chr(170)+chr(127)+chr(85)+chr(254) ? -->] + ? ' charnot(chr(85)+chr(128)+chr(170)+chr(1)) == ' + ? ' chr(170)+chr(127)+chr(85)+chr(254) ? -->' - ? [ ] + ? ' ' cStr := charnot( Chr( 85 ) + Chr( 128 ) + Chr( 170 ) + Chr( 1 ) ) FOR ni := 1 TO Len( cStr ) ?? "chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")" @@ -81,8 +81,8 @@ PROCEDURE Main() NEXT ? - ? [ charnot(charnot("This is a test!")) == "This is a test!" ?] - ? [ --> "] + charnot( charnot( "This is a test!" ) ) + ["] + ? ' charnot(charnot("This is a test!")) == "This is a test!" ?' + ? ' --> "' + charnot( charnot( "This is a test!" ) ) + '"' ? ? "End test of CHARNOT()" diff --git a/harbour/contrib/hbct/tests/charodd.prg b/harbour/contrib/hbct/tests/charodd.prg index d414fb766c..42012b0941 100644 --- a/harbour/contrib/hbct/tests/charodd.prg +++ b/harbour/contrib/hbct/tests/charodd.prg @@ -61,8 +61,8 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charodd("1A2B3C4D5E") == "12345" ? --> "] + charodd( "1A2B3C4D5E" ) + ["] - ? [ charodd("1A2B3C4D5") == "12345" ? --> "] + charodd( "1A2B3C4D5" ) + ["] + ? ' charodd("1A2B3C4D5E") == "12345" ? --> "' + charodd( "1A2B3C4D5E" ) + '"' + ? ' charodd("1A2B3C4D5") == "12345" ? --> "' + charodd( "1A2B3C4D5" ) + '"' ? "End test of CHARODD()" ? diff --git a/harbour/contrib/hbct/tests/charone.prg b/harbour/contrib/hbct/tests/charone.prg index 18400e3ccc..5bc7fd8934 100644 --- a/harbour/contrib/hbct/tests/charone.prg +++ b/harbour/contrib/hbct/tests/charone.prg @@ -61,11 +61,11 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charone("112333a123") == "123a123"? --> "] + charone( "112333a123" ) + ["] - ? [ charone("122333a123") == "123a123"? --> "] + charone( "122333a123" ) + ["] - ? [ charone("A B CCCD") == "A B CD"? ---> "] + charone( "A B CCCD" ) + ["] - ? [ charone(" ", "A B A B") == "A B A B"? --> "] + charone( " ", "A B A B" ) + ["] - ? [ charone("o", "122oooB12o") == "122oB12o"? -> "] + charone( "o", "122oooB12o" ) + ["] + ? ' charone("112333a123") == "123a123"? --> "' + charone( "112333a123" ) + '"' + ? ' charone("122333a123") == "123a123"? --> "' + charone( "122333a123" ) + '"' + ? ' charone("A B CCCD") == "A B CD"? ---> "' + charone( "A B CCCD" ) + '"' + ? ' charone(" ", "A B A B") == "A B A B"? --> "' + charone( " ", "A B A B" ) + '"' + ? ' charone("o", "122oooB12o") == "122oB12o"? -> "' + charone( "o", "122oooB12o" ) + '"' ? ? "End test of CHARONE()" diff --git a/harbour/contrib/hbct/tests/charonly.prg b/harbour/contrib/hbct/tests/charonly.prg index 6d9d19360c..f05df9b675 100644 --- a/harbour/contrib/hbct/tests/charonly.prg +++ b/harbour/contrib/hbct/tests/charonly.prg @@ -61,8 +61,8 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charonly("0123456789", "0211 - 38 99 77") == "0211389977" ? --> "] + charonly( "0123456789", "0211 - 38 99 77" ) + ["] - ? [ charonly("0123456789", "0211/ 389 977") == "0211389977" ? --> "] + charonly( "0123456789", "0211/ 389 977" ) + ["] + ? ' charonly("0123456789", "0211 - 38 99 77") == "0211389977" ? --> "' + charonly( "0123456789", "0211 - 38 99 77" ) + '"' + ? ' charonly("0123456789", "0211/ 389 977") == "0211389977" ? --> "' + charonly( "0123456789", "0211/ 389 977" ) + '"' ? ? "End test of CHARONLY()" diff --git a/harbour/contrib/hbct/tests/charor.prg b/harbour/contrib/hbct/tests/charor.prg index 8164bc8591..b53afebee6 100644 --- a/harbour/contrib/hbct/tests/charor.prg +++ b/harbour/contrib/hbct/tests/charor.prg @@ -62,8 +62,8 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charor("012345678", chr(1)) == "113355779" ? --> "] + charor( "012345678", Chr( 1 ) ) + ["] - ? [ charor("012345678", chr(1)+chr(3)) == "133357779" ? --> "] + charor( "012345678", Chr( 1 ) + Chr( 3 ) ) + ["] + ? ' charor("012345678", chr(1)) == "113355779" ? --> "' + charor( "012345678", Chr( 1 ) ) + '"' + ? ' charor("012345678", chr(1)+chr(3)) == "133357779" ? --> "' + charor( "012345678", Chr( 1 ) + Chr( 3 ) ) + '"' ? "End test of CHAROR()" ? diff --git a/harbour/contrib/hbct/tests/charrem.prg b/harbour/contrib/hbct/tests/charrem.prg index a3150ee923..6418a2bb39 100644 --- a/harbour/contrib/hbct/tests/charrem.prg +++ b/harbour/contrib/hbct/tests/charrem.prg @@ -61,8 +61,8 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charrem(" ", " 1 2 ") == "12" ? ---> "] + charrem( " ", " 1 2 " ) + ["] - ? [ charrem("3y", "xyz123") == "xz12" ? ---> "] + charrem( "3y", "xyz123" ) + ["] + ? ' charrem(" ", " 1 2 ") == "12" ? ---> "' + charrem( " ", " 1 2 " ) + '"' + ? ' charrem("3y", "xyz123") == "xz12" ? ---> "' + charrem( "3y", "xyz123" ) + '"' ? ? "End test of CHARREM()" diff --git a/harbour/contrib/hbct/tests/charrepl.prg b/harbour/contrib/hbct/tests/charrepl.prg index ea5fe175b0..2b58c4e7f1 100644 --- a/harbour/contrib/hbct/tests/charrepl.prg +++ b/harbour/contrib/hbct/tests/charrepl.prg @@ -61,11 +61,11 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charrepl("1234", "1x2y3z", "abcd") == "axbycz" ? --> "] + charrepl( "1234", "1x2y3z", "abcd" ) + ["] - ? [ charrepl("abcdefghij", "jhfdb", "1234567890") == "08642" ? --> "] + charrepl( "abcdefghij", "jhfdb", "1234567890" ) + ["] - ? [ charrepl("abcdefghij", "jhfdb", "12345") == "55542" ? --> "] + charrepl( "abcdefghij", "jhfdb", "12345" ) + ["] - ? [ charrepl("1234", "1234", "234A") == "AAAA" ? --> "] + charrepl( "1234", "1234", "234A" ) + ["] - ? [ charrepl("1234", "1234", "234A", .T.) == "234A" ? --> "] + charrepl( "1234", "1234", "234A", .T. ) + ["] + ? ' charrepl("1234", "1x2y3z", "abcd") == "axbycz" ? --> "' + charrepl( "1234", "1x2y3z", "abcd" ) + '"' + ? ' charrepl("abcdefghij", "jhfdb", "1234567890") == "08642" ? --> "' + charrepl( "abcdefghij", "jhfdb", "1234567890" ) + '"' + ? ' charrepl("abcdefghij", "jhfdb", "12345") == "55542" ? --> "' + charrepl( "abcdefghij", "jhfdb", "12345" ) + '"' + ? ' charrepl("1234", "1234", "234A") == "AAAA" ? --> "' + charrepl( "1234", "1234", "234A" ) + '"' + ? ' charrepl("1234", "1234", "234A", .T.) == "234A" ? --> "' + charrepl( "1234", "1234", "234A", .T. ) + '"' ? ? "End test of CHARREPL()" diff --git a/harbour/contrib/hbct/tests/charrll.prg b/harbour/contrib/hbct/tests/charrll.prg index e58774b698..67e9639f71 100644 --- a/harbour/contrib/hbct/tests/charrll.prg +++ b/harbour/contrib/hbct/tests/charrll.prg @@ -53,7 +53,7 @@ */ #ifndef __HARBOUR__ - #define hb_ntos( n ) LTrim( Str( n ) ) +#define hb_ntos( n ) LTrim( Str( n ) ) #endif PROCEDURE Main() @@ -67,11 +67,11 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charrll(chr(1)+chr(2)+chr(4)+chr(8)+chr(16)+chr(32)+] - ? [ chr(64)+chr(128), 3) == ] - ? [ chr(8)+chr(16)+chr(32)+chr(64)+chr(128)+chr(1)+chr(2)+chr(4) ? -->] + ? ' charrll(chr(1)+chr(2)+chr(4)+chr(8)+chr(16)+chr(32)+' + ? ' chr(64)+chr(128), 3) == ' + ? ' chr(8)+chr(16)+chr(32)+chr(64)+chr(128)+chr(1)+chr(2)+chr(4) ? -->' - ? [ ] + ? ' ' cStr := charrll( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) FOR ni := 1 TO Len( cStr ) ?? "chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")" diff --git a/harbour/contrib/hbct/tests/charrlr.prg b/harbour/contrib/hbct/tests/charrlr.prg index c29785ebb9..0b503eea27 100644 --- a/harbour/contrib/hbct/tests/charrlr.prg +++ b/harbour/contrib/hbct/tests/charrlr.prg @@ -53,7 +53,7 @@ */ #ifndef __HARBOUR__ - #define hb_ntos( n ) LTrim( Str( n ) ) +#define hb_ntos( n ) LTrim( Str( n ) ) #endif PROCEDURE Main() @@ -67,11 +67,11 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charrlr(chr(1)+chr(2)+chr(4)+chr(8)+chr(16)+chr(32)+] - ? [ chr(64)+chr(128), 3) == ] - ? [ chr(32)+chr(64)+chr(128)+chr(1)+chr(2)+chr(4)+chr(8)+chr(16) ? -->] + ? ' charrlr(chr(1)+chr(2)+chr(4)+chr(8)+chr(16)+chr(32)+' + ? ' chr(64)+chr(128), 3) == ' + ? ' chr(32)+chr(64)+chr(128)+chr(1)+chr(2)+chr(4)+chr(8)+chr(16) ? -->' - ? [ ] + ? ' ' cStr := charrlr( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) FOR ni := 1 TO Len( cStr ) ?? "chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")" diff --git a/harbour/contrib/hbct/tests/charshl.prg b/harbour/contrib/hbct/tests/charshl.prg index a4ecd1c0c4..0680b4e957 100644 --- a/harbour/contrib/hbct/tests/charshl.prg +++ b/harbour/contrib/hbct/tests/charshl.prg @@ -53,7 +53,7 @@ */ #ifndef __HARBOUR__ - #define hb_ntos( n ) LTrim( Str( n ) ) +#define hb_ntos( n ) LTrim( Str( n ) ) #endif PROCEDURE Main() @@ -67,11 +67,11 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charshl(chr(1)+chr(2)+chr(4)+chr(8)+chr(16)+chr(32)+] - ? [ chr(64)+chr(128), 3) == ] - ? [ chr(8)+chr(16)+chr(32)+chr(64)+chr(128)+chr(0)+chr(0)+chr(0) ? -->] + ? ' charshl(chr(1)+chr(2)+chr(4)+chr(8)+chr(16)+chr(32)+' + ? ' chr(64)+chr(128), 3) == ' + ? ' chr(8)+chr(16)+chr(32)+chr(64)+chr(128)+chr(0)+chr(0)+chr(0) ? -->' - ? [ ] + ? ' ' cStr := charshl( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) FOR ni := 1 TO Len( cStr ) ?? "chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")" diff --git a/harbour/contrib/hbct/tests/charshr.prg b/harbour/contrib/hbct/tests/charshr.prg index 554ead44a6..e8f4a6836a 100644 --- a/harbour/contrib/hbct/tests/charshr.prg +++ b/harbour/contrib/hbct/tests/charshr.prg @@ -53,7 +53,7 @@ */ #ifndef __HARBOUR__ - #define hb_ntos( n ) LTrim( Str( n ) ) +#define hb_ntos( n ) LTrim( Str( n ) ) #endif PROCEDURE Main() @@ -67,11 +67,11 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charshr(chr(1)+chr(2)+chr(4)+chr(8)+chr(16)+chr(32)+] - ? [ chr(64)+chr(128), 3) == ] - ? [ chr(0)+chr(0)+chr(0)+chr(1)+chr(2)+chr(4)+chr(8)+chr(16) ? -->] + ? ' charshr(chr(1)+chr(2)+chr(4)+chr(8)+chr(16)+chr(32)+' + ? ' chr(64)+chr(128), 3) == ' + ? ' chr(0)+chr(0)+chr(0)+chr(1)+chr(2)+chr(4)+chr(8)+chr(16) ? -->' - ? [ ] + ? ' ' cStr := charshr( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) FOR ni := 1 TO Len( cStr ) ?? "chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")" diff --git a/harbour/contrib/hbct/tests/charslst.prg b/harbour/contrib/hbct/tests/charslst.prg index d5da3a79aa..3c15962ba2 100644 --- a/harbour/contrib/hbct/tests/charslst.prg +++ b/harbour/contrib/hbct/tests/charslst.prg @@ -61,8 +61,8 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charslist("Hello World !") == " !HWdelor" ? -> "] + charslist( "Hello World !" ) + ["] - ? [ charslist(NIL) == "" ? -> "] + charslist( NIL ) + ["] + ? ' charslist("Hello World !") == " !HWdelor" ? -> "' + charslist( "Hello World !" ) + '"' + ? ' charslist(NIL) == "" ? -> "' + charslist( NIL ) + '"' ? "End test of CHARSLIST()" ? diff --git a/harbour/contrib/hbct/tests/charsort.prg b/harbour/contrib/hbct/tests/charsort.prg index c89e4019d4..2261ac359d 100644 --- a/harbour/contrib/hbct/tests/charsort.prg +++ b/harbour/contrib/hbct/tests/charsort.prg @@ -61,15 +61,15 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charsort("qwert") == "eqrtw" ? --> "] + charsort( "qwert" ) + ["] - ? [ charsort("qwert", 2) == "erqwt" ? --> "] + charsort( "qwert", 2 ) + ["] - ? [ charsort("b1a4a3a2a1", 2, 1) == "a2a1a3a4b1" ? --> "] + charsort( "b1a4a3a2a1", 2, 1 ) + ["] - ? [ NOTE : The order of equal elements(here the one beginning with the same char) is NOT determined !] - ? [ charsort("XXXqwert", 1, 1, 3) == "XXXeqrtw" ? --> "] + charsort( "XXXqwert", 1, 1, 3 ) + ["] - ? [ charsort("b1a4a3a2a1", 2, 1, 0, 1) == "a1b1a2a3a4" ? --> "] + charsort( "b1a4a3a2a1", 2, 1, 0, 1 ) + ["] - ? [ NOTE : The order of equal elements(here the one ending with the same number) is NOT determined !] - ? [ charsort("384172852", 1, 1, 0, 0, 4) == "134872852" ? --> "] + charsort( "384172852", 1, 1, 0, 0, 4 ) + ["] - ? [ charsort("qwert",,,,,,.T.) == "wtrqe" ? --> "] + charsort( "qwert",,,,,, .T. ) + ["] + ? ' charsort("qwert") == "eqrtw" ? --> "' + charsort( "qwert" ) + '"' + ? ' charsort("qwert", 2) == "erqwt" ? --> "' + charsort( "qwert", 2 ) + '"' + ? ' charsort("b1a4a3a2a1", 2, 1) == "a2a1a3a4b1" ? --> "' + charsort( "b1a4a3a2a1", 2, 1 ) + '"' + ? ' NOTE : The order of equal elements(here the one beginning with the same char) is NOT determined !' + ? ' charsort("XXXqwert", 1, 1, 3) == "XXXeqrtw" ? --> "' + charsort( "XXXqwert", 1, 1, 3 ) + '"' + ? ' charsort("b1a4a3a2a1", 2, 1, 0, 1) == "a1b1a2a3a4" ? --> "' + charsort( "b1a4a3a2a1", 2, 1, 0, 1 ) + '"' + ? ' NOTE : The order of equal elements(here the one ending with the same number) is NOT determined !' + ? ' charsort("384172852", 1, 1, 0, 0, 4) == "134872852" ? --> "' + charsort( "384172852", 1, 1, 0, 0, 4 ) + '"' + ? ' charsort("qwert",,,,,,.T.) == "wtrqe" ? --> "' + charsort( "qwert",,,,,, .T. ) + '"' ? ? "End test of CHARSORT()" diff --git a/harbour/contrib/hbct/tests/charsub.prg b/harbour/contrib/hbct/tests/charsub.prg index ba467c7f0d..bdde6ab828 100644 --- a/harbour/contrib/hbct/tests/charsub.prg +++ b/harbour/contrib/hbct/tests/charsub.prg @@ -61,10 +61,10 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charadd("123456789", chr(1)) == "012345678" ? -> "] + charsub( "123456789", Chr( 1 ) ) + ["] - ? [ charadd("123456789", chr(1)+chr(2)) == "002244668" ? -> "] + charsub( "123456789", Chr( 1 ) + Chr( 2 ) ) + ["] - ? [ charadd("012345678", chr(255)) == "123456789" ? -> "] + charsub( "012345678", Chr( 255 ) ) + ["] - ? [ charadd("012345678", chr(255)+Chr(254)) == "133557799" ? -> "] + charsub( "012345678", Chr( 255 ) + Chr( 254 ) ) + ["] + ? ' charadd("123456789", chr(1)) == "012345678" ? -> "' + charsub( "123456789", Chr( 1 ) ) + '"' + ? ' charadd("123456789", chr(1)+chr(2)) == "002244668" ? -> "' + charsub( "123456789", Chr( 1 ) + Chr( 2 ) ) + '"' + ? ' charadd("012345678", chr(255)) == "123456789" ? -> "' + charsub( "012345678", Chr( 255 ) ) + '"' + ? ' charadd("012345678", chr(255)+Chr(254)) == "133557799" ? -> "' + charsub( "012345678", Chr( 255 ) + Chr( 254 ) ) + '"' ? "End test of CHARSUB()" ? diff --git a/harbour/contrib/hbct/tests/charswap.prg b/harbour/contrib/hbct/tests/charswap.prg index 47c9fc33fe..054a5a292d 100644 --- a/harbour/contrib/hbct/tests/charswap.prg +++ b/harbour/contrib/hbct/tests/charswap.prg @@ -61,8 +61,8 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charswap("0123456789") == "1032547698" ? --> "] + charswap( "0123456789" ) + ["] - ? [ charswap("ABCDEFGHIJK") == "BADCFEHGJIK" ? --> "] + charswap( "ABCDEFGHIJK" ) + ["] + ? ' charswap("0123456789") == "1032547698" ? --> "' + charswap( "0123456789" ) + '"' + ? ' charswap("ABCDEFGHIJK") == "BADCFEHGJIK" ? --> "' + charswap( "ABCDEFGHIJK" ) + '"' ? ? "End test of CHARSWAP()" diff --git a/harbour/contrib/hbct/tests/charxor.prg b/harbour/contrib/hbct/tests/charxor.prg index 27f62438ef..5368b583ff 100644 --- a/harbour/contrib/hbct/tests/charxor.prg +++ b/harbour/contrib/hbct/tests/charxor.prg @@ -61,9 +61,9 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ charxor(charxor("This is top secret !", "My Password"),] - ? [ "My Password") == "This is top secret !" ? ->] - ? [ ] + charxor( charxor("This is top secret !", "My Password" ),"My Password" ) + ? ' charxor(charxor("This is top secret !", "My Password"),' + ? ' "My Password") == "This is top secret !" ? ->' + ? ' ' + charxor( charxor( "This is top secret !", "My Password" ), "My Password" ) ? "End test of CHARXOR()" ? diff --git a/harbour/contrib/hbct/tests/csetarge.prg b/harbour/contrib/hbct/tests/csetarge.prg index 09268e53f4..3c45165a3a 100644 --- a/harbour/contrib/hbct/tests/csetarge.prg +++ b/harbour/contrib/hbct/tests/csetarge.prg @@ -57,7 +57,7 @@ #include "ct.ch" #ifndef __HARBOUR__ - #define hb_ntos( n ) LTrim( Str( n ) ) +#define hb_ntos( n ) LTrim( Str( n ) ) #endif PROCEDURE Main() diff --git a/harbour/contrib/hbct/tests/ctwtest.prg b/harbour/contrib/hbct/tests/ctwtest.prg index 6205f42b49..440c95a238 100644 --- a/harbour/contrib/hbct/tests/ctwtest.prg +++ b/harbour/contrib/hbct/tests/ctwtest.prg @@ -23,7 +23,7 @@ PROCEDURE Main() wsetshadow( 7 ) setclearA( 10 * 16 + 14 ) setclearB( 35 ) - DispBox( 0, 0, MaxRow(), MaxCol(), replicate( "#", 9 ), ntocolor( 10 * 16 + 14 ) ) + DispBox( 0, 0, MaxRow(), MaxCol(), Replicate( "#", 9 ), ntocolor( 10 * 16 + 14 ) ) SetPos( 0, 0 ) ? "GT driver: " + hb_gtVersion() ? hb_gtVersion( 1 ) diff --git a/harbour/contrib/hbct/tests/datetime.prg b/harbour/contrib/hbct/tests/datetime.prg index 80204e9239..e5d0b7b33b 100644 --- a/harbour/contrib/hbct/tests/datetime.prg +++ b/harbour/contrib/hbct/tests/datetime.prg @@ -156,14 +156,14 @@ PROCEDURE Main( cLang ) RETURN -//: +// FUNCTION addmtest() - //: - //: addmonth(dDate, nMonths) - //: ========================= - //: This version will only accept an nMonths value of from 0 to 70 + // + // addmonth(dDate, nMonths) + // ========================= + // This version will only accept an nMonths value of from 0 to 70 LOCAL getlist := {} LOCAL dDate := SToD() @@ -205,13 +205,13 @@ FUNCTION addmtest() RETURN NIL -//: +// FUNCTION bomtest() - //: - //: bom( dDate ) - //: ============= + // + // bom( dDate ) + // ============= LOCAL getlist := {} LOCAL dDate := SToD() @@ -249,13 +249,13 @@ FUNCTION bomtest() RETURN NIL -//: +// FUNCTION boqtest() - //: - //: bom( dDate ) - //: ============= + // + // bom( dDate ) + // ============= LOCAL getlist := {} LOCAL dDate := SToD() @@ -295,13 +295,13 @@ FUNCTION boqtest() RETURN NIL -//: +// FUNCTION boytest() - //: - //: boy( dDate ) - //: ============= + // + // boy( dDate ) + // ============= LOCAL getlist := {} LOCAL dDate := SToD() @@ -341,16 +341,16 @@ FUNCTION boytest() RETURN NIL -//: +// FUNCTION ctodowtest() - //: - //: ctodow( cDow ) - //: ============== - //: Convert name of day of the week to its ordinal number - //: if cDow is invalid, returns 0 - //: English day names only. + // + // ctodow( cDow ) + // ============== + // Convert name of day of the week to its ordinal number + // if cDow is invalid, returns 0 + // English day names only. LOCAL getlist := {} LOCAL cDow := Space( 9 ) @@ -390,15 +390,15 @@ FUNCTION ctodowtest() RETURN NIL -//: +// FUNCTION ctomonthtest() - //: - //: ctomonth(cDom ) - //: =============== - //: Convert the name of a month to its ordinal number. If cMonth is - //: invalid, ctomonth() Returns 0. English month names only + // + // ctomonth(cDom ) + // =============== + // Convert the name of a month to its ordinal number. If cMonth is + // invalid, ctomonth() Returns 0. English month names only LOCAL getlist := {} LOCAL cDom := Space( 9 ) @@ -438,15 +438,15 @@ FUNCTION ctomonthtest() RETURN NIL -//: +// FUNCTION dInMonthtest() - //: - //: daysInMonth( xDate, lleap ) - //: ============================ - //: Returns the number of days in nMonth, either whose name as a - //: string or month number is passed. English Month names only. + // + // daysInMonth( xDate, lleap ) + // ============================ + // Returns the number of days in nMonth, either whose name as a + // string or month number is passed. English Month names only. LOCAL getlist := {} LOCAL cMonth := Space( 9 ) @@ -506,16 +506,16 @@ FUNCTION dInMonthtest() RETURN NIL -//: +// FUNCTION d2month() - //: - //: daystomonth() - //: ============= - //: Total number days from first of Jan to beginning of nMonth. - //: lLeap is .F. for a non-leap year but .T. if it is. If so and - //: nMonth is greater than 2, ndays is incremented. + // + // daystomonth() + // ============= + // Total number days from first of Jan to beginning of nMonth. + // lLeap is .F. for a non-leap year but .T. if it is. If so and + // nMonth is greater than 2, ndays is incremented. LOCAL getlist := {} LOCAL cMonth := Space( 2 ) @@ -564,17 +564,17 @@ FUNCTION d2month() RETURN NIL -//: +// FUNCTION dmytest() - //: - //: dmy( dDate, lmode) - //: =================== - //: Returns the date as a string in DD Month YY format. If lmode - //: is .T., a "." is inserted after the DD - //: This version does not observe the Nations module. English - //: only. + // + // dmy( dDate, lmode) + // =================== + // Returns the date as a string in DD Month YY format. If lmode + // is .T., a "." is inserted after the DD + // This version does not observe the Nations module. English + // only. LOCAL getlist := {} LOCAL dDate := SToD() @@ -621,15 +621,15 @@ FUNCTION dmytest() RETURN NIL -//: +// FUNCTION doytest() - //: - //: doy( dDate ) - //: ============= - //: Determines the day of the year for a specific date - //: if dDate is invalid, returns 0 + // + // doy( dDate ) + // ============= + // Determines the day of the year for a specific date + // if dDate is invalid, returns 0 LOCAL getlist := {} LOCAL dDate := SToD() @@ -669,15 +669,15 @@ FUNCTION doytest() RETURN NIL -//: +// FUNCTION eomtest() - //: - //: dBom := eom( dDate ) - //: ===================== - //: Returns the last date in the month of the month appearing in - //: date. + // + // dBom := eom( dDate ) + // ===================== + // Returns the last date in the month of the month appearing in + // date. LOCAL getlist := {} LOCAL dDate := SToD() @@ -718,14 +718,14 @@ FUNCTION eomtest() RETURN NIL -//: +// FUNCTION eoqtest() - //: - //: dret := eoq( dDate ) - //: ===================== - //: Returns the last date in the quarter in which dDate falls. + // + // dret := eoq( dDate ) + // ===================== + // Returns the last date in the quarter in which dDate falls. LOCAL getlist := {} LOCAL dDate := SToD() @@ -766,15 +766,15 @@ FUNCTION eoqtest() RETURN NIL -//: +// FUNCTION eoytest() - //: - //: dEoy := eoy( dDate ) - //: ===================== - //: Returns the last date in the year of the year appearing in - //: date. + // + // dEoy := eoy( dDate ) + // ===================== + // Returns the last date in the year of the year appearing in + // date. LOCAL getlist := {} LOCAL dDate := SToD() @@ -815,15 +815,15 @@ FUNCTION eoytest() RETURN NIL -//: +// FUNCTION isleaptest() - //: - //: lRet := isleap( dDate ) - //: ======================== - //: if dDate is a leap year, lRet is .T., otherwise .F.. - //: Leap years are exactly divisible by 4 and 1,000 but not 100. + // + // lRet := isleap( dDate ) + // ======================== + // if dDate is a leap year, lRet is .T., otherwise .F.. + // Leap years are exactly divisible by 4 and 1,000 but not 100. LOCAL getlist := {} LOCAL dDate := SToD() @@ -870,17 +870,17 @@ FUNCTION isleaptest() RETURN NIL -//: +// FUNCTION lastdayomtest() - //: - //: ndays := lastdayom( xDate ) - //: =========================== - //: Returns the the number of days in the month. - //: xDate can be a date or a month number. If empty uses the - //: system date. - //: If xDate is invalid, returns 0 + // + // ndays := lastdayom( xDate ) + // =========================== + // Returns the the number of days in the month. + // xDate can be a date or a month number. If empty uses the + // system date. + // If xDate is invalid, returns 0 LOCAL getlist := {} LOCAL dDate := SToD() @@ -896,7 +896,7 @@ FUNCTION lastdayomtest() @ 10, 10 SAY "a month" @ 9, 30 GET dDate - @ 10, 38 GET cMth PICTURE "99" //valid val(cmth) < 12 + @ 10, 38 GET cMth PICTURE "99" // VALID Val( cmth ) < 12 SET CONFIRM ON SET ESCAPE ON @@ -930,16 +930,16 @@ FUNCTION lastdayomtest() RETURN NIL -//: +// FUNCTION mdytest() - //: - //: cDate := mdy( dDate ) - //: ====================== - //: Returns the date as a string in "Month DD, YY" or "Month DD, YYYY" - //: If dDate is NULL, the system date is used - //: This version does not observe the Nations module. English only. + // + // cDate := mdy( dDate ) + // ====================== + // Returns the date as a string in "Month DD, YY" or "Month DD, YYYY" + // If dDate is NULL, the system date is used + // This version does not observe the Nations module. English only. LOCAL getlist := {} LOCAL dDate := SToD() @@ -981,16 +981,16 @@ FUNCTION mdytest() RETURN NIL -//: +// FUNCTION ntocdowtest() - //: - //: cDay := ntocdow( nDayNum ) - //: ================================== - //: ntocdow() receives the number of a day and returns its - //: name as a string. This version does not observe the Nations - //: module. English only. + // + // cDay := ntocdow( nDayNum ) + // ================================== + // ntocdow() receives the number of a day and returns its + // name as a string. This version does not observe the Nations + // module. English only. LOCAL getlist := {} LOCAL cDay := " " @@ -1031,16 +1031,16 @@ FUNCTION ntocdowtest() RETURN NIL -//: +// FUNCTION ntocmthtest() - //: - //: cMonth := ntocmonth( nMonthNum ) - //: ================================== - //: ntocmonth() receives the number of a month and returns its - //: name as a string. This version does not observe the Nations - //: module. English only. + // + // cMonth := ntocmonth( nMonthNum ) + // ================================== + // ntocmonth() receives the number of a month and returns its + // name as a string. This version does not observe the Nations + // module. English only. LOCAL getlist := {} LOCAL cMonth := " " @@ -1081,15 +1081,15 @@ FUNCTION ntocmthtest() RETURN NIL -//: +// FUNCTION qtrtest() - //: - //: nqtr := quarter( dDate ) - //: =========================== - //: Returns the quarter as a number. If no date is specified, - //: the system date is used. + // + // nqtr := quarter( dDate ) + // =========================== + // Returns the quarter as a number. If no date is specified, + // the system date is used. LOCAL getlist := {} LOCAL dDate := SToD() @@ -1130,15 +1130,15 @@ FUNCTION qtrtest() RETURN NIL -//: +// FUNCTION stodtest() - //: - //: stod( ansi-date) - //: ================ - //: Returns a Clipper format date. If Ansi date is invalid, a - //: null date is returned. + // + // stod( ansi-date) + // ================ + // Returns a Clipper format date. If Ansi date is invalid, a + // null date is returned. LOCAL getlist := {} LOCAL dDate @@ -1181,11 +1181,11 @@ FUNCTION stodtest() RETURN NIL -//: +// FUNCTION chkansi( cAnsidate ) - //: + // LOCAL nYear LOCAL nMonth LOCAL nDay @@ -1207,16 +1207,16 @@ FUNCTION chkansi( cAnsidate ) RETURN lretval -//: +// FUNCTION weektest() - //: - //: nWeek := week( dDate, lSWN ) - //: ============================= - //: Returns the calendar week as a number. If no date is specified, - //: the system date is used. An empty date viz stod() - //: returns 0. + // + // nWeek := week( dDate, lSWN ) + // ============================= + // Returns the calendar week as a number. If no date is specified, + // the system date is used. An empty date viz stod() + // returns 0. LOCAL getlist := {} LOCAL dDate := SToD() diff --git a/harbour/contrib/hbct/tests/expomant.prg b/harbour/contrib/hbct/tests/expomant.prg index f09d3c30f2..21bb1c8474 100644 --- a/harbour/contrib/hbct/tests/expomant.prg +++ b/harbour/contrib/hbct/tests/expomant.prg @@ -66,8 +66,8 @@ PROCEDURE Main() NEXT // The call to str( infinity(.T.) ), generate a GPF. -// ?? Str( infinity( .T. ) ) + Str( mantissa( infinity( .T. ) ) ) + Str( exponent( infinity( .T. ) ) ) -// ?? Str( infinity( .T. ) ) + // ?? Str( infinity( .T. ) ) + Str( mantissa( infinity( .T. ) ) ) + Str( exponent( infinity( .T. ) ) ) + // ?? Str( infinity( .T. ) ) ?? " infinity(.T.): " + Str( mantissa( infinity( .T. ) ), 20, 15 ) + " " ? Str( exponent( infinity( .T. ) ), 4 ) diff --git a/harbour/contrib/hbct/tests/numline.prg b/harbour/contrib/hbct/tests/numline.prg index 3923be98db..4eb1805457 100644 --- a/harbour/contrib/hbct/tests/numline.prg +++ b/harbour/contrib/hbct/tests/numline.prg @@ -14,16 +14,16 @@ PROCEDURE Main() - ? NUMLINE( "" ) , 0 - ? NUMLINE( "-" ) , 1 - ? NUMLINE( Replicate( "-", 80 ) ) , 2 - ? NUMLINE( Replicate( "-", 160 ) ) , 3 - ? NUMLINE( Replicate( "-", 100 ), 30 ) , 4 - ? NUMLINE( "-" + Chr( 13 ) + Chr( 10 ) ) , 2 - ? NUMLINE( "-" + Chr( 10 ) ) , 2 - ? NUMLINE( "-" + Chr( 13 ) + Chr( 10 ) + "=" ) , 2 - ? NUMLINE( "-" + Chr( 10 ) + "=" ) , 2 - ? NUMLINE( Replicate( "-", 100 ) + Chr( 13 ) + Chr( 10 ), 30 ) , 5 - ? NUMLINE( Replicate( "-", 100 ) + Chr( 10 ), 30 ) , 5 + ? NUMLINE( "" ), 0 + ? NUMLINE( "-" ), 1 + ? NUMLINE( Replicate( "-", 80 ) ), 2 + ? NUMLINE( Replicate( "-", 160 ) ), 3 + ? NUMLINE( Replicate( "-", 100 ), 30 ), 4 + ? NUMLINE( "-" + Chr( 13 ) + Chr( 10 ) ), 2 + ? NUMLINE( "-" + Chr( 10 ) ), 2 + ? NUMLINE( "-" + Chr( 13 ) + Chr( 10 ) + "=" ), 2 + ? NUMLINE( "-" + Chr( 10 ) + "=" ), 2 + ? NUMLINE( Replicate( "-", 100 ) + Chr( 13 ) + Chr( 10 ), 30 ), 5 + ? NUMLINE( Replicate( "-", 100 ) + Chr( 10 ), 30 ), 5 RETURN diff --git a/harbour/contrib/hbct/tests/numtoken.prg b/harbour/contrib/hbct/tests/numtoken.prg index 9e0d384770..01520fe22c 100644 --- a/harbour/contrib/hbct/tests/numtoken.prg +++ b/harbour/contrib/hbct/tests/numtoken.prg @@ -63,18 +63,18 @@ PROCEDURE Main() // Some simple tests ? " Simple tests:" - ? [ numtoken("Hello, World!") == 2 ? ------------------------------> ] + Str( numtoken( "Hello, World!" ),2 ) - ? [ numtoken("This is good. See you! How do you do?",".!?") == 3 ? -> ] + Str( numtoken( "This is good. See you! How do you do?", ".!?" ), 2 ) - ? [ numtoken("one,,three,four,,six",",",1) == 6 ? -----------------> ] + Str( numtoken( "one,,three,four,,six", ",", 1 ), 2 ) + ? ' numtoken("Hello, World!") == 2 ? ------------------------------> ' + Str( numtoken( "Hello, World!" ), 2 ) + ? ' numtoken("This is good. See you! How do you do?",".!?") == 3 ? -> ' + Str( numtoken( "This is good. See you! How do you do?", ".!?" ), 2 ) + ? ' numtoken("one,,three,four,,six",",",1) == 6 ? -----------------> ' + Str( numtoken( "one,,three,four,,six", ",", 1 ), 2 ) ? - ? [ # of tokens in the string "] + cStr + ["] - ? [ separator list = ".,!" and skip width = 1: ] + Str( numtoken(cStr, ".,!", 1 ) ) - ? [ skip width = 3: ] + Str( numtoken(cStr, ".,!", 3 ) ) - ? [ separator list = ",!" and skip width = 1: ] + Str( numtoken(cStr, ",!", 1 ) ) - ? [ skip width = 3: ] + Str( numtoken(cStr, ",!", 3 ) ) - ? [ separator list = "!" and skip width = 1: ] + Str( numtoken(cStr, "!", 1 ) ) - ? [ skip width = 3: ] + Str( numtoken(cStr, "!", 3 ) ) + ? ' # of tokens in the string "' + cStr + '"' + ? ' separator list = ".,!" and skip width = 1: ' + Str( numtoken( cStr, ".,!", 1 ) ) + ? ' skip width = 3: ' + Str( numtoken( cStr, ".,!", 3 ) ) + ? ' separator list = ",!" and skip width = 1: ' + Str( numtoken( cStr, ",!", 1 ) ) + ? ' skip width = 3: ' + Str( numtoken( cStr, ",!", 3 ) ) + ? ' separator list = "!" and skip width = 1: ' + Str( numtoken( cStr, "!", 1 ) ) + ? ' skip width = 3: ' + Str( numtoken( cStr, "!", 3 ) ) ? ? "End test of NUMTOKEN()" diff --git a/harbour/contrib/hbct/tests/rangerem.prg b/harbour/contrib/hbct/tests/rangerem.prg index 924e28e28b..ac73ba11bb 100644 --- a/harbour/contrib/hbct/tests/rangerem.prg +++ b/harbour/contrib/hbct/tests/rangerem.prg @@ -59,12 +59,12 @@ PROCEDURE Main() ? "Begin test of RANGEREM()" ? - ? [ rangerem("0","9","year2002.dbf") == "year.dbf" ? --> "] + ; - rangerem( "0", "9", "year2002.dbf" ) + ["] - ? [ rangerem("9","0","year2002.dbf") == "22" ? --> "] + ; - rangerem( "9", "0", "year2002.dbf" ) + ["] - ? [ rangerem("0","9","yearcurr.dbf") == "yearcurr.dbf" ? --> "] + ; - rangerem( "0", "9", "yearcurr.dbf" ) + ["] + ? ' rangerem("0","9","year2002.dbf") == "year.dbf" ? --> "' + ; + rangerem( "0", "9", "year2002.dbf" ) + '"' + ? ' rangerem("9","0","year2002.dbf") == "22" ? --> "' + ; + rangerem( "9", "0", "year2002.dbf" ) + '"' + ? ' rangerem("0","9","yearcurr.dbf") == "yearcurr.dbf" ? --> "' + ; + rangerem( "0", "9", "yearcurr.dbf" ) + '"' ? ? "End test of RANGEREM()" diff --git a/harbour/contrib/hbct/tests/rangerep.prg b/harbour/contrib/hbct/tests/rangerep.prg index 00b8b47f89..1ffb6cf31e 100644 --- a/harbour/contrib/hbct/tests/rangerep.prg +++ b/harbour/contrib/hbct/tests/rangerep.prg @@ -59,12 +59,12 @@ PROCEDURE Main() ? "Begin test of RANGEREPL()" ? - ? [ rangerepl("0","9","year2002.dbf","?") == "year????.dbf" ? --> "] + ; - rangerepl( "0", "9", "year2002.dbf", "?" ) + ["] - ? [ rangerepl("9","0","year2002.dbf","?") == "????2??2????" ? --> "] + ; - rangerepl( "9", "0", "year2002.dbf", "?" ) + ["] - ? [ rangerepl("0","9","yearcurr.dbf","?") == "yearcurr.dbf" ? --> "] + ; - rangerepl( "0", "9", "yearcurr.dbf", "?" ) + ["] + ? ' rangerepl("0","9","year2002.dbf","?") == "year????.dbf" ? --> "' + ; + rangerepl( "0", "9", "year2002.dbf", "?" ) + '"' + ? ' rangerepl("9","0","year2002.dbf","?") == "????2??2????" ? --> "' + ; + rangerepl( "9", "0", "year2002.dbf", "?" ) + '"' + ? ' rangerepl("0","9","yearcurr.dbf","?") == "yearcurr.dbf" ? --> "' + ; + rangerepl( "0", "9", "yearcurr.dbf", "?" ) + '"' ? ? "End test of RANGEREPL()" diff --git a/harbour/contrib/hbct/tests/strdiff.prg b/harbour/contrib/hbct/tests/strdiff.prg index e00428c5ee..0de68fb671 100644 --- a/harbour/contrib/hbct/tests/strdiff.prg +++ b/harbour/contrib/hbct/tests/strdiff.prg @@ -62,12 +62,12 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ strdiff("ABC", "ADC") == 3 ? -> ], strdiff( "ABC", "ADC" ) - ? [ strdiff("ABC", "AEC") == 3 ? -> ], strdiff( "ABC", "AEC" ) - ? [ strdiff("CBA", "ABC") == 6 ? -> ], strdiff( "CBA", "ABC" ) - ? [ strdiff("ABC", "AXBC") == 1 ? -> ], strdiff( "ABC", "AXBC" ) - ? [ strdiff("AXBC", "ABC") == 6 ? -> ], strdiff( "AXBC", "ABC" ) - ? [ strdiff("AXBC", "ADC") == 9 ? -> ], strdiff( "AXBC", "ADC" ) + ? ' strdiff("ABC", "ADC") == 3 ? -> ', strdiff( "ABC", "ADC" ) + ? ' strdiff("ABC", "AEC") == 3 ? -> ', strdiff( "ABC", "AEC" ) + ? ' strdiff("CBA", "ABC") == 6 ? -> ', strdiff( "CBA", "ABC" ) + ? ' strdiff("ABC", "AXBC") == 1 ? -> ', strdiff( "ABC", "AXBC" ) + ? ' strdiff("AXBC", "ABC") == 6 ? -> ', strdiff( "AXBC", "ABC" ) + ? ' strdiff("AXBC", "ADC") == 9 ? -> ', strdiff( "AXBC", "ADC" ) ? "End test of STRDIFF()" ? diff --git a/harbour/contrib/hbct/tests/tab.prg b/harbour/contrib/hbct/tests/tab.prg index 1b650496ba..53c86f2821 100644 --- a/harbour/contrib/hbct/tests/tab.prg +++ b/harbour/contrib/hbct/tests/tab.prg @@ -63,36 +63,36 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ tabexpand("-"+chr(9)+"!") == "- !" ? -> "] + tabexpand( "-" + Chr( 9 ) + "!" ) + ["] - ? [ tabexpand("----"+chr(9) +"!") == "---- !" ? -> "] + tabexpand( "----" + Chr( 9 ) + "!" ) + ["] - ? [ tabexpand("-"+chr(9)+"!",, "+") == "-+++++++!" ? -> "] + tabexpand( "-" + Chr( 9 ) + "!",, "+" ) + ["] - ? [ tabexpand("-"+chr(9)+ "!", 4) == "- !" ? -> "] + tabexpand( "-" + Chr( 9 ) + "!", 4 ) + ["] - ? [ tabexpand("----"+chr(9)+ "!", 8) == "---- !" ? -> "] + tabexpand( "----" + Chr( 9 ) + "!", 8 ) + ["] - ? [ tabexpand("----"+chr(9)+ "!", 8, "+") == "----++++!" ? -> "] + tabexpand( "----" + Chr( 9 ) + "!", 8, "+" ) + ["] + ? ' tabexpand("-"+chr(9)+"!") == "- !" ? -> "' + tabexpand( "-" + Chr( 9 ) + "!" ) + '"' + ? ' tabexpand("----"+chr(9) +"!") == "---- !" ? -> "' + tabexpand( "----" + Chr( 9 ) + "!" ) + '"' + ? ' tabexpand("-"+chr(9)+"!",, "+") == "-+++++++!" ? -> "' + tabexpand( "-" + Chr( 9 ) + "!",, "+" ) + '"' + ? ' tabexpand("-"+chr(9)+ "!", 4) == "- !" ? -> "' + tabexpand( "-" + Chr( 9 ) + "!", 4 ) + '"' + ? ' tabexpand("----"+chr(9)+ "!", 8) == "---- !" ? -> "' + tabexpand( "----" + Chr( 9 ) + "!", 8 ) + '"' + ? ' tabexpand("----"+chr(9)+ "!", 8, "+") == "----++++!" ? -> "' + tabexpand( "----" + Chr( 9 ) + "!", 8, "+" ) + '"' ? ? "Tests with newline characters: ^J == LF, ^M == CR" cStr := hb_eol() cStr := StrTran( cStr, Chr( 10 ), "^J" ) cStr := StrTran( cStr, Chr( 13 ), "^M" ) - ? [ hb_eol() = "] + cStr + ["] + ? ' hb_eol() = "' + cStr + '"' cStr := tabexpand( "-" + Chr( 9 ) + "!" + hb_eol() + "----" + Chr( 9 ) + "!", , "+" ) cStr := StrTran( cStr, Chr( 10 ), "^J" ) cStr := StrTran( cStr, Chr( 13 ), "^M" ) - ? [ tabexpand("-"+chr(9)+"!"+hb_eol()+"----"+chr(9)+ "!",, "+")] - ? [ == "-+++++++!"+hb_eol()+"----++++!" ? -> "] + cStr + ["] + ? ' tabexpand("-"+chr(9)+"!"+hb_eol()+"----"+chr(9)+ "!",, "+")' + ? ' == "-+++++++!"+hb_eol()+"----++++!" ? -> "' + cStr + '"' cStr := tabexpand( "-" + Chr( 9 ) + "!$$--" + hb_eol() + "--" + Chr( 9 ) + "!", , "+", "$" ) cStr := StrTran( cStr, Chr( 10 ), "^J" ) cStr := StrTran( cStr, Chr( 13 ), "^M" ) - ? [ tabexpand("-"+chr(9)+"!$$--"+hb_eol()+--"+chr(9)+ "!",, "+", "$")] + ? ' tabexpand("-"+chr(9)+"!$$--"+hb_eol()+--"+chr(9)+ "!",, "+", "$")' nLen := Len( hb_eol() ) - ? [ == "-+++++++!$$--"+hb_eol()+"] + Replicate( "-",4 - nLen ) + [++!" ? -> "] + cStr + ["] + ? ' == "-+++++++!$$--"+hb_eol()+"' + Replicate( "-", 4 - nLen ) + '++!" ? -> "' + cStr + '"' ? ? "Tests with tab characters:" - ? [ tabexpand("-"+chr(9)+"-",,"+") == "-+++++++-" ? -> "] + tabexpand( "-" + Chr( 9 ) + "-",, "+" ) + ["] - ? [ tabexpand("-"+chr(9)+"-",,"+",,"-")] - ? [ == "++++++++^I+++++++" ? -> "] + StrTran( tabexpand( "-" + Chr( 9 ) + "-",, "+",, "-" ), Chr( 9 ), "^I" ) + ["] + ? ' tabexpand("-"+chr(9)+"-",,"+") == "-+++++++-" ? -> "' + tabexpand( "-" + Chr( 9 ) + "-",, "+" ) + '"' + ? ' tabexpand("-"+chr(9)+"-",,"+",,"-")' + ? ' == "++++++++^I+++++++" ? -> "' + StrTran( tabexpand( "-" + Chr( 9 ) + "-",, "+",, "-" ), Chr( 9 ), "^I" ) + '"' ? ? "End test of TABEXPAND()" @@ -106,53 +106,55 @@ PROCEDURE Main() // simple tests ? "Simple tests: ^I == tab character" - ? [ tabpack("AAAAAAA*",, "*") == "AAAAAAA*" ? -> "] + StrTran( tabpack("AAAAAAA*",, "*" ), Chr( 9 ), "^I" ) + ["] - ? [ tabpack("AAAAA***",, "*") == "AAAAA^I" ? -> "] + StrTran( tabpack("AAAAA***",, "*" ), Chr( 9 ), "^I" ) + ["] - ? [ tabpack("AAAAA*****",, "*") == "AAAAA^I**" ? -> "] + StrTran( tabpack("AAAAA*****",, "*" ), Chr( 9 ), "^I" ) + ["] + ? ' tabpack("AAAAAAA*",, "*") == "AAAAAAA*" ? -> "' + StrTran( tabpack( "AAAAAAA*",, "*" ), Chr( 9 ), "^I" ) + '"' + ? ' tabpack("AAAAA***",, "*") == "AAAAA^I" ? -> "' + StrTran( tabpack( "AAAAA***",, "*" ), Chr( 9 ), "^I" ) + '"' + ? ' tabpack("AAAAA*****",, "*") == "AAAAA^I**" ? -> "' + StrTran( tabpack( "AAAAA*****",, "*" ), Chr( 9 ), "^I" ) + '"' ? ? "Tests with newline characters:" cStr := hb_eol() cStr := StrTran( cStr, Chr( 10 ), "^J" ) cStr := StrTran( cStr, Chr( 13 ), "^M" ) - ? [ hb_eol() = "] + cStr + ["] + ? ' hb_eol() = "' + cStr + '"' 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" ) - ? [ tabpack("ABCD+" + hb_eol() + "++---+++++", 4, "+")] - ? [ == "ABCD+"+hb_eol()+"++---"+chr(9)+"++" ? -> "] + cStr + ["] + ? ' tabpack("ABCD+" + hb_eol() + "++---+++++", 4, "+")' + ? ' == "ABCD+"+hb_eol()+"++---"+chr(9)+"++" ? -> "' + cStr + '"' ? "End test of TABPACK()" ? -// ? "Test with a MEMOEDITed string:" -// ? " Now, a memoedit() will start. Please type a text, use tab characters" -// ? " and make sure, you make use of soft and hard returns !" -// ? " ...press any key to start the memoedit now..." -// ? -// Inkey( 0 ) -// CLS -// DispBox( 0, 0, 20, 60 ) -// cStr := MemoEdit( , 1, 1, 9, 59,,, 59 ) -// CLS -// ? " 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_eol() ) -// -// FOR ni := 1 TO MLCount( cStr1, 59, 4, .T. ) -// ? " " + Str( ni ) + ": " + MemoLine( cStr1, 59, ni, 4, .T. ) -// NEXT -// -// 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. ) -// ? " " + Str( ni ) + ": " + MemoLine( cStr1, 59, ni, 4, .T. ) -// NEXT -// Inkey( 0 ) +#if 0 + ? "Test with a MEMOEDITed string:" + ? " Now, a memoedit() will start. Please type a text, use tab characters" + ? " and make sure, you make use of soft and hard returns !" + ? " ...press any key to start the memoedit now..." + ? + Inkey( 0 ) + CLS + DispBox( 0, 0, 20, 60 ) + cStr := MemoEdit( , 1, 1, 9, 59,,, 59 ) + CLS + ? " 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_eol() ) + + FOR ni := 1 TO MLCount( cStr1, 59, 4, .T. ) + ? " " + Str( ni ) + ": " + MemoLine( cStr1, 59, ni, 4, .T. ) + NEXT + + 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. ) + ? " " + Str( ni ) + ": " + MemoLine( cStr1, 59, ni, 4, .T. ) + NEXT + Inkey( 0 ) +#endif ctexit() diff --git a/harbour/contrib/hbct/tests/token.prg b/harbour/contrib/hbct/tests/token.prg index 409dad6a35..4e85f1b3f8 100644 --- a/harbour/contrib/hbct/tests/token.prg +++ b/harbour/contrib/hbct/tests/token.prg @@ -53,7 +53,7 @@ */ #ifndef __HARBOUR__ - #define hb_ntos( n ) LTrim( Str( n ) ) +#define hb_ntos( n ) LTrim( Str( n ) ) #endif PROCEDURE Main() @@ -70,27 +70,27 @@ PROCEDURE Main() // Some simple tests ? " Simple tests:" - ? [ token("Hello, World!") == "World" ? -----------> "] + token( "Hello, World!" ) + ["] - ? [ token("Hello, World!",,2,1) == "" ? -----------> "] + token( "Hello, World!",, 2, 1 ) + ["] - ? [ token("Hello, World!",",",2,1) == " World!" ? -> "] + token( "Hello, World!", ",", 2, 1 ) + ["] - ? [ token("Hello, World!"," ",2,1) == "World!" ? --> "] + token( "Hello, World!", " ", 2, 1 ) + ["] + ? ' token("Hello, World!") == "World" ? -----------> "' + token( "Hello, World!" ) + '"' + ? ' token("Hello, World!",,2,1) == "" ? -----------> "' + token( "Hello, World!",, 2, 1 ) + '"' + ? ' token("Hello, World!",",",2,1) == " World!" ? -> "' + token( "Hello, World!", ",", 2, 1 ) + '"' + ? ' token("Hello, World!"," ",2,1) == "World!" ? --> "' + token( "Hello, World!", " ", 2, 1 ) + '"' ? - ? [ Tokenizing the string "] + cStr + ["] - ? [ with skip width == 1 and ".,!" as tokenizer list:] + ? ' Tokenizing the string "' + cStr + '"' + ? ' with skip width == 1 and ".,!" as tokenizer list:' ? FOR ni := 1 TO numtoken( cStr, ".,!", 1 ) - ? [ Token #] + hb_ntos( ni ) + [("] + token( cStr, ".,!", ni, 1, @cPre, @cPost ) + ; - [") @ pos ] + Str( npos := attoken( cStr, ".,!", ni, 1 ), 3 ) + [, tokenized by "] + cPre + [" and "] + cPost + [" is ] + iif( SubStr( cStr, npos, 1 ) $ ".,!", "", "not " ) + "empty" + ? ' Token #' + hb_ntos( ni ) + '("' + token( cStr, ".,!", ni, 1, @cPre, @cPost ) + ; + '") @ pos ' + Str( npos := attoken( cStr, ".,!", ni, 1 ), 3 ) + ', tokenized by "' + cPre + '" and "' + cPost + '" is ' + iif( SubStr( cStr, npos, 1 ) $ ".,!", "", "not " ) + "empty" NEXT ? - ? [ Tokenizing the string "] + cStr + ["] - ? [ with skip width == 3 and ".,!" as tokenizer list:] + ? ' Tokenizing the string "' + cStr + '"' + ? ' with skip width == 3 and ".,!" as tokenizer list:' ? FOR ni := 1 TO numtoken( cStr, ".,!", 3 ) - ? [ Token #] + hb_ntos( ni ) + [("] + token( cStr, ".,!", ni, 3, @cPre, @cPost ) + ; - [") @ pos ] + Str( npos := attoken( cStr, ".,!", ni, 3 ), 3 ) + [, tokenized by "] + cPre + [" and "] + cPost + [" is ] + iif( SubStr( cStr, npos, 1 ) $ ".,!", "", "not " ) + "empty." + ? ' Token #' + hb_ntos( ni ) + '("' + token( cStr, ".,!", ni, 3, @cPre, @cPost ) + ; + '") @ pos ' + Str( npos := attoken( cStr, ".,!", ni, 3 ), 3 ) + ', tokenized by "' + cPre + '" and "' + cPost + '" is ' + iif( SubStr( cStr, npos, 1 ) $ ".,!", "", "not " ) + "empty." NEXT ? diff --git a/harbour/contrib/hbct/tests/token2.prg b/harbour/contrib/hbct/tests/token2.prg index 69ded0b8f2..96a9bc68ed 100644 --- a/harbour/contrib/hbct/tests/token2.prg +++ b/harbour/contrib/hbct/tests/token2.prg @@ -64,7 +64,7 @@ PROCEDURE Main() LOCAL cStr1 := "A,BB,CCC,DDDD,EEEEE,FFFFFF" -// LOCAL cStr2 := "ZZZZZZ,YYYYY,XXXX,WWW,VV,U" + // LOCAL cStr2 := "ZZZZZZ,YYYYY,XXXX,WWW,VV,U" LOCAL cStr3 := "0123456789ABCDEFGHIJKLM" LOCAL cStr4 := "08:09:10:11:12" LOCAL cStr5 := "05:00+20:00+35:00+50:00" @@ -77,93 +77,93 @@ PROCEDURE Main() ? // Some simple tests with global token environment - ? [ Incremental tokenizing the string "] + cStr1 + ["] - ? [ tokeninit(@cStr1, ",", 1) == .T. ? ----> ] + ltoc( tokeninit(@cStr1, ",", 1 ) ) - ? [ tokennum() == 6 ? ---------------------> ] + Str( tokennum() ) - ? [ tokenend() ? -------------------------> ] + ltoc( tokenend() ) + ? ' Incremental tokenizing the string "' + cStr1 + '"' + ? ' tokeninit(@cStr1, ",", 1) == .T. ? ----> ' + ltoc( tokeninit( @cStr1, ",", 1 ) ) + ? ' tokennum() == 6 ? ---------------------> ' + Str( tokennum() ) + ? ' tokenend() ? -------------------------> ' + ltoc( tokenend() ) WHILE !tokenend() - ? [ tokennext(@cStr1) ------------------> "] + tokennext( @cStr1 ) + ["] - ? [ tokenend() ? -------------------------> ] + ltoc( tokenend() ) + ? ' tokennext(@cStr1) ------------------> "' + tokennext( @cStr1 ) + '"' + ? ' tokenend() ? -------------------------> ' + ltoc( tokenend() ) ENDDO ? - ? [ rewind with tokeninit() == .T. ? ------> ] + ltoc( tokeninit() ) - ? [ tokenend() ? -------------------------> ] + ltoc( tokenend() ) + ? ' rewind with tokeninit() == .T. ? ------> ' + ltoc( tokeninit() ) + ? ' tokenend() ? -------------------------> ' + ltoc( tokenend() ) WHILE !tokenend() - ? [ tokennext(@cStr1) ------------------> "] + tokennext( @cStr1 ) + ["] - ? [ tokenend() ? -------------------------> ] + ltoc( tokenend() ) + ? ' tokennext(@cStr1) ------------------> "' + tokennext( @cStr1 ) + '"' + ? ' tokenend() ? -------------------------> ' + ltoc( tokenend() ) ENDDO ? - ? [ access tokens directly with tokennext] - ? [ tokennext(@cStr1,2) == "BB" ? -------> "] + tokennext( @cStr1,2 ) + ["] - ? [ tokennext(@cStr1,4) == "DDDD" ? -----> "] + tokennext( @cStr1,4 ) + ["] + ? ' access tokens directly with tokennext' + ? ' tokennext(@cStr1,2) == "BB" ? -------> "' + tokennext( @cStr1, 2 ) + '"' + ? ' tokennext(@cStr1,4) == "DDDD" ? -----> "' + tokennext( @cStr1, 4 ) + '"' ? ? "...Press any key..." ? Inkey( 0 ) - ? [ Incremental tokenizing the string "] + cStr3 + [" with the] - ? [ token environment of cStr1 !] - ? [ rewind with tokeninit() == .T. ? ------> ] + ltoc( tokeninit() ) - ? [ tokenend() ? -------------------------> ] + ltoc( tokenend() ) + ? ' Incremental tokenizing the string "' + cStr3 + '" with the' + ? ' token environment of cStr1 !' + ? ' rewind with tokeninit() == .T. ? ------> ' + ltoc( tokeninit() ) + ? ' tokenend() ? -------------------------> ' + ltoc( tokenend() ) WHILE !tokenend() - ? [ tokennext(@cStr3) ------------------> "] + tokennext( @cStr3 ) + ["] - ? [ tokenend() ? -------------------------> ] + ltoc( tokenend() ) + ? ' tokennext(@cStr3) ------------------> "' + tokennext( @cStr3 ) + '"' + ? ' tokenend() ? -------------------------> ' + ltoc( tokenend() ) ENDDO ? - ? [ rewind with tokeninit() == .T. ? ------> ] + ltoc( tokeninit() ) - ? [ tokenend() ? -------------------------> ] + ltoc( tokenend() ) + ? ' rewind with tokeninit() == .T. ? ------> ' + ltoc( tokeninit() ) + ? ' tokenend() ? -------------------------> ' + ltoc( tokenend() ) WHILE( !tokenend() ) - ? [ start & end with tokenat(.F./.T.)-----> ] + Str( tokenat() ) + [ ] + Str( tokenat( .T. ) ) + ? ' start & end with tokenat(.F./.T.)-----> ' + Str( tokenat() ) + ' ' + Str( tokenat( .T. ) ) tokennext( @cStr1 ) - ? [ tokenend() ? -------------------------> ] + ltoc( tokenend() ) + ? ' tokenend() ? -------------------------> ' + ltoc( tokenend() ) ENDDO ? - ? [ access tokens directly with tokenat] - ? [ tokenat( .F., 2 ) == 3 ? ---------------> ] + Str( tokenat( .F., 2 ) ) - ? [ tokenat( .T., 4 ) == 14 ? --------------> ] + Str( tokenat( .T., 4 ) ) + ? ' access tokens directly with tokenat' + ? ' tokenat( .F., 2 ) == 3 ? ---------------> ' + Str( tokenat( .F., 2 ) ) + ? ' tokenat( .T., 4 ) == 14 ? --------------> ' + Str( tokenat( .T., 4 ) ) ? ? "...Press any key..." ? Inkey( 0 ) - ? [ Save global token environment with savetoken] + ? ' Save global token environment with savetoken' cTE1 := savetoken() - ? [ tokeninit a different string, cStr4 := "] + cStr4 + [", with tokeninit()] - ? [ tokeninit( @cStr4, ":", 1 ) == .T. ? ----> ] + ltoc( tokeninit( @cStr4, ":", 1 ) ) - ? [ tokennum() == 5 ? ---------------------> ] + Str( tokennum() ) - ? [ tokennext() == "08" ? ------------------> "] + tokennext( @cStr4 ) + ["] - ? [ Now restore global token environment with resttoken and rewind it] + ? ' tokeninit a different string, cStr4 := "' + cStr4 + '", with tokeninit()' + ? ' tokeninit( @cStr4, ":", 1 ) == .T. ? ----> ' + ltoc( tokeninit( @cStr4, ":", 1 ) ) + ? ' tokennum() == 5 ? ---------------------> ' + Str( tokennum() ) + ? ' tokennext() == "08" ? ------------------> "' + tokennext( @cStr4 ) + '"' + ? ' Now restore global token environment with resttoken and rewind it' resttoken( cTE1 ) tokeninit() - ? [ tokennum() == 6 ? ----------------------> ] + Str( tokennum() ) - ? [ tokenend() ? -------------------------> ] + ltoc( tokenend() ) + ? ' tokennum() == 6 ? ----------------------> ' + Str( tokennum() ) + ? ' tokenend() ? -------------------------> ' + ltoc( tokenend() ) WHILE !tokenend() - ? [ tokennext( @cStr1 ) -----------------> "] + tokennext( @cStr1 ) + ["] - ? [ tokenend() ? -------------------------> ] + ltoc( tokenend() ) + ? ' tokennext( @cStr1 ) -----------------> "' + tokennext( @cStr1 ) + '"' + ? ' tokenend() ? -------------------------> ' + ltoc( tokenend() ) ENDDO - ? [ Release global TE with tokenexit() ----> ] + ltoc( tokenexit() ) + ? ' Release global TE with tokenexit() ----> ' + ltoc( tokenexit() ) ? ? "...Press any key..." ? Inkey( 0 ) - ? [ Now tokenize cStr4 := "] + cStr4 + [" and] - ? [ cStr5 := "] + cStr5 + ["] - ? [ and store the token environment locally to cTE1 and cTE2:] - ? [ tokeninit( @cStr4, ":", 1, @cTE1 ) == .T. ? -> ] + ltoc( tokeninit( @cStr4, ":", 1, @cTE1 ) ) - ? [ tokeninit( @cStr5, "+", 1, @cTE2 ) == .T. ? -> ] + ltoc( tokeninit( @cStr5, "+", 1, @cTE2 ) ) - ? [ tokennum( @cTE1 ) == 5 ? --------------------> ] + Str( tokennum( @cTE1 ) ) - ? [ tokennum( @cTE2 ) == 4 ? --------------------> ] + Str( tokennum( @cTE2 ) ) - ? [ tokenend( @cTE1 ) ? ---------------------> ] + ltoc( tokenend( @cTE1 ) ) - ? [ tokenend( @cTE2 ) ? ---------------------> ] + ltoc( tokenend( @cTE2 ) ) + ? ' Now tokenize cStr4 := "' + cStr4 + '" and' + ? ' cStr5 := "' + cStr5 + '"' + ? ' and store the token environment locally to cTE1 and cTE2:' + ? ' tokeninit( @cStr4, ":", 1, @cTE1 ) == .T. ? -> ' + ltoc( tokeninit( @cStr4, ":", 1, @cTE1 ) ) + ? ' tokeninit( @cStr5, "+", 1, @cTE2 ) == .T. ? -> ' + ltoc( tokeninit( @cStr5, "+", 1, @cTE2 ) ) + ? ' tokennum( @cTE1 ) == 5 ? --------------------> ' + Str( tokennum( @cTE1 ) ) + ? ' tokennum( @cTE2 ) == 4 ? --------------------> ' + Str( tokennum( @cTE2 ) ) + ? ' tokenend( @cTE1 ) ? ---------------------> ' + ltoc( tokenend( @cTE1 ) ) + ? ' tokenend( @cTE2 ) ? ---------------------> ' + ltoc( tokenend( @cTE2 ) ) WHILE !tokenend( @cTE1 ) .AND. !tokenend( @cTE2 ) - ? [ next train at ] + tokennext( cStr4,, @cTE1 ) + ":" + tokennext( cStr5,, @cTE2 ) - ? [ compiled with tokennext( cStr4,, @cTE1 ) + ":" + tokennext( cStr5,, @cTE2 )] - ? [ tokenend( @cTE1 ) ? ---------------------> ] + ltoc( tokenend( @cTE1 ) ) - ? [ tokenend( @cTE2 ) ? ---------------------> ] + ltoc( tokenend( @cTE2 ) ) + ? ' next train at ' + tokennext( cStr4,, @cTE1 ) + ":" + tokennext( cStr5,, @cTE2 ) + ? ' compiled with tokennext( cStr4,, @cTE1 ) + ":" + tokennext( cStr5,, @cTE2 )' + ? ' tokenend( @cTE1 ) ? ---------------------> ' + ltoc( tokenend( @cTE1 ) ) + ? ' tokenend( @cTE2 ) ? ---------------------> ' + ltoc( tokenend( @cTE2 ) ) ENDDO ? diff --git a/harbour/contrib/hbct/tests/tokenlow.prg b/harbour/contrib/hbct/tests/tokenlow.prg index c9fca97898..44aa10854d 100644 --- a/harbour/contrib/hbct/tests/tokenlow.prg +++ b/harbour/contrib/hbct/tests/tokenlow.prg @@ -63,22 +63,22 @@ PROCEDURE Main() // Some simple tests ? " Simple tests:" - ? [ tokenlower("Hello, World, here I am!") == "hello, world, here i am!" ?] - ? [ -> "] + tokenlower( "Hello, World, here I am!" ) + ["] - ? [ tokenlower("Hello, World, here I am!",,3) == "hello, world, here I am!" ?] - ? [ -> "] + tokenlower( "Hello, World, here I am!",, 3 ) + ["] - ? [ tokenlower("Hello, World, here I am!",",",3) == "hello, World, here I am!" ?] - ? [ -> "] + tokenlower( "Hello, World, here I am!", ",", 3 ) + ["] - ? [ tokenlower("Hello, World, here I am!"," W") == "hello, World, here i am!" ?] - ? [ -> "] + tokenlower( "Hello, World, here I am!", " W" ) + ["] + ? ' tokenlower("Hello, World, here I am!") == "hello, world, here i am!" ?' + ? ' -> "' + tokenlower( "Hello, World, here I am!" ) + '"' + ? ' tokenlower("Hello, World, here I am!",,3) == "hello, world, here I am!" ?' + ? ' -> "' + tokenlower( "Hello, World, here I am!",, 3 ) + '"' + ? ' tokenlower("Hello, World, here I am!",",",3) == "hello, World, here I am!" ?' + ? ' -> "' + tokenlower( "Hello, World, here I am!", ",", 3 ) + '"' + ? ' tokenlower("Hello, World, here I am!"," W") == "hello, World, here i am!" ?' + ? ' -> "' + tokenlower( "Hello, World, here I am!", " W" ) + '"' ? - ? [ Lowercase the tokens in the string "] + cStr + ["] - ? [ with csetref(.T.) and "@"] + ? ' Lowercase the tokens in the string "' + cStr + '"' + ? ' with csetref(.T.) and "@"' csetref( .T. ) ? - ? [ --> return value of tokenlower(@cStr): ], tokenlower( @cStr ) - ? [ --> cStr is now: "] + cStr + ["] + ? ' --> return value of tokenlower(@cStr): ', tokenlower( @cStr ) + ? ' --> cStr is now: "' + cStr + '"' ? ? "End test of TOKENLOWER()" diff --git a/harbour/contrib/hbct/tests/tokensep.prg b/harbour/contrib/hbct/tests/tokensep.prg index 6b621e6b9e..fb5cc27c28 100644 --- a/harbour/contrib/hbct/tests/tokensep.prg +++ b/harbour/contrib/hbct/tests/tokensep.prg @@ -53,7 +53,7 @@ */ #ifndef __HARBOUR__ - #define hb_ntos( n ) LTrim( Str( n ) ) +#define hb_ntos( n ) LTrim( Str( n ) ) #endif PROCEDURE Main() @@ -67,21 +67,21 @@ PROCEDURE Main() ? // Some simple tests - ? [ Tokenizing the string "] + cStr + ["] - ? [ with skip width == 1 and ".,!" as tokenizer list:] + ? ' Tokenizing the string "' + cStr + '"' + ? ' with skip width == 1 and ".,!" as tokenizer list:' ? FOR ni := 1 TO numtoken( cStr, ".,!", 1 ) - ? [ Token #] + hb_ntos( ni ) + [("] + token( cStr, ".,!", ni, 1 ) + ; - [") is tokenized by "] + tokensep( .F. ) + [" and "] + tokensep( .T. ) + ["] + ? ' Token #' + hb_ntos( ni ) + '("' + token( cStr, ".,!", ni, 1 ) + ; + '") is tokenized by "' + tokensep( .F. ) + '" and "' + tokensep( .T. ) + '"' NEXT ? - ? [ Tokenizing the string "] + cStr + ["] - ? [ with skip width == 3 and ".,!" as tokenizer list:] + ? ' Tokenizing the string "' + cStr + '"' + ? ' with skip width == 3 and ".,!" as tokenizer list:' ? FOR ni := 1 TO numtoken( cStr, ".,!", 3 ) - ? [ Token #] + hb_ntos( ni ) + [("] + token( cStr, ".,!", ni, 3 ) + ; - [") is tokenized by "] + tokensep( .F. ) + [" and "] + tokensep( .T. ) + ["] + ? ' Token #' + hb_ntos( ni ) + '("' + token( cStr, ".,!", ni, 3 ) + ; + '") is tokenized by "' + tokensep( .F. ) + '" and "' + tokensep( .T. ) + '"' NEXT ? diff --git a/harbour/contrib/hbct/tests/tokenupp.prg b/harbour/contrib/hbct/tests/tokenupp.prg index 472cd476a9..e8474a7244 100644 --- a/harbour/contrib/hbct/tests/tokenupp.prg +++ b/harbour/contrib/hbct/tests/tokenupp.prg @@ -63,22 +63,22 @@ PROCEDURE Main() // Some simple tests ? " Simple tests:" - ? [ tokenupper("Hello, world, here I am!") == "Hello, World, Here I Am!" ?] - ? [ -> "] + tokenupper( "Hello, world, here I am!" ) + ["] - ? [ tokenupper("Hello, world, here I am!",,3) == "Hello, World, Here I am!" ?] - ? [ -> "] + tokenupper( "Hello, world, here I am!",, 3 ) + ["] - ? [ tokenupper("Hello, world, here I am!",",",3) == "Hello, world, here I am!" ?] - ? [ -> "] + tokenupper( "Hello, world, here I am!", ",", 3 ) + ["] - ? [ tokenupper("Hello, world, here I am!"," w") == "Hello, wOrld, Here I Am!" ?] - ? [ -> "] + tokenupper( "Hello, world, here I am!", " w" ) + ["] + ? ' tokenupper("Hello, world, here I am!") == "Hello, World, Here I Am!" ?' + ? ' -> "' + tokenupper( "Hello, world, here I am!" ) + '"' + ? ' tokenupper("Hello, world, here I am!",,3) == "Hello, World, Here I am!" ?' + ? ' -> "' + tokenupper( "Hello, world, here I am!",, 3 ) + '"' + ? ' tokenupper("Hello, world, here I am!",",",3) == "Hello, world, here I am!" ?' + ? ' -> "' + tokenupper( "Hello, world, here I am!", ",", 3 ) + '"' + ? ' tokenupper("Hello, world, here I am!"," w") == "Hello, wOrld, Here I Am!" ?' + ? ' -> "' + tokenupper( "Hello, world, here I am!", " w" ) + '"' ? - ? [ Uppercase the tokens in the string "] + cStr + ["] - ? [ with csetref(.T.) and "@"] + ? ' Uppercase the tokens in the string "' + cStr + '"' + ? ' with csetref(.T.) and "@"' csetref( .T. ) ? - ? [ --> return value of tokenupper(@cStr): ], tokenupper( @cStr ) - ? [ --> cStr is now: "] + cStr + ["] + ? ' --> return value of tokenupper(@cStr): ', tokenupper( @cStr ) + ? ' --> cStr is now: "' + cStr + '"' ? ? "End test of TOKENUPPER()" diff --git a/harbour/contrib/hbct/tests/valpos.prg b/harbour/contrib/hbct/tests/valpos.prg index cdf4f7302f..eda32d5dff 100644 --- a/harbour/contrib/hbct/tests/valpos.prg +++ b/harbour/contrib/hbct/tests/valpos.prg @@ -59,10 +59,10 @@ PROCEDURE Main() ? "Begin test of VALPOS()" ? - ? [ valpos("1234x56789") == 9 ? --> ] + Str( valpos("1234x56789" ) ) - ? [ valpos("1234x56789",1) == 1 ? --> ] + Str( valpos("1234x56789",1 ) ) - ? [ valpos("1234x56789",11) == 0 ? --> ] + Str( valpos("1234x56789",11 ) ) - ? [ valpos("1234x56789",5) == 0 ? --> ] + Str( valpos("1234x56789",5 ) ) + ? ' valpos("1234x56789") == 9 ? --> ' + Str( valpos( "1234x56789" ) ) + ? ' valpos("1234x56789",1) == 1 ? --> ' + Str( valpos( "1234x56789", 1 ) ) + ? ' valpos("1234x56789",11) == 0 ? --> ' + Str( valpos( "1234x56789", 11 ) ) + ? ' valpos("1234x56789",5) == 0 ? --> ' + Str( valpos( "1234x56789", 5 ) ) ? ? "End test of VALPOS()" diff --git a/harbour/contrib/hbct/tests/wordone.prg b/harbour/contrib/hbct/tests/wordone.prg index a885b569be..1ab8a8184a 100644 --- a/harbour/contrib/hbct/tests/wordone.prg +++ b/harbour/contrib/hbct/tests/wordone.prg @@ -61,9 +61,9 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ wordone("12ABAB12") == "12AB12" ? --> "] + wordone( "12ABAB12" ) + ["] - ? [ wordone("1AAAA2") == "1AAAA2" ? --> "] + wordone( "1AAAA2" ) + ["] - ? [ wordone("12", "1212ABAB") == "12ABAB" ? --> "] + wordone( "12", "1212ABAB" ) + ["] + ? ' wordone("12ABAB12") == "12AB12" ? --> "' + wordone( "12ABAB12" ) + '"' + ? ' wordone("1AAAA2") == "1AAAA2" ? --> "' + wordone( "1AAAA2" ) + '"' + ? ' wordone("12", "1212ABAB") == "12ABAB" ? --> "' + wordone( "12", "1212ABAB" ) + '"' ? ? "End test of WORDONE()" diff --git a/harbour/contrib/hbct/tests/wordonly.prg b/harbour/contrib/hbct/tests/wordonly.prg index 897f43877b..52ea501c8d 100644 --- a/harbour/contrib/hbct/tests/wordonly.prg +++ b/harbour/contrib/hbct/tests/wordonly.prg @@ -61,8 +61,8 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ wordonly("AABBCCDD", "XXAAYYBBZZ") == "AABB" ? --> "] + wordonly( "AABBCCDD", "XXAAYYBBZZ" ) + ["] - ? [ wordonly("AABBCCDD", "XAAYYYBBZZ") == "BB" ? ----> "] + wordonly( "AABBCCDD", "XAAYYYBBZZ" ) + ["] + ? ' wordonly("AABBCCDD", "XXAAYYBBZZ") == "AABB" ? --> "' + wordonly( "AABBCCDD", "XXAAYYBBZZ" ) + '"' + ? ' wordonly("AABBCCDD", "XAAYYYBBZZ") == "BB" ? ----> "' + wordonly( "AABBCCDD", "XAAYYYBBZZ" ) + '"' ? ? "End test of WORDONLY()" diff --git a/harbour/contrib/hbct/tests/wordrem.prg b/harbour/contrib/hbct/tests/wordrem.prg index c775b49fe3..3b88e5e918 100644 --- a/harbour/contrib/hbct/tests/wordrem.prg +++ b/harbour/contrib/hbct/tests/wordrem.prg @@ -61,8 +61,8 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ wordrem("abcd", "0ab1cd") == "0ab1" ? ----> "] + wordrem( "abcd", "0ab1cd" ) + ["] - ? [ wordrem("abcd", "ab0cd1") == "0cd1" ? ----> "] + wordrem( "abcd", "ab0cd1" ) + ["] + ? ' wordrem("abcd", "0ab1cd") == "0ab1" ? ----> "' + wordrem( "abcd", "0ab1cd" ) + '"' + ? ' wordrem("abcd", "ab0cd1") == "0cd1" ? ----> "' + wordrem( "abcd", "ab0cd1" ) + '"' ? ? "End test of WORDREM()" diff --git a/harbour/contrib/hbct/tests/wordrepl.prg b/harbour/contrib/hbct/tests/wordrepl.prg index b2a97c84b8..5d0e886988 100644 --- a/harbour/contrib/hbct/tests/wordrepl.prg +++ b/harbour/contrib/hbct/tests/wordrepl.prg @@ -61,15 +61,15 @@ PROCEDURE Main() // simple tests ? " Simple tests:" - ? [ wordrepl("CC", "AABBCCDDEE", "XX") == "AABBXXDDEE"? --> "] + wordrepl( "CC", "AABBCCDDEE", "XX" ) + ["] - ? [ wordrepl("aa", "1aaaa", "ba") == "1abaa" ? ------> "] + wordrepl( "aa", "1aaaa", "ba" ) + ["] - ? [ wordrepl("aa", "1aaaa", "ba", .T.) == "1baba" ? ------> "] + wordrepl( "aa", "1aaaa", "ba", .T. ) + ["] + ? ' wordrepl("CC", "AABBCCDDEE", "XX") == "AABBXXDDEE"? --> "' + wordrepl( "CC", "AABBCCDDEE", "XX" ) + '"' + ? ' wordrepl("aa", "1aaaa", "ba") == "1abaa" ? ------> "' + wordrepl( "aa", "1aaaa", "ba" ) + '"' + ? ' wordrepl("aa", "1aaaa", "ba", .T.) == "1baba" ? ------> "' + wordrepl( "aa", "1aaaa", "ba", .T. ) + '"' ? ? " Testing CSETATMUPA(.T.) with lMode==.T.:" csetatmupa( .T. ) - ? [ wordrepl("aa", "1aaaa", "ba") == "1abaa" ? --> "] + wordrepl( "aa", "1aaaa", "ba" ) + ["] - ? [ wordrepl("aa", "1aaaa", "ba", .T.) == "1bbba" ? --> "] + wordrepl( "aa", "1aaaa", "ba", .T. ) + ["] + ? ' wordrepl("aa", "1aaaa", "ba") == "1abaa" ? --> "' + wordrepl( "aa", "1aaaa", "ba" ) + '"' + ? ' wordrepl("aa", "1aaaa", "ba", .T.) == "1bbba" ? --> "' + wordrepl( "aa", "1aaaa", "ba", .T. ) + '"' ? ? "End test of WORDREPL()" diff --git a/harbour/contrib/hbct/tests/wordswap.prg b/harbour/contrib/hbct/tests/wordswap.prg index 5df57d90c6..10a98b19e8 100644 --- a/harbour/contrib/hbct/tests/wordswap.prg +++ b/harbour/contrib/hbct/tests/wordswap.prg @@ -61,8 +61,8 @@ PROCEDURE Main() // simple tests ? "Simple tests:" - ? [ wordswap("1234567890") == "3412785690" ? --> "] + wordswap( "1234567890" ) + ["] - ? [ wordswap("1234567890", .T.) == "4321876590" ? --> "] + wordswap( "1234567890", .T. ) + ["] + ? ' wordswap("1234567890") == "3412785690" ? --> "' + wordswap( "1234567890" ) + '"' + ? ' wordswap("1234567890", .T.) == "4321876590" ? --> "' + wordswap( "1234567890", .T. ) + '"' ? ? "End test of WORDSWAP()" diff --git a/harbour/contrib/hbcups/tests/test.prg b/harbour/contrib/hbcups/tests/test.prg index 0c74807a26..3ab6d4af10 100644 --- a/harbour/contrib/hbcups/tests/test.prg +++ b/harbour/contrib/hbcups/tests/test.prg @@ -5,6 +5,7 @@ #require "hbcups" PROCEDURE Main() + LOCAL i LOCAL aPrinter @@ -27,11 +28,15 @@ PROCEDURE Main() aPrinter := cupsGetDests() i := AChoice( 2, 5, 30, Len( aPrinter ) + 2, aPrinter ) ? "Printing... Job ID:", cupsPrintFile( aPrinter[ i ], __FILE__, "Harbour CUPS Printing" ) -/* for duplex printing, tested on OKI B410 */ -/* ? "Printing... Job ID:", cupsPrintFile( aPrinter[ i ], ".." + hb_ps() + "core.c", "Harbour CUPS Printing", { "sides=two-sided-short-edge" } ) */ +#if 0 + /* for duplex printing, tested on OKI B410 */ + ? "Printing... Job ID:", cupsPrintFile( aPrinter[ i ], ".." + hb_ps() + "core.c", "Harbour CUPS Printing", { "sides=two-sided-short-edge" } ) +#endif ELSE ? "Printing... Job ID:", cupsPrintFile( cupsGetDefault(), __FILE__, "Harbour CUPS Printing", { "sides=one-sided" } ) -/* ? "Printing... Job ID:", cupsPrintFile( cupsGetDefault(), __FILE__, "Harbour CUPS Printing", { "sides" => "one-sided" } ) */ +#if 0 + ? "Printing... Job ID:", cupsPrintFile( cupsGetDefault(), __FILE__, "Harbour CUPS Printing", { "sides" => "one-sided" } ) +#endif ENDIF RETURN diff --git a/harbour/contrib/hbcurl/tests/ftp_uldl.prg b/harbour/contrib/hbcurl/tests/ftp_uldl.prg index 11c76a7927..4fa4c4908c 100644 --- a/harbour/contrib/hbcurl/tests/ftp_uldl.prg +++ b/harbour/contrib/hbcurl/tests/ftp_uldl.prg @@ -15,6 +15,7 @@ #define REMOTE_URL_MEM "ftp://harbour:power@localhost/from_mem.txt" PROCEDURE Main( cDL, cUL ) + LOCAL curl LOCAL info LOCAL tmp @@ -59,7 +60,10 @@ PROCEDURE Main( cDL, cUL ) ? curl_easy_setopt( curl, HB_CURLOPT_URL, REMOTE_URL ) ? curl_easy_setopt( curl, HB_CURLOPT_UL_FILE_SETUP, cUL ) ? curl_easy_setopt( curl, HB_CURLOPT_INFILESIZE, hb_FSize( cUL ) ), hb_FSize( cUL ) -// ? curl_easy_setopt( curl, HB_CURLOPT_USERPWD, "harbour:power" ) /* May use this instead of embedding in URL */ +#if 0 + /* May use this instead of embedding in URL */ + ? curl_easy_setopt( curl, HB_CURLOPT_USERPWD, "harbour:power" ) +#endif ? curl_easy_setopt( curl, HB_CURLOPT_PROGRESSBLOCK, {| nPos, nLen | a := CurGet(), hb_DispOutAt( 10, 10, Str( ( nPos / nLen ) * 100, 6, 2 ) + "%" ), CurSet( a ) } ) ? curl_easy_setopt( curl, HB_CURLOPT_NOPROGRESS, .F. ) ? curl_easy_setopt( curl, HB_CURLOPT_POSTQUOTE, { "RNFR " + UPLOAD_FILE_AS, "RNTO " + RENAME_FILE_TO } ) @@ -86,7 +90,10 @@ PROCEDURE Main( cDL, cUL ) ? curl_easy_setopt( curl, HB_CURLOPT_UPLOAD ) ? curl_easy_setopt( curl, HB_CURLOPT_UL_NULL_SETUP ) ? curl_easy_setopt( curl, HB_CURLOPT_URL, REMOTE_URL_DEL ) -// ? curl_easy_setopt( curl, HB_CURLOPT_USERPWD, "harbour:power" ) /* May use this instead of embedding in URL */ +#if 0 + /* May use this instead of embedding in URL */ + ? curl_easy_setopt( curl, HB_CURLOPT_USERPWD, "harbour:power" ) +#endif ? curl_easy_setopt( curl, HB_CURLOPT_NOPROGRESS ) ? curl_easy_setopt( curl, HB_CURLOPT_POSTQUOTE, { "DELE " + RENAME_FILE_TO } ) ? curl_easy_setopt( curl, HB_CURLOPT_VERBOSE, lVerbose ) @@ -106,7 +113,10 @@ PROCEDURE Main( cDL, cUL ) ? curl_easy_setopt( curl, HB_CURLOPT_URL, REMOTE_URL_MEM ) ? curl_easy_setopt( curl, HB_CURLOPT_UL_BUFF_SETUP, tmp ) ? curl_easy_setopt( curl, HB_CURLOPT_INFILESIZE, Len( tmp ) ), Len( tmp ) -// ? curl_easy_setopt( curl, HB_CURLOPT_USERPWD, "harbour:power" ) /* May use this instead of embedding in URL */ +#if 0 + /* May use this instead of embedding in URL */ + ? curl_easy_setopt( curl, HB_CURLOPT_USERPWD, "harbour:power" ) +#endif ? curl_easy_setopt( curl, HB_CURLOPT_PROGRESSBLOCK, {| nPos, nLen | a := CurGet(), hb_DispOutAt( 10, 10, Str( ( nPos / nLen ) * 100, 6, 2 ) + "%" ), CurSet( a ) } ) ? curl_easy_setopt( curl, HB_CURLOPT_NOPROGRESS, .F. ) ? curl_easy_setopt( curl, HB_CURLOPT_VERBOSE, lVerbose ) @@ -201,5 +211,7 @@ STATIC FUNCTION CurGet() RETURN { Row(), Col() } STATIC PROCEDURE CurSet( a ) + SetPos( a[ 1 ], a[ 2 ] ) + RETURN diff --git a/harbour/contrib/hbexpat/tests/test.prg b/harbour/contrib/hbexpat/tests/test.prg index 7b3f82c3d3..441b9201d6 100644 --- a/harbour/contrib/hbexpat/tests/test.prg +++ b/harbour/contrib/hbexpat/tests/test.prg @@ -15,6 +15,7 @@ #include "hbexpat.ch" PROCEDURE Main( cFileName ) + LOCAL p := XML_ParserCreate() LOCAL xData LOCAL v1, v2, v3 @@ -41,20 +42,21 @@ PROCEDURE Main( cFileName ) OutStd( XML_GetUserData( p ), hb_eol() ) XML_SetUserData( p, xData ) OutStd( ValType( XML_GetUserData( p ) ), hb_eol() ) - XML_SetElementHandler( p, {| x, e, a | start( x, e, a ) }, {| x, e | end( x, e ) } ) - XML_SetCharacterDataHandler( p, {| x, d | data( x, d ) } ) + XML_SetElementHandler( p, {| x, e, a | cb_start( x, e, a ) }, {| x, e | cb_end( x, e ) } ) + XML_SetCharacterDataHandler( p, {| x, d | cb_data( x, d ) } ) IF XML_Parse( p, MemoRead( cFileName ), .T. ) == HB_XML_STATUS_ERROR - OutErr( hb_StrFormat( e"Parse error at line %s:\n%s\n",; - hb_ntos( XML_GetCurrentLineNumber( p ) ),; - XML_ErrorString( XML_GetErrorCode( p ) ) ) ) + OutErr( hb_StrFormat( e"Parse error at line %s:\n%s\n", ; + hb_ntos( XML_GetCurrentLineNumber( p ) ), ; + XML_ErrorString( XML_GetErrorCode( p ) ) ) ) ErrorLevel( -1 ) RETURN ENDIF RETURN -PROCEDURE start( xData, cElement, aAttr ) +STATIC PROCEDURE cb_start( xData, cElement, aAttr ) + LOCAL aItem OutStd( Replicate( " ", xData[ 1 ] ), cElement ) @@ -71,7 +73,7 @@ PROCEDURE start( xData, cElement, aAttr ) RETURN -PROCEDURE end( xData, cElement ) +STATIC PROCEDURE cb_end( xData, cElement ) HB_SYMBOL_UNUSED( xData ) HB_SYMBOL_UNUSED( cElement ) @@ -80,7 +82,7 @@ PROCEDURE end( xData, cElement ) RETURN -PROCEDURE data( xData, cData ) +STATIC PROCEDURE cb_data( xData, cData ) HB_SYMBOL_UNUSED( xData ) diff --git a/harbour/contrib/hbexpat/tests/tohash.prg b/harbour/contrib/hbexpat/tests/tohash.prg index a071e4359e..9df271d739 100644 --- a/harbour/contrib/hbexpat/tests/tohash.prg +++ b/harbour/contrib/hbexpat/tests/tohash.prg @@ -29,6 +29,7 @@ REQUEST HB_CODEPAGE_UTF8 REQUEST HB_CODEPAGE_UTF8EX PROCEDURE Main( cFileName ) + LOCAL p := XML_ParserCreate() LOCAL aUserData LOCAL aNode @@ -73,9 +74,9 @@ PROCEDURE Main( cFileName ) XML_SetUnknownEncodingHandler( p, {| x, e, i | cb_unknownencoding( x, e, i ) } ) IF XML_Parse( p, MemoRead( cFileName ), .T. ) == HB_XML_STATUS_ERROR - OutErr( hb_StrFormat( e"Parse error at line %s:\n%s\n",; - hb_ntos( XML_GetCurrentLineNumber( p ) ),; - XML_ErrorString( XML_GetErrorCode( p ) ) ) ) + OutErr( hb_StrFormat( e"Parse error at line %s:\n%s\n", ; + hb_ntos( XML_GetCurrentLineNumber( p ) ), ; + XML_ErrorString( XML_GetErrorCode( p ) ) ) ) ErrorLevel( -1 ) RETURN ENDIF @@ -84,7 +85,8 @@ PROCEDURE Main( cFileName ) RETURN -PROCEDURE DUMP( hTree, n ) +STATIC PROCEDURE DUMP( hTree, n ) + LOCAL aEl LOCAL aNode @@ -97,8 +99,10 @@ PROCEDURE DUMP( hTree, n ) RETURN -FUNCTION DUMPATTR( hAttr ) +STATIC FUNCTION DUMPATTR( hAttr ) + LOCAL s := "", cValue + IF ! Empty( hAttr ) s += " (" FOR EACH cValue IN hAttr @@ -106,9 +110,11 @@ FUNCTION DUMPATTR( hAttr ) NEXT s := RTrim( s ) + ")" ENDIF + RETURN s -FUNCTION cb_unknownencoding( xEData, cEncoding, aMap ) +STATIC FUNCTION cb_unknownencoding( xEData, cEncoding, aMap ) + LOCAL aMyMap HB_SYMBOL_UNUSED( xEData ) @@ -121,7 +127,8 @@ FUNCTION cb_unknownencoding( xEData, cEncoding, aMap ) RETURN HB_XML_STATUS_ERROR -PROCEDURE cb_start( aUserData, cElement, aAttrList ) +STATIC PROCEDURE cb_start( aUserData, cElement, aAttrList ) + LOCAL aAttr LOCAL aNode LOCAL aNewNode @@ -150,13 +157,13 @@ PROCEDURE cb_start( aUserData, cElement, aAttrList ) RETURN -PROCEDURE cb_end( aUserData ) +STATIC PROCEDURE cb_end( aUserData ) aUserData[ _D_aNode ] := aUserData[ _D_aNode ][ _N_aParent ] RETURN -PROCEDURE cb_data( aUserData, cData ) +STATIC PROCEDURE cb_data( aUserData, cData ) aUserData[ _D_aNode ][ _N_xValue ] += cData diff --git a/harbour/contrib/hbexpat/unitable.prg b/harbour/contrib/hbexpat/unitable.prg index e7e5779662..1055bf6de6 100644 --- a/harbour/contrib/hbexpat/unitable.prg +++ b/harbour/contrib/hbexpat/unitable.prg @@ -55,6 +55,7 @@ #define _UNI_NAME_NORM( s ) StrTran( StrTran( StrTran( s, "-" ), "." ), " " ) FUNCTION hb_xml_get_unicode_table( cCP ) + THREAD STATIC t_uni := NIL LOCAL cdp diff --git a/harbour/contrib/hbfbird/tests/simple.prg b/harbour/contrib/hbfbird/tests/simple.prg index 79ddcb2899..036fe0a1e7 100644 --- a/harbour/contrib/hbfbird/tests/simple.prg +++ b/harbour/contrib/hbfbird/tests/simple.prg @@ -7,6 +7,7 @@ #include "simpleio.ch" PROCEDURE Main() + LOCAL oServer, oQuery, oRow, i, x, aTables, aStruct, aKey LOCAL cServer := "localhost:" @@ -49,12 +50,12 @@ PROCEDURE Main() ? "Using implicit transaction..." IF oServer:TableExists( "TEST" ) - oServer:Execute( "DROP TABLE Test" ) - oServer:Execute( "DROP DOMAIN boolean_field" ) + oServer:Execute( "DROP TABLE Test" ) + oServer:Execute( "DROP DOMAIN boolean_field" ) ENDIF ? "Creating domain for boolean fields..." - oServer:Execute("create domain boolean_field as smallint default 0 not null check (value in (0,1))") + oServer:Execute( "create domain boolean_field as smallint default 0 not null check (value in (0,1))" ) oServer:StartTransaction() ? "Creating test table..." @@ -70,15 +71,15 @@ PROCEDURE Main() cQuery += " Creation Date, " cQuery += " Description blob sub_type 1 segment size 40 ) " - oServer:Execute(cQuery) + oServer:Execute( cQuery ) - IF oServer:neterr() + IF oServer:NetErr() ? oServer:Error() ENDIF oServer:Commit() - oServer:Query("SELECT code, dept, name, sales, salary, creation FROM test") + oServer:Query( "SELECT code, dept, name, sales, salary, creation FROM test" ) WAIT @@ -97,18 +98,18 @@ PROCEDURE Main() FOR i := 1 TO 100 cQuery := "INSERT INTO test(code, dept, name, sales, tax, salary, budget, Discount, Creation, Description) " - cQuery += 'VALUES( ' + str(i) + ', 2, "TEST", 1, 5, 3000, 1500.2, 7.5, "12-22-2003", "Short Description about what ? ")' + cQuery += 'VALUES( ' + Str( i ) + ', 2, "TEST", 1, 5, 3000, 1500.2, 7.5, "12-22-2003", "Short Description about what ? ")' - oServer:Execute(cQuery) + oServer:Execute( cQuery ) - IF oServer:neterr() + IF oServer:NetErr() ? oServer:error() ENDIF NEXT oServer:Commit() - oQuery := oServer:Query("SELECT code, name, description, sales FROM test") + oQuery := oServer:Query( "SELECT code, name, description, sales FROM test" ) aStruct := oQuery:Struct() @@ -118,23 +119,24 @@ PROCEDURE Main() aKey := oQuery:GetKeyField() - ? "Fields: ", oQuery:Fcount(), "Primary Key: ", aKey[ 1 ] + ? "Fields: ", oQuery:FCount(), "Primary Key: ", aKey[ 1 ] oRow := oQuery:Blank() - ? oRow:FCount(),; - oRow:Fieldpos( "code" ),; - oRow:Fieldget( 1 ),; - oRow:Fieldname( 1 ),; - oRow:Fieldtype( 1 ),; - oRow:Fielddec( 1 ),; - oRow:Fieldlen( 1 ),; - Len( oRow:Getkeyfield() ) + ? ; + oRow:FCount(), ; + oRow:FieldPos( "code" ), ; + oRow:FieldGet( 1 ), ; + oRow:FieldName( 1 ), ; + oRow:FieldType( 1 ), ; + oRow:FieldDec( 1 ), ; + oRow:FieldLen( 1 ), ; + Len( oRow:Getkeyfield() ) - oRow:Fieldput( 1, 150 ) - oRow:Fieldput( 2, "MY TEST" ) + oRow:FieldPut( 1, 150 ) + oRow:FieldPut( 2, "MY TEST" ) - ? oRow:Fieldget( 1 ), oRow:Fieldget( 2 ) + ? oRow:FieldGet( 1 ), oRow:FieldGet( 2 ) ? oServer:Append( oRow ) @@ -144,23 +146,24 @@ PROCEDURE Main() DO WHILE ! oQuery:Eof() oQuery:Skip() - ? oQuery:Fieldget( oQuery:Fieldpos( "code" ) ),; - oQuery:Fieldget( 4 ),; - oQuery:Fieldget( 2 ),; - oQuery:Fieldname( 1 ),; - oQuery:Fieldtype( 1 ),; - oQuery:Fielddec( 1 ),; - oQuery:Fieldlen( 1 ),; - oQuery:Fieldget( 3 ) + ? ; + oQuery:FieldGet( oQuery:FieldPos( "code" ) ), ; + oQuery:FieldGet( 4 ), ; + oQuery:FieldGet( 2 ), ; + oQuery:FieldName( 1 ), ; + oQuery:FieldType( 1 ), ; + oQuery:FieldDec( 1 ), ; + oQuery:FieldLen( 1 ), ; + oQuery:FieldGet( 3 ) - IF oQuery:Recno() == 50 + IF oQuery:RecNo() == 50 oRow := oQuery:getrow() - oRow:Fieldput( 2, "My Second test" ) + oRow:FieldPut( 2, "My Second test" ) ? "Update: ", oServer:Update( oRow ) ENDIF - IF oQuery:Recno() == 60 + IF oQuery:RecNo() == 60 oRow := oQuery:getrow() ? "Delete: ", oServer:Delete( oRow ) ENDIF @@ -173,14 +176,15 @@ PROCEDURE Main() DO WHILE oQuery:Fetch() oRow := oQuery:getrow() - ? oRow:Fieldget( oRow:Fieldpos( "code" ) ),; - oRow:Fieldget( 4 ),; - oRow:Fieldget( 2 ),; - oRow:Fieldname( 1 ),; - oRow:Fieldtype( 1 ),; - oRow:Fielddec( 1 ),; - oRow:Fieldlen( 1 ),; - oRow:Fieldget( 3 ) + ? ; + oRow:FieldGet( oRow:FieldPos( "code" ) ), ; + oRow:FieldGet( 4 ), ; + oRow:FieldGet( 2 ), ; + oRow:FieldName( 1 ), ; + oRow:FieldType( 1 ), ; + oRow:FieldDec( 1 ), ; + oRow:FieldLen( 1 ), ; + oRow:FieldGet( 3 ) ENDDO oQuery:Destroy() diff --git a/harbour/contrib/hbfbird/tests/stress.prg b/harbour/contrib/hbfbird/tests/stress.prg index 446aed4a15..94a186dcab 100644 --- a/harbour/contrib/hbfbird/tests/stress.prg +++ b/harbour/contrib/hbfbird/tests/stress.prg @@ -46,7 +46,7 @@ PROCEDURE Main() ? "Creating domain for boolean fields..." - ? oServer:Execute("create domain boolean_field as smallint default 0 not null check (value in (0,1))") + ? oServer:Execute( "create domain boolean_field as smallint default 0 not null check (value in (0,1))" ) ? "Creating test table..." cQuery := "CREATE TABLE test(" @@ -72,12 +72,12 @@ PROCEDURE Main() oRow := oQuery:Blank() - oRow:Fieldput( 1, i ) - oRow:Fieldput( 2, i + 1 ) - oRow:Fieldput( 3, "DEPARTMENT NAME " + StrZero( i ) ) - oRow:Fieldput( 4, ( i % 10 ) == 0 ) - oRow:Fieldput( 5, 3000 + i ) - oRow:fieldput( 6, Date() ) + oRow:FieldPut( 1, i ) + oRow:FieldPut( 2, i + 1 ) + oRow:FieldPut( 3, "DEPARTMENT NAME " + StrZero( i ) ) + oRow:FieldPut( 4, ( i % 10 ) == 0 ) + oRow:FieldPut( 5, 3000 + i ) + oRow:FieldPut( 6, Date() ) oServer:Append( oRow ) @@ -103,7 +103,7 @@ PROCEDURE Main() @ 17, 0 SAY "Updating values...." + Str( i ) oRow := oQuery:Blank() - oRow:Fieldput( 5, 4000 + i ) + oRow:FieldPut( 5, 4000 + i ) oServer:update( oRow, "code = " + Str( i ) ) IF i % 100 == 0 @@ -114,9 +114,9 @@ PROCEDURE Main() oQuery := oServer:Query( "SELECT sum(salary) sum_salary FROM test WHERE code between 1 and 4000" ) - IF ! oQuery:Neterr() + IF ! oQuery:NetErr() oQuery:Fetch() - @ 18, 0 SAY "Sum values...." + Str( oQuery:Fieldget( 1 ) ) + @ 18, 0 SAY "Sum values...." + Str( oQuery:FieldGet( 1 ) ) oQuery:Destroy() ENDIF @@ -124,12 +124,12 @@ PROCEDURE Main() FOR i := 1 TO 4000 oQuery := oServer:Query( "SELECT * FROM test WHERE code = " + Str( i ) ) - IF ! oQuery:Neterr() + IF ! oQuery:NetErr() oQuery:Fetch() oRow := oQuery:getrow() oQuery:destroy() - x += oRow:fieldget( oRow:fieldpos( "salary" ) ) + x += oRow:FieldGet( oRow:FieldPos( "salary" ) ) @ 19, 0 SAY "Sum values...." + Str( x ) ENDIF diff --git a/harbour/contrib/hbfbird/tfirebrd.prg b/harbour/contrib/hbfbird/tfirebrd.prg index 9783f3780d..108f13fe51 100644 --- a/harbour/contrib/hbfbird/tfirebrd.prg +++ b/harbour/contrib/hbfbird/tfirebrd.prg @@ -71,6 +71,7 @@ #define SQL_DATE SQL_TIMESTAMP CREATE CLASS TFbServer + VAR db VAR trans VAR StartedTrans @@ -468,6 +469,7 @@ METHOD Update( oRow, cWhere ) CLASS TFbServer RETURN result CREATE CLASS TFbQuery + VAR nError VAR lError VAR Dialect @@ -575,6 +577,7 @@ METHOD Refresh() CLASS TFbQuery RETURN result METHOD Destroy() CLASS TFbQuery + LOCAL result := .T. LOCAL n @@ -588,6 +591,7 @@ METHOD Destroy() CLASS TFbQuery RETURN result METHOD Fetch() CLASS TFbQuery + LOCAL result := .F. LOCAL fetch_stat @@ -610,6 +614,7 @@ METHOD Fetch() CLASS TFbQuery RETURN result METHOD Struct() CLASS TFbQuery + LOCAL result := {} LOCAL i @@ -622,6 +627,7 @@ METHOD Struct() CLASS TFbQuery RETURN result METHOD FieldPos( cField ) CLASS TFbQuery + LOCAL result := 0 IF ! ::lError @@ -631,6 +637,7 @@ METHOD FieldPos( cField ) CLASS TFbQuery RETURN result METHOD FieldName( nField ) CLASS TFbQuery + LOCAL result IF ! ::lError .AND. nField >= 1 .AND. nField <= Len( ::aStruct ) @@ -640,6 +647,7 @@ METHOD FieldName( nField ) CLASS TFbQuery RETURN result METHOD FieldType( nField ) CLASS TFbQuery + LOCAL result IF ! ::lError .AND. nField >= 1 .AND. nField <= Len( ::aStruct ) @@ -649,6 +657,7 @@ METHOD FieldType( nField ) CLASS TFbQuery RETURN result METHOD FieldLen( nField ) CLASS TFbQuery + LOCAL result IF ! ::lError .AND. nField >= 1 .AND. nField <= Len( ::aStruct ) @@ -658,6 +667,7 @@ METHOD FieldLen( nField ) CLASS TFbQuery RETURN result METHOD FieldDec( nField ) CLASS TFbQuery + LOCAL result IF ! ::lError .AND. nField >= 1 .AND. nField <= Len( ::aStruct ) @@ -667,6 +677,7 @@ METHOD FieldDec( nField ) CLASS TFbQuery RETURN result METHOD FieldGet( nField ) CLASS TFbQuery + LOCAL result, aBlob, i, cType IF ! ::lError .AND. nField >= 1 .AND. nField <= Len( ::aStruct ) .AND. ! ::closed @@ -687,7 +698,7 @@ METHOD FieldGet( nField ) CLASS TFbQuery result += aBlob[ i ] NEXT - //result := FBGetBlob( ::db, result ) + // result := FBGetBlob( ::db, result ) ELSE result := "" ENDIF @@ -728,7 +739,7 @@ METHOD Getrow() CLASS TFbQuery aRow := Array( ::numcols ) FOR i := 1 TO ::numcols - aRow[ i ] := ::Fieldget( i ) + aRow[ i ] := ::FieldGet( i ) NEXT result := TFbRow():New( aRow, ::aStruct, ::db, ::dialect, ::aTables ) @@ -778,6 +789,7 @@ METHOD GetKeyField() CLASS TFbQuery RETURN ::aKeys CREATE CLASS TFbRow + VAR aRow VAR aStruct VAR aChanged @@ -813,6 +825,7 @@ METHOD new( row, struct, nDb, nDialect, aTable ) CLASS TFbRow RETURN self METHOD Changed( nField ) CLASS TFbRow + LOCAL result IF nField >= 1 .AND. nField <= Len( ::aRow ) @@ -822,6 +835,7 @@ METHOD Changed( nField ) CLASS TFbRow RETURN result METHOD FieldGet( nField ) CLASS TFbRow + LOCAL result IF nField >= 1 .AND. nField <= Len( ::aRow ) @@ -831,6 +845,7 @@ METHOD FieldGet( nField ) CLASS TFbRow RETURN result METHOD FieldPut( nField, Value ) CLASS TFbRow + LOCAL result IF nField >= 1 .AND. nField <= Len( ::aRow ) @@ -841,6 +856,7 @@ METHOD FieldPut( nField, Value ) CLASS TFbRow RETURN result METHOD FieldName( nField ) CLASS TFbRow + LOCAL result IF nField >= 1 .AND. nField <= Len( ::aStruct ) @@ -853,6 +869,7 @@ METHOD FieldPos( cField ) CLASS TFbRow RETURN AScan( ::aStruct, {| x | x[ 1 ] == RTrim( Upper( cField ) ) } ) METHOD FieldType( nField ) CLASS TFbRow + LOCAL result IF nField >= 1 .AND. nField <= Len( ::aStruct ) @@ -862,6 +879,7 @@ METHOD FieldType( nField ) CLASS TFbRow RETURN result METHOD FieldLen( nField ) CLASS TFbRow + LOCAL result IF nField >= 1 .AND. nField <= Len( ::aStruct ) @@ -871,6 +889,7 @@ METHOD FieldLen( nField ) CLASS TFbRow RETURN result METHOD FieldDec( nField ) CLASS TFbRow + LOCAL result IF nField >= 1 .AND. nField <= Len( ::aStruct ) @@ -906,12 +925,12 @@ STATIC FUNCTION KeyField( aTables, db, dialect ) cQuery += ' where ' cQuery += ' a.rdb$index_name = b.rdb$index_name and ' cQuery += ' b.rdb$constraint_type = "PRIMARY KEY" and ' - cQuery += ' b.rdb$relation_name = ' + DataToSql(cTable) + cQuery += ' b.rdb$relation_name = ' + DataToSql( cTable ) cQuery += ' order by ' cQuery += ' b.rdb$relation_name, ' cQuery += ' a.rdb$field_position ' - qry := FBQuery(db, RemoveSpaces(cQuery), dialect) + qry := FBQuery( db, RemoveSpaces( cQuery ), dialect ) IF HB_ISARRAY( qry ) DO WHILE FBFetch( qry ) == 0 @@ -982,9 +1001,10 @@ STATIC FUNCTION StructConvert( aStru, db, dialect ) IF HB_ISARRAY( qry ) DO WHILE FBFetch( qry ) == 0 - AAdd( aDomains, { iif( FBGetdata( qry, 1 ) == NIL, "", FBGetdata( qry, 1 ) ),; - iif( FBGetdata( qry, 2 ) == NIL, "", FBGetdata( qry, 2 ) ),; - iif( FBGetdata( qry, 3 ) == NIL, "", FBGetdata( qry, 3 ) ) } ) + AAdd( aDomains, { ; + iif( FBGetdata( qry, 1 ) == NIL, "", FBGetdata( qry, 1 ) ), ; + iif( FBGetdata( qry, 2 ) == NIL, "", FBGetdata( qry, 2 ) ), ; + iif( FBGetdata( qry, 3 ) == NIL, "", FBGetdata( qry, 3 ) ) } ) ENDDO FBFree( qry ) diff --git a/harbour/contrib/hbformat/hbfmtcls.prg b/harbour/contrib/hbformat/hbfmtcls.prg index 6a7bccc9cf..85004c1047 100644 --- a/harbour/contrib/hbformat/hbfmtcls.prg +++ b/harbour/contrib/hbformat/hbfmtcls.prg @@ -86,7 +86,6 @@ CREATE CLASS HBFORMATCODE VAR nEol INIT 0 // Eol: -1 - no change, 0 - OS default, 1 - DOS, 2 - UNIX VAR lFCaseLow INIT .F. // If true, convert file name to lower case - VAR lNoTabs INIT .T. // If true, converts all tabs to spaces VAR lIndent INIT .T. // If true, indent code VAR lCase INIT .T. // If true, make case conversion VAR lSpaces INIT .T. // If true, reformat spaces @@ -110,22 +109,23 @@ CREATE CLASS HBFORMATCODE VAR nLineRet INIT 1 // -1 - no change, 1 - insert empty line before return, 2 - remove it VAR nLineVar INIT 1 // -1 - no change, 1 - insert empty line before variables declaration, 2 - remove it VAR nLineCode INIT 1 // -1 - no change, 1 - insert empty line before code in function, 2 - remove it - VAR nBr4Comma INIT 1 // Max level of nesting in brackets, while space is added after a comma - VAR nBr4Brac INIT 2 // Max level of nesting in brackets, while space is added after/before a bracket + VAR nBr4Comma INIT 8 // Max level of nesting in brackets, while space is added after a comma + VAR nBr4Brac INIT 8 // Max level of nesting in brackets, while space is added after/before a bracket + VAR cHBXList INIT "" - VAR cExtSave INIT "" // Extension for a formatted file ( "" - replace original ) - VAR cExtBack INIT ".bak" // Extension for a backup file + VAR cExtSave INIT "" // Extension for a formatted file ( "" - replace original ) + VAR cExtBack INIT ".bak" // Extension for a backup file - VAR cCommands INIT "," - VAR cClauses INIT "," - VAR cFunctions INIT "," + VAR cCommands INIT "," + VAR cClauses INIT "," + VAR cFunctions INIT "," VAR aContr INIT { { "if" , "" , "|else|elseif|" , "endif" },; { "do" , "while" , "" , "enddo" },; { "while" , "" , "" , "enddo" },; { "for" , "" , "" , "next" },; { "do" , "case" , "|case|otherwise|", "endcase" },; { "with" , "object" , "" , "end" },; - { "begin" , "sequence", "|recover|" , "end" },; + { "begin" , "sequence", "|recover|always|", "end" },; { "switch", "" , "|case|otherwise|", "endswitch" } } VAR bCallback @@ -145,8 +145,7 @@ ENDCLASS METHOD New( aParams, cIniName ) CLASS HBFORMATCODE - LOCAL i, cParam - LOCAL cLine + LOCAL cParam, cHBX ::nErr := 0 @@ -154,8 +153,8 @@ METHOD New( aParams, cIniName ) CLASS HBFORMATCODE IF ! ::ReadIni( cIniName ) RETURN Self ENDIF - FOR i := 1 TO Len( aParams ) - IF Left( cParam := aParams[ i ], 1 ) == "@" + FOR EACH cParam IN aParams + IF Left( cParam, 1 ) == "@" IF ! ::ReadIni( SubStr( cParam, 2 ) ) RETURN Self ENDIF @@ -170,30 +169,29 @@ METHOD New( aParams, cIniName ) CLASS HBFORMATCODE IF !( Right( ::cCommands, 1 ) == "," ) ::cCommands += "," ENDIF - ::cCommands += "IF,ELSEIF,ELSE,ENDIF,END,DO,WHILE,ENDDO,WITH,CASE,OTHERWISE,ENDCASE,BEGIN," +; - "FUNCTION,PROCEDURE,RETURN,CLASS,ENDCLASS,METHOD,DATA,LOCAL,PRIVATE,PUBLIC,STATIC,FIELD,MEMVAR,PARAMETERS,DECLARE," +; - "ACCEPT,APPEND,AVERAGE,CLEAR,CLOSE,COMMIT,CONTINUE,COPY,COUNT,CREATE,DEFAULT," +; - "DELETE,DISPLAY,EJECT,ERASE,EXIT,FOR,GO,GOTO,INDEX,INPUT,JOIN,KEYBOARD,LABEL,LIST,LOCATE," +; - "LOOP,MENU,NEXT,PACK,PRINT,QUIT,READ,RECALL,REINDEX,RELEASE,RENAME,REQUEST,REPLACE,RESTORE," +; - "RUN,SAVE,SEEK,SELECT,SET,SKIP,SORT,STORE,SUM,TEXT,TOTAL,UNLOCK,USE,WAIT,ZAP," + ::cCommands += "IF,ELSE,ELSEIF,END,ENDIF,DO,WHILE,ENDDO,WITH,CASE,OTHERWISE,ENDCASE,BEGIN,ANNOUNCE,REQUEST,THREAD,DYNAMIC,EXTERNAL," + ; + "FUNCTION,PROCEDURE,RETURN,CLASS,ENDCLASS,METHOD,DATA,LOCAL,PRIVATE,PUBLIC,STATIC,FIELD,MEMVAR,PARAMETERS,DECLARE," + ; + "ACCEPT,APPEND,AVERAGE,CLEAR,CLOSE,COMMIT,CONTINUE,COPY,COUNT,CREATE,DEFAULT," + ; + "DELETE,DISPLAY,EJECT,ERASE,EXIT,FOR,GO,GOTO,INDEX,INIT,INPUT,JOIN,KEYBOARD,LABEL,LIST,LOCATE," + ; + "LOOP,MENU,NEXT,PACK,PRINT,QUIT,READ,RECALL,REINDEX,RELEASE,RENAME,REQUEST,REPLACE,RESTORE," + ; + "RUN,SAVE,SEEK,SELECT,SET,SKIP,SORT,STORE,SUM,TEXT,TOTAL,UNLOCK,USE,VAR,WAIT,ZAP," IF !( Right( ::cClauses, 1 ) == "," ) ::cClauses += "," ENDIF - ::cClauses += "ADDITIVE,ALIAS,ALL,BLANK,BOTTOM,BOX,COLOR,DATE,DELETED,EACH,EXTENDED,EXCLUSIVE,FROM,GET," +; - "RANGE,READONLY,REST,SAY,SCREEN,ALTERNATE,BELL,CENTURY,CONFIRM,CONSOLE,CURSOR,DECIMALS,DELIMITERS,DEVICE,EPOCH,ESCAPE," +; - "EXACT,EXCLUSIVE,FILTER,FIXED,FORMAT,INTENSITY,KEY,LIKE,MARGIN,MESSAGE,NEW,OFF,ON,ORDER,PATH,PICTURE,PRINTER,PROMPT," +; + ::cClauses += "ADDITIVE,ALIAS,ALL,BLANK,BOTTOM,BOX,COLOR,DATE,DELETED,EACH,EXTENDED,EXCLUSIVE,FROM,GET," + ; + "RANGE,READONLY,REST,SAY,SCREEN,ALTERNATE,BELL,CENTURY,CONFIRM,CONSOLE,CURSOR,DECIMALS,DELIMITERS,DEVICE,EPOCH,ESCAPE," + ; + "EXACT,EXCLUSIVE,FILTER,FIXED,FORMAT,INHERIT,INTENSITY,KEY,LIKE,MARGIN,MESSAGE,NEW,NIL,OFF,ON,ORDER,PATH,PICTURE,PRINTER,PROMPT," + ; "PROTECTED,RELATION,SCOREBOARD,SEQUENCE,SOFTSEEK,STEP,STRUCTURE,TYPEAHEAD,UNIQUE,WRAP,TAG,TO,TOP,VALID,WHEN," IF !( Right( ::cFunctions, 1 ) == "," ) ::cFunctions += "," ENDIF IF !( ",STR," $ Upper( ::cFunctions ) ) - ::cFunctions += "iif,ISNIL,ISARRAY,ISBLOCK,ISCHARACTER,ISDATE,ISLOGICAL,ISMEMO,ISNUMBER,ISOBJECT" - FOR EACH cLine IN hb_ATokens( StrTran( __harbour_hbx(), Chr( 13 ) ), Chr( 10 ) ) - IF Left( cLine, Len( "DYNAMIC " ) ) == "DYNAMIC " - ::cFunctions += "," + SubStr( cLine, Len( "DYNAMIC " ) + 1 ) - ENDIF + ::cFunctions += "iif,ISNIL,ISARRAY,ISBLOCK,ISCHARACTER,ISDATE,ISLOGICAL,ISMEMO,ISNUMBER,ISOBJECT,Main" + HBXToFuncList( @::cFunctions, __harbour_hbx() ) + FOR EACH cHBX IN hb_ATokens( ::cHBXList ) + HBXToFuncList( @::cFunctions, hb_MemoRead( hb_PathJoin( hb_DirBase(), cHBX ) ) ) NEXT ENDIF @@ -204,12 +202,20 @@ METHOD New( aParams, cIniName ) CLASS HBFORMATCODE ELSEIF ::nEol == 0 ::cEol := hb_eol() ENDIF - IF ::lIndent - ::lNoTabs := .T. - ENDIF RETURN Self +STATIC PROCEDURE HBXToFuncList( /* @ */ cFuncList, cHBX ) + LOCAL cLine + + FOR EACH cLine IN hb_ATokens( StrTran( cHBX, Chr( 13 ) ), Chr( 10 ) ) + IF Left( cLine, Len( "DYNAMIC " ) ) == "DYNAMIC " + cFuncList += "," + SubStr( cLine, Len( "DYNAMIC " ) + 1 ) + ENDIF + NEXT + + RETURN + STATIC FUNCTION __harbour_hbx() #pragma __streaminclude "harbour.hbx" | RETURN %s @@ -245,7 +251,7 @@ METHOD Reformat( aFile ) CLASS HBFORMATCODE LOOP ENDIF IF lComment - IF ( nPos := FindNotQuoted( "*/", aFile[ i ] ) ) != 0 + IF ( nPos := At( "*/", aFile[ i ] ) ) != 0 lComment := .F. IF ! Empty( cToken1 := SubStr( aFile[ i ], nPos + 2 ) ) aFile[ i ] := Left( aFile[ i ], nPos + 1 ) @@ -283,19 +289,22 @@ METHOD Reformat( aFile ) CLASS HBFORMATCODE cLineAll := Left( cLineAll, nPos - 1 ) + "//" + SubStr( cLineAll, nPos + 2 ) ENDIF ENDIF + IF nPosComment > 0 + nPos := nPosComment + iif( SubStr( cLineAll, nPosComment, 1) == "*", 1, 2 ) + if SubStr( cLineAll, nPos, 1 ) != " " + cLineAll := Left( cLineAll, nPos - 1) + " " + SubStr( cLineAll, nPos ) + endif + endif IF ( nPos := FindNotQuoted( "/*", cLineAll ) ) != 0 .AND. ( nPosComment == 0 .OR. nPosComment > nPos ) nPosComment := nPos - IF ( nPos := FindNotQuoted( "*/", cLineAll, nPos + 2 ) ) != 0 - IF ! Empty( cToken1 := SubStr( cLineAll, nPos + 2 ) ) - cLineAll := Left( cLineAll, nPos + 1 ) - nLen := rf_AINS( aFile, i + 1, cToken1 ) - iDelta++ - ENDIF - ELSE + IF hb_At( "*/", cLineAll, nPos + 2 ) == 0 lComment := .T. ENDIF ENDIF - IF ! lPragmaDump .AND. ::lIndent .AND. ( ! lComment .OR. nPosComment > 1 ) + IF nPosComment == 1 .AND. nDeep == 0 .AND. nState == RF_STATE_RET + nState := 0 + ENDIF + IF ! lPragmaDump .AND. ::lIndent .AND. ! lComment aFile[ i ] := cLineAll IF ! lContinue nPosSep := 1 @@ -325,10 +334,12 @@ METHOD Reformat( aFile ) CLASS HBFORMATCODE ENDIF cToken2 := Lower( hb_tokenGet( cLine, 2 ) ) IF Left( cToken1, 1 ) == "#" - ELSEIF nLenToken >= 4 .AND. ( ( LEFTEQUAL( "static", cToken1 ) .AND. ; - ( LEFTEQUAL( "function", cToken2 ) .OR. LEFTEQUAL( "procedure", cToken2 ) ) ) .OR. ; - LEFTEQUAL( "function", cToken1 ) .OR. LEFTEQUAL( "procedure", cToken1 ) ; - .OR. ( "method" == cToken1 .AND. ! lClass ) .OR. ; + ELSEIF nLenToken >= 4 .AND. ( ; + ( LEFTEQUAL( "static", cToken1 ) .AND. ( LEFTEQUAL( "function", cToken2 ) .OR. LEFTEQUAL( "procedure", cToken2 ) ) ) .OR. ; + ( Len( cToken2 ) >= 4 .AND. LEFTEQUAL( "procedure", cToken2 ) .AND. ( "init" == cToken1 .OR. "exit" == cToken1 ) ) .OR. ; + LEFTEQUAL( "function", cToken1 ) .OR. ; + LEFTEQUAL( "procedure", cToken1 ) .OR. ; + ( "method" == cToken1 .AND. ! lClass ) .OR. ; ( "class" == cToken1 .AND. ! lClass ) .OR. ; ( "create" == cToken1 .AND. "class" == cToken2 .AND. ! lClass ) ) IF nDeep == 0 @@ -342,6 +353,13 @@ METHOD Reformat( aFile ) CLASS HBFORMATCODE ::cLineErr := cLine RETURN .F. ENDIF + ELSEIF nLenToken >= 4 .AND. ( ; + LEFTEQUAL( "request", cToken1 ) .OR. ; + LEFTEQUAL( "announce", cToken1 ) .OR. ; + LEFTEQUAL( "dynamic", cToken1 ) .OR. ; + LEFTEQUAL( "external", cToken1 ) .OR. ; + LEFTEQUAL( "thread", cToken1 ) ) + nState := 0 ELSEIF nLenToken >= 4 .AND. ( ; LEFTEQUAL( "local", cToken1 ) .OR. ; LEFTEQUAL( "private", cToken1 ) .OR. ; @@ -360,7 +378,7 @@ METHOD Reformat( aFile ) CLASS HBFORMATCODE nState := RF_STATE_RET ENDIF ELSE - IF !( cToken1 == "request" ) + IF nState > 0 nState := RF_STATE_CODE ENDIF IF ( nContrState := Ascan( ::aContr, ; @@ -403,15 +421,11 @@ METHOD Reformat( aFile ) CLASS HBFORMATCODE IF Left( cLine, 1 ) == "#" .AND. ! ::lIndDrt nIndent := 0 ENDIF - IF Left( cLine, 2 ) == "//" .AND. nDeep == 0 - nIndent := 0 - ENDIF cLineAll := Space( nIndent ) + ::FormatLine( cLine ) - - IF i > 1 .AND. ( ( nState == RF_STATE_RET .AND. ::nLineRet > 0 ) .OR. ; - ( nState == RF_STATE_FUNC .AND. ::nLineFnc > 0 ) .OR. ; - ( nState == RF_STATE_VAR .AND. nStatePrev != nState .AND. ::nLineVar > 0 ) .OR. ; - ( nState == RF_STATE_CODE .AND. nStatePrev != nState .AND. ::nLineCode > 0 ) ) + IF i > 1 .AND. ( ( nState == RF_STATE_RET .AND. ::nLineRet > 0 .AND. nStatePrev != RF_STATE_FUNC ) .OR. ; + ( nState == RF_STATE_FUNC .AND. ::nLineFnc > 0 .AND. nStatePrev > 0 ) .OR. ; + ( nState == RF_STATE_VAR .AND. nStatePrev != nState .AND. ::nLineVar > 0 ) .OR. ; + ( nState == RF_STATE_CODE .AND. nStatePrev != nState .AND. ::nLineCode > 0 ) ) nPos := i - 1 IF ( nState == RF_STATE_RET .AND. ::nLineRet == 1 ) .OR. ; ( nState == RF_STATE_FUNC .AND. ::nLineFnc == 1 ) .OR. ; @@ -435,8 +449,11 @@ METHOD Reformat( aFile ) CLASS HBFORMATCODE ELSE cLineAll += ::FormatLine( cLine ) ENDIF - IF lClass .AND. nState == RF_STATE_RET - lClass := .F. + IF nState == RF_STATE_RET + IF lClass + lClass := .F. + ENDIF + nState := 0 ENDIF IF nPosSep == 0 .OR. nPosSep == Len( aFile[ i ] ) EXIT @@ -538,8 +555,16 @@ METHOD FormatLine( cLine, lContinued ) CLASS HBFORMATCODE cSymb := c nState := FL_STATE_QUOTED ELSEIF c == "[" - nState := FL_STATE_SQBR - ELSEIF c == "/" .AND. ( ( c := SubStr( cLine, i + 1, 1 ) ) == "/" .OR. c == "*" ) + IF nState == FL_STATE_STRING .OR. nState == FL_STATE_ANY + IF nEnd == nBegin + nEnd := i + ENDIF + ::ConvertCmd( @cLine, nBegin, nEnd ) + nA := i + ELSE + nState := FL_STATE_SQBR + ENDIF + ELSEIF c == "/" .AND. ( SubStr( cLine, i + 1, 1 ) $ "*/" ) IF nState == FL_STATE_STRING IF nEnd == nBegin nEnd := i @@ -554,6 +579,16 @@ METHOD FormatLine( cLine, lContinued ) CLASS HBFORMATCODE i++ ENDDO i-- + IF ( SubStr( cLine, i + 1, 1 ) == "," .AND. ! SubStr( cLine, nEnd - 1, 1 ) $ "(," ) .OR. ; + "*" + SubStr( cLine, nEnd - 1, 1 ) + SubStr( cLine, i + 1, 1 ) + "*" $ "*{}*()*][*{|*||*" .OR. ; + SubStr( cLine, i + 1, 2 ) == "->" .OR. ; + SubStr( cLine, nEnd - 2, 2 ) == "->" .OR. ; + ( nState == FL_STATE_STRING .AND. ( SubStr( cLine, i + 1, 1 ) == "[" .OR. "*" + SubStr( cLine, i + 1, 3 ) + "*" $ "*-- *++ *" ) ) .OR. ; + ( nState != FL_STATE_STRING .AND. "*" + SubStr( cLine, nEnd - 3, 3 ) + "*" $ "* --* ++*" ) + cLine := Left( cLine, nEnd - 1 ) + SubStr( cLine, i + 1 ) + nLen := Len( cLine ) + i := nEnd + ENDIF ELSEIF c == "(" .OR. c == "{" aBrackets[ iif( c == "(", 1, 2 ) ]++ IF nState == FL_STATE_STRING @@ -565,7 +600,7 @@ METHOD FormatLine( cLine, lContinued ) CLASS HBFORMATCODE ENDIF ENDIF IF ::lSpaces .AND. aBrackets[ iif( c == "(", 1, 2 ) ] <= ::nBr4Brac .AND. ; - i < nLen .AND. !( SubStr( cLine, i + 1, 1 ) $ iif( c == "(", " )", " |} " ) ) + i < nLen .AND. !( SubStr( cLine, i + 1, 1 ) $ iif( c == "(", " )", " |}" ) ) nA := i ENDIF nState := FL_STATE_ANY @@ -607,9 +642,24 @@ METHOD FormatLine( cLine, lContinued ) CLASS HBFORMATCODE IF SubStr( cLine, i + 1, 1 ) $ cOperators i++ ENDIF + IF c == "-" // .AND. SubStr( cLine, i + 1, 1 ) $ "1234567890" + IF nState == FL_STATE_STRING + IF ::ConvertCmd( @cLine, nBegin, nEnd ) + nState := FL_STATE_ANY + ELSE + nA := i + nState := FL_STATE_OP + ENDIF + ELSEIF nState == FL_STATE_OP + nState := FL_STATE_ANY + ENDIF + ELSE + nA := i + nState := FL_STATE_OP + ENDIF + ELSEIF c == "|" .AND. SubStr( cLine, i + 1, 1 ) != "|" nA := i - nState := FL_STATE_OP - ELSEIF c == ")" .OR. c == "}" + ELSEIF c == ")" .OR. c == "}" .OR. c == "]" IF ::lSpaces .AND. aBrackets[ iif( c == "(", 1, 2 ) ] <= ::nBr4Brac .AND. ; i > 1 .AND. !( SubStr( cLine, i - 1, 1 ) $ " ({" ) nB := i @@ -623,7 +673,7 @@ METHOD FormatLine( cLine, lContinued ) CLASS HBFORMATCODE lFirst := .F. ENDIF IF !( "|" + SubStr( cLine, nB, 2 ) + "|" $ "|--|++|->|" ) - IF nA != 0 .AND. ::lSpaces .AND. nA < nLen .AND. !( SubStr( cLine, nA + 1, 1 ) == " " ) + IF nA != 0 .AND. ::lSpaces .AND. nA < nLen .AND. !( SubStr( cLine, nA + 1, 1 ) $ " ," ) cLine := Left( cLine, nA ) + " " + SubStr( cLine, nA + 1 ) nLen++ i++ diff --git a/harbour/contrib/hbformat/utils/hbformat.ini b/harbour/contrib/hbformat/utils/hbformat.ini index 31e9a92617..396646c1a7 100644 --- a/harbour/contrib/hbformat/utils/hbformat.ini +++ b/harbour/contrib/hbformat/utils/hbformat.ini @@ -91,3 +91,6 @@ nSpaceDrt = 0 # Extension for a backup file #cExtBack = bak + +# List of space separated .hbx files for specifying proper casing of function names +#cHBXList= diff --git a/harbour/contrib/hbformat/utils/hbformat.prg b/harbour/contrib/hbformat/utils/hbformat.prg index 1d2eaac29c..5e44be5367 100644 --- a/harbour/contrib/hbformat/utils/hbformat.prg +++ b/harbour/contrib/hbformat/utils/hbformat.prg @@ -57,27 +57,27 @@ REQUEST HB_GT_CGI_DEFAULT PROCEDURE Main( ... ) - LOCAL oRef, aParams, cFileName, cInitDir, i, lRecursive := .F. + LOCAL oRef, aParams, cFileName, cInitDir, i, cParam, lRecursive := .F. - // Altd( 2 ); Altd() + // AltD( 2 ); AltD() aParams := hb_AParams() - IF Empty( aParams ) .OR. ( Left( cFileName := Atail(aParams ), 1 ) $ "@/-" ) + IF Empty( aParams ) .OR. ( Left( cFileName := ATail( aParams ), 1 ) $ "@/-" ) About() RETURN ENDIF - FOR i := 1 TO Len( aParams ) - IF Left( aParams[ i ], 1 ) $ "-/" - IF SubStr( aParams[ i ], 2 ) == "r" + FOR EACH cParam IN aParams + IF Left( cParam, 1 ) $ "-/" + IF SubStr( cParam, 2 ) == "r" lRecursive := .T. - aParams[ i ] := "#" + cParam := "#" EXIT ENDIF ENDIF NEXT - oRef := hbFormatCode():New( aParams, hb_FNameMerge( hb_dirBase(), "hbformat.ini" ) ) + oRef := hbFormatCode():New( aParams, hb_FNameMerge( hb_DirBase(), "hbformat.ini" ) ) IF oRef:nErr > 0 OutStd( "Initialization error", oRef:nErr, iif( oRef:nLineErr == 0, "in parameter", "on line " + hb_ntos( oRef:nLineErr ) ), ":", oRef:cLineErr, hb_eol() ) RETURN @@ -86,12 +86,14 @@ PROCEDURE Main( ... ) oRef:bCallBack := {| a, i | FCallBack( a, i ) } IF "*" $ cFileName - IF ( i := RAt( ".", cFileName ) ) == 0 .OR. Substr( cFileName, i + 1, 1 ) < "A" + IF ( i := RAt( ".", cFileName ) ) == 0 .OR. SubStr( cFileName, i + 1, 1 ) < "A" OutErr( "Wrong mask" + hb_eol() ) ELSE - cInitDir := iif( ( i := RAt( "\", cFileName ) ) == 0, ; + cInitDir := ; + iif( ( i := RAt( "\", cFileName ) ) == 0, ; iif( ( i := RAt( "/", cFileName ) ) == 0, ; - "." + hb_ps(), Left( cFileName, i ) ), ; + "." + hb_ps(), ; + Left( cFileName, i ) ), ; Left( cFileName, i ) ) cFileName := iif( i == 0, cFileName, SubStr( cFileName, i + 1 ) ) DirEval( cInitDir, cFileName, lRecursive, {| name | Reformat( oRef, name ) } ) @@ -99,7 +101,6 @@ PROCEDURE Main( ... ) ELSE Reformat( oRef, cFileName ) ENDIF - OutStd( hb_eol() ) RETURN @@ -115,12 +116,12 @@ STATIC PROCEDURE Reformat( oRef, cFileName ) LOCAL aFile - IF !Empty( aFile := oRef:File2Array( cFileName ) ) + IF ! Empty( aFile := oRef:File2Array( cFileName ) ) OutStd( "Reformatting " + cFileName + " (" + hb_ntos( Len( aFile ) ) + " lines)" + hb_eol() ) - OutStd( "<" + hb_eol() ) + OutStd( "<" ) IF oRef:Reformat( aFile ) oRef:Array2File( cFileName, aFile ) - OutStd( ">" ) + OutStd( ">" + hb_eol() ) ELSE OutErr( "Error", oRef:nErr, "on line", oRef:nLineErr, ":", oRef:cLineErr, hb_eol() ) ENDIF @@ -130,58 +131,22 @@ STATIC PROCEDURE Reformat( oRef, cFileName ) RETURN -STATIC FUNCTION CmpMsk( strcmp, mask ) - - LOCAL lenm := Len( mask ), i, nPos1 := 1, nPos2, c - - FOR i := 1 TO lenm - c := SubStr( mask, i, 1 ) - IF c == "*" - IF i == lenm - RETURN .T. - ELSE - c := SubStr( mask, i + 1, 1 ) - DO WHILE .T. - nPos2 := At( c, SubStr( strcmp, nPos1 ) ) - IF nPos2 == 0 - RETURN .F. - ENDIF - nPos1 += nPos2 - 1 - IF CmpMsk( SubStr( strcmp, nPos1 ), SubStr( mask, i + 1 ) ) - RETURN .T. - ENDIF - nPos1 ++ - ENDDO - ENDIF - ELSE - IF !( c == SubStr( strcmp, nPos1, 1 ) ) - RETURN .F. - ENDIF - nPos1 ++ - ENDIF - NEXT - - RETURN .T. - STATIC PROCEDURE DirEval( cInitDir, cMask, lRecur, bCode ) - LOCAL i, nLen, aFiles + LOCAL file cInitDir := hb_DirSepAdd( cInitDir ) + cMask := iif( cMask == NIL, hb_osFileMask(), cMask ) - cMask := iif( cMask == NIL, hb_osFileMask(), Upper( cMask ) ) - - aFiles := Directory( cInitDir + hb_osFileMask(), "HSD" ) - nLen := Len( aFiles ) - FOR i := 1 TO nLen - IF "D" $ aFiles[ i ][ F_ATTR ] - IF !( "." == aFiles[ i ][ F_NAME ] ) .AND. ; - !( ".." == aFiles[ i ][ F_NAME ] ) .AND. lRecur - DirEval( cInitDir + aFiles[ i ][ F_NAME ], cMask, lRecur, bCode ) + FOR EACH file IN Directory( cInitDir + cMask, "HSD" ) + IF "D" $ file[ F_ATTR ] + IF !( "." == file[ F_NAME ] ) .AND. ; + !( ".." == file[ F_NAME ] ) .AND. lRecur + DirEval( cInitDir + file[ F_NAME ], cMask, lRecur, bCode ) ENDIF - ELSEIF CmpMsk( Upper( aFiles[ i ][ F_NAME ] ), cMask ) + ELSE IF bCode != NIL - Eval( bCode, cInitDir + aFiles[ i ][ F_NAME ] ) + Eval( bCode, cInitDir + file[ F_NAME ] ) ENDIF ENDIF NEXT @@ -190,12 +155,13 @@ STATIC PROCEDURE DirEval( cInitDir, cMask, lRecur, bCode ) STATIC PROCEDURE About() - OutStd( "Harbour Source Formatter " + HBRawVersion() + hb_eol() +; - "Copyright (c) 2009-2012, Alexander S.Kresin" + hb_eol() +; - "http://harbour-project.org/" + hb_eol() +; - hb_eol() +; - "Syntax: hbformat [options] [@config] " + hb_eol() +; - hb_eol() ) + OutStd( ; + "Harbour Source Formatter " + HBRawVersion() + hb_eol() + ; + "Copyright (c) 2009-2012, Alexander S.Kresin" + hb_eol() + ; + "http://harbour-project.org/" + hb_eol() + ; + hb_eol() + ; + "Syntax: hbformat [options] [@config] " + hb_eol() + ; + hb_eol() ) RETURN diff --git a/harbour/contrib/hbfoxpro/dll.prg b/harbour/contrib/hbfoxpro/dll.prg index fe0e855eb4..a4c9e182f8 100644 --- a/harbour/contrib/hbfoxpro/dll.prg +++ b/harbour/contrib/hbfoxpro/dll.prg @@ -58,6 +58,7 @@ DECLARE [cFunctionType] FunctionName IN LibraryName [AS AliasName] */ FUNCTION FOX___DYNCALL( cCommand, ... ) + LOCAL aParam LOCAL cFunction @@ -67,13 +68,13 @@ FUNCTION FOX___DYNCALL( cCommand, ... ) LOCAL aCommand := hb_ATokens( cCommand ) LOCAL nPos := 1 - LOCAL aType := {; - "SHORT" => HB_DYN_CTYPE_SHORT ,; - "INTEGER" => HB_DYN_CTYPE_INT ,; - "SINGLE" => HB_DYN_CTYPE_FLOAT ,; - "DOUBLE" => HB_DYN_CTYPE_DOUBLE ,; - "LONG" => HB_DYN_CTYPE_LONG ,; - "STRING" => HB_DYN_CTYPE_CHAR_PTR ,; + LOCAL aType := { ; + "SHORT" => HB_DYN_CTYPE_SHORT, ; + "INTEGER" => HB_DYN_CTYPE_INT, ; + "SINGLE" => HB_DYN_CTYPE_FLOAT, ; + "DOUBLE" => HB_DYN_CTYPE_DOUBLE, ; + "LONG" => HB_DYN_CTYPE_LONG, ; + "STRING" => HB_DYN_CTYPE_CHAR_PTR, ; "OBJECT" => HB_DYN_CTYPE_VOID_PTR } IF nPos <= Len( aCommand ) .AND. Upper( aCommand[ nPos ] ) == "DECLARE" @@ -130,4 +131,4 @@ FUNCTION FOX___DYNCALL( cCommand, ... ) ENDIF ENDDO - RETURN hb_dynCall( aParam, ... ) + RETURN hb_DynCall( aParam, ... ) diff --git a/harbour/contrib/hbfoxpro/misc.prg b/harbour/contrib/hbfoxpro/misc.prg index f036b5e794..fffce7e4f2 100644 --- a/harbour/contrib/hbfoxpro/misc.prg +++ b/harbour/contrib/hbfoxpro/misc.prg @@ -71,6 +71,7 @@ FUNCTION SYS( nValue, xPar1 ) RETURN NIL STATIC FUNCTION AFillNested( aValue, xVal ) + LOCAL item FOR EACH item IN aValue diff --git a/harbour/contrib/hbfship/fldarr.prg b/harbour/contrib/hbfship/fldarr.prg index 74c397fd46..534f97a004 100644 --- a/harbour/contrib/hbfship/fldarr.prg +++ b/harbour/contrib/hbfship/fldarr.prg @@ -51,13 +51,14 @@ */ FUNCTION FieldGetArr( xRecNo ) + LOCAL xPrevRec LOCAL aFields LOCAL nFields, n IF xRecNo != NIL - xPrevRec := recNo() - dbGoTo( xRecNo ) + xPrevRec := RecNo() + dbGoto( xRecNo ) ENDIF nFields := FCount() @@ -67,18 +68,19 @@ FUNCTION FieldGetArr( xRecNo ) NEXT IF xPrevRec != NIL - dbGoTo( xPrevRec ) + dbGoto( xPrevRec ) ENDIF -RETURN aFields + RETURN aFields FUNCTION FieldPutArr( aFields, xRecNo ) + LOCAL xPrevRec LOCAL nFields, n IF xRecNo != NIL - xPrevRec := recNo() - dbGoTo( xRecNo ) + xPrevRec := RecNo() + dbGoto( xRecNo ) ENDIF nFields := FCount() @@ -92,7 +94,7 @@ FUNCTION FieldPutArr( aFields, xRecNo ) NEXT IF xPrevRec != NIL - dbGoTo( xPrevRec ) + dbGoto( xPrevRec ) ENDIF -RETURN .T. + RETURN .T. diff --git a/harbour/contrib/hbfship/isdb.prg b/harbour/contrib/hbfship/isdb.prg index ea585551e3..9cecc9651a 100644 --- a/harbour/contrib/hbfship/isdb.prg +++ b/harbour/contrib/hbfship/isdb.prg @@ -56,11 +56,11 @@ #include "dbinfo.ch" FUNCTION IsDbExcl() - RETURN ! DBINFO( DBI_SHARED ) + RETURN ! dbInfo( DBI_SHARED ) FUNCTION IsDbFlock() - RETURN DBINFO( DBI_ISFLOCK ) + RETURN dbInfo( DBI_ISFLOCK ) FUNCTION IsDbRLock( xRec ) - RETURN DBINFO( DBI_ISFLOCK ) .OR. ! DBINFO( DBI_SHARED ) .OR. ; - dbRecordInfo( DBRI_LOCKED, xRec ) + RETURN dbInfo( DBI_ISFLOCK ) .OR. ! dbInfo( DBI_SHARED ) .OR. ; + dbRecordInfo( DBRI_LOCKED, xRec ) diff --git a/harbour/contrib/hbgd/doc/en/hbgd.txt b/harbour/contrib/hbgd/doc/en/hbgd.txt index bb915e28eb..8e17a001ed 100644 --- a/harbour/contrib/hbgd/doc/en/hbgd.txt +++ b/harbour/contrib/hbgd/doc/en/hbgd.txt @@ -12,17 +12,17 @@ $DESCRIPTION$ HBGD is basically a wrapper of Thomas Boutell's GD Library version 2.0.33. GD Library is a powerfull graphic library very usefull expecially under CGI environment. - + HBGD actually contains almost all GD functions, more a set of functions that extends original library and a set of classes that make easier to work with this library. - + Thomas Boutell's GD library actually supports these graphic formats: PNG, JPEG, GIF, Animated GIF, GD, GD2, WBMP, XBM, XPM WBMP is Wireless Bitmap, not Windows Bitmap, and it is used for WAP. It is a B&W bitmap. - + HBGD actually supports PNG, JPEG, GIF, GD, WBMP The other Animated GIF, GD2, XBM and XPM are not wrapped actually. - + Using this library you can, as a little example: - create an image in memory, true color or with a 256 colors palette; - load and save an image of above formats and convert it to another supported format; @@ -33,15 +33,15 @@ - draw characters and words with internal fonts or using truetype fonts; - write strings on a base line or on a circle line and with any angle degree; - copy, resize and rotate part or full image; - + and, over this, some functions to clone, crop, zoom, rotate outside and inside. - + The prefix for all functions is GD (i.e. gdImageCreate() ) - + You can use directly all API functions or TGD class. - + NOTE: Not all functions are wrapped. - + $SEEALSO$ Alphabetical list of functions, Categorized list of functions, GDImage Class, GDChart Class. $END$ @@ -64,19 +64,19 @@ $DESCRIPTION$ gdImageCreate() creates an empty image in memory. This image has no more than 256 colors. - + gdImageCreate() returns an image pointer or NIL if unable to create the image. The image pointer must be destroyed using gdImageDestroy() - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage - + pImage := gdImageCreate( 64, 64 ) // Use here image ......... gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -108,19 +108,19 @@ $DESCRIPTION$ gdImageCreateTrueColor() creates an empty image in memory. This image has true colors. - + gdImageCreateTrueColor() returns an image pointer or NIL if unable to create the image. The image pointer must be destroyed using gdImageDestroy() - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage - + pImage := gdImageCreateTrueColor( 64, 64 ) // Use here image ......... gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -151,18 +151,18 @@ $DESCRIPTION$ gdImageDestroy() frees memory used from an image. It's important to use this function before exiting from a program. - + HBGD uses it's own memory to manage an image, so it is important to use this function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage - + pImage := gdImageCreateTrueColor( 64, 64 ) // Use here image ......... gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -195,34 +195,34 @@ - Image pointer $DESCRIPTION$ gdImageFromJpeg() creates a JPEG image from a file or a handle or another image in memory. - + You can use one of 3 syntax: - + pImage := gdImageFromJpeg( "myimage.jpg" ) - + or - + pImage := gdImageFromJpeg( nFileHandle, nSize ) - + or - + pImage := gdImageFromJpeg( pMemoryImagePtr, nSize ) - + the pImage pointer returned will be not NIL if successfull and will contains a memory pointer to the jpeg image. - + Remember to free memory with gdImageDestroy() before exit from application. HBGD uses it's own memory to manage an image, so it is important to use this function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage - + pImage := gdImageFromJpeg( "myimage.jpg" ) // Use here image ......... gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -255,34 +255,34 @@ - Image pointer $DESCRIPTION$ gdImageFromGif() creates a GIF image from a file or a handle or another image in memory. - + You can use one of 3 syntax: - + pImage := gdImageFromGif( "myimage.gif" ) - + or - + pImage := gdImageFromGif( nFileHandle, nSize ) - + or - + pImage := gdImageFromGif( pMemoryImagePtr, nSize ) - + the pImage pointer returned will be not NIL if successfull and will contains a memory pointer to the gif image. - + Remember to free memory with gdImageDestroy() before exit from application. HBGD uses it's own memory to manage an image, so it is important to use this function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage - + pImage := gdImageFromGif( "myimage.gif" ) // Use here image ......... gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -315,34 +315,34 @@ - Image pointer $DESCRIPTION$ gdImageFromPng() creates a PNG image from a file or a handle or another image in memory. - + You can use one of 3 syntax: - + pImage := gdImageFromPng( "myimage.png" ) - + or - + pImage := gdImageFromPng( nFileHandle, nSize ) - + or - + pImage := gdImageFromPng( pMemoryImagePtr, nSize ) - + the pImage pointer returned will be not NIL if successfull and will contains a memory pointer to the png image. - + Remember to free memory with gdImageDestroy() before exit from application. HBGD uses it's own memory to manage an image, so it is important to use this function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage - + pImage := gdImageFromPng( "myimage.png" ) // Use here image ......... gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -375,34 +375,34 @@ - Image pointer $DESCRIPTION$ gdImageFromGD() creates a GD image from a file or a handle or another image in memory. - + You can use one of 3 syntax: - + pImage := gdImageFromGD( "myimage.gd" ) - + or - + pImage := gdImageFromGD( nFileHandle, nSize ) - + or - + pImage := gdImageFromGD( pMemoryImagePtr, nSize ) - + the pImage pointer returned will be not NIL if successfull and will contains a memory pointer to the GD image. - + Remember to free memory with gdImageDestroy() before exit from application. HBGD uses it's own memory to manage an image, so it is important to use this function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage - + pImage := gdImageFromGD( "myimage.gd" ) // Use here image ......... gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -435,34 +435,34 @@ - Image pointer $DESCRIPTION$ gdImageFromWBmp() creates a WBmp image from a file or a handle or another image in memory. - + You can use one of 3 syntax: - + pImage := gdImageFromWBmp( "myimage.wbmp" ) - + or - + pImage := gdImageFromWBmp( nFileHandle, nSize ) - + or - + pImage := gdImageFromWBmp( pMemoryImagePtr, nSize ) - + the pImage pointer returned will be not NIL if successfull and will contains a memory pointer to the WBmp image. - + Remember to free memory with gdImageDestroy() before exit from application. HBGD uses it's own memory to manage an image, so it is important to use this function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage - + pImage := gdImageFromWBmp( "myimage.wbmp" ) // Use here image ......... gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -496,26 +496,26 @@ NIL $DESCRIPTION$ gdImageJpeg() saves a JPEG image to a file or a handle. - + You can use one of 2 syntax: - + gdImageJpeg( pImage, "myimage.jpg" ) - + or - + gdImageJpeg( pImage, nFileHandle ) - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage - + pImage := gdImageFromGif( "myimage.gif" ) - + // Image conversion gdImageJpeg( pImage, "myimage.jpg" ) - + gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -547,26 +547,26 @@ NIL $DESCRIPTION$ gdImageGif() saves a GIF image to a file or a handle. - + You can use one of 2 syntax: - + gdImageGif( pImage, "myimage.gif" ) - + or - + gdImageGif( pImage, nFileHandle ) - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage - + pImage := gdImageFromJpeg( "myimage.jpg" ) - + // Image conversion gdImageGif( pImage, "myimage.gif" ) - + gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -600,26 +600,26 @@ NIL $DESCRIPTION$ gdImagePng() saves a PNG image to a file or a handle. - + You can use one of 2 syntax: - + gdImagePng( pImage, "myimage.png" ) - + or - + gdImagePng( pImage, nFileHandle ) - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage - + pImage := gdImageFromGif( "myimage.gif" ) - + // Image conversion gdImagePng( pImage, "myimage.png" ) - + gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -651,26 +651,26 @@ NIL $DESCRIPTION$ gdImageGd() saves a GD image to a file or a handle. - + You can use one of 2 syntax: - + gdImageGd( pImage, "myimage.gd" ) - + or - + gdImageGd( pImage, nFileHandle ) - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage - + pImage := gdImageFromGif( "myimage.gif" ) - + // Image conversion gdImageGd( pImage, "myimage.gd" ) - + gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -703,38 +703,38 @@ NIL $DESCRIPTION$ gdImageWBmp() saves a WBMP image to a file or a handle. - + You can use one of 2 syntax: - + gdImageWBmp( pImage, "myimage.wbmp", nColor ) - + or - + gdImagePng( pImage, nFileHandle, nColor ) - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage LOCAL white, black - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate background white := gdImageColorAllocate(pImage, 255, 255, 255) - + // Allocate drawing color black := gdImageColorAllocate(pImage, 0, 0, 0) - + // Draw a rectangle gdImageRectangle(pImage, 0, 0, 99, 99, black) - + // Save the image with black as foreground color gdImageWBmp( pImage, "myimage.wbmp", black ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -767,29 +767,29 @@ NIL $DESCRIPTION$ gdImageSetPixel() sets a pixel to a particular color index. - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage LOCAL white - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color white := gdImageColorAllocate(pImage, 255, 255, 255) - + // Draw a pixel gdImageSetPixel(pImage, 50, 50, white) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -825,29 +825,29 @@ $DESCRIPTION$ gdImageLine() Draws a line between two end points (x1, y1 and x2, y2) with a particular color index. - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage LOCAL blue - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color blue := gdImageColorAllocate(pImage, 0, 0, 255) - + // Draw a line gdImageLine(pImage, 10, 10, 90, 90, blue) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -883,29 +883,29 @@ $DESCRIPTION$ gdImageDashedLine() Draws a dashed line between two end points (x1, y1 and x2, y2) with a particular color index. - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage LOCAL blue - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color blue := gdImageColorAllocate(pImage, 0, 0, 255) - + // Draw a dashed line gdImageDashedLine(pImage, 10, 10, 90, 90, blue) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -940,9 +940,9 @@ $DESCRIPTION$ gdImagePolygon() Draws a closed polygon with verticies (at least 3) with a particular color index. - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage @@ -952,22 +952,22 @@ { 99, 99 } ,; { 0, 99 } ; } - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color blue := gdImageColorAllocate(pImage, 0, 0, 255) - + // Draw a polygon gdImagePolygon(pImage, aVerticies, blue) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -1003,9 +1003,9 @@ gdImageOpenPolygon() Draws an open polygon with verticies (at least 3) with a particular color index. Unlike gdImagePolygon() the endpoints of the line sequence are not connected to close the polygon. - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage @@ -1015,22 +1015,22 @@ { 99, 99 } ,; { 0, 99 } ; } - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color blue := gdImageColorAllocate(pImage, 0, 0, 255) - + // Draws an open polygon gdImageOpenPolygon(pImage, aVerticies, blue) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -1066,29 +1066,29 @@ $DESCRIPTION$ gdImageRectangle() draws a rectangle between 2 points with a particular color index. - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage LOCAL blue - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color blue := gdImageColorAllocate(pImage, 0, 0, 255) - + // Draw a rectangle gdImageRectangle(pImage, 10, 10, 50, 50, blue) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -1123,9 +1123,9 @@ $DESCRIPTION$ gdImageFilledPolygon() Draws a filled polygon with verticies (at least 3) with a particular color index. - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage @@ -1135,22 +1135,22 @@ { 99, 99 } ,; { 0, 99 } ; } - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color blue := gdImageColorAllocate(pImage, 0, 0, 255) - + // Draw a filled polygon gdImageFilledPolygon(pImage, aVerticies, blue) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -1186,29 +1186,29 @@ $DESCRIPTION$ gdImageFilledRectangle() draws a filled rectangle between 2 points with a particular color index. - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage LOCAL blue - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color blue := gdImageColorAllocate(pImage, 0, 0, 255) - + // Draw a filled rectangle gdImageFilledRectangle(pImage, 10, 10, 50, 50, blue) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -1250,29 +1250,29 @@ The arc is drawn in the color specified by the last argument. A circle can be drawn by beginning from 0 degrees and ending at 360 degrees, with width and height being equal. must be greater than . Values greater than 360 are interpreted modulo 360. - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage LOCAL blue - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color blue := gdImageColorAllocate(pImage, 0, 0, 255) - + // Draw an ellipse gdImageArc(pImage, 50, 25, 98, 48, 0, 360, blue) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -1315,16 +1315,16 @@ The arc is drawn in the color specified by the last argument. A circle can be drawn by beginning from 0 degrees and ending at 360 degrees, with width and height being equal. must be greater than . Values greater than 360 are interpreted modulo 360. - + To set the color index you have to use gdImageColorAllocate() function. - + Last parameter is a bitwise OR of the following possibilities: gdArc gdChord gdPie (synonym for gdArc) gdNoFill gdEdged - + gdArc and gdChord are mutually exclusive; gdChord just connects the starting and ending angles with a straight line, while gdArc produces a rounded edge. gdPie is a synonym for gdArc. @@ -1332,31 +1332,31 @@ gdEdged, used together with gdNoFill, indicates that the beginning and ending angles should be connected to the center; this is a good way to outline (rather than fill) a 'pie slice' - + these constants are defined in gd.ch - + $EXAMPLES$ #include "gd.ch" - + PROCEDURE Main() LOCAL pImage LOCAL blue - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color blue := gdImageColorAllocate(pImage, 0, 0, 255) - + // Draw an ellipse gdImageFilledArc(pImage, 50, 25, 98, 48, 0, 360, blue, gdArc) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -1392,29 +1392,29 @@ $DESCRIPTION$ gdImageFilledEllipse() is used to draw a filled ellipse centered at the given point, with the specified width and height in pixels. - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage LOCAL blue - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color blue := gdImageColorAllocate(pImage, 0, 0, 255) - + // Draw an ellipse gdImageFilledEllipse(pImage, 50, 25, 98, 48, blue) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -1450,33 +1450,33 @@ gdImageFillToBorder() floods a portion of the image with the specified color, beginning at the specified point and stopping at the specified border color. For a way of flooding an area defined by the color of the starting point, see gdImageFill(). - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage LOCAL blue, red - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color blue := gdImageColorAllocate(pImage, 0, 0, 255) red := gdImageColorAllocate(pImage, 255, 0, 0) - + // Draw an ellipse gdImageArc(pImage, 50, 25, 98, 48, 0, 360, blue) - + // Fill the ellipse gdImageFillToBorder(pImage, 50, 50, blue, red) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -1516,33 +1516,33 @@ However, the tile image cannot be transparent. If the image you wish to fill with has a transparent color index, call gdImageTransparent on the tile image and set the transparent color index to -1 to turn off its transparency. - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage LOCAL blue, red - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color blue := gdImageColorAllocate(pImage, 0, 0, 255) red := gdImageColorAllocate(pImage, 255, 0, 0) - + // Draw an ellipse gdImageArc(pImage, 50, 25, 98, 48, 0, 360, blue) - + // Fill the ellipse gdImageFill(pImage, 50, 50, red) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -1578,47 +1578,47 @@ the boundaries of the line being drawn. All line-drawing functions, such as gdImageLine(), gdImageOpenPolygon() and gdImagePolygon(), will draw antialiased lines if the special "color" gdAntiAliased constant is used when calling them. - + gdImageSetAntiAliased is used to specify the actual foreground color to be used when drawing antialiased lines. You may set any color to be the foreground, however as of version 2.0.12 an alpha channel component is not supported. - + Antialiased lines can be drawn on both truecolor and palette-based images. However, attempts to draw antialiased lines on highly complex palette-based backgrounds may not give satisfactory results, due to the limited number of colors available in the palette. Antialiased line-drawing on simple backgrounds should work well with palette-based images; otherwise create or fetch a truecolor image instead. - + You need not take any special action when you are finished with antialised line drawing. - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ #include "gd.ch" - + PROCEDURE Main() LOCAL pImage LOCAL blue, red - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color /* Background color (first allocated) */ blue := gdImageColorAllocate(pImage, 0, 0, 255) red := gdImageColorAllocate(pImage, 255, 0, 0) - + gdImageSetAntiAliased(pImage, blue) - + // Draw a smooth line gdImageLine(pImage, 0, 0, 99, 9, gdAntiAliased) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -1653,39 +1653,39 @@ desired that lines not be blended with one particular color when it is encountered in the background, the gdImageSetAntiAliasedDontBlend() function can be used to indicate the special color that the foreground should stand out more clearly against. - + To set the color index you have to use gdImageColorAllocate() function. - + $EXAMPLES$ #include "gd.ch" - + PROCEDURE Main() LOCAL pImage LOCAL black, white, blue - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color /* Background color (first allocated) */ black := gdImageColorAllocate(pImage, 0, 0, 0) white := gdImageColorAllocate(pImage, 255, 255, 255) blue := gdImageColorAllocate(pImage, 0, 0, 255) - + gdImageSetAntiAliased(pImage, blue) - + // The portion of the line that crosses this white rectangle will not be blended smoothly gdImageSetAntiAliasedDontBlend(pImage, white) - + // Draw a smooth line gdImageLine(pImage, 0, 0, 99, 9, gdAntiAliased) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -1730,43 +1730,43 @@ should not set a brush unless you will actually use it; if you set a rapid succession of different brush images, you can quickly fill your color map, and the results will not be optimal. - + You need not take any special action when you are finished with a brush. As for any other image, if you will not be using the brush image for any further purpose, you should call gdImageDestroy. You must not use the color gdBrushed if the current brush has been destroyed; you can of course set a new brush to replace it. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage, pBrush LOCAL blue, red - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Open the brush PNG. For best results, portions of the brush that should be transparent // (ie, not part of the brush shape) should have the transparent color index. pBrush := gdImageCreateFromPng( "mybrush.png" ) - + // Allocate color (background color is the first allocate) black := gdImageColorAllocate(pImage, 0, 0, 0) - + // Set the brush gdImageSetBrush(pImage, pBrush) - + // Draw a line from the upper left corner to the lower // right corner using the brush. gdImageLine(pImage, 0, 0, 99, 99, gdBrushed) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + // Destroy the brush image gdImageDestroy( pBrush ) - + RETURN $STATUS$ R @@ -1802,7 +1802,7 @@ the underlying area to shine through can be created. All region-filling functions, such as gdImageFill and gdImageFilledPolygon, will use the current tile if the special "color" gdTiled is used when calling them. - + gdImageSetTile is used to specify the tile to be used in a particular image. You can set any image to be the tile. If the tile image does not have the same color map as the first image, any colors missing from the first image will be allocated. If not @@ -1810,44 +1810,44 @@ This allows arbitrary PNGs to be used as tile images. It also means, however, that you should not set a tile unless you will actually use it; if you set a rapid succession of different tile images, you can quickly fill your color map, and the results will not be optimal. - + You need not take any special action when you are finished with a tile. As for any other image, if you will not be using the tile image for any further purpose, you should call gdImageDestroy. You must not use the color gdTiled if the current tile has been destroyed; you can of course set a new tile to replace it. - + $EXAMPLES$ PROCEDURE Main() LOCAL pImage, pTile LOCAL blue, red - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Open the tile PNG. For best results, portions of the // tile that should be transparent (ie, allowing the // background to shine through) should have the transparent // color index. pTile := gdImageCreateFromPng( "mytile.png" ) - + // Allocate color (background color is the first allocate) black := gdImageColorAllocate(pImage, 0, 0, 0) - + // Set the tile gdImageSetTile(pImage, pTile) - + // Fill an area using the tile gdImageFilledRectangle(pImage, 25, 25, 75, 75, gdTiled) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + // Destroy the tile image gdImageDestroy( pTile ) - + RETURN $STATUS$ R @@ -1885,38 +1885,38 @@ of color values to be repeated. You can assign the special color value gdTransparent to indicate that the existing color should be left unchanged for that particular pixel (allowing a dashed line to be attractively drawn over an existing image). - + Then, to draw a line using the style, use the normal gdImageLine function with the special color value gdStyled. - + The style array is copied when you set the style, so you need not be concerned with keeping the array around indefinitely. This should not break existing code that assumes styles are not copied. - + You can also combine styles and brushes to draw the brush image at intervals instead of in a continuous stroke. When creating a style for use with a brush, the style values are interpreted differently: zero (0) indicates pixels at which the brush should not be drawn, while one (1) indicates pixels at which the brush should be drawn. To draw a styled, brushed line, you must use the special color value gdStyledBrushed. - + $EXAMPLES$ #include "gd.ch" - + PROCEDURE Main() LOCAL pImage, aStyleDotted := {}, aStyleDashed := {} LOCAL black, red - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color (background color is the first allocate) black := gdImageColorAllocate(pImage, 0, 0, 0) red := gdImageColorAllocate(pImage, 255, 0, 0) - + // Set up dotted style. Leave every other pixel alone. aAdd( aStyleDotted, red ) aAdd( aStyleDotted, gdTransparent ) - + // Set up dashed style. Three on, three off. aAdd( aStyleDashed, red ) aAdd( aStyleDashed, red ) @@ -1924,23 +1924,23 @@ aAdd( aStyleDashed, gdTransparent ) aAdd( aStyleDashed, gdTransparent ) aAdd( aStyleDashed, gdTransparent ) - + // Set dotted style. gdImageSetStyle(pImage, aStyleDotted) - + // Draw a line from the upper left corner to the lower right corner. gdImageLine(pImage, 0, 0, 99, 99, gdStyled) - + // Now the dashed line. gdImageSetStyle(pImage, aStyleDashed) gdImageLine(pimage, 0, 99, 0, 99, gdStyled) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R @@ -1972,33 +1972,33 @@ $DESCRIPTION$ gdImageSetThickness determines the width of lines drawn by the gdImageLine, gdImagePolygon, gdImageOpenPolygon and related functions, in pixels. - + $EXAMPLES$ #include "gd.ch" - + PROCEDURE Main() LOCAL pImage LOCAL black, white - + // Create an image in memory pImage := gdImageCreate( 100, 100 ) - + // Allocate color (background color is the first allocate) black := gdImageColorAllocate(pImage, 0, 0, 0) white := gdImageColorAllocate(pImage, 255, 255, 255) - + // Set thickness. gdImageSetThickness(pImage, 4) - + // Draw a fat line from the upper left corner to the lower right corner. gdImageLine(pImage, 0, 0, 99, 99, white) - + // Save the image gdImageJpeg( pImage, "myimage.jpg" ) - + // Destroy the image gdImageDestroy( pImage ) - + RETURN $STATUS$ R diff --git a/harbour/contrib/hbgd/gd.prg b/harbour/contrib/hbgd/gd.prg index 6146e6ee65..5ec89cae94 100644 --- a/harbour/contrib/hbgd/gd.prg +++ b/harbour/contrib/hbgd/gd.prg @@ -66,39 +66,42 @@ FUNCTION gdImageEllipse( im, cx, cy, w, h, color ) RETURN gdImageArc( im, cx, cy, w, h, 0, 360, color ) FUNCTION gdImageFTWidth( fontname, ptsize, angle ) + LOCAL nWidth := 0 LOCAL cErr LOCAL aRect := Array( 8 ) hb_default( @fontname, "Arial" ) - hb_default( @ptsize , 8 ) - hb_default( @angle , 0 ) + hb_default( @ptsize, 8 ) + hb_default( @angle, 0 ) cErr := gdImageStringFTEx( , @aRect, 0, fontname, ptsize, angle, 0, 0, "M" ) IF cErr == "" - nWidth := aRect[3] - aRect[1] + nWidth := aRect[ 3 ] - aRect[ 1 ] ENDIF RETURN nWidth FUNCTION gdImageFTHeight( fontname, ptsize, angle ) + LOCAL nWidth := 0 LOCAL cErr LOCAL aRect := Array( 8 ) hb_default( @fontname, "Arial" ) - hb_default( @ptsize , 8 ) - hb_default( @angle , 0 ) + hb_default( @ptsize, 8 ) + hb_default( @angle, 0 ) cErr := gdImageStringFTEx( , @aRect, 0, fontname, ptsize, angle, 0, 0, "M" ) IF cErr == "" - nWidth := aRect[2] - aRect[8] + nWidth := aRect[ 2 ] - aRect[ 8 ] ENDIF RETURN nWidth FUNCTION gdImageFTSize( string, fontname, ptsize, angle ) + LOCAL nWidth := 0 LOCAL nHeight := 0 LOCAL nX, nY @@ -106,38 +109,42 @@ FUNCTION gdImageFTSize( string, fontname, ptsize, angle ) LOCAL aRect := Array( 8 ) hb_default( @fontname, "Arial" ) - hb_default( @ptsize , 8 ) - hb_default( @angle , 0 ) + hb_default( @ptsize, 8 ) + hb_default( @angle, 0 ) cErr := gdImageStringFTEx( , @aRect, 0, fontname, ptsize, angle, 0, 0, string ) IF cErr == "" - nWidth := aRect[3] - aRect[1] - nHeight := aRect[2] - aRect[8] - nX := aRect[1] - nY := aRect[2] + nWidth := aRect[ 3 ] - aRect[ 1 ] + nHeight := aRect[ 2 ] - aRect[ 8 ] + nX := aRect[ 1 ] + nY := aRect[ 2 ] ENDIF RETURN { nWidth, nHeight, nX, nY } FUNCTION gdImageStringFT( im, fg, fontname, ptsize, angle, x, y, string, ; - linespacing, charmap, resolution ) + linespacing, charmap, resolution ) + LOCAL cErr - LOCAL aRect := Array(8) + LOCAL aRect := Array( 8 ) + cErr := gdImageStringFTEx( , @aRect, fg, fontname, ptsize, angle, x, y, string, linespacing, charmap, resolution ) IF cErr == "" cErr := gdImageStringFTEx( im, aRect, fg, fontname, ptsize, angle, x, y, string, linespacing, charmap, resolution ) ENDIF + RETURN cErr FUNCTION gdImageFromFile( cFile ) + LOCAL cPath, cName, cExt, cDrive LOCAL cType, cMime LOCAL hFile := { => } LOCAL oImage IF hb_FileExists( cFile ) - HB_FNameSplit( cFile, @cPath, @cName, @cExt, @cDrive ) + hb_FNameSplit( cFile, @cPath, @cName, @cExt, @cDrive ) SWITCH Lower( cExt ) CASE ".jpg" @@ -181,6 +188,7 @@ FUNCTION gdImageFromFile( cFile ) RETURN { oImage, hFile, cType, cMime } FUNCTION gdImageToString( oImage ) + LOCAL cString IF HB_ISOBJECT( oImage ) .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) ) @@ -198,9 +206,11 @@ FUNCTION gdImageToString( oImage ) ENDSWITCH ENDIF ENDIF + RETURN cString PROCEDURE gdImageToFile( oImage, cFile ) + LOCAL cString, cExt IF ! HB_ISSTRING( cFile ) diff --git a/harbour/contrib/hbgd/gdbar.prg b/harbour/contrib/hbgd/gdbar.prg index c3a24c0507..0c6b068c86 100644 --- a/harbour/contrib/hbgd/gdbar.prg +++ b/harbour/contrib/hbgd/gdbar.prg @@ -315,7 +315,7 @@ METHOD Finish( image_style, quality, nFG ) CLASS TBarCode // Output std handle == 1 - //::filename := ::text + // ::filename := ::text IF image_style == IMG_FORMAT_PNG ::OutputPng() ELSEIF image_style == IMG_FORMAT_JPEG diff --git a/harbour/contrib/hbgd/gdbarcod.prg b/harbour/contrib/hbgd/gdbarcod.prg index 5514a68645..5321244b64 100644 --- a/harbour/contrib/hbgd/gdbarcod.prg +++ b/harbour/contrib/hbgd/gdbarcod.prg @@ -108,7 +108,7 @@ METHOD New( nTypeCode ) CLASS TCode ELSEIF nTypeCode == 128 - ::aCode := {; + ::aCode := { ; "212222", "222122", "222221", "121223", "121322", "131222", "122213", "122312", "132212", "221213", ; "221312", "231212", "112232", "122132", "122231", "113222", "123122", "123221", "223211", "221132", ; "221231", "213212", "223112", "312131", "311222", "321122", "321221", "312212", "322112", "322211", ; @@ -245,7 +245,7 @@ METHOD Draw13( cText ) CLASS TCode IF ii > 1 .AND. ii < 8 - ::DrawSingleBar( iif( SubStr( xParity, ii - 1, 1 ) == "E",; + ::DrawSingleBar( iif( SubStr( xParity, ii - 1, 1 ) == "E", ; ::LeftHand_Even[ jj ], ; ::LeftHand_Odd[ jj ] ) ) ELSEIF ii > 1 .AND. ii >= 8 @@ -323,7 +323,7 @@ METHOD Draw8( cText ) CLASS TCode ::positionX := iif( ::textfont == 0, 0, 10 ) - //xParity := ::Parity[ 7 ] + // xParity := ::Parity[ 7 ] // First Bar ::positionX := 10 diff --git a/harbour/contrib/hbgd/gdchart.prg b/harbour/contrib/hbgd/gdchart.prg index 58628c9b55..1b7601d795 100644 --- a/harbour/contrib/hbgd/gdchart.prg +++ b/harbour/contrib/hbgd/gdchart.prg @@ -102,30 +102,39 @@ METHOD New( sx, sy ) CLASS GDChart RETURN Self METHOD AddData( hData ) CLASS GDChart + IF HB_ISHASH( hData ) - aAdd( ::aDataOfHashes, hData ) + AAdd( ::aDataOfHashes, hData ) ENDIF + RETURN Self METHOD SetData( aData ) CLASS GDChart + IF HB_ISARRAY( aData ) ::aDataOfHashes := aData ENDIF + RETURN Self METHOD AddDef( cDefKey, xDefVal ) CLASS GDChart + IF HB_ISSTRING( cDefKey ) hb_HSet( ::hDefs, Upper( cDefKey ), xDefVal ) ENDIF + RETURN Self METHOD SetDefs( hDefs ) CLASS GDChart + IF HB_ISHASH( hDefs ) ::hDefs := hDefs ENDIF + RETURN Self METHOD PieChart() CLASS GDChart + LOCAL hElement, nTot := 0 LOCAL nDegree := 0 LOCAL lFilled, lExtruded, nExtrude, nTotExtr := 0, pTile @@ -206,9 +215,9 @@ METHOD PieChart() CLASS GDChart ::SetTile( pTile ) colorp := gdTiled ELSE - if HB_ISARRAY( colorp ) - colorp := ::SetColor( colorp[1], colorp[2], colorp[3] ) - endif + IF HB_ISARRAY( colorp ) + colorp := ::SetColor( colorp[ 1 ], colorp[ 2 ], colorp[ 3 ] ) + ENDIF ENDIF IF lFilled ::Arc( nPosX, nPosY, nWidth, nWidth, nDegree, nDegree + nDim, .T., colorp, gdPie ) @@ -238,7 +247,7 @@ METHOD PieChart() CLASS GDChart colorp := ::GetPixel( nPosX, nPosY ) textcolor := ::SetColor( 255 - ::Red( colorp ), 255 - ::Green( colorp ), 255 - ::Blue( colorp ) ) ENDIF - //cTitle := hb_ntos( nVal ) + // cTitle := hb_ntos( nVal ) IF hFont == NIL ::Say( nPosX, nPosY, cLabel, textcolor, gdAlignCenter ) ELSE @@ -248,11 +257,13 @@ METHOD PieChart() CLASS GDChart nDegree += nDim + 0.1 NEXT + RETURN Self METHOD VerticalBarChart() CLASS GDChart + LOCAL hElement, nTot := 0 - //LOCAL nDegree := 0 +// LOCAL nDegree := 0 LOCAL lFilled, /*lExtruded, nExtrude,*/ pTile LOCAL colorp LOCAL nVal, nDim @@ -262,12 +273,12 @@ METHOD VerticalBarChart() CLASS GDChart LOCAL x, y, nWidth, nHeight, nMaxValue, color, nMaxLabel, cLabel LOCAL lShowAxis, lShowGrid - LOCAL nLeftLabelSpace //:= 40 - LOCAL nRightLabelSpace //:= 40 - LOCAL nBottomLabelSpace //:= 40 + LOCAL nLeftLabelSpace // := 40 + LOCAL nRightLabelSpace // := 40 + LOCAL nBottomLabelSpace // := 40 LOCAL nTopLabelSpace := 40 LOCAL lShowLabelLeft := .T. - LOCAL lShowLabelRight := .T. //.F. + LOCAL lShowLabelRight := .T. // .F. LOCAL lShowLabelBottom := .T. LOCAL lShowLabelTop := .F. LOCAL cAxisPict @@ -324,27 +335,27 @@ METHOD VerticalBarChart() CLASS GDChart nMaxLabel := 0 nMax := 0 FOR EACH hElement IN aDataOfHash - IF hElement:__enumIndex() == 1 - nMax := hElement[ "VALUE" ] - ELSE - nMax := Max( nMax, hElement[ "VALUE" ] ) - ENDIF - cLabel := __HGetValue( hElement, "LABEL" ) - nMaxLabel := Max( nMaxLabel, Len( iif( cLabel != NIL, cLabel, "" ) ) ) - nTot += hElement[ "VALUE" ] + IF hElement:__enumIndex() == 1 + nMax := hElement[ "VALUE" ] + ELSE + nMax := Max( nMax, hElement[ "VALUE" ] ) + ENDIF + cLabel := __HGetValue( hElement, "LABEL" ) + nMaxLabel := Max( nMaxLabel, Len( iif( cLabel != NIL, cLabel, "" ) ) ) + nTot += hElement[ "VALUE" ] NEXT IF ! HB_ISNUMERIC( nLeftLabelSpace ) nLeftLabelSpace := nBorder + Len( LTrim( Transform( nMax, cAxisPict ) ) ) * ::GetFontWidth() + nBorder ENDIF IF ! HB_ISNUMERIC( nRightLabelSpace ) - nRightLabelSpace := nLeftLabelSpace //nBorder + Len( hb_ntos( nMax ) ) * ::GetFontWidth() + nBorder + nRightLabelSpace := nLeftLabelSpace // nBorder + Len( hb_ntos( nMax ) ) * ::GetFontWidth() + nBorder ENDIF IF ! HB_ISNUMERIC( nBottomLabelSpace ) nBottomLabelSpace := nBorder + nMaxLabel * ::GetFontWidth() + nBorder ENDIF - __defaultNIL( @nMaxValue , nMax ) + __defaultNIL( @nMaxValue, nMax ) IF lShowAxis IF lShowLabelLeft @@ -381,24 +392,24 @@ METHOD VerticalBarChart() CLASS GDChart ::AddStyle( gdTransparent ) ::SetStyle() FOR n := 10 TO 100 STEP 10 - nDim := ( ( nMaxValue / 100 ) * n ) - nPosY := ( nDim / nMaxValue ) * nHeight - ::Line( x, ::Height() - ( y + nPosY), x + nWidth, ::Height() - ( y + nPosY ), gdStyled ) + nDim := ( ( nMaxValue / 100 ) * n ) + nPosY := ( nDim / nMaxValue ) * nHeight + ::Line( x, ::Height() - ( y + nPosY ), x + nWidth, ::Height() - ( y + nPosY ), gdStyled ) NEXT - ::SetThickness( nThick ) + ::SetThickness( nThick ) ENDIF IF lShowAxis // Y Axis FOR n := 10 TO 100 STEP 10 - nDim := ( ( nMaxValue / 100 ) * n ) - cLabel := LTrim( Transform( nDim, cAxisPict ) ) - nPosY := ( nDim / nMaxValue ) * nHeight - IF lShowLabelLeft - ::Say( x - nLeftLabelSpace + nBorder, ::Height() - ( y + nPosY ), PadL( cLabel, Len( LTrim( Transform( nMaxValue, cAxisPict ) ) ) ), color ) - ENDIF - IF lShowLabelRight - ::Say( x + nWidth + nBorder, ::Height() - ( y + nPosY ), cLabel, color ) - ENDIF + nDim := ( ( nMaxValue / 100 ) * n ) + cLabel := LTrim( Transform( nDim, cAxisPict ) ) + nPosY := ( nDim / nMaxValue ) * nHeight + IF lShowLabelLeft + ::Say( x - nLeftLabelSpace + nBorder, ::Height() - ( y + nPosY ), PadL( cLabel, Len( LTrim( Transform( nMaxValue, cAxisPict ) ) ) ), color ) + ENDIF + IF lShowLabelRight + ::Say( x + nWidth + nBorder, ::Height() - ( y + nPosY ), cLabel, color ) + ENDIF NEXT ENDIF @@ -406,19 +417,19 @@ METHOD VerticalBarChart() CLASS GDChart FOR EACH hElement IN aDataOfHash cLabel := __HGetValue( hElement, "LABEL" ) lFilled := __HGetValue( hElement, "FILLED" ) - //nExtrude := __HGetValue( hElement, "EXTRUDE" ) + // nExtrude := __HGetValue( hElement, "EXTRUDE" ) pTile := __HGetValue( hElement, "TILE" ) - //IF nExtrude != NIL + // IF nExtrude != NIL // lExtruded := .T. - //ELSE + // ELSE // lExtruded := .F. - //ENDIF + // ENDIF colorp := __HGetValue( hElement, "COLOR" ) nVal := hElement[ "VALUE" ] nDim := ( nVal / nMaxValue ) * nHeight __defaultNIL( @lFilled , .F. ) - //DEFAULT nExtrude TO 0 + // __defaultNIL( @nExtrude, 0 ) __defaultNIL( @colorp , ::SetColor( 0, 0, 0 ) ) nPosX := x + ( nSize * ( hElement:__enumIndex() - 1 ) ) @@ -427,9 +438,9 @@ METHOD VerticalBarChart() CLASS GDChart ::SetTile( pTile ) colorp := gdTiled ELSE - if HB_ISARRAY( colorp ) - colorp := ::SetColor( colorp[1], colorp[2], colorp[3] ) - endif + IF HB_ISARRAY( colorp ) + colorp := ::SetColor( colorp[ 1 ], colorp[ 2 ], colorp[ 3 ] ) + ENDIF ENDIF ::Rectangle( nPosX + nBorder, ::Height() - ( nPosY + nDim ), nPosX + nSize - nBorder, ::Height() - nPosY, lFilled, colorp ) @@ -440,11 +451,13 @@ METHOD VerticalBarChart() CLASS GDChart ENDIF ENDIF NEXT + RETURN Self METHOD HorizontalBarChart() CLASS GDChart + LOCAL hElement, nTot := 0 - //LOCAL nDegree := 0 +// LOCAL nDegree := 0 LOCAL lFilled, /*lExtruded, nExtrude,*/ pTile LOCAL colorp LOCAL nVal, nDim @@ -454,10 +467,10 @@ METHOD HorizontalBarChart() CLASS GDChart LOCAL x, y, nWidth, nHeight, nMaxValue, color, nMaxLabel, cLabel LOCAL lShowAxis, lShowGrid - LOCAL nLeftLabelSpace //:= 40 - LOCAL nRightLabelSpace //:= 40 - LOCAL nBottomLabelSpace //:= 40 - LOCAL nTopLabelSpace //:= 40 + LOCAL nLeftLabelSpace // := 40 + LOCAL nRightLabelSpace // := 40 + LOCAL nBottomLabelSpace // := 40 + LOCAL nTopLabelSpace // := 40 LOCAL lShowLabelLeft := .T. LOCAL lShowLabelRight := .T. LOCAL lShowLabelBottom := .T. @@ -574,9 +587,9 @@ METHOD HorizontalBarChart() CLASS GDChart ::AddStyle( gdTransparent ) ::SetStyle() FOR n := 10 TO 100 STEP 10 - nDim := ( ( nMaxValue / 100 ) * n ) - nPosX := ( nDim / nMaxValue ) * nWidth - ::Line( x + nPosX, y, x + nPosX, y + nHeight, gdStyled ) + nDim := ( ( nMaxValue / 100 ) * n ) + nPosX := ( nDim / nMaxValue ) * nWidth + ::Line( x + nPosX, y, x + nPosX, y + nHeight, gdStyled ) NEXT ::SetThickness( nThick ) ENDIF @@ -599,18 +612,18 @@ METHOD HorizontalBarChart() CLASS GDChart FOR EACH hElement IN aDataOfHash cLabel := __HGetValue( hElement, "LABEL" ) lFilled := __HGetValue( hElement, "FILLED" ) - //nExtrude := __HGetValue( hElement, "EXTRUDE" ) + // nExtrude := __HGetValue( hElement, "EXTRUDE" ) pTile := __HGetValue( hElement, "TILE" ) - //IF nExtrude != NIL + // IF nExtrude != NIL // lExtruded := .T. - //ELSE + // ELSE // lExtruded := .F. - //ENDIF + // ENDIF colorp := __HGetValue( hElement, "COLOR" ) nVal := hElement[ "VALUE" ] nDim := ( nVal / nMaxValue ) * nWidth __defaultNIL( @lFilled , .F. ) - //DEFAULT nExtrude TO 0 + // __defaultNIL( @nExtrude, 0 ) __defaultNIL( @colorp , ::SetColor( 0, 0, 0 ) ) nPosX := x @@ -620,9 +633,9 @@ METHOD HorizontalBarChart() CLASS GDChart ::SetTile( pTile ) colorp := gdTiled ELSE - if HB_ISARRAY( colorp ) - colorp := ::SetColor( colorp[1], colorp[2], colorp[3] ) - endif + IF HB_ISARRAY( colorp ) + colorp := ::SetColor( colorp[ 1 ], colorp[ 2 ], colorp[ 3 ] ) + ENDIF ENDIF ::Rectangle( nPosX, nPosY + nBorder, nPosX + nDim, nPosY + nSize - nBorder, lFilled, colorp ) @@ -633,11 +646,13 @@ METHOD HorizontalBarChart() CLASS GDChart ENDIF ENDIF NEXT + RETURN Self METHOD LineChart() CLASS GDChart + LOCAL hElement - //LOCAL nDegree := 0 +// LOCAL nDegree := 0 LOCAL /*lFilled, lExtruded, nExtrude,*/ pTile LOCAL colorp LOCAL nVal, nDim @@ -648,12 +663,12 @@ METHOD LineChart() CLASS GDChart LOCAL x, y, nWidth, nHeight, nMaxValue, nMinValue, nMaxLabel, nMinLabel LOCAL lShowAxis, lShowGrid - LOCAL nLeftLabelSpace //:= 40 - LOCAL nRightLabelSpace //:= 40 - LOCAL nBottomLabelSpace //:= 40 + LOCAL nLeftLabelSpace // := 40 + LOCAL nRightLabelSpace // := 40 + LOCAL nBottomLabelSpace // := 40 LOCAL nTopLabelSpace := 40 LOCAL lShowLabelLeft := .T. - LOCAL lShowLabelRight := .T. //.F. + LOCAL lShowLabelRight := .T. // .F. LOCAL lShowLabelBottom := .T. LOCAL lShowLabelTop := .F. LOCAL cAxisPict @@ -763,26 +778,26 @@ METHOD LineChart() CLASS GDChart nSize := Len( aDataOfHash ) - 1 - if nSize > 1 + IF nSize > 1 nSize := nWidth / nSize - else + ELSE nSize := nWidth - endif + ENDIF - nTotRange := nMaxValue + iif( nMinValue < 0, abs( nMinValue ), 0 ) + nTotRange := nMaxValue + iif( nMinValue < 0, Abs( nMinValue ), 0 ) nCeiling := 0 - do while ( nTotRange / ( 10 ^ nCeiling ) ) > 100 + DO WHILE ( nTotRange / ( 10 ^ nCeiling ) ) > 100 nCeiling++ - enddo + ENDDO nCeiling := 10 ^ nCeiling nMaxValue := ceiling( nMaxValue / nCeiling ) * nCeiling - nMinValue := iif( nMinValue < 0, -ceiling( abs( nMinValue ) / nCeiling ) * nCeiling, ceiling( nMinValue / nCeiling ) * nCeiling ) + nMinValue := iif( nMinValue < 0, -ceiling( Abs( nMinValue ) / nCeiling ) * nCeiling, ceiling( nMinValue / nCeiling ) * nCeiling ) - nTotRange := nMaxValue + iif( nMinValue < 0, abs( nMinValue ), 0 ) + nTotRange := nMaxValue + iif( nMinValue < 0, Abs( nMinValue ), 0 ) IF lShowGrid ::Rectangle( x, ::Height() - ( y + nHeight ), x + nWidth, ::Height() - y, .F., colorp ) @@ -800,29 +815,29 @@ METHOD LineChart() CLASS GDChart ::AddStyle( gdTransparent ) ::SetStyle() FOR n := 10 TO 100 STEP 10 - nDim := ( ( nTotRange / 100 ) * n ) - nPosY := ( nDim / nTotRange ) * nHeight - ::Line( x, ::Height() - ( y + nPosY), x + nWidth, ::Height() - ( y + nPosY ), gdStyled ) + nDim := ( ( nTotRange / 100 ) * n ) + nPosY := ( nDim / nTotRange ) * nHeight + ::Line( x, ::Height() - ( y + nPosY ), x + nWidth, ::Height() - ( y + nPosY ), gdStyled ) NEXT FOR EACH hElement IN aDataOfHash - nPosX := x + ( nSize * ( hElement:__enumIndex() - 1 ) ) - ::Line( nPosX, ::Height() - y, nPosX, ::Height() - ( y + nHeight ), gdStyled ) + nPosX := x + ( nSize * ( hElement:__enumIndex() - 1 ) ) + ::Line( nPosX, ::Height() - y, nPosX, ::Height() - ( y + nHeight ), gdStyled ) NEXT - ::SetThickness( nThick ) + ::SetThickness( nThick ) ENDIF IF lShowAxis // Y Axis FOR n := 0 TO 100 STEP 10 - nDim := ( ( nTotRange / 100 ) * n ) - cLabel := LTrim( Transform( nMinValue + ( nTotRange / 10 ) * ( n / 10 ), cAxisPict ) ) - nPosY := ( nDim / nTotRange ) * nHeight - IF lShowLabelLeft - ::Say( x - nLeftLabelSpace + nBorder, ::Height() - ( y + nPosY ), cLabel, colorp ) - ENDIF - IF lShowLabelRight - ::Say( x + nWidth + nBorder, ::Height() - ( y + nPosY ), cLabel, colorp ) - ENDIF + nDim := ( ( nTotRange / 100 ) * n ) + cLabel := LTrim( Transform( nMinValue + ( nTotRange / 10 ) * ( n / 10 ), cAxisPict ) ) + nPosY := ( nDim / nTotRange ) * nHeight + IF lShowLabelLeft + ::Say( x - nLeftLabelSpace + nBorder, ::Height() - ( y + nPosY ), cLabel, colorp ) + ENDIF + IF lShowLabelRight + ::Say( x + nWidth + nBorder, ::Height() - ( y + nPosY ), cLabel, colorp ) + ENDIF NEXT ENDIF @@ -830,21 +845,21 @@ METHOD LineChart() CLASS GDChart aPoints := {} FOR EACH hElement IN aDataOfHash cLabel := __HGetValue( hElement, "LABEL" ) - //lFilled := __HGetValue( hElement, "FILLED" ) - //nExtrude := __HGetValue( hElement, "EXTRUDE" ) + // lFilled := __HGetValue( hElement, "FILLED" ) + // nExtrude := __HGetValue( hElement, "EXTRUDE" ) pTile := __HGetValue( hElement, "TILE" ) - //IF nExtrude != NIL + // IF nExtrude != NIL // lExtruded := .T. - //ELSE + // ELSE // lExtruded := .F. - //ENDIF + // ENDIF colorp := __HGetValue( hElement, "COLOR" ) nVal := hElement[ "VALUE" ] - nDim := ( ( nVal + abs( nMinValue ) ) / nTotRange ) * nHeight + nDim := ( ( nVal + Abs( nMinValue ) ) / nTotRange ) * nHeight - //DEFAULT lFilled TO .F. - //DEFAULT nExtrude TO 0 - __defaultNIL( @colorp , ::SetColor( 0, 0, 0 ) ) + // __defaultNIL( @lFilled, .F. ) + // __defaultNIL( @nExtrude, 0 ) + __defaultNIL( @colorp, ::SetColor( 0, 0, 0 ) ) nPosX := x + ( nSize * ( hElement:__enumIndex() - 1 ) ) nPosY := y @@ -852,12 +867,12 @@ METHOD LineChart() CLASS GDChart ::SetTile( pTile ) colorp := gdTiled ELSE - if HB_ISARRAY( colorp ) + IF HB_ISARRAY( colorp ) colorp := ::SetColor( colorp[ 1 ], colorp[ 2 ], colorp[ 3 ] ) - endif + ENDIF ENDIF - //::Rectangle( nPosX + nBorder, ::Height() - ( nPosY + nDim ), nPosX + nSize - nBorder, ::Height() - nPosY, lFilled, colorp ) - aAdd( aPoints, { nPosX, ::Height() - ( nPosY + nDim ) } ) + // ::Rectangle( nPosX + nBorder, ::Height() - ( nPosY + nDim ), nPosX + nSize - nBorder, ::Height() - nPosY, lFilled, colorp ) + AAdd( aPoints, { nPosX, ::Height() - ( nPosY + nDim ) } ) IF lShowAxis // Y Axis @@ -871,24 +886,25 @@ METHOD LineChart() CLASS GDChart // Draw lines nThick := ::SetThickness( 3 ) - //::ResetStyles() - //::AddStyle( color ) - //::AddStyle( color ) - //::AddStyle( color ) - //::AddStyle( gdTransparent ) - //::AddStyle( gdTransparent ) - //::AddStyle( gdTransparent ) - //::AddStyle( gdTransparent ) - //::AddStyle( gdTransparent ) - //::SetStyle() + // ::ResetStyles() + // ::AddStyle( color ) + // ::AddStyle( color ) + // ::AddStyle( color ) + // ::AddStyle( gdTransparent ) + // ::AddStyle( gdTransparent ) + // ::AddStyle( gdTransparent ) + // ::AddStyle( gdTransparent ) + // ::AddStyle( gdTransparent ) + // ::SetStyle() FOR n := 1 TO Len( aPoints ) - 1 - ::Line( aPoints[ n ][ 1 ], aPoints[ n ][ 2 ], aPoints[ n + 1 ][ 1 ], aPoints[ n + 1 ][ 2 ], colorp ) + ::Line( aPoints[ n ][ 1 ], aPoints[ n ][ 2 ], aPoints[ n + 1 ][ 1 ], aPoints[ n + 1 ][ 2 ], colorp ) NEXT ::SetThickness( nThick ) RETURN Self METHOD Clone() CLASS GDChart + LOCAL oDestImage LOCAL pImage @@ -900,21 +916,22 @@ METHOD Clone() CLASS GDChart pImage := oDestImage:pImage oDestImage := oDestImage:CloneDataFrom( Self ) - //oDestImage := __objClone( Self ) + // oDestImage := __objClone( Self ) oDestImage:pImage := pImage ::Copy( 0, 0, ::Width, ::Height, 0, 0, oDestImage ) - //pImage := oDestImage:pImage - //// Signal that this image must not be destroyed - //oDestImage:lDestroy := .F. - //oDestImage := NIL - //oDestImage:pImage := pImage + // pImage := oDestImage:pImage + // // Signal that this image must not be destroyed + // oDestImage:lDestroy := .F. + // oDestImage := NIL + // oDestImage:pImage := pImage RETURN oDestImage METHOD CloneDataFrom( oSrc ) + // copy values from Source to Dest // please update in case of new datas diff --git a/harbour/contrib/hbgd/gdimage.prg b/harbour/contrib/hbgd/gdimage.prg index 59459be98a..156efba974 100644 --- a/harbour/contrib/hbgd/gdimage.prg +++ b/harbour/contrib/hbgd/gdimage.prg @@ -147,7 +147,7 @@ CREATE CLASS GDImage // Functions usefull for polygons METHOD Polygon( aPoints, lFilled, color ) METHOD OpenPolygon( aPoints, color ) - METHOD AddPoint( x, y ) INLINE aAdd( ::aPoints, { x, y } ) + METHOD AddPoint( x, y ) INLINE AAdd( ::aPoints, { x, y } ) METHOD ResetPoints() INLINE ::aPoints := {} METHOD Points() INLINE Len( ::aPoints ) @@ -170,7 +170,7 @@ CREATE CLASS GDImage // Functions usefull for style METHOD SetStyle( aStyle ) INLINE hb_default( @aStyle, ::aStyles ), gdImageSetStyle( ::pImage, aStyle ) - METHOD AddStyle( pColor ) INLINE aAdd( ::aStyles, pColor ) + METHOD AddStyle( pColor ) INLINE AAdd( ::aStyles, pColor ) METHOD ResetStyles() INLINE ::aStyles := {} METHOD StyleLenght() INLINE Len( ::aStyles ) @@ -364,19 +364,20 @@ METHOD Ellipse( x, y, nWidth, nHeight, lFilled, color ) CLASS GDImage RETURN Self METHOD LoadFromFile( cFile ) CLASS GDImage + LOCAL aLoad aLoad := gdImageFromFile( cFile ) - //Self := aLoad[1]:Clone() + //Self := aLoad[ 1 ]:Clone() ::Destroy() - Self := ::CloneDataFrom( aLoad[1] ) - //Self := __objClone( aLoad[1] ) - aLoad[1]:lDestroy := .F. - aLoad[1] := NIL + Self := ::CloneDataFrom( aLoad[ 1 ] ) + // Self := __objClone( aLoad[1] ) + aLoad[ 1 ]:lDestroy := .F. + aLoad[ 1 ] := NIL - ::hFile := aLoad[2] - ::cType := aLoad[3] - ::cMime := aLoad[4] + ::hFile := aLoad[ 2 ] + ::cType := aLoad[ 3 ] + ::cMime := aLoad[ 4 ] RETURN Self @@ -518,6 +519,7 @@ METHOD CopyMergeGray( nSrcX, nSrcY, nWidth, nHeight, nDstX, nDstY, nPerc, oDestI RETURN oDestImage METHOD CopyZoomed( nPerc, nSrcX, nSrcY, nSrcWidth, nSrcHeight ) CLASS GDImage + LOCAL oDestImage LOCAL nDstX, nDstY, nDstWidth, nDstHeight @@ -547,6 +549,7 @@ METHOD CopyZoomed( nPerc, nSrcX, nSrcY, nSrcWidth, nSrcHeight ) CLASS GDImage RETURN oDestImage METHOD Rotate( nAngle, lInside ) CLASS GDImage + LOCAL oDestImage LOCAL nWidth, nHeight LOCAL nAngRad := nAngle * PI() / 180 @@ -567,13 +570,13 @@ METHOD Rotate( nAngle, lInside ) CLASS GDImage oDestImage := GDImage():Create( nWidth, nHeight ) ENDIF IF !lInside - ::CopyRotated( ,,,, nWidth - nWidth/2, nHeight - nHeight/2, nAngle, oDestImage ) + ::CopyRotated( ,,,, nWidth - nWidth / 2, nHeight - nHeight / 2, nAngle, oDestImage ) ELSE - ::CopyRotated( ,,,,,, nAngle, oDestImage ) + ::CopyRotated( ,,,,,, nAngle, oDestImage ) ENDIF ::Destroy() Self := ::CloneDataFrom( oDestImage ) - //Self := __ObjClone( oDestImage ) // non funziona + // Self := __ObjClone( oDestImage ) // non funziona // Move new image to existing one // Signal that this image must not be destroyed @@ -583,12 +586,13 @@ METHOD Rotate( nAngle, lInside ) CLASS GDImage RETURN Self METHOD Crop( nX, nY, nWidth, nHeight ) CLASS GDImage + LOCAL oDestImage oDestImage := ::CopyResized( nX, nY, nWidth, nHeight, 0, 0, nWidth, nHeight ) ::Destroy() Self := ::CloneDataFrom( oDestImage ) - //Self := __ObjClone( oDestImage ) // non funziona + // Self := __ObjClone( oDestImage ) // non funziona // Move new image to existing one // Signal that this image must not be destroyed @@ -598,12 +602,13 @@ METHOD Crop( nX, nY, nWidth, nHeight ) CLASS GDImage RETURN Self METHOD Resize( nWidth, nHeight ) CLASS GDImage + LOCAL oDestImage oDestImage := ::CopyResampled( 0, 0, NIL, NIL, 0, 0, nWidth, nHeight ) ::Destroy() Self := ::CloneDataFrom( oDestImage ) - //Self := __ObjClone( oDestImage ) // non funziona + // Self := __ObjClone( oDestImage ) // non funziona // Move new image to existing one // Signal that this image must not be destroyed @@ -613,12 +618,13 @@ METHOD Resize( nWidth, nHeight ) CLASS GDImage RETURN Self METHOD Zoom( nPerc ) CLASS GDImage + LOCAL oDestImage oDestImage := ::CopyZoomed( nPerc ) ::Destroy() Self := ::CloneDataFrom( oDestImage ) - //Self := __ObjClone( oDestImage ) // non funziona + // Self := __ObjClone( oDestImage ) // non funziona // Move new image to existing one // Signal that this image must not be destroyed @@ -628,6 +634,7 @@ METHOD Zoom( nPerc ) CLASS GDImage RETURN Self METHOD Clone() CLASS GDImage + LOCAL oDestImage LOCAL pImage @@ -639,24 +646,25 @@ METHOD Clone() CLASS GDImage pImage := oDestImage:pImage oDestImage := oDestImage:CloneDataFrom( Self ) - //oDestImage := __objClone( Self ) + // oDestImage := __objClone( Self ) oDestImage:pImage := pImage ::Copy( 0, 0, ::Width, ::Height, 0, 0, oDestImage ) - //pImage := oDestImage:pImage - //// Signal that this image must not be destroyed - //oDestImage:lDestroy := .F. - //oDestImage := NIL - //oDestImage:pImage := pImage + // pImage := oDestImage:pImage + // // Signal that this image must not be destroyed + // oDestImage:lDestroy := .F. + // oDestImage := NIL + // oDestImage:pImage := pImage RETURN oDestImage METHOD Say( x, y, cString, color, nAlign ) CLASS GDImage + LOCAL nWidth, nLen LOCAL nPosX - hb_default( @color , ::pColor ) + hb_default( @color, ::pColor ) hb_default( @nAlign, gdAlignLeft ) IF nAlign == gdAlignCenter @@ -676,7 +684,8 @@ METHOD Say( x, y, cString, color, nAlign ) CLASS GDImage RETURN Self METHOD SayFreeType( x, y, cString, cFontName, nPitch, nAngle, color, nAlign, ; - nLineSpacing, nCharMap, nResolution ) CLASS GDImage + nLineSpacing, nCharMap, nResolution ) CLASS GDImage + LOCAL nWidth, nLen LOCAL nPosX @@ -687,11 +696,11 @@ METHOD SayFreeType( x, y, cString, cFontName, nPitch, nAngle, color, nAlign, ; hb_default( @nAngle , ::nFontAngle ) IF nAlign == gdAlignCenter - nWidth := nPitch //gdImageFTWidth( cFontName, nPitch )//, ::Radians( nAngle ) ) //::GetFontWidth() + nWidth := nPitch // gdImageFTWidth( cFontName, nPitch )//, ::Radians( nAngle ) ) //::GetFontWidth() nLen := Len( cString ) - nPosX := x - ( (nLen / 2) * nWidth ) + nPosX := x - ( ( nLen / 2 ) * nWidth ) ELSEIF nAlign == gdAlignRight - nWidth := gdImageFTWidth( cFontName, nPitch ) //, ::Radians( nAngle ) ) //::GetFontWidth() + nWidth := gdImageFTWidth( cFontName, nPitch ) // , ::Radians( nAngle ) ) //::GetFontWidth() nLen := Len( cString ) nPosX := x - ( nLen * nWidth ) ELSE @@ -699,11 +708,12 @@ METHOD SayFreeType( x, y, cString, cFontName, nPitch, nAngle, color, nAlign, ; ENDIF gdImageStringFT( ::pImage, color, cFontName, nPitch, ::Radians( nAngle ), nPosX, y, ; - cString, nLineSpacing, nCharMap, nResolution ) + cString, nLineSpacing, nCharMap, nResolution ) RETURN Self METHOD CloneDataFrom( oSrc ) + // copy values from Source to Dest // please update in case of new datas diff --git a/harbour/contrib/hbgd/tests/animgif.prg b/harbour/contrib/hbgd/tests/animgif.prg index 04c758a6bd..5efeb686d0 100644 --- a/harbour/contrib/hbgd/tests/animgif.prg +++ b/harbour/contrib/hbgd/tests/animgif.prg @@ -82,7 +82,7 @@ PROCEDURE Main() gdImageGifAnimAdd( im3, IMAGES_OUT + "anim2.gif", 0, 0, 0, 100, 1, im2 ) /* Write the end marker */ /* gdImageGifAnimEnd(out); is the same as the following: */ - //putc (";", out); + // putc (";", out); gdImageGifAnimEnd( hFile ) gdImageGifAnimEnd( IMAGES_OUT + "anim2.gif" ) /* Close file */ diff --git a/harbour/contrib/hbgd/tests/antialia.prg b/harbour/contrib/hbgd/tests/antialia.prg index 9d4f21f916..d57bd33e2d 100644 --- a/harbour/contrib/hbgd/tests/antialia.prg +++ b/harbour/contrib/hbgd/tests/antialia.prg @@ -79,7 +79,7 @@ PROCEDURE Main() gdImageFilledRectangle( im, 0, 0, 100, 100, white ) /* set foreground color */ - blue := gdImageColorAllocate( im, 0, 0, 255 ) + blue := gdImageColorAllocate( im, 0, 0, 255 ) /* Now we draw an aliased line */ gdImageLine( im, 0, 0, 99, 40, blue ) diff --git a/harbour/contrib/hbgd/tests/barms.prg b/harbour/contrib/hbgd/tests/barms.prg index f718e10526..d2abb0248d 100644 --- a/harbour/contrib/hbgd/tests/barms.prg +++ b/harbour/contrib/hbgd/tests/barms.prg @@ -54,7 +54,7 @@ PROCEDURE Main() bar:Finish( 2 ) // EAN8 - bar:= TCode():New( 8 ) + bar := TCode():New( 8 ) bar:Configure( 70, black, white, 2, 1 ) @@ -67,12 +67,12 @@ PROCEDURE Main() bar:ResizeImage() // EAN128 - bar:= TCode():New( 128 ) + bar := TCode():New( 128 ) bar:Configure( 50, black, white, 2, 1 ) // output image - //bar:out_img := "image_out/" + // bar:out_img := "image_out/" bar:CreateBar( 559, 88, IMAGES_OUT + "bar128.gif", white ) @@ -91,7 +91,7 @@ PROCEDURE Main() bar:Configure( 25, black, white, 1, 1,, .T. ) // output image - //bar:out_img := "febraban/" + // bar:out_img := "febraban/" bar:CreateBar( 560, 60, IMAGES_OUT + "febraban.gif", white ) bar:DrawI25( "P48WBQ7BX3M73X8V3WRT7F9JW" ) bar:Finish( 8 ) diff --git a/harbour/contrib/hbgd/tests/gdtestcl.prg b/harbour/contrib/hbgd/tests/gdtestcl.prg index 983a71000f..43207f3a9f 100644 --- a/harbour/contrib/hbgd/tests/gdtestcl.prg +++ b/harbour/contrib/hbgd/tests/gdtestcl.prg @@ -128,13 +128,13 @@ PROCEDURE Main() oI2:SavePng( IMAGES_OUT + "test.png" ) oI2:SaveJpeg( IMAGES_OUT + "test.jpg" ) oI2:SaveGif( IMAGES_OUT + "test.gif" ) - //oI2:SaveWBmp( IMAGES_OUT + "vale1.bmp", black ) + // oI2:SaveWBmp( IMAGES_OUT + "vale1.bmp", black ) /* test copy functions */ - //oI3 := GDImage():CreateTrueColor( oI2:Width * 2, oI2:Height * 2 ) - //oI2:CopyResampled( 0, 0, oI2:Width, oI2:Height, 0, 0, oI3:Width, oI3:Height, oI3 ) - //oI3:SaveJpeg("vale2.jpg") + // oI3 := GDImage():CreateTrueColor( oI2:Width * 2, oI2:Height * 2 ) + // oI2:CopyResampled( 0, 0, oI2:Width, oI2:Height, 0, 0, oI3:Width, oI3:Height, oI3 ) + // oI3:SaveJpeg("vale2.jpg") nSecs := Seconds() @@ -161,13 +161,13 @@ PROCEDURE Main() oI4:Zoom( 200 ) ? "end", Seconds() - nSecs - //__OutDebug( oI2:pImage ) - //oI4:SetFontGiant() + // __OutDebug( oI2:pImage ) + // oI4:SetFontGiant() gray := oI4:SetColor( 30, 30, 30 ) blue := oI4:SetColor( 0, 0, 200 ) - //oI4:SetColor( black ) - //oI4:Say( 100, 10, "Valentina" ) + // oI4:SetColor( black ) + // oI4:Say( 100, 10, "Valentina" ) #if defined( __PLATFORM__UNIX ) oI4:SayFreeType( oI4:CenterWidth(), oI4:CenterHeight(), "GD power", "arib____", 40, 45 ) #else @@ -184,7 +184,7 @@ PROCEDURE Main() oI4:SaveJpeg( IMAGES_OUT + "writing.jpg" ) - //oI4 := __ObjClone( oI2 ) + // oI4 := __ObjClone( oI2 ) oI4 := oI2:Clone() nSecs := Seconds() @@ -197,12 +197,12 @@ PROCEDURE Main() ? "start rotate inside" oI4:RotateInside( 45 ) ? "end", Seconds() - nSecs - //oI2:CopyRotated( , , , , , , 90, oI4 ) + // oI2:CopyRotated( , , , , , , 90, oI4 ) oI4:SaveJpeg( IMAGES_OUT + "rotatein.jpg" ) oI5:Zoom( 40 ) - //oI5:Rotate( 90 ) + // oI5:Rotate( 90 ) blue := oI5:SetColor( 0, 0, 200 ) oI5:SayFreeType( oI5:CenterWidth(), oI5:CenterHeight(), "GD", "verdana", 20, 0, blue ) oI5:SaveJpeg( IMAGES_OUT + "gd_zoom.jpg" ) @@ -219,8 +219,8 @@ PROCEDURE Main() oB := GDImage():LoadFromGif( IMAGES_IN + "harbour.gif" ) oB:Zoom( 15 ) - //oI5:Circle( 200, 200, oI5:Width() ) - //oI5:Line( 0, 200, 200, 200 ) + // oI5:Circle( 200, 200, oI5:Width() ) + // oI5:Line( 0, 200, 200, 200 ) oI5:AddDef( "FONTPITCH", "GIANT" ) @@ -234,7 +234,7 @@ PROCEDURE Main() { "LABEL" => "Seven", "VALUE" => 55, "FILLED" => .T. , "COLOR" => green } ; } ) - //oI5:VerticalBarChart() + // oI5:VerticalBarChart() oI5:PieChart() @@ -256,23 +256,23 @@ PROCEDURE Main() oI5:AddDef( "FONTPITCH", "GIANT" ) oI5:AddDef( "COLOR", blue ) - //oI5:AddSeries( "LABEL" => "Primo",; - // "VALUES" => { 10, 23, 54, 11, 32, 25 }, ; - // "COLOR" => blue ) + // oI5:AddSeries( "LABEL" => "Primo",; + // "VALUES" => { 10, 23, 54, 11, 32, 25 }, ; + // "COLOR" => blue ) -/* +#if 0 oI5:SetData( { ; - { "LABEL" => "One", "VALUE" => 1000, "COLOR" => blue, "FILLED" => .T., "EXTRUDE" => 40 },; - { "LABEL" => "Two", "VALUE" => 3500, "COLOR" => gray, "FILLED" => .T., "FONT" => { "NAME" => "Verdana", "PITCH" => 12, "ANGLE" => 0, "COLOR" => red } },; - { "LABEL" => "Three", "VALUE" => 5500, "COLOR" => green, "FILLED" => .T. }, ; - { "LABEL" => "Four", "VALUE" => 6500, "FILLED" => .T., "TILE" => oB }, ; - { "LABEL" => "Five", "VALUE" => 3400, "FILLED" => .T., "COLOR" => green }, ; - { "LABEL" => "Six", "VALUE" => 10000 }, ; - { "LABEL" => "Seven", "VALUE" => 0, "FILLED" => .T., "COLOR" => red }, ; - { "LABEL" => "Eight", "VALUE" => -2200 }, ; - { "LABEL" => "Nine", "VALUE" => -3600, "COLOR" => blue, "FILLED" => .T. } ; - } ) -*/ + { "LABEL" => "One", "VALUE" => 1000, "COLOR" => blue, "FILLED" => .T., "EXTRUDE" => 40 },; + { "LABEL" => "Two", "VALUE" => 3500, "COLOR" => gray, "FILLED" => .T., "FONT" => { "NAME" => "Verdana", "PITCH" => 12, "ANGLE" => 0, "COLOR" => red } },; + { "LABEL" => "Three", "VALUE" => 5500, "COLOR" => green, "FILLED" => .T. }, ; + { "LABEL" => "Four", "VALUE" => 6500, "FILLED" => .T., "TILE" => oB }, ; + { "LABEL" => "Five", "VALUE" => 3400, "FILLED" => .T., "COLOR" => green }, ; + { "LABEL" => "Six", "VALUE" => 10000 }, ; + { "LABEL" => "Seven", "VALUE" => 0, "FILLED" => .T., "COLOR" => red }, ; + { "LABEL" => "Eight", "VALUE" => -2200 }, ; + { "LABEL" => "Nine", "VALUE" => -3600, "COLOR" => blue, "FILLED" => .T. } ; + } ) +#endif oI5:SetData( { ; @@ -283,8 +283,8 @@ PROCEDURE Main() { "LABEL" => "Five", "VALUE" => 34, "FILLED" => .T., "COLOR" => green }, ; { "LABEL" => "Six", "VALUE" => 100 }, ; { "LABEL" => "Seven", "VALUE" => 0, "FILLED" => .T., "COLOR" => red }, ; - { "LABEL" => "Eight", "VALUE" => - 0 }, ; - { "LABEL" => "Nine", "VALUE" => - 0, "COLOR" => blue, "FILLED" => .T. } ; + { "LABEL" => "Eight", "VALUE" => 0 }, ; + { "LABEL" => "Nine", "VALUE" => 0, "COLOR" => blue, "FILLED" => .T. } ; } ) @@ -295,10 +295,10 @@ PROCEDURE Main() oI5:LineChart() oI5:SaveJpeg( IMAGES_OUT + "hystogrm.jpg" ) - //oI4 := GDImage():CreateTrueColor( oI2:Width * 2, oI2:Height * 2 ) - //oI2:CopyResampled( 0, 0, oI2:Width, oI2:Height, 0, 0, oI2:Width, oI2:Height, oI4 ) - //oI2:CopyResampled( 0, 0, oI2:Width, oI2:Height, oI4:CenterWidth(), oI4:CenterHeight(), oI2:Width, oI2:Height, oI4 ) - //oI4:SaveJpeg("vale3.jpg") + // oI4 := GDImage():CreateTrueColor( oI2:Width * 2, oI2:Height * 2 ) + // oI2:CopyResampled( 0, 0, oI2:Width, oI2:Height, 0, 0, oI2:Width, oI2:Height, oI4 ) + // oI2:CopyResampled( 0, 0, oI2:Width, oI2:Height, oI4:CenterWidth(), oI4:CenterHeight(), oI2:Width, oI2:Height, oI4 ) + // oI4:SaveJpeg("vale3.jpg") /* Destroy images in memory */ // Class does it auto diff --git a/harbour/contrib/hbgd/tests/test_out.prg b/harbour/contrib/hbgd/tests/test_out.prg index 36fb55fd89..acf5cced6c 100644 --- a/harbour/contrib/hbgd/tests/test_out.prg +++ b/harbour/contrib/hbgd/tests/test_out.prg @@ -34,8 +34,6 @@ PROCEDURE Main( ... ) hParams := GetParams( aParams ) ENDIF -// - // Gestione parametri IF ! Empty( hParams ) FOR EACH cPar IN hParams:Keys @@ -69,15 +67,15 @@ PROCEDURE Main( ... ) hb_default( @nPt, 30 ) IF cImg != NIL - //OutJpg( cImg, nPt ) + // OutJpg( cImg, nPt ) OutPhoto( cImg, nWidth, nHeight ) ELSEIF cPhoto != NIL StartHTML() - //OutHTML ValToPrg( hParams ) + "
" - //OutHTML ValToPrg( cParams ) + "
" - //OutHTML ValToPrg( cQuery ) + "
" - //OutHTML "" + "
" + // OutHTML ValToPrg( hParams ) + "
" + // OutHTML ValToPrg( cParams ) + "
" + // OutHTML ValToPrg( cQuery ) + "
" + // OutHTML "" + "
" OutHTML "" OutHTML "" OutHTML "
" OutHTML "" + "
" @@ -93,8 +91,8 @@ PROCEDURE Main( ... ) OutHTML "
" OutHTML "
" - //OutHTML "" + "
" - //OutHTML OS() + "
" + // OutHTML "" + "
" + // OutHTML OS() + "
" EndHTML() ELSE StartHTML() @@ -107,8 +105,8 @@ PROCEDURE StartHTML( cTitle ) hb_default( @cTitle, "" ) - WRITE 'content-type: text/html' - WRITE 'Pragma: no-cache' + WRITE "content-type: text/html" + WRITE "Pragma: no-cache" WRITE hb_eol() WRITE "" WRITE "" @@ -143,7 +141,7 @@ PROCEDURE OutPhoto( cPhoto, nWidth, nHeight ) // __OutDebug( hb_dumpvar( oImage ) ) - WRITE 'content-type: ' + oImage:cMime + hb_eol() + WRITE "content-type: " + oImage:cMime + hb_eol() cType := oImage:cType DO CASE @@ -205,7 +203,7 @@ PROCEDURE OutJpg( cText, nPitch ) // oI:SetColor( blue ) // oI:Say( 0, 0, cText ) - WRITE 'content-type: image/jpeg' + hb_eol() + WRITE "content-type: image/jpeg" + hb_eol() oI:OutputJpeg() @@ -243,7 +241,7 @@ FUNCTION GetVars( cFields, cSeparator ) hHashVars[ cName ] := xValue ENDIF - //Tracelog( "hHashVars, cName, xValue", DumpValue( hHashVars ), cName, xValue ) + // Tracelog( "hHashVars, cName, xValue", DumpValue( hHashVars ), cName, xValue ) NEXT // __OutDebug( hHashVars ) @@ -279,7 +277,7 @@ FUNCTION GetParams( aParams ) hHashVars[ cName ] := xValue ENDIF - //Tracelog( "hHashVars, cName, xValue", DumpValue( hHashVars ), cName, xValue ) + // Tracelog( "hHashVars, cName, xValue", DumpValue( hHashVars ), cName, xValue ) NEXT // __OutDebug( hHashVars ) diff --git a/harbour/contrib/hbgd/tests/tostring.prg b/harbour/contrib/hbgd/tests/tostring.prg index cc61947867..d9fddfc23c 100644 --- a/harbour/contrib/hbgd/tests/tostring.prg +++ b/harbour/contrib/hbgd/tests/tostring.prg @@ -32,7 +32,7 @@ PROCEDURE Main() oI:SaveJpeg( IMAGES_OUT + "testfile.jpg" ) - //Tracelog( oI:ToString() ) + // Tracelog( oI:ToString() ) hb_MemoWrit( IMAGES_OUT + "teststring.jpg", oI:ToString() ) diff --git a/harbour/contrib/hbgs/tests/testgs.prg b/harbour/contrib/hbgs/tests/testgs.prg index 3c560595b9..eb274dd6ca 100644 --- a/harbour/contrib/hbgs/tests/testgs.prg +++ b/harbour/contrib/hbgs/tests/testgs.prg @@ -15,15 +15,16 @@ #include "simpleio.ch" PROCEDURE Main() - LOCAL a, b, c, d - ? HB_GSAPI_REVISION( @a, @b, @c, @d ) + LOCAL a, b, c, d - ? a - ? b - ? c - ? d + ? HB_GSAPI_REVISION( @a, @b, @c, @d ) - ? HB_GS( { "--version" } ) + ? a + ? b + ? c + ? d - RETURN + ? HB_GS( { "--version" } ) + + RETURN diff --git a/harbour/contrib/hbgt/doc/en/hbgt.txt b/harbour/contrib/hbgt/doc/en/hbgt.txt index 20f217f6aa..3a2c23e396 100644 --- a/harbour/contrib/hbgt/doc/en/hbgt.txt +++ b/harbour/contrib/hbgt/doc/en/hbgt.txt @@ -20,24 +20,24 @@ Return the ascii value of a specified character in a string Equivalent (but much faster) to asc(substr(cStr, nPos, 1) - + NOTE: invalid parameters will return -1 nPos > len(cStr) will return -2 - + This last behaviour is different to the Funcky function of the same name. I changed the behaviour because some of the strings I process contain embedded NULs. $EXAMPLES$ ? gt_ascpos("the cat sat on the mat", 3) // prints e $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -60,15 +60,15 @@ Sum the ascii value of every character in the passed string and return the result. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -93,20 +93,20 @@ If the strings differ in the first character GT_AtDiff() will return 1. If the two strings are identical (or identical upto the last character in ) the function will return 0. - + NOTE: invalid parameters will return -1 $EXAMPLES$ ? gt_atDiff("the cat", "the rat") // prints 5 ? gt_atDiff("the cat", "the ") // prints 0 $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -128,19 +128,19 @@ $DESCRIPTION$ Return a string consisting of all the characters in even positions in . - + NOTE: invalid parameters will return "" $EXAMPLES$ ? gt_CharEven("abcdefghijklm") // prints "bdfhjl" $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -164,7 +164,7 @@ $DESCRIPTION$ Return a string consisting of all the characters in mixed with the characters from . - + NOTE: invalid parameters will return "" $EXAMPLES$ @@ -172,13 +172,13 @@ ? gt_CharMix("abcde", "123") // prints "a1b2c3de" ? gt_CharMix("abc", "12345") // prints "a1b2c345" $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -200,19 +200,19 @@ $DESCRIPTION$ Return a string consisting of all the characters in odd positions in . - + NOTE: invalid parameters will return "" $EXAMPLES$ ? gt_CharOdd("abcdefghijklm") // prints "acegikm" $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -235,19 +235,19 @@ $DESCRIPTION$ GT_ChrCount() counts how many times a specified character appears in a string. - + NOTE: invalid parameters will return -1 $EXAMPLES$ ? GT_ChrCount("t", "the cat sat on the mat") // prints 4 $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -275,13 +275,13 @@ ? chr(GT_ChrFirst("sa ", "This is a test")) // prints "s" ? chr(GT_ChrFirst("et", "This is a test")) // prints "t" $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -306,22 +306,22 @@ Returns the numnber of occurrences of characters belonging to the set in the string . If no characters in appears in GT_ChrTotal() will return 0. - + NOTE: invalid parameters will return -1 $EXAMPLES$ local cStr1 := "the cat sat on the mat" - + ? GT_ChrTotal("tae", cStr1) // prints 10 ? GT_ChrTotal("zqw", cStr1) // prints 0 $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -348,19 +348,19 @@ will return 0. If the substring is a single character use GT_ChrCount() as it will be faster. - + NOTE: invalid parameters will return -1 $EXAMPLES$ ? GT_StrCount("the", "the cat sat on the mat") // prints 2 $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -387,13 +387,13 @@ ? GT_strcspn("this is a test", "as ") // prints 3 ? GT_strcspn("this is a test", "elnjpq") // prints 11 $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -419,20 +419,20 @@ begins to differ from . If the two strings are identical (or identical upto the last character in ) the function will return "". - + NOTE: invalid parameters will return "" $EXAMPLES$ ? gt_strDiff("the cat", "the rat") // prints "rat" ? gt_strDiff("the cat", "the ") // prints "" $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -456,7 +456,7 @@ every character in the original. $DESCRIPTION$ Inserts fill characters into a string. - + NOTE: invalid parameters will return "" $EXAMPLES$ @@ -464,13 +464,13 @@ ? gt_strexpand("abc", 2) // prints "a b c" ? gt_strexpand("abc", 2, '|') // prints "a||b||c" $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -494,7 +494,7 @@ Return the length of the leading segment in the passed string that consists solely of the characters in the character set . - + If no characters in the the search set are found, the function shall return 0 $EXAMPLES$ @@ -502,13 +502,13 @@ ? GT_StrLeft("this is a test", "hit a") // prints 3 ? GT_StrLeft("this is a test", "zxy") // prints 0 $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -536,13 +536,13 @@ ? GT_Strpbrk("This is a test", "sa ") // prints "s is a test" ? GT_Strpbrk("This is a test", "et") // prints "test" $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -566,7 +566,7 @@ Return the length of the trailing segment in the passed string that consists solely of the characters in the character set . - + If no characters in the the search set are found, the function shall return 0 $EXAMPLES$ @@ -574,13 +574,13 @@ ? GT_StrRight("this is a test", "tes h") // prints 5 ? GT_StrRight("this is a test", "zxy") // prints 0 $TESTS$ - + $STATUS$ R $COMPLIANCE$ - + $PLATFORMS$ - + $FILES$ Library is libgt $END$ @@ -603,7 +603,7 @@ GT_NewFlag() is used to construct a bit flag string. The bit flag functions can be used for storing a large number of logical values in a small space. - + To create a bit flag string you need to pass GT_NewFlag() a value that is equal to or greater than the number of flags required (you may want to allow for future expansion). Each character in the @@ -627,10 +627,10 @@ GT_SetFlag(,[],[]) --> cFlagString $ARGUMENTS$ is a bit flag string created with GT_NewFlag() - + is the starting flag. This is an optional numeric value. If not supplied it defaults to 1. - + is the ending flag. This is an optional numeric value. If not supplied it defaults to . $RETURNS$ @@ -640,17 +640,17 @@ $EXAMPLES$ cFlags := GT_NewFlag(20) // Create a bit flag string for 20 // logical values. - + // Now set flags 10 to 15 to true. - + cFlags := GT_SetFlag(cFlags,10,15) - + // And set flag 18 to true. - + cFlags := GT_SetFlag(cFlags,18) - + // And set flag 1 to true. - + cFlags := GT_SetFlag(cFlags) $SEEALSO$ GT_NEWFLAG() GT_CLRFLAG() GT_ISFLAG() @@ -668,10 +668,10 @@ GT_ClrFlag(,[],[]) --> cFlagString $ARGUMENTS$ is a bit flag string created with GT_NewFlag() - + is the starting flag. This is an optional numeric value. If not supplied it defaults to 1. - + is the ending flag. This is an optional numeric value. If not supplied it defaults to . $RETURNS$ @@ -681,21 +681,21 @@ $EXAMPLES$ cFlags := GT_NewFlag(20) // Create a bit flag string for 20 // logical values. - + // Now, turn them all on. - + cFlags := GT_SetFlag(cFlags,1,20) - + // Now set flags 10 to 15 to false. - + cFlags := GT_ClrFlag(cFlags,10,15) - + // And set flag 18 to false. - + cFlags := GT_ClrFlag(cFlags,18) - + // And set flag 1 to false. - + cFlags := GT_ClrFlag(cFlags) $SEEALSO$ GT_NEWFLAG() GT_SETFLAG() GT_ISFLAG() @@ -713,7 +713,7 @@ GT_IsFlag(,[]) --> lSetting $ARGUMENTS$ is a bit flag string created with GT_NewFlag() - + is the flag to be tested. $RETURNS$ A boolean value, TRUE if the flag is on, FALSE if it's off. @@ -722,7 +722,7 @@ string. $EXAMPLES$ // Print the setting of the flags in a flag string called ``cDave'' - + for nFlag := 1 to (len(cDave)*8) ? "Flag number ",nFlag," == ",GT_IsFlag(cDave,nFlag) next diff --git a/harbour/contrib/hbhpdf/misc.prg b/harbour/contrib/hbhpdf/misc.prg index 9dd1d3dd53..c0e26fd867 100644 --- a/harbour/contrib/hbhpdf/misc.prg +++ b/harbour/contrib/hbhpdf/misc.prg @@ -51,6 +51,7 @@ */ FUNCTION hb_HPDF_IsVersion( ma, mi, mu ) + LOCAL HPDF_MAJOR_VERSION, HPDF_MINOR_VERSION, HPDF_BUGFIX_VERSION hb_HPDF_Version( @HPDF_MAJOR_VERSION, @HPDF_MINOR_VERSION, @HPDF_BUGFIX_VERSION ) diff --git a/harbour/contrib/hbhpdf/tests/harupdf.prg b/harbour/contrib/hbhpdf/tests/harupdf.prg index 469e83026e..7e51973e25 100644 --- a/harbour/contrib/hbhpdf/tests/harupdf.prg +++ b/harbour/contrib/hbhpdf/tests/harupdf.prg @@ -485,17 +485,17 @@ STATIC FUNCTION Page_Text( pdf ) page := HPDF_AddPage( pdf ) HPDF_Page_SetSize( page, HPDF_PAGE_SIZE_A5, HPDF_PAGE_PORTRAIT ) - //print_grid( pdf, page ) + // print_grid( pdf, page ) // page_height := HPDF_Page_GetHeight( page ) font := HPDF_GetFont( pdf, "Helvetica", NIL ) HPDF_Page_SetTextLeading( page, 20 ) - #define rLEFT 1 - #define rTOP 2 - #define rRIGHT 3 - #define rBOTTOM 4 +#define rLEFT 1 +#define rTOP 2 +#define rRIGHT 3 +#define rBOTTOM 4 /* text_rect method */ @@ -647,7 +647,7 @@ STATIC FUNCTION Page_Text( pdf ) HPDF_Page_Circle( page, 210, 190, 113 ) HPDF_Page_Stroke( page ) - angle1 := 360 / ( Len(SAMP_TXT ) ) + angle1 := 360 / ( Len( SAMP_TXT ) ) angle2 := 180 HPDF_Page_BeginText( page ) @@ -682,7 +682,7 @@ STATIC FUNCTION Page_TextScaling( pdf ) LOCAL page_title := "Text Demo" /* set compression mode */ - //HPDF_SetCompressionMode( pdf, HPDF_COMP_ALL ) + // HPDF_SetCompressionMode( pdf, HPDF_COMP_ALL ) /* create default-font */ font := HPDF_GetFont( pdf, "Helvetica", NIL ) @@ -691,7 +691,7 @@ STATIC FUNCTION Page_TextScaling( pdf ) page := HPDF_AddPage( pdf ) /* draw grid to the page */ - //print_grid( pdf, page ) + // print_grid( pdf, page ) /* print the lines of the page. HPDF_Page_SetLineWidth( page, 1 ) @@ -760,8 +760,8 @@ STATIC FUNCTION Page_TextScaling( pdf ) HPDF_Page_MoveTextPos( page, 0, - 25 ) FOR i := 1 TO len - r := i /len - b := 1 - ( i /len ) + r := i / len + b := 1 - ( i / len ) buf := SubStr( samp_text, i, 1 ) HPDF_Page_SetRGBFill( page, r, 0.0, b ) @@ -770,8 +770,8 @@ STATIC FUNCTION Page_TextScaling( pdf ) HPDF_Page_MoveTextPos( page, 0, - 25 ) FOR i := 1 TO len - b := i /len - g := 1 - ( i /len ) + b := i / len + g := 1 - ( i / len ) buf := SubStr( samp_text, i, 1 ) HPDF_Page_SetRGBFill( page, 0.0, g, b ) @@ -925,7 +925,7 @@ STATIC FUNCTION Page_TextScaling( pdf ) HPDF_Page_TextOut( page, 60, 60, samp_text2 ) HPDF_Page_EndText( page ) - //HPDF_SetCompressionMode( pdf, nComp ) + // HPDF_SetCompressionMode( pdf, nComp ) RETURN NIL @@ -1024,7 +1024,7 @@ STATIC FUNCTION Page_CodePages( pdf ) HPDF_Page_SetWidth( page, PAGE_WIDTH ) HPDF_Page_SetHeight( page, PAGE_HEIGHT ) - outline := HPDF_CreateOutline( pdf, root, encodings[i], NIL ) + outline := HPDF_CreateOutline( pdf, root, encodings[ i ], NIL ) dst := HPDF_Page_CreateDestination( page ) HPDF_Destination_SetXYZ( dst, 0, HPDF_Page_GetHeight( page ), 1 ) @@ -1037,16 +1037,16 @@ STATIC FUNCTION Page_CodePages( pdf ) HPDF_Page_BeginText( page ) HPDF_Page_SetFontAndSize( page, font, 20 ) HPDF_Page_MoveTextPos( page, 40, PAGE_HEIGHT - 50 ) - HPDF_Page_ShowText( page, encodings[i] ) + HPDF_Page_ShowText( page, encodings[ i ] ) HPDF_Page_ShowText( page, " Encoding" ) HPDF_Page_EndText( page ) - IF encodings[i] == "Symbol-Set" + IF encodings[ i ] == "Symbol-Set" font2 := HPDF_GetFont( pdf, "Symbol", NIL ) - ELSEIF encodings[i] == "ZapfDingbats-Set" + ELSEIF encodings[ i ] == "ZapfDingbats-Set" font2 := HPDF_GetFont( pdf, "ZapfDingbats", NIL ) ELSE - font2 := HPDF_GetFont( pdf, font_name, encodings[i] ) + font2 := HPDF_GetFont( pdf, font_name, encodings[ i ] ) ENDIF HPDF_Page_SetFontAndSize( page, font2, 14 ) @@ -1140,7 +1140,7 @@ STATIC FUNCTION Page_Graphics( pdf ) HPDF_Page_SetWidth( page, 200 ) /* draw grid to the page */ - //print_grid( pdf, page ) + // print_grid( pdf, page ) /* draw pie chart * @@ -1198,14 +1198,14 @@ STATIC FUNCTION Page_Graphics( pdf ) STATIC FUNCTION Page_Annotation( pdf ) - LOCAL rect1 := { 50 , 350, 150, 400 } + LOCAL rect1 := { 50, 350, 150, 400 } LOCAL rect2 := { 210, 350, 350, 400 } - LOCAL rect3 := { 50 , 250, 150, 300 } + LOCAL rect3 := { 50, 250, 150, 300 } LOCAL rect4 := { 210, 250, 350, 300 } - LOCAL rect5 := { 50 , 150, 150, 200 } + LOCAL rect5 := { 50, 150, 150, 200 } LOCAL rect6 := { 210, 150, 350, 200 } - LOCAL rect7 := { 50 , 50 , 150, 100 } - LOCAL rect8 := { 210, 50 , 350, 100 } + LOCAL rect7 := { 50, 50, 150, 100 } + LOCAL rect8 := { 210, 50, 350, 100 } LOCAL page, font, encoding, annot diff --git a/harbour/contrib/hbhttpd/core.prg b/harbour/contrib/hbhttpd/core.prg index 5217c0f8a4..7ec325809e 100644 --- a/harbour/contrib/hbhttpd/core.prg +++ b/harbour/contrib/hbhttpd/core.prg @@ -38,7 +38,7 @@ CREATE CLASS UHttpd MODULE FRIENDLY METHOD RUN( hConfig ) METHOD Stop() - VAR cError INIT "" + VAR cError INIT "" HIDDEN: VAR hConfig @@ -68,7 +68,7 @@ METHOD RUN( hConfig ) CLASS UHttpd LOCAL hSocket, nI, aI, xValue, aThreads, nJobs, nWorkers - IF ! HB_MTVM() + IF ! hb_mtvm() Self:cError := "Multithread support required" RETURN .F. ENDIF @@ -87,7 +87,7 @@ METHOD RUN( hConfig ) CLASS UHttpd "FirewallFilter" => "0.0.0.0/0" } FOR EACH xValue IN hConfig - IF ! HB_HHasKey( Self:hConfig, xValue:__enumKey ) .OR. !( ValType( xValue ) == ValType( Self:hConfig[ xValue:__enumKey ] ) ) + IF ! hb_HHasKey( Self:hConfig, xValue:__enumKey ) .OR. !( ValType( xValue ) == ValType( Self:hConfig[ xValue:__enumKey ] ) ) Self:cError := "Invalid config option '" + xValue:__enumKey + "'" RETURN .F. ENDIF @@ -95,20 +95,20 @@ METHOD RUN( hConfig ) CLASS UHttpd NEXT - IF Self:hConfig["SSL"] + IF Self:hConfig[ "SSL" ] #ifdef HB_HAS_OPENSSL SSL_INIT() DO WHILE RAND_STATUS() != 1 - RAND_add( Str( hb_random(), 18, 15 ) + Str( hb_milliseconds(), 20 ), 1 ) + RAND_add( Str( hb_Random(), 18, 15 ) + Str( hb_milliSeconds(), 20 ), 1 ) ENDDO Self:hSSLCtx := SSL_CTX_NEW( HB_SSL_CTX_NEW_METHOD_SSLV23_SERVER ) SSL_CTX_SET_OPTIONS( Self:hSSLCtx, HB_SSL_OP_NO_TLSv1 ) - IF SSL_CTX_USE_PRIVATEKEY_FILE( Self:hSSLCtx, Self:hConfig["PrivateKeyFilename"], HB_SSL_FILETYPE_PEM ) != 1 + IF SSL_CTX_USE_PRIVATEKEY_FILE( Self:hSSLCtx, Self:hConfig[ "PrivateKeyFilename" ], HB_SSL_FILETYPE_PEM ) != 1 Self:cError := "Invalid private key file" RETURN .F. ENDIF - IF SSL_CTX_USE_CERTIFICATE_FILE( Self:hSSLCtx, Self:hConfig["CertificateFilename"], HB_SSL_FILETYPE_PEM ) != 1 + IF SSL_CTX_USE_CERTIFICATE_FILE( Self:hSSLCtx, Self:hConfig[ "CertificateFilename" ], HB_SSL_FILETYPE_PEM ) != 1 Self:cError := "Invalid certificate file" RETURN .F. ENDIF @@ -118,12 +118,12 @@ METHOD RUN( hConfig ) CLASS UHttpd #endif ENDIF - IF Self:hConfig["Port"] < 1 .OR. Self:hConfig["Port"] > 65535 + IF Self:hConfig[ "Port" ] < 1 .OR. Self:hConfig[ "Port" ] > 65535 Self:cError := "Invalid port number" RETURN .F. ENDIF - IF ParseFirewallFilter( Self:hConfig["FirewallFilter"], @aI ) + IF ParseFirewallFilter( Self:hConfig[ "FirewallFilter" ], @aI ) Self:aFirewallFilter := aI ELSE Self:cError := "Invalid firewall filter" @@ -135,18 +135,18 @@ METHOD RUN( hConfig ) CLASS UHttpd Self:hmtxSession := hb_mutexCreate() IF Empty( Self:hListen := hb_socketOpen() ) - Self:cError := "Socket create error: " + hb_socketErrorString() + Self:cError := "Socket create error: " + hb_socketErrorString() RETURN .F. ENDIF - IF ! hb_socketBind( Self:hListen, { HB_SOCKET_AF_INET, Self:hConfig["BindAddress"], Self:hConfig["Port"] } ) - Self:cError := "Bind error: " + hb_socketErrorString() + IF ! hb_socketBind( Self:hListen, { HB_SOCKET_AF_INET, Self:hConfig[ "BindAddress" ], Self:hConfig[ "Port" ] } ) + Self:cError := "Bind error: " + hb_socketErrorString() hb_socketClose( Self:hListen ) RETURN .F. ENDIF IF ! hb_socketListen( Self:hListen ) - Self:cError := "Listen error: " + hb_socketErrorString() + Self:cError := "Listen error: " + hb_socketErrorString() hb_socketClose( Self:hListen ) RETURN .F. ENDIF @@ -162,7 +162,7 @@ METHOD RUN( hConfig ) CLASS UHttpd DO WHILE .T. IF Empty( hSocket := hb_socketAccept( Self:hListen,, 1000 ) ) IF hb_socketGetError() == HB_SOCKET_ERR_TIMEOUT - Eval( Self:hConfig["Idle"], Self ) + Eval( Self:hConfig[ "Idle" ], Self ) IF Self:lStop EXIT ENDIF @@ -208,11 +208,11 @@ METHOD LogAccess() CLASS UHttpd hb_mutexLock( Self:hmtxLog ) Eval( Self:hConfig[ "LogAccess" ], ; - server["REMOTE_ADDR"] + " - - [" + Right( cDate, 2 ) + "/" + ; - { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }[VAL(SUBSTR(cDate, 5, 2))] + ; - "/" + Left( cDate, 4 ) + ":" + cTime + ' +0000] "' + server["REQUEST_ALL"] + '" ' + ; + server[ "REMOTE_ADDR" ] + " - - [" + Right( cDate, 2 ) + "/" + ; + { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }[ Val( SubStr( cDate, 5, 2 ) ) ] + ; + "/" + Left( cDate, 4 ) + ":" + cTime + ' +0000] "' + server[ "REQUEST_ALL" ] + '" ' + ; hb_ntos( t_nStatusCode ) + " " + hb_ntos( Len( t_cResult ) ) + ; - ' "' + server["HTTP_REFERER"] + '" "' + server["HTTP_USER_AGENT"] + ; + ' "' + server[ "HTTP_REFERER" ] + '" "' + server[ "HTTP_USER_AGENT" ] + ; '"' ) hb_mutexUnlock( Self:hmtxLog ) @@ -223,9 +223,9 @@ STATIC FUNCTION IPAddr2Num( cIP ) LOCAL aA, n1, n2, n3, n4 aA := hb_regex( "^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$", cIP ) - IF Len( aA ) == 5 .AND. ( n1 := Val( aA[2] ) ) <= 255 .AND. ( n2 := Val( aA[3] ) ) <= 255 .AND. ; - ( n3 := Val( aA[4] ) ) <= 255 .AND. ( n4 := Val( aA[5] ) ) <= 255 - RETURN ( ( (n1 * 256 ) + n2 ) * 256 + n3 ) * 256 + n4 + IF Len( aA ) == 5 .AND. ( n1 := Val( aA[ 2 ] ) ) <= 255 .AND. ( n2 := Val( aA[ 3 ] ) ) <= 255 .AND. ; + ( n3 := Val( aA[ 4 ] ) ) <= 255 .AND. ( n4 := Val( aA[ 5 ] ) ) <= 255 + RETURN ( ( ( n1 * 256 ) + n2 ) * 256 + n3 ) * 256 + n4 ENDIF RETURN NIL @@ -259,7 +259,7 @@ STATIC FUNCTION ParseFirewallFilter( cFilter, aFilter ) ENDIF ELSE nPrefix := Val( cI ) - IF nPrefix < 0 .OR. nPrefix > 32 .OR. ! ( HB_NTOS( nPrefix ) == cI ) + IF nPrefix < 0 .OR. nPrefix > 32 .OR. ! ( hb_ntos( nPrefix ) == cI ) RETURN .F. ENDIF ENDIF @@ -279,46 +279,46 @@ STATIC FUNCTION ParseFirewallFilter( cFilter, aFilter ) AAdd( aDeny, { nAddr, nAddr2 } ) ELSE // Add to filter - HB_HHasKey( aFilter, nAddr, @nPos ) - IF nPos == 0 .OR. HB_HValueAt( aFilter, nPos ) + 1 < nAddr + hb_HHasKey( aFilter, nAddr, @nPos ) + IF nPos == 0 .OR. hb_HValueAt( aFilter, nPos ) + 1 < nAddr // Does not overlap/glue with nPos // So, add new interval aFilter[ nAddr ] := nAddr2 nPos++ ENDIF - HB_HHasKey( aFilter, nAddr2 + 1, @nPos2 ) + hb_HHasKey( aFilter, nAddr2 + 1, @nPos2 ) // Merge and delete inner subintervals - aFilter[ HB_HKeyAt( aFilter, nPos ) ] := Max( HB_HValueAt( aFilter, nPos2 ), nAddr2 ) + aFilter[ hb_HKeyAt( aFilter, nPos ) ] := Max( hb_HValueAt( aFilter, nPos2 ), nAddr2 ) DO WHILE nPos2-- > nPos - HB_HDelAt( aFilter, nPos + 1 ) + hb_HDelAt( aFilter, nPos + 1 ) ENDDO ENDIF ENDIF NEXT FOR EACH aI IN aDeny - nAddr := aI[1] - nAddr2 := aI[2] + nAddr := aI[ 1 ] + nAddr2 := aI[ 2 ] // Delete from filter - HB_HHasKey( aFilter, nAddr, @nPos ) - IF nPos == 0 .OR. HB_HValueAt( aFilter, nPos ) < nAddr + hb_HHasKey( aFilter, nAddr, @nPos ) + IF nPos == 0 .OR. hb_HValueAt( aFilter, nPos ) < nAddr nPos++ ENDIF IF nPos > Len( aFilter ) LOOP ENDIF - HB_HHasKey( aFilter, nAddr2, @nPos2 ) - IF nPos2 > 0 .AND. HB_HValueAt( aFilter, nPos2 ) > nAddr2 - aFilter[ nAddr2 + 1 ] := HB_HValueAt( aFilter, nPos2 ) + hb_HHasKey( aFilter, nAddr2, @nPos2 ) + IF nPos2 > 0 .AND. hb_HValueAt( aFilter, nPos2 ) > nAddr2 + aFilter[ nAddr2 + 1 ] := hb_HValueAt( aFilter, nPos2 ) ENDIF - IF nAddr > HB_HKeyAt( aFilter, nPos ) - aFilter[ HB_HKeyAt( aFilter, nPos ) ] := nAddr - 1 + IF nAddr > hb_HKeyAt( aFilter, nPos ) + aFilter[ hb_HKeyAt( aFilter, nPos ) ] := nAddr - 1 nPos++ ENDIF DO WHILE nPos2-- >= nPos - HB_HDelAt( aFilter, nPos ) + hb_HDelAt( aFilter, nPos ) ENDDO NEXT @@ -337,7 +337,7 @@ STATIC FUNCTION MY_SSL_READ( hConfig, hSSL, hSocket, cBuf, nTimeout, nError ) nErr := hb_socketSelectRead( hSocket, nTimeout ) IF nErr < 0 nError := hb_socketGetError() - ELSE // Both cases: data received and timeout + ELSE // Both cases: data received and timeout nError := HB_SOCKET_ERR_TIMEOUT ENDIF RETURN -1 @@ -345,7 +345,7 @@ STATIC FUNCTION MY_SSL_READ( hConfig, hSSL, hSocket, cBuf, nTimeout, nError ) nErr := hb_socketSelectWrite( hSocket, nTimeout ) IF nErr < 0 nError := hb_socketGetError() - ELSE // Both cases: data sent and timeout + ELSE // Both cases: data sent and timeout nError := HB_SOCKET_ERR_TIMEOUT ENDIF RETURN -1 @@ -442,7 +442,7 @@ STATIC FUNCTION ProcessConnection( oServer ) /* main worker thread loop */ DO WHILE .T. - hb_mutexSubscribe( oServer:hmtxQueue, , @hSocket ) + hb_mutexSubscribe( oServer:hmtxQueue,, @hSocket ) IF hSocket == NIL EXIT ENDIF @@ -450,41 +450,41 @@ STATIC FUNCTION ProcessConnection( oServer ) /* Prepare server variable and clone it for every query, because request handler script can ruin variable value */ aServer := { => } - aServer["HTTPS"] := oServer:hConfig["SSL"] + aServer[ "HTTPS" ] := oServer:hConfig[ "SSL" ] IF ! Empty( aI := hb_socketGetPeerName( hSocket ) ) - aServer["REMOTE_ADDR"] := aI[2] - aServer["REMOTE_HOST"] := aServer["REMOTE_ADDR"] // no reverse DNS - aServer["REMOTE_PORT"] := aI[3] + aServer[ "REMOTE_ADDR" ] := aI[ 2 ] + aServer[ "REMOTE_HOST" ] := aServer[ "REMOTE_ADDR" ] // no reverse DNS + aServer[ "REMOTE_PORT" ] := aI[ 3 ] ENDIF IF ! Empty( aI := hb_socketGetSockName( hSocket ) ) - aServer["SERVER_ADDR"] := aI[2] - aServer["SERVER_PORT"] := aI[3] + aServer[ "SERVER_ADDR" ] := aI[ 2 ] + aServer[ "SERVER_PORT" ] := aI[ 3 ] ENDIF /* Firewall */ - nLen := IPAddr2Num( aServer["REMOTE_ADDR"] ) - HB_HHasKey( oServer:aFirewallFilter, nLen, @nErr ) - IF nErr > 0 .AND. nLen <= HB_HValueAt( oServer:aFirewallFilter, nErr ) - Eval( oServer:hConfig[ "Trace" ], "Firewall denied", aServer["REMOTE_ADDR"] ) + nLen := IPAddr2Num( aServer[ "REMOTE_ADDR" ] ) + hb_HHasKey( oServer:aFirewallFilter, nLen, @nErr ) + IF nErr > 0 .AND. nLen <= hb_HValueAt( oServer:aFirewallFilter, nErr ) + Eval( oServer:hConfig[ "Trace" ], "Firewall denied", aServer[ "REMOTE_ADDR" ] ) hb_socketShutdown( hSocket ) hb_socketClose( hSocket ) LOOP ENDIF #ifdef HB_HAS_OPENSSL - IF oServer:hConfig["SSL"] + IF oServer:hConfig[ "SSL" ] hSSL := SSL_NEW( oServer:hSSLCtx ) - SSL_SET_MODE( hSSL, hb_bitOr( SSL_GET_MODE(hSSL ), HB_SSL_MODE_ENABLE_PARTIAL_WRITE ) ) + SSL_SET_MODE( hSSL, hb_bitOr( SSL_GET_MODE( hSSL ), HB_SSL_MODE_ENABLE_PARTIAL_WRITE ) ) hb_socketSetBlockingIO( hSocket, .F. ) SSL_SET_FD( hSSL, hb_socketGetFD( hSocket ) ) - nTime := hb_milliseconds() + nTime := hb_milliSeconds() DO WHILE .T. IF ( nErr := MY_SSL_ACCEPT( oServer:hConfig, hSSL, hSocket, 1000 ) ) == 0 EXIT ELSE IF nErr == HB_SOCKET_ERR_TIMEOUT - IF ( hb_milliseconds() - nTime ) > 1000 * 30 .OR. oServer:lStop + IF ( hb_Milliseconds() - nTime ) > 1000 * 30 .OR. oServer:lStop Eval( oServer:hConfig[ "Trace" ], "SSL accept timeout", hSocket ) EXIT ENDIF @@ -502,13 +502,13 @@ STATIC FUNCTION ProcessConnection( oServer ) LOOP ENDIF - aServer["SSL_CIPHER"] := SSL_GET_CIPHER( hSSL ) - aServer["SSL_PROTOCOL"] := SSL_GET_VERSION( hSSL ) - aServer["SSL_CIPHER_USEKEYSIZE"] := SSL_GET_CIPHER_BITS( hSSL, @nErr ) - aServer["SSL_CIPHER_ALGKEYSIZE"] := nErr - aServer["SSL_VERSION_LIBRARY"] := SSLEAY_VERSION( HB_SSLEAY_VERSION ) - aServer["SSL_SERVER_I_DN"] := X509_NAME_ONELINE( X509_GET_ISSUER_NAME( SSL_GET_CERTIFICATE(hSSL ) ) ) - aServer["SSL_SERVER_S_DN"] := X509_NAME_ONELINE( X509_GET_SUBJECT_NAME( SSL_GET_CERTIFICATE(hSSL ) ) ) + aServer[ "SSL_CIPHER" ] := SSL_GET_CIPHER( hSSL ) + aServer[ "SSL_PROTOCOL" ] := SSL_GET_VERSION( hSSL ) + aServer[ "SSL_CIPHER_USEKEYSIZE" ] := SSL_GET_CIPHER_BITS( hSSL, @nErr ) + aServer[ "SSL_CIPHER_ALGKEYSIZE" ] := nErr + aServer[ "SSL_VERSION_LIBRARY" ] := SSLEAY_VERSION( HB_SSLEAY_VERSION ) + aServer[ "SSL_SERVER_I_DN" ] := X509_NAME_ONELINE( X509_GET_ISSUER_NAME( SSL_GET_CERTIFICATE( hSSL ) ) ) + aServer[ "SSL_SERVER_S_DN" ] := X509_NAME_ONELINE( X509_GET_SUBJECT_NAME( SSL_GET_CERTIFICATE( hSSL ) ) ) ENDIF #endif @@ -520,15 +520,15 @@ STATIC FUNCTION ProcessConnection( oServer ) /* receive query header */ nLen := 1 - nTime := hb_milliseconds() + nTime := hb_Milliseconds() cBuf := Space( 4096 ) DO WHILE At( CR_LF + CR_LF, cRequest ) == 0 #ifdef HB_HAS_OPENSSL - IF oServer:hConfig["SSL"] + IF oServer:hConfig[ "SSL" ] nLen := MY_SSL_READ( oServer:hConfig, hSSL, hSocket, @cBuf, 1000, @nErr ) ELSE #endif - nLen := hb_socketRecv( hSocket, @cBuf, , , 1000 ) + nLen := hb_socketRecv( hSocket, @cBuf,,, 1000 ) IF nLen < 0 nErr := hb_socketGetError() ENDIF @@ -543,7 +543,7 @@ STATIC FUNCTION ProcessConnection( oServer ) ELSE /* nLen == -1 socket error */ IF nErr == HB_SOCKET_ERR_TIMEOUT - IF ( hb_milliseconds() - nTime ) > 1000 * 30 .OR. oServer:lStop + IF ( hb_Milliseconds() - nTime ) > 1000 * 30 .OR. oServer:lStop Eval( oServer:hConfig[ "Trace" ], "receive timeout", hSocket ) EXIT ENDIF @@ -559,7 +559,7 @@ STATIC FUNCTION ProcessConnection( oServer ) ENDIF // PRIVATE - server := HB_HCLONE( aServer ) + server := hb_HClone( aServer ) get := { => } post := { => } cookie := { => } @@ -580,15 +580,15 @@ STATIC FUNCTION ProcessConnection( oServer ) /* receive query body */ nLen := 1 - nTime := hb_milliseconds() + nTime := hb_Milliseconds() cBuf := Space( 4096 ) DO WHILE Len( cRequest ) < nReqLen #ifdef HB_HAS_OPENSSL - IF oServer:hConfig["SSL"] + IF oServer:hConfig[ "SSL" ] nLen := MY_SSL_READ( oServer:hConfig, hSSL, hSocket, @cBuf, 1000, @nErr ) ELSE #endif - nLen := hb_socketRecv( hSocket, @cBuf, , , 1000 ) + nLen := hb_socketRecv( hSocket, @cBuf,,, 1000 ) IF nLen < 0 nErr := hb_socketGetError() ENDIF @@ -603,7 +603,7 @@ STATIC FUNCTION ProcessConnection( oServer ) ELSE /* nLen == -1 socket error */ IF nErr == HB_SOCKET_ERR_TIMEOUT - IF ( hb_milliseconds() - nTime ) > 1000 * 120 .OR. oServer:lStop + IF ( hb_Milliseconds() - nTime ) > 1000 * 120 .OR. oServer:lStop Eval( oServer:hConfig[ "Trace" ], "receive timeout", hSocket ) EXIT ENDIF @@ -623,16 +623,16 @@ STATIC FUNCTION ProcessConnection( oServer ) cRequest := SubStr( cRequest, nReqLen + 1 ) /* Deal with supported protocols and methods */ - IF ! ( Left( server["SERVER_PROTOCOL"], 5 ) == "HTTP/" ) + IF ! ( Left( server[ "SERVER_PROTOCOL" ], 5 ) == "HTTP/" ) USetStatusCode( 400 ) /* Bad request */ UAddHeader( "Connection", "close" ) - ELSEIF ! ( SubStr( server["SERVER_PROTOCOL"], 6 ) $ "1.0 1.1" ) + ELSEIF ! ( SubStr( server[ "SERVER_PROTOCOL" ], 6 ) $ "1.0 1.1" ) USetStatusCode( 505 ) /* HTTP version not supported */ - ELSEIF !( server["REQUEST_METHOD"] $ "GET POST" ) + ELSEIF !( server[ "REQUEST_METHOD" ] $ "GET POST" ) USetStatusCode( 501 ) /* Not implemented */ ELSE - IF server["SERVER_PROTOCOL"] == "HTTP/1.1" - IF Lower( server["HTTP_CONNECTION"] ) == "close" + IF server[ "SERVER_PROTOCOL" ] == "HTTP/1.1" + IF Lower( server[ "HTTP_CONNECTION" ] ) == "close" UAddHeader( "Connection", "close" ) ELSE UAddHeader( "Connection", "keep-alive" ) @@ -650,11 +650,11 @@ STATIC FUNCTION ProcessConnection( oServer ) DO WHILE hb_BLen( cBuf ) > 0 .AND. ! oServer:lStop #ifdef HB_HAS_OPENSSL - IF oServer:hConfig["SSL"] + IF oServer:hConfig[ "SSL" ] nLen := MY_SSL_WRITE( oServer:hConfig, hSSL, hSocket, cBuf, 1000, @nErr ) ELSE #endif - nLen := hb_socketSend( hSocket, cBuf, , , 1000 ) + nLen := hb_socketSend( hSocket, cBuf,,, 1000 ) IF nLen < 0 nErr := hb_socketGetError() ENDIF @@ -675,7 +675,7 @@ STATIC FUNCTION ProcessConnection( oServer ) oServer:LogAccess() - IF Lower( UGetHeader( "Connection" ) ) == "close" .OR. server["SERVER_PROTOCOL"] == "HTTP/1.0" + IF Lower( UGetHeader( "Connection" ) ) == "close" .OR. server[ "SERVER_PROTOCOL" ] == "HTTP/1.0" EXIT ENDIF ENDDO @@ -692,20 +692,20 @@ STATIC FUNCTION ProcessConnection( oServer ) STATIC PROCEDURE ProcessRequest( oServer ) - LOCAL nI, aMount, cMount, cPath, bEval, xRet, nT := HB_MILLISECONDS() + LOCAL nI, aMount, cMount, cPath, bEval, xRet, nT := hb_milliSeconds() // Search mounting table - aMount := oServer:hConfig["Mount"] - cMount := server["SCRIPT_NAME"] - IF HB_HHasKey( aMount, cMount ) + aMount := oServer:hConfig[ "Mount" ] + cMount := server[ "SCRIPT_NAME" ] + IF hb_HHasKey( aMount, cMount ) cPath := "" ELSE nI := Len( cMount ) - DO WHILE ( nI := HB_RAT( "/", cMount,, nI ) ) > 0 - IF HB_HHasKey( aMount, Left( cMount, nI ) + "*" ) + DO WHILE ( nI := hb_RAt( "/", cMount,, nI ) ) > 0 + IF hb_HHasKey( aMount, Left( cMount, nI ) + "*" ) Eval( oServer:hConfig[ "Trace" ], "HAS", Left( cMount, nI ) + "*" ) cMount := Left( cMount, nI ) + "*" - cPath := SubStr( server["SCRIPT_NAME"], nI + 1 ) + cPath := SubStr( server[ "SCRIPT_NAME" ], nI + 1 ) EXIT ENDIF IF --nI == 0 @@ -715,7 +715,7 @@ STATIC PROCEDURE ProcessRequest( oServer ) ENDIF IF cPath != NIL - bEval := aMount[cMount] + bEval := aMount[ cMount ] BEGIN SEQUENCE WITH {| oErr | UErrorHandler( oErr, oServer ) } xRet := Eval( bEval, cPath ) IF HB_ISSTRING( xRet ) @@ -731,13 +731,13 @@ STATIC PROCEDURE ProcessRequest( oServer ) // Unlock session IF t_aSessionData != NIL session := NIL - hb_mutexUnlock( t_aSessionData[1] ) + hb_mutexUnlock( t_aSessionData[ 1 ] ) t_aSessionData := NIL ENDIF ELSE USetStatusCode( 404 ) ENDIF - Eval( oServer:hConfig[ "Trace" ], "ProcessRequest time:", hb_ntos( HB_MILLISECONDS() - nT ), "ms" ) + Eval( oServer:hConfig[ "Trace" ], "ProcessRequest time:", hb_ntos( hb_milliSeconds() - nT ), "ms" ) RETURN @@ -749,51 +749,51 @@ STATIC FUNCTION ParseRequestHeader( cRequest ) aRequest := hb_ATokens( Left( cRequest, nI - 1 ), CR_LF ) cRequest := SubStr( cRequest, nI + 4 ) - aLine := hb_ATokens( aRequest[1], " " ) + aLine := hb_ATokens( aRequest[ 1 ], " " ) - server["REQUEST_ALL"] := aRequest[1] - IF Len( aLine ) == 3 .AND. Left( aLine[3], 5 ) == "HTTP/" - server["REQUEST_METHOD"] := aLine[1] - server["REQUEST_URI"] := aLine[2] - server["SERVER_PROTOCOL"] := aLine[3] + server[ "REQUEST_ALL" ] := aRequest[ 1 ] + IF Len( aLine ) == 3 .AND. Left( aLine[ 3 ], 5 ) == "HTTP/" + server[ "REQUEST_METHOD" ] := aLine[ 1 ] + server[ "REQUEST_URI" ] := aLine[ 2 ] + server[ "SERVER_PROTOCOL" ] := aLine[ 3 ] ELSE - server["REQUEST_METHOD"] := aLine[1] - server["REQUEST_URI"] := iif( Len( aLine ) >= 2, aLine[2], "" ) - server["SERVER_PROTOCOL"] := iif( Len( aLine ) >= 3, aLine[3], "" ) + server[ "REQUEST_METHOD" ] := aLine[ 1 ] + server[ "REQUEST_URI" ] := iif( Len( aLine ) >= 2, aLine[ 2 ], "" ) + server[ "SERVER_PROTOCOL" ] := iif( Len( aLine ) >= 3, aLine[ 3 ], "" ) RETURN NIL ENDIF // Fix invalid queries: bind to root - IF ! ( Left( server["REQUEST_URI"], 1 ) == "/" ) - server["REQUEST_URI"] := "/" + server["REQUEST_URI"] + IF ! ( Left( server[ "REQUEST_URI" ], 1 ) == "/" ) + server[ "REQUEST_URI" ] := "/" + server[ "REQUEST_URI" ] ENDIF - IF ( nI := At( "?", server["REQUEST_URI"] ) ) > 0 - server["SCRIPT_NAME"] := Left( server["REQUEST_URI"], nI - 1 ) - server["QUERY_STRING"] := SubStr( server["REQUEST_URI"], nI + 1 ) + IF ( nI := At( "?", server[ "REQUEST_URI" ] ) ) > 0 + server[ "SCRIPT_NAME" ] := Left( server[ "REQUEST_URI" ], nI - 1 ) + server[ "QUERY_STRING" ] := SubStr( server[ "REQUEST_URI" ], nI + 1 ) ELSE - server["SCRIPT_NAME"] := server["REQUEST_URI"] - server["QUERY_STRING"] := "" + server[ "SCRIPT_NAME" ] := server[ "REQUEST_URI" ] + server[ "QUERY_STRING" ] := "" ENDIF - server["HTTP_ACCEPT"] := "" - server["HTTP_ACCEPT_CHARSET"] := "" - server["HTTP_ACCEPT_ENCODING"] := "" - server["HTTP_ACCEPT_LANGUAGE"] := "" - server["HTTP_CONNECTION"] := "" - server["HTTP_HOST"] := "" - server["HTTP_KEEP_ALIVE"] := "" - server["HTTP_REFERER"] := "" - server["HTTP_USER_AGENT"] := "" + server[ "HTTP_ACCEPT" ] := "" + server[ "HTTP_ACCEPT_CHARSET" ] := "" + server[ "HTTP_ACCEPT_ENCODING" ] := "" + server[ "HTTP_ACCEPT_LANGUAGE" ] := "" + server[ "HTTP_CONNECTION" ] := "" + server[ "HTTP_HOST" ] := "" + server[ "HTTP_KEEP_ALIVE" ] := "" + server[ "HTTP_REFERER" ] := "" + server[ "HTTP_USER_AGENT" ] := "" FOR nI := 2 TO Len( aRequest ) - IF aRequest[nI] == "" + IF aRequest[ nI ] == "" EXIT - ELSEIF ( nJ := At( ":", aRequest[nI] ) ) > 0 - cI := AllTrim( SubStr( aRequest[nI], nJ + 1 ) ) - SWITCH Upper( Left( aRequest[nI], nJ - 1 ) ) + ELSEIF ( nJ := At( ":", aRequest[ nI ] ) ) > 0 + cI := AllTrim( SubStr( aRequest[ nI ], nJ + 1 ) ) + SWITCH Upper( Left( aRequest[ nI ], nJ - 1 ) ) CASE "COOKIE" - server["HTTP_COOKIE"] := cI + server[ "HTTP_COOKIE" ] := cI IF ( nK := At( ";", cI ) ) == 0 nK := Len( RTrim( cI ) ) ENDIF @@ -807,16 +807,16 @@ STATIC FUNCTION ParseRequestHeader( cRequest ) nContentLength := Val( cI ) EXIT CASE "CONTENT-TYPE" - server["CONTENT_TYPE"] := cI + server[ "CONTENT_TYPE" ] := cI EXIT OTHERWISE - server["HTTP_" + StrTran( Upper( Left( aRequest[ nI ], nJ - 1 ) ), "-", "_" )] := cI + server[ "HTTP_" + StrTran( Upper( Left( aRequest[ nI ], nJ - 1 ) ), "-", "_" ) ] := cI EXIT ENDSWITCH ENDIF NEXT - IF !( server["QUERY_STRING"] == "" ) - FOR EACH cI IN hb_ATokens( server["QUERY_STRING"], "&" ) + IF !( server[ "QUERY_STRING" ] == "" ) + FOR EACH cI IN hb_ATokens( server[ "QUERY_STRING" ], "&" ) IF ( nI := At( "=", cI ) ) > 0 get[ UUrlDecode( Left( cI, nI - 1 ) ) ] := UUrlDecode( SubStr( cI, nI + 1 ) ) ELSE @@ -831,18 +831,18 @@ STATIC FUNCTION ParseRequestBody( cRequest ) LOCAL nI, cPart, cEncoding - IF HB_HHasKey( server, "CONTENT_TYPE" ) .AND. ; - Left( server["CONTENT_TYPE"], 33 ) == "application/x-www-form-urlencoded" - IF ( nI := At( "CHARSET=", Upper( server["CONTENT_TYPE"] ) ) ) > 0 - cEncoding := Upper( SubStr( server["CONTENT_TYPE"], nI + 8 ) ) + IF hb_HHasKey( server, "CONTENT_TYPE" ) .AND. ; + Left( server[ "CONTENT_TYPE" ], 33 ) == "application/x-www-form-urlencoded" + IF ( nI := At( "CHARSET=", Upper( server[ "CONTENT_TYPE" ] ) ) ) > 0 + cEncoding := Upper( SubStr( server[ "CONTENT_TYPE" ], nI + 8 ) ) ENDIF IF !( cRequest == "" ) IF cEncoding == "UTF-8" FOR EACH cPart IN hb_ATokens( cRequest, "&" ) IF ( nI := At( "=", cPart ) ) > 0 - post[ HB_UTF8TOSTR( UUrlDecode( Left( cPart, nI - 1 ) ) ) ] := HB_UTF8TOSTR( UUrlDecode( SubStr( cPart, nI + 1 ) ) ) + post[ hb_UTF8ToStr( UUrlDecode( Left( cPart, nI - 1 ) ) ) ] := hb_UTF8ToStr( UUrlDecode( SubStr( cPart, nI + 1 ) ) ) ELSE - post[ HB_UTF8TOSTR( UUrlDecode( cPart ) ) ] := NIL + post[ hb_UTF8ToStr( UUrlDecode( cPart ) ) ] := NIL ENDIF NEXT ELSE @@ -866,9 +866,9 @@ STATIC FUNCTION MakeResponse( hConfig ) IF UGetHeader( "Content-Type" ) == NIL UAddHeader( "Content-Type", "text/html" ) ENDIF - UAddHeader( "Date", HttpDateFormat( HB_DATETIME() ) ) + UAddHeader( "Date", HttpDateFormat( hb_DateTime() ) ) - cRet := iif( server["SERVER_PROTOCOL"] == "HTTP/1.0", "HTTP/1.0 ", "HTTP/1.1 " ) + cRet := iif( server[ "SERVER_PROTOCOL" ] == "HTTP/1.0", "HTTP/1.0 ", "HTTP/1.1 " ) SWITCH t_nStatusCode CASE 100 ; cStatus := "100 Continue" ; EXIT CASE 101 ; cStatus := "101 Switching Protocols" ; EXIT @@ -929,10 +929,11 @@ STATIC FUNCTION HttpDateFormat( tDate ) tDate -= HB_UTCOFFSET() / ( 3600 * 24 ) - RETURN { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }[DOW(tDate)] + ", " + ; + RETURN ; + { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }[ DoW( tDate ) ] + ", " + ; PadL( Day( tDate ), 2, "0" ) + " " + ; - { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }[MONTH(tDate)] + ; - " " + PadL( Year( tDate ), 4, "0" ) + " " + HB_TTOC( tDate, "", "HH:MM:SS" ) + " GMT" // TOFIX: time zone + { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }[ Month( tDate ) ] + ; + " " + PadL( Year( tDate ), 4, "0" ) + " " + hb_TToC( tDate, "", "HH:MM:SS" ) + " GMT" // TOFIX: time zone STATIC FUNCTION HttpDateUnformat( cDate, tDate ) @@ -943,9 +944,9 @@ STATIC FUNCTION HttpDateUnformat( cDate, tDate ) nMonth := AScan( { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", ; "Oct", "Nov", "Dec" }, SubStr( cDate, 9, 3 ) ) IF nMonth > 0 - tI := HB_STOT( SubStr( cDate, 13, 4 ) + PadL( nMonth, 2, "0" ) + SubStr( cDate, 6, 2 ) + StrTran( SubStr( cDate, 18, 8 ), ":" ) ) + tI := hb_SToT( SubStr( cDate, 13, 4 ) + PadL( nMonth, 2, "0" ) + SubStr( cDate, 6, 2 ) + StrTran( SubStr( cDate, 18, 8 ), ":" ) ) IF ! Empty( tI ) - tDate := tI + HB_UTCOFFSET() / ( 3600 * 24 ) + tDate := tI + hb_UTCOffset() / ( 3600 * 24 ) RETURN .T. ENDIF ENDIF @@ -956,7 +957,7 @@ STATIC FUNCTION HttpDateUnformat( cDate, tDate ) STATIC FUNCTION UErrorHandler( oErr, oServer ) Eval( oServer:hConfig[ "Trace" ], "UErrorHandler" ) - IF oErr:genCode == EG_ZERODIV; RETURN 0 + IF oErr:genCode == EG_ZERODIV; RETURN 0 ELSEIF oErr:genCode == EG_LOCK; RETURN .T. ELSEIF ( oErr:genCode == EG_OPEN .AND. oErr:osCode == 32 .OR. ; oErr:genCode == EG_APPENDLOCK ) .AND. oErr:canDefault @@ -964,8 +965,8 @@ STATIC FUNCTION UErrorHandler( oErr, oServer ) RETURN .F. ENDIF oServer:LogError( GetErrorDesc( oErr ) ) - IF oErr != NIL // Dummy check to avoid unreachable code warning for RETURN NIL - BREAK( oErr ) + IF oErr != NIL // Dummy check to avoid unreachable code warning for RETURN NIL + Break( oErr ) ENDIF RETURN NIL @@ -987,7 +988,7 @@ STATIC FUNCTION GetErrorDesc( oErr ) ENDIF IF HB_ISARRAY( oErr:args ) cRet += "Arguments:" + hb_eol() - AEval( oErr:args, {| X, Y | cRet += Str( Y, 5 ) + ": " + HB_CStr( X ) + hb_eol() } ) + AEval( oErr:args, {| X, Y | cRet += Str( Y, 5 ) + ": " + hb_CStr( X ) + hb_eol() } ) ENDIF cRet += hb_eol() @@ -1002,16 +1003,16 @@ STATIC FUNCTION GetErrorDesc( oErr ) cI := " " + ProcName( nI ) + "(" + hb_ntos( ProcLine( nI ) ) + ")" cI := PadR( cI, Max( 32, Len( cI ) + 1 ) ) cI += "(" - aPar := __dbgvmParLList( nI ) + aPar := __dbgVMParLList( nI ) FOR nJ := 1 TO Len( aPar ) - cI += cvt2str( aPar[nJ] ) + cI += cvt2str( aPar[ nJ ] ) IF nJ < Len( aPar ) cI += ", " ENDIF NEXT cI += ")" nJ := Len( aPar ) - DO WHILE ! HB_ISSYMBOL( xI := __dbgvmVarLGet( nI, ++nJ ) ) + DO WHILE ! HB_ISSYMBOL( xI := __dbgVMVarLGet( nI, ++nJ ) ) cI += ", " + cvt2str( xI ) ENDDO xI := NIL @@ -1020,25 +1021,25 @@ STATIC FUNCTION GetErrorDesc( oErr ) #endif cRet += hb_eol() - cRet += "Executable: " + HB_PROGNAME() + hb_eol() + cRet += "Executable: " + hb_ProgName() + hb_eol() cRet += "Versions:" + hb_eol() cRet += " OS: " + OS() + hb_eol() - cRet += " Harbour: " + Version() + ", " + HB_BUILDDATE() + hb_eol() + cRet += " Harbour: " + Version() + ", " + hb_BuildDate() + hb_eol() cRet += hb_eol() IF oErr:genCode != EG_MEM cRet += "Database areas:" + hb_eol() cRet += " Current: " + hb_ntos( Select() ) + " " + Alias() + hb_eol() - BEGIN SEQUENCE WITH {| o | BREAK( o ) } + BEGIN SEQUENCE WITH {| o | Break( o ) } IF Used() cRet += " Filter: " + dbFilter() + hb_eol() cRet += " Relation: " + dbRelation() + hb_eol() - cRet += " Index expression: " + OrdKey( OrdSetFocus() ) + hb_eol() + cRet += " Index expression: " + ordKey( ordSetFocus() ) + hb_eol() cRet += hb_eol() - BEGIN SEQUENCE WITH {| o | BREAK( o ) } + BEGIN SEQUENCE WITH {| o | Break( o ) } FOR nI := 1 TO FCount() - cRet += Str( nI, 6 ) + " " + PadR( FieldName( nI ), 14 ) + ": " + HB_VALTOEXP( FieldGet( nI ) ) + hb_eol() + cRet += Str( nI, 6 ) + " " + PadR( FieldName( nI ), 14 ) + ": " + hb_ValToExp( FieldGet( nI ) ) + hb_eol() NEXT RECOVER cRet += "!!! Error reading database fields !!!" + hb_eol() @@ -1050,12 +1051,12 @@ STATIC FUNCTION GetErrorDesc( oErr ) END SEQUENCE FOR nI := 1 TO 250 - BEGIN SEQUENCE WITH {| o | BREAK( o ) } + BEGIN SEQUENCE WITH {| o | Break( o ) } IF Used() dbSelectArea( nI ) cRet += Str( nI, 6 ) + " " + rddName() + " " + PadR( Alias(), 15 ) + ; Str( RecNo() ) + "/" + Str( LastRec() ) + ; - iif( Empty( OrdSetFocus() ), "", " Index " + OrdSetFocus() + "(" + hb_ntos( OrdNumber() ) + ")" ) + hb_eol() + iif( Empty( ordSetFocus() ), "", " Index " + ordSetFocus() + "(" + hb_ntos( ordNumber() ) + ")" ) + hb_eol() dbCloseArea() ENDIF RECOVER @@ -1072,12 +1073,13 @@ STATIC FUNCTION ErrDescCode( nCode ) LOCAL cI := NIL IF nCode > 0 .AND. nCode <= 41 - cI := { "ARG" , "BOUND" , "STROVERFLOW", "NUMOVERFLOW", "ZERODIV" , "NUMERR" , "SYNTAX" , "COMPLEXITY" , ; // 1, 2, 3, 4, 5, 6, 7, 8 - NIL , NIL , "MEM" , "NOFUNC" , "NOMETHOD", "NOVAR" , "NOALIAS" , "NOVARMETHOD", ; // 9, 10, 11, 12, 13, 14, 15, 16 - "BADALIAS", "DUPALIAS" , NIL , "CREATE" , "OPEN" , "CLOSE" , "READ" , "WRITE" , ; // 17, 18, 19, 20, 21, 22, 23, 24 - "PRINT" , NIL , NIL , NIL , NIL , "UNSUPPORTED", "LIMIT" , "CORRUPTION" , ; // 25, 26 - 29, 30, 31, 32 - "DATATYPE", "DATAWIDTH", "NOTABLE" , "NOORDER" , "SHARED" , "UNLOCKED" , "READONLY", "APPENDLOCK" , ; // 33, 34, 35, 36, 37, 38, 39, 40 - "LOCK" }[nCode] // 41 + cI := { ; + "ARG" , "BOUND" , "STROVERFLOW", "NUMOVERFLOW", "ZERODIV" , "NUMERR" , "SYNTAX" , "COMPLEXITY" , ; // 1, 2, 3, 4, 5, 6, 7, 8 + NIL , NIL , "MEM" , "NOFUNC" , "NOMETHOD", "NOVAR" , "NOALIAS" , "NOVARMETHOD", ; // 9, 10, 11, 12, 13, 14, 15, 16 + "BADALIAS", "DUPALIAS" , NIL , "CREATE" , "OPEN" , "CLOSE" , "READ" , "WRITE" , ; // 17, 18, 19, 20, 21, 22, 23, 24 + "PRINT" , NIL , NIL , NIL , NIL , "UNSUPPORTED", "LIMIT" , "CORRUPTION" , ; // 25, 26 - 29, 30, 31, 32 + "DATATYPE", "DATAWIDTH", "NOTABLE" , "NOORDER" , "SHARED" , "UNLOCKED" , "READONLY", "APPENDLOCK" , ; // 33, 34, 35, 36, 37, 38, 39, 40 + "LOCK" }[ nCode ] // 41 ENDIF RETURN iif( cI == NIL, "", "EG_" + cI ) @@ -1088,7 +1090,7 @@ STATIC FUNCTION cvt2str( xI, lLong ) cValtype := ValType( xI ) lLong := ! Empty( lLong ) - IF cValtype == "U" + IF cValtype == "U" RETURN iif( lLong, "[U]:NIL", "NIL" ) ELSEIF cValtype == "N" RETURN iif( lLong, "[N]:" + Str( xI ), hb_ntos( xI ) ) @@ -1128,9 +1130,9 @@ STATIC FUNCTION cvt2str( xI, lLong ) ELSEIF cValtype == "L" RETURN iif( lLong, "[L]:", "" ) + iif( xI, ".T.", ".F." ) ELSEIF cValtype == "P" - RETURN iif( lLong, "[P]:", "" ) + "0p" + HB_NumToHex( xI ) + RETURN iif( lLong, "[P]:", "" ) + "0p" + hb_NumToHex( xI ) ELSE - RETURN "[" + cValtype + "]" // BS,etc + RETURN "[" + cValtype + "]" // BS,etc ENDIF RETURN NIL @@ -1150,8 +1152,8 @@ FUNCTION UGetHeader( cType ) LOCAL nI - IF ( nI := AScan( t_aHeader, {| x | Upper(x[1] ) == Upper(cType ) } ) ) > 0 - RETURN t_aHeader[nI, 2] + IF ( nI := AScan( t_aHeader, {| x | Upper( x[ 1 ] ) == Upper( cType ) } ) ) > 0 + RETURN t_aHeader[ nI, 2 ] ENDIF RETURN NIL @@ -1160,8 +1162,8 @@ PROCEDURE UAddHeader( cType, cValue ) LOCAL nI - IF ( nI := AScan( t_aHeader, {| x | Upper(x[1] ) == Upper(cType ) } ) ) > 0 - t_aHeader[nI, 2] := cValue + IF ( nI := AScan( t_aHeader, {| x | Upper( x[ 1 ] ) == Upper( cType ) } ) ) > 0 + t_aHeader[ nI, 2 ] := cValue ELSE AAdd( t_aHeader, { cType, cValue } ) ENDIF @@ -1188,20 +1190,20 @@ STATIC PROCEDURE USessionCreateInternal() LOCAL cSID, hMtx - cSID := HB_MD5( DToS( Date() ) + Time() + Str( HB_RANDOM(), 15, 12 ) ) + cSID := hb_MD5( DToS( Date() ) + Time() + Str( hb_Random(), 15, 12 ) ) hMtx := hb_mutexCreate() hb_mutexLock( hMtx ) - t_aSessionData := httpd:hSession[cSID] := { hMtx, { "_unique" => HB_MD5( Str( HB_RANDOM(), 15, 12 ) ) }, HB_MILLISECONDS() + SESSION_TIMEOUT * 1000, cSID } - session := t_aSessionData[2] + t_aSessionData := httpd:hSession[ cSID ] := { hMtx, { "_unique" => hb_MD5( Str( hb_Random(), 15, 12 ) ) }, hb_milliSeconds() + SESSION_TIMEOUT * 1000, cSID } + session := t_aSessionData[ 2 ] UAddHeader( "Set-Cookie", "SESSID=" + cSID + "; path=/" ) RETURN STATIC PROCEDURE USessionDestroyInternal() - HB_HDel( httpd:hSession, t_aSessionData[4] ) - hb_mutexUnlock( t_aSessionData[1] ) - UAddHeader( "Set-Cookie", "SESSID=" + t_aSessionData[4] + "; path=/; Max-Age=0" ) + hb_HDel( httpd:hSession, t_aSessionData[ 4 ] ) + hb_mutexUnlock( t_aSessionData[ 1 ] ) + UAddHeader( "Set-Cookie", "SESSID=" + t_aSessionData[ 4 ] + "; path=/; Max-Age=0" ) RETURN @@ -1209,24 +1211,24 @@ PROCEDURE USessionStart() LOCAL cSID - IF HB_HHasKey( cookie, "SESSID" ) - cSID := cookie["SESSID"] + IF hb_HHasKey( cookie, "SESSID" ) + cSID := cookie[ "SESSID" ] ENDIF hb_mutexLock( httpd:hmtxSession ) - IF cSID == NIL .OR. ! HB_HHasKey( httpd:hSession, cSID ) + IF cSID == NIL .OR. ! hb_HHasKey( httpd:hSession, cSID ) // Session does not exist USessionCreateInternal() ELSE // Session exists - t_aSessionData := httpd:hSession[cSID] - IF hb_mutexLock( t_aSessionData[1], 0 ) + t_aSessionData := httpd:hSession[ cSID ] + IF hb_mutexLock( t_aSessionData[ 1 ], 0 ) // No concurent sessions - IF t_aSessionData[3] > HB_MILLISECONDS() - t_aSessionData[3] := HB_MILLISECONDS() + SESSION_TIMEOUT * 1000 - session := t_aSessionData[2] + IF t_aSessionData[ 3 ] > hb_milliSeconds() + t_aSessionData[ 3 ] := hb_milliSeconds() + SESSION_TIMEOUT * 1000 + session := t_aSessionData[ 2 ] ELSE USessionDestroyInternal() USessionCreateInternal() @@ -1237,15 +1239,15 @@ PROCEDURE USessionStart() hb_mutexUnlock( httpd:hmtxSession ) // Wait for session - hb_mutexLock( t_aSessionData[1] ) + hb_mutexLock( t_aSessionData[ 1 ] ) // Check if session is not destroyed hb_mutexLock( httpd:hmtxSession ) - IF HB_HHasKey( httpd:hSession, cSID ) + IF hb_HHasKey( httpd:hSession, cSID ) // Session exists - IF t_aSessionData[3] > HB_MILLISECONDS() - t_aSessionData[3] := HB_MILLISECONDS() + SESSION_TIMEOUT * 1000 - session := t_aSessionData[2] + IF t_aSessionData[ 3 ] > hb_milliSeconds() + t_aSessionData[ 3 ] := hb_milliSeconds() + SESSION_TIMEOUT * 1000 + session := t_aSessionData[ 2 ] ELSE USessionDestroyInternal() USessionCreateInternal() @@ -1263,7 +1265,7 @@ PROCEDURE USessionStart() PROCEDURE USessionStop() session := NIL - hb_mutexUnlock( t_aSessionData[1] ) + hb_mutexUnlock( t_aSessionData[ 1 ] ) t_aSessionData := NIL RETURN @@ -1315,7 +1317,7 @@ FUNCTION UUrlEncode( cString ) IF cI == " " cRet += "+" ELSEIF Asc( cI ) >= 127 .OR. Asc( cI ) <= 31 .OR. cI $ '=&%+' - cRet += "%" + HB_StrToHex( cI ) + cRet += "%" + hb_StrToHex( cI ) ELSE cRet += cI ENDIF @@ -1330,13 +1332,13 @@ FUNCTION UUrlDecode( cString ) cString := StrTran( cString, "+", " " ) nI := 1 DO WHILE nI <= Len( cString ) - nI := HB_AT( "%", cString, nI ) + nI := hb_At( "%", cString, nI ) IF nI == 0 EXIT ENDIF IF Upper( SubStr( cString, nI + 1, 1 ) ) $ "0123456789ABCDEF" .AND. ; Upper( SubStr( cString, nI + 2, 1 ) ) $ "0123456789ABCDEF" - cString := Stuff( cString, nI, 3, HB_HexToStr( SubStr(cString, nI + 1, 2 ) ) ) + cString := Stuff( cString, nI, 3, hb_HexToStr( SubStr( cString, nI + 1, 2 ) ) ) ENDIF nI++ ENDDO @@ -1349,20 +1351,20 @@ FUNCTION ULink( cText, cUrl ) FUNCTION UUrlCheckSum( cUrl ) - RETURN cUrl + iif( "?" $ cUrl, "&", "?" ) + "_ucs=" + HB_MD5( session["_unique"] + cUrl + session["_unique"] ) + RETURN cUrl + iif( "?" $ cUrl, "&", "?" ) + "_ucs=" + hb_MD5( session[ "_unique" ] + cUrl + session[ "_unique" ] ) FUNCTION UUrlValidate( cUrl ) LOCAL nI IF cUrl == NIL - cUrl := server["REQUEST_URI"] + cUrl := server[ "REQUEST_URI" ] ENDIF IF ( nI := At( "?_ucs=", cUrl ) ) == 0 nI := At( "&_ucs=", cUrl ) ENDIF - RETURN HB_MD5( session["_unique"] + Left( cUrl, nI - 1 ) + session["_unique"] ) == SubStr( cUrl, nI + 6 ) + RETURN hb_MD5( session[ "_unique" ] + Left( cUrl, nI - 1 ) + session[ "_unique" ] ) == SubStr( cUrl, nI + 6 ) PROCEDURE UProcFiles( cFileName, lIndex ) @@ -1380,16 +1382,16 @@ PROCEDURE UProcFiles( cFileName, lIndex ) RETURN ENDIF - IF HB_FileExists( uOSFileName( cFileName ) ) - IF HB_HHasKey( server, "HTTP_IF_MODIFIED_SINCE" ) .AND. ; - HttpDateUnformat( server["HTTP_IF_MODIFIED_SINCE"], @tHDate ) .AND. ; - HB_FGETDATETIME( UOsFileName( cFileName ), @tDate ) .AND. ; - ( tDate <= tHDate ) + IF hb_FileExists( uOSFileName( cFileName ) ) + IF hb_HHasKey( server, "HTTP_IF_MODIFIED_SINCE" ) .AND. ; + HttpDateUnformat( server[ "HTTP_IF_MODIFIED_SINCE" ], @tHDate ) .AND. ; + hb_FGetDateTime( UOsFileName( cFileName ), @tDate ) .AND. ; + tDate <= tHDate USetStatusCode( 304 ) - ELSEIF HB_HHasKey( server, "HTTP_IF_UNMODIFIED_SINCE" ) .AND. ; - HttpDateUnformat( server["HTTP_IF_UNMODIFIED_SINCE"], @tHDate ) .AND. ; - HB_FGETDATETIME( UOsFileName( cFileName ), @tDate ) .AND. ; - ( tDate > tHDate ) + ELSEIF hb_HHasKey( server, "HTTP_IF_UNMODIFIED_SINCE" ) .AND. ; + HttpDateUnformat( server[ "HTTP_IF_UNMODIFIED_SINCE" ], @tHDate ) .AND. ; + hb_FGetDateTime( UOsFileName( cFileName ), @tDate ) .AND. ; + tDate > tHDate USetStatusCode( 412 ) ELSE IF ( nI := RAt( ".", cFileName ) ) > 0 @@ -1433,21 +1435,21 @@ PROCEDURE UProcFiles( cFileName, lIndex ) ENDIF UAddHeader( "Content-Type", cI ) - IF HB_FGETDATETIME( UOsFileName( cFileName ), @tDate ) + IF hb_FGetDateTime( UOsFileName( cFileName ), @tDate ) UAddHeader( "Last-Modified", HttpDateFormat( tDate ) ) ENDIF - UWrite( HB_MEMOREAD( UOsFileName(cFileName ) ) ) + UWrite( hb_MemoRead( UOsFileName( cFileName ) ) ) ENDIF - ELSEIF HB_DirExists( UOsFileName( cFileName ) ) + ELSEIF hb_DirExists( UOsFileName( cFileName ) ) IF !( Right( cFileName, 1 ) == "/" ) - URedirect( "http://" + server["HTTP_HOST"] + server["SCRIPT_NAME"] + "/" ) + URedirect( "http://" + server[ "HTTP_HOST" ] + server[ "SCRIPT_NAME" ] + "/" ) RETURN ENDIF IF AScan( { "index.html", "index.htm" }, ; - {| x | iif( HB_FileExists( UOSFileName(cFileName + X ) ), ( cFileName += X, .T. ), .F. ) } ) > 0 + {| x | iif( hb_FileExists( UOSFileName( cFileName + X ) ), ( cFileName += X, .T. ), .F. ) } ) > 0 UAddHeader( "Content-Type", "text/html" ) - UWrite( HB_MEMOREAD( UOsFileName(cFileName ) ) ) + UWrite( hb_MemoRead( UOsFileName( cFileName ) ) ) RETURN ENDIF IF ! lIndex @@ -1458,34 +1460,34 @@ PROCEDURE UProcFiles( cFileName, lIndex ) UAddHeader( "Content-Type", "text/html" ) aDir := Directory( UOsFileName( cFileName ), "D" ) - IF HB_HHasKey( get, "s" ) - IF get["s"] == "s" - ASort( aDir, , , {| X, Y | iif( X[5] == "D", iif(Y[5] == "D", X[1] < Y[1], .T. ), ; - iif( Y[5] == "D", .F., X[2] < Y[2] ) ) } ) - ELSEIF get["s"] == "m" - ASort( aDir, , , {| X, Y | iif( X[5] == "D", iif(Y[5] == "D", X[1] < Y[1], .T. ), ; - iif( Y[5] == "D", .F., DToS( X[3] ) + X[4] < DToS( Y[3] ) + Y[4] ) ) } ) + IF hb_HHasKey( get, "s" ) + IF get[ "s" ] == "s" + ASort( aDir,,, {| X, Y | iif( X[ 5 ] == "D", iif( Y[ 5 ] == "D", X[ 1 ] < Y[ 1 ], .T. ), ; + iif( Y[ 5 ] == "D", .F., X[ 2 ] < Y[ 2 ] ) ) } ) + ELSEIF get[ "s" ] == "m" + ASort( aDir,,, {| X, Y | iif( X[ 5 ] == "D", iif( Y[ 5 ] == "D", X[ 1 ] < Y[ 1 ], .T. ), ; + iif( Y[ 5 ] == "D", .F., DToS( X[ 3 ] ) + X[ 4 ] < DToS( Y[ 3 ] ) + Y[ 4 ] ) ) } ) ELSE - ASort( aDir, , , {| X, Y | iif( X[5] == "D", iif(Y[5] == "D", X[1] < Y[1], .T. ), ; - iif( Y[5] == "D", .F., X[1] < Y[1] ) ) } ) + ASort( aDir,,, {| X, Y | iif( X[ 5 ] == "D", iif( Y[ 5 ] == "D", X[ 1 ] < Y[ 1 ], .T. ), ; + iif( Y[ 5 ] == "D", .F., X[ 1 ] < Y[ 1 ] ) ) } ) ENDIF ELSE - ASort( aDir, , , {| X, Y | iif( X[5] == "D", iif(Y[5] == "D", X[1] < Y[1], .T. ), ; - iif( Y[5] == "D", .F., X[1] < Y[1] ) ) } ) + ASort( aDir,,, {| X, Y | iif( X[ 5 ] == "D", iif( Y[ 5 ] == "D", X[ 1 ] < Y[ 1 ], .T. ), ; + iif( Y[ 5 ] == "D", .F., X[ 1 ] < Y[ 1 ] ) ) } ) ENDIF - UWrite( '

Index of ' + server["SCRIPT_NAME"] + '

      ' )
+      UWrite( '

Index of ' + server[ "SCRIPT_NAME" ] + '

      ' )
       UWrite( 'Name                                                  ' )
       UWrite( 'Modified             ' )
       UWrite( 'Size' + CR_LF + '
' ) FOR EACH aF IN aDir - IF Left( aF[1], 1 ) == "." - ELSEIF "D" $ aF[5] - UWrite( '[DIR] ' + aF[1] + '' + Space( 50 - Len(aF[1] ) ) + ; - DToC( aF[3] ) + ' ' + aF[4] + CR_LF ) + IF Left( aF[ 1 ], 1 ) == "." + ELSEIF "D" $ aF[ 5 ] + UWrite( '[DIR] ' + aF[ 1 ] + '' + Space( 50 - Len( aF[ 1 ] ) ) + ; + DToC( aF[ 3 ] ) + ' ' + aF[ 4 ] + CR_LF ) ELSE - UWrite( ' ' + aF[1] + '' + Space( 50 - Len(aF[1] ) ) + ; - DToC( aF[3] ) + ' ' + aF[4] + Str( aF[2], 12 ) + CR_LF ) + UWrite( ' ' + aF[ 1 ] + '' + Space( 50 - Len( aF[ 1 ] ) ) + ; + DToC( aF[ 3 ] ) + ' ' + aF[ 4 ] + Str( aF[ 2 ], 12 ) + CR_LF ) ENDIF NEXT UWrite( "
" ) @@ -1505,14 +1507,14 @@ PROCEDURE UProcInfo() UWrite( '' ) UWrite( '' ) UWrite( '' ) - UWrite( '' ) - UWrite( '' ) + UWrite( '' ) + UWrite( '' ) UWrite( '
OS' + UHtmlEncode( OS() ) + '
Harbour' + UHtmlEncode( Version() ) + '
Build date' + UHtmlEncode( HB_BUILDDATE() ) + '
Compiler' + UHtmlEncode( HB_COMPILER() ) + '
Build date' + UHtmlEncode( hb_BuildDate() ) + '
Compiler' + UHtmlEncode( hb_Compiler() ) + '
' ) UWrite( '

Capabilities

' ) UWrite( '' ) cI := "" - AEval( rddList(), {| X | cI += iif( Empty(cI ), "", ", " ) + X } ) + AEval( rddList(), {| X | cI += iif( Empty( cI ), "", ", " ) + X } ) UWrite( '' ) UWrite( '
RDD' + UHtmlEncode( cI ) + '
' ) @@ -1520,20 +1522,20 @@ PROCEDURE UProcInfo() UWrite( '

server

' ) UWrite( '' ) - AEval( ASort( HB_HKeys( server ) ), {| X | UWrite( '' ) } ) + AEval( ASort( hb_HKeys( server ) ), {| X | UWrite( '' ) } ) UWrite( '
' + X + '' + UHtmlEncode( HB_CStr( server[X] ) ) + '
' + X + '' + UHtmlEncode( hb_CStr( server[ X ] ) ) + '
' ) IF !Empty( get ) UWrite( '

get

' ) UWrite( '' ) - AEval( ASort( HB_HKeys( get ) ), {| X | UWrite( '' ) } ) + AEval( ASort( hb_HKeys( get ) ), {| X | UWrite( '' ) } ) UWrite( '
' + X + '' + UHtmlEncode( HB_CStr( get[X] ) ) + '
' + X + '' + UHtmlEncode( hb_CStr( get[ X ] ) ) + '
' ) ENDIF IF !Empty( post ) UWrite( '

post

' ) UWrite( '' ) - AEval( ASort( HB_HKeys( post ) ), {| X | UWrite( '' ) } ) + AEval( ASort( hb_HKeys( post ) ), {| X | UWrite( '' ) } ) UWrite( '
' + X + '' + UHtmlEncode( HB_CStr( post[X] ) ) + '
' + X + '' + UHtmlEncode( hb_CStr( post[ X ] ) ) + '
' ) ENDIF @@ -1557,7 +1559,7 @@ STATIC FUNCTION parse_data( aData, aCode, hConfig ) EXIT CASE "=" - IF HB_HHasKey( aData, aInstr[ 2 ] ) + IF hb_HHasKey( aData, aInstr[ 2 ] ) xValue := aData[ aInstr[ 2 ] ] IF HB_ISSTRING( xValue ) cRet += UHtmlEncode( xValue ) @@ -1566,19 +1568,19 @@ STATIC FUNCTION parse_data( aData, aCode, hConfig ) ELSEIF HB_ISDATE( xValue ) cRet += UHtmlEncode( DToC( xValue ) ) ELSEIF HB_ISTIMESTAMP( xValue ) - cRet += UHtmlEncode( HB_TTOC( xValue ) ) + cRet += UHtmlEncode( hb_TToC( xValue ) ) ELSEIF HB_ISOBJECT( xValue ) cRet += UHtmlEncode( xValue:Output() ) ELSE - Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: invalid type '%s'", ValType( xValue ) ) ) + Eval( hConfig[ "Trace" ], hb_StrFormat( "Template error: invalid type '%s'", ValType( xValue ) ) ) ENDIF ELSE - Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: variable '%s' not found", aInstr[ 2 ] ) ) + Eval( hConfig[ "Trace" ], hb_StrFormat( "Template error: variable '%s' not found", aInstr[ 2 ] ) ) ENDIF EXIT CASE ":" - IF HB_HHasKey( aData, aInstr[ 2 ] ) + IF hb_HHasKey( aData, aInstr[ 2 ] ) xValue := aData[ aInstr[ 2 ] ] IF HB_ISSTRING( xValue ) cRet += xValue @@ -1587,19 +1589,19 @@ STATIC FUNCTION parse_data( aData, aCode, hConfig ) ELSEIF HB_ISDATE( xValue ) cRet += DToC( xValue ) ELSEIF HB_ISTIMESTAMP( xValue ) - cRet += HB_TTOC( xValue ) + cRet += hb_TToC( xValue ) ELSEIF HB_ISOBJECT( xValue ) cRet += xValue:Output() ELSE - Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: invalid type '%s'", ValType( xValue ) ) ) + Eval( hConfig[ "Trace" ], hb_StrFormat( "Template error: invalid type '%s'", ValType( xValue ) ) ) ENDIF ELSE - Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: variable '%s' not found", aInstr[ 2 ] ) ) + Eval( hConfig[ "Trace" ], hb_StrFormat( "Template error: variable '%s' not found", aInstr[ 2 ] ) ) ENDIF EXIT CASE "if" - xValue := iif( HB_HHasKey( aData, aInstr[ 2 ] ), aData[ aInstr[ 2 ] ], NIL ) + xValue := iif( hb_HHasKey( aData, aInstr[ 2 ] ), aData[ aInstr[ 2 ] ], NIL ) IF ! Empty( xValue ) cRet += parse_data( aData, aInstr[ 3 ], hConfig ) ELSE @@ -1608,16 +1610,16 @@ STATIC FUNCTION parse_data( aData, aCode, hConfig ) EXIT CASE "loop" - IF HB_HHasKey( aData, aInstr[ 2 ] ) .AND. HB_ISARRAY( aValue := aData[ aInstr[ 2 ] ] ) + IF hb_HHasKey( aData, aInstr[ 2 ] ) .AND. HB_ISARRAY( aValue := aData[ aInstr[ 2 ] ] ) FOR EACH xValue IN aValue - aData2 := HB_HCLONE( aData ) - HB_HEVAL( xValue, {| k, v | aData2[ aInstr[ 2 ] + "." + k ] := v } ) - aData2[ aInstr[ 2 ] + ".__index"] := xValue:__enumIndex + aData2 := hb_HClone( aData ) + hb_HEval( xValue, {| k, v | aData2[ aInstr[ 2 ] + "." + k ] := v } ) + aData2[ aInstr[ 2 ] + ".__index" ] := xValue:__enumIndex cRet += parse_data( aData2, aInstr[ 3 ], hConfig ) aData2 := NIL NEXT ELSE - Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: loop variable '%s' not found", aInstr[ 2 ] ) ) + Eval( hConfig[ "Trace" ], hb_StrFormat( "Template error: loop variable '%s' not found", aInstr[ 2 ] ) ) ENDIF EXIT @@ -1644,21 +1646,21 @@ STATIC FUNCTION compile_file( cFileName, hConfig ) LOCAL nPos, cTpl, aCode := {} IF cFileName == NIL - cFileName := MEMVAR->server["SCRIPT_NAME"] + cFileName := MEMVAR->server[ "SCRIPT_NAME" ] ENDIF - cFileName := UOsFileName( HB_DIRBASE() + "/tpl/" + cFileName + ".tpl" ) - IF HB_FILEEXISTS( cFileName ) - cTpl := HB_MEMOREAD( cFileName ) + cFileName := UOsFileName( hb_DirBase() + "/tpl/" + cFileName + ".tpl" ) + IF hb_FileExists( cFileName ) + cTpl := hb_MemoRead( cFileName ) BEGIN SEQUENCE IF ( nPos := compile_buffer( cTpl, 1, aCode ) ) < Len( cTpl ) + 1 - BREAK( nPos ) + Break( nPos ) ENDIF RECOVER USING nPos - Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: syntax at %s(%d,%d)", cFileName, SUBSTRCOUNT( Chr(10 ), cTpl,, nPos ) + 1, nPos - HB_RAT( Chr(10 ), Left( cTpl, nPos - 1 ) ) ) ) + Eval( hConfig[ "Trace" ], hb_StrFormat( "Template error: syntax at %s(%d,%d)", cFileName, SUBSTRCOUNT( Chr( 10 ), cTpl,, nPos ) + 1, nPos - hb_RAt( Chr( 10 ), Left( cTpl, nPos - 1 ) ) ) ) aCode := {} END SEQUENCE ELSE - Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: file '%s' not found", cFileName ) ) + Eval( hConfig[ "Trace" ], hb_StrFormat( "Template error: file '%s' not found", cFileName ) ) ENDIF RETURN aCode @@ -1667,13 +1669,13 @@ STATIC FUNCTION compile_buffer( cTpl, nStart, aCode ) LOCAL nI, nS, nE, cTag, cParam - DO WHILE ( nS := HB_AT( "{{", cTpl, nStart ) ) > 0 + DO WHILE ( nS := hb_At( "{{", cTpl, nStart ) ) > 0 IF nS > nStart AAdd( aCode, { "txt", SubStr( cTpl, nStart, nS - nStart ) } ) ENDIF - nE := HB_AT( "}}", cTpl, nS ) + nE := hb_At( "}}", cTpl, nS ) IF nE > 0 - IF ( nI := HB_AT( " ", cTpl, nS, nE ) ) == 0 + IF ( nI := hb_At( " ", cTpl, nS, nE ) ) == 0 nI := nE ENDIF cTag := SubStr( cTpl, nS + 2, nI - nS - 2 ) @@ -1688,24 +1690,24 @@ STATIC FUNCTION compile_buffer( cTpl, nStart, aCode ) CASE "if" AAdd( aCode, { "if", cParam, {}, {} } ) - nI := compile_buffer( cTpl, nE + 2, ATAIL( aCode )[3] ) + nI := compile_buffer( cTpl, nE + 2, ATail( aCode )[3] ) IF SubStr( cTpl, nI, 8 ) == "{{else}}" - nI := compile_buffer( cTpl, nI + 8, ATAIL( aCode )[4] ) + nI := compile_buffer( cTpl, nI + 8, ATail( aCode )[4] ) ENDIF IF SubStr( cTpl, nI, 9 ) == "{{endif}}" nStart := nI + 9 ELSE - BREAK( nI ) + Break( nI ) ENDIF EXIT CASE "loop" AAdd( aCode, { "loop", cParam, {} } ) - nI := compile_buffer( cTpl, nE + 2, ATAIL( aCode )[3] ) + nI := compile_buffer( cTpl, nE + 2, ATail( aCode )[3] ) IF SubStr( cTpl, nI, 11 ) == "{{endloop}}" nStart := nI + 11 ELSE - BREAK( nI ) + Break( nI ) ENDIF EXIT @@ -1724,7 +1726,7 @@ STATIC FUNCTION compile_buffer( cTpl, nStart, aCode ) ENDSWITCH ELSE - BREAK( nS ) + Break( nS ) ENDIF ENDDO IF nStart < Len( cTpl ) @@ -1740,7 +1742,7 @@ STATIC FUNCTION SUBSTRCOUNT( cSub, cString, nStart, nEnd ) IF nStart == NIL nStart := 1 ENDIF - DO WHILE ( nStart := HB_AT( cSub, cString, nStart, nEnd ) ) > 0 + DO WHILE ( nStart := hb_At( cSub, cString, nStart, nEnd ) ) > 0 nCount++ nStart++ ENDDO diff --git a/harbour/contrib/hbhttpd/log.prg b/harbour/contrib/hbhttpd/log.prg index 056a3315af..c0e5484947 100644 --- a/harbour/contrib/hbhttpd/log.prg +++ b/harbour/contrib/hbhttpd/log.prg @@ -97,6 +97,7 @@ METHOD Add( cMsg ) CLASS UHttpdLog RETURN ::fhnd != F_ERROR .AND. FWrite( ::fhnd, cMsg ) == hb_BLen( cMsg ) METHOD Close() CLASS UHttpdLog + LOCAL lRetVal IF ::fhnd != F_ERROR diff --git a/harbour/contrib/hbhttpd/tests/eshop.prg b/harbour/contrib/hbhttpd/tests/eshop.prg index 1636728add..0b529654c9 100644 --- a/harbour/contrib/hbhttpd/tests/eshop.prg +++ b/harbour/contrib/hbhttpd/tests/eshop.prg @@ -22,7 +22,7 @@ PROCEDURE Main() LOCAL nPort - IF HB_ARGCHECK( "help" ) + IF hb_argCheck( "help" ) ? "Usage: app [options]" ? "Options:" ? " //help Print help" @@ -30,8 +30,8 @@ PROCEDURE Main() RETURN ENDIF - IF HB_ARGCHECK( "stop" ) - HB_MEMOWRIT( ".uhttpd.stop", "" ) + IF hb_argCheck( "stop" ) + hb_MemoWrit( ".uhttpd.stop", "" ) RETURN ELSE FErase( ".uhttpd.stop" ) @@ -41,40 +41,40 @@ PROCEDURE Main() SET( _SET_DATEFORMAT, "yyyy-mm-dd" ) - IF ! HB_FILEEXISTS( "users.dbf" ) + IF ! hb_FileExists( "users.dbf" ) FErase( "users.cdx" ) dbCreate( "users", { { "USER", "C", 16, 0 }, { "PASSWORD", "C", 16, 0 }, { "NAME", "C", 50, 0 } }, , .T., "user" ) dbAppend() FIELD->USER := "demo" FIELD->PASSWORD := "demo" FIELD->NAME := "Demo" - OrdCreate( "users", "user", "USER" ) + ordCreate( "users", "user", "USER" ) dbCloseArea() - ELSEIF ! HB_FILEEXISTS( "users.cdx" ) + ELSEIF ! hb_FileExists( "users.cdx" ) dbUseArea( .T., , "users", , .F., .F. ) - OrdCreate( "users", "user", "USER" ) + ordCreate( "users", "user", "USER" ) dbCloseArea() ENDIF - IF ! HB_FILEEXISTS( "carts.dbf" ) + IF ! hb_FileExists( "carts.dbf" ) FErase( "carts.cdx" ) dbCreate( "carts", { { "USER", "C", 16, 0 }, { "CODE", "C", 16, 0 }, { "AMOUNT", "N", 6, 0 }, { "TOTAL", "N", 9, 2 } }, , .T., "cart" ) - OrdCreate( "carts", "user", "USER+CODE" ) + ordCreate( "carts", "user", "USER+CODE" ) dbCloseArea() - ELSEIF ! HB_FILEEXISTS( "carts.cdx" ) + ELSEIF ! hb_FileExists( "carts.cdx" ) dbUseArea( .T., , "carts", , .F., .F. ) - OrdCreate( "carts", "user", "USER+CODE" ) + ordCreate( "carts", "user", "USER+CODE" ) dbCloseArea() ENDIF - IF ! HB_FILEEXISTS( "items.dbf" ) + IF ! hb_FileExists( "items.dbf" ) FErase( "items.cdx" ) dbCreate( "items", { { "CODE", "C", 16, 0 }, { "TITLE", "C", 80, 0 }, { "PRICE", "N", 9, 2 } }, , .T., "items" ) - OrdCreate( "items", "code", "CODE" ) + ordCreate( "items", "code", "CODE" ) dbCloseArea() - ELSEIF ! HB_FILEEXISTS( "item.cdx" ) + ELSEIF ! hb_FileExists( "item.cdx" ) dbUseArea( .T., , "items", , .F., .F. ) - OrdCreate( "items", "code", "CODE" ) + ordCreate( "items", "code", "CODE" ) dbCloseArea() ENDIF @@ -99,20 +99,20 @@ PROCEDURE Main() oServer := UHttpdNew() - IF ! oServer:Run( {; - "FirewallFilter" => "", ; - "LogAccess" => {| m | oLogAccess:Add( m + hb_eol() ) }, ; - "LogError" => {| m | oLogError:Add( m + hb_eol() ) }, ; - "Trace" => {| ... | QOut( ... ) }, ; - "Port" => nPort, ; - "Idle" => {| o | iif( HB_FILEEXISTS( ".uhttpd.stop" ), ( FErase(".uhttpd.stop" ), o:Stop() ), NIL ) }, ; - "PrivateKeyFilename" => "private.key", ; - "CertificateFilename" => "certificate.crt", ; - "SSL" => .T., ; - "Mount" => {; + IF ! oServer:Run( { ; + "FirewallFilter" => "", ; + "LogAccess" => {| m | oLogAccess:Add( m + hb_eol() ) }, ; + "LogError" => {| m | oLogError:Add( m + hb_eol() ) }, ; + "Trace" => {| ... | QOut( ... ) }, ; + "Port" => nPort, ; + "Idle" => {| o | iif( hb_FileExists( ".uhttpd.stop" ), ( FErase( ".uhttpd.stop" ), o:Stop() ), NIL ) }, ; + "PrivateKeyFilename" => "private.key", ; + "CertificateFilename" => "certificate.crt", ; + "SSL" => .T., ; + "Mount" => { ; "/hello" => {|| UWrite( "Hello!" ) }, ; "/info" => {|| UProcInfo() }, ; - "/files/*" => {| x | QOUT( HB_DIRBASE() + "/files/" + X ), UProcFiles( HB_DIRBASE() + "/files/" + X, .F. ) }, ; + "/files/*" => {| x | QOut( hb_DirBase() + "/files/" + X ), UProcFiles( hb_DirBase() + "/files/" + X, .F. ) }, ; "/app/login" => @proc_login(), ; "/app/logout" => @proc_logout(), ; "/app/account" => @proc_account(), ; @@ -138,14 +138,14 @@ STATIC FUNCTION proc_login() LOCAL cUser - IF server["REQUEST_METHOD"] == "POST" + IF server[ "REQUEST_METHOD" ] == "POST" dbUseArea( .T., , "users", "users", .T., .T. ) - OrdSetFocus( "user" ) - cUser := PadR( HB_HGetDef( post, "user", "" ), 16 ) + ordSetFocus( "user" ) + cUser := PadR( hb_HGetDef( post, "user", "" ), 16 ) USessionStart() IF !Empty( cUser ) .AND. dbSeek( cUser, .F. ) .AND. ! Deleted() .AND. ; - PadR( HB_HGetDef( post, "password", "" ), 16 ) == FIELD->PASSWORD - session["user"] := cUser + PadR( hb_HGetDef( post, "password", "" ), 16 ) == FIELD->PASSWORD + session[ "user" ] := cUser URedirect( "main" ) ELSE URedirect( "login?err" ) @@ -153,7 +153,7 @@ STATIC FUNCTION proc_login() ENDIF dbCloseArea() ELSE - IF HB_HHasKey( get, "err" ) + IF hb_HHasKey( get, "err" ) RETURN { "errtext" => "Invalid user name or password!" } ENDIF RETURN { => } @@ -171,7 +171,7 @@ STATIC FUNCTION proc_logout() STATIC FUNCTION proc_main() USessionStart() - IF ! HB_HHasKey( session, "user" ) + IF ! hb_HHasKey( session, "user" ) URedirect( "/app/login" ) RETURN NIL ENDIF @@ -183,22 +183,22 @@ STATIC FUNCTION proc_shopping() LOCAL oW, nT, cCode USessionStart() - IF ! HB_HHasKey( session, "user" ) + IF ! hb_HHasKey( session, "user" ) URedirect( "/app/login" ) RETURN NIL ENDIF dbUseArea( .T., , "carts", "carts", .T., .F. ) - OrdSetFocus( "user" ) + ordSetFocus( "user" ) dbUseArea( .T., , "items", "items", .T., .T. ) - OrdSetFocus( "code" ) + ordSetFocus( "code" ) - IF HB_HHasKey( get, "add" ) - cCode := PadR( get["add"], 16 ) + IF hb_HHasKey( get, "add" ) + cCode := PadR( get[ "add" ], 16 ) IF items->( dbSeek( cCode ) ) .AND. carts->( FLock() ) - IF ! carts->( dbSeek( session["user"] + cCode ) ) + IF ! carts->( dbSeek( session[ "user" ] + cCode ) ) carts->( dbAppend() ) - carts->USER := session["user"] + carts->USER := session[ "user" ] carts->CODE := cCode ENDIF carts->AMOUNT += 1 @@ -210,8 +210,8 @@ STATIC FUNCTION proc_shopping() ENDIF dbSelectArea( "carts" ) - ORDSCOPE( 0, session["user"] ) - ORDSCOPE( 1, session["user"] ) + ordScope( 0, session[ "user" ] ) + ordScope( 1, session[ "user" ] ) nT := 0 carts->( dbEval( {|| nT += FIELD->TOTAL } ) ) dbSelectArea( "items" ) @@ -221,8 +221,8 @@ STATIC FUNCTION proc_shopping() oW:AddColumn( 103, "Price", "PRICE" ) oW:AddColumn( 104, "", {|| ULink( "Add to cart", "?add=" + RTrim( FIELD->CODE ) ) }, .T. ) oW:nPageSize := 10 - IF HB_HHasKey( get, "_pos" ) - oW:nPos := Val( get["_pos"] ) + IF hb_HHasKey( get, "_pos" ) + oW:nPos := Val( get[ "_pos" ] ) ENDIF RETURN { "browse" => oW:Output(), "cartsum" => nT } @@ -232,20 +232,20 @@ STATIC FUNCTION proc_cart() LOCAL oW, nT, cCode USessionStart() - IF ! HB_HHasKey( session, "user" ) + IF ! hb_HHasKey( session, "user" ) URedirect( "/app/login" ) RETURN NIL ENDIF dbUseArea( .T., , "items", "items", .T., .T. ) - OrdSetFocus( "code" ) + ordSetFocus( "code" ) dbUseArea( .T., , "carts", "carts", .T., .F. ) - OrdSetFocus( "user" ) + ordSetFocus( "user" ) - IF HB_HHasKey( get, "del" ) - cCode := PadR( get["del"], 16 ) + IF hb_HHasKey( get, "del" ) + cCode := PadR( get[ "del" ], 16 ) IF items->( dbSeek( cCode ) ) .AND. carts->( FLock() ) - IF carts->( dbSeek( session["user"] + cCode ) ) + IF carts->( dbSeek( session[ "user" ] + cCode ) ) carts->( dbDelete() ) carts->USER := "" carts->CODE := cCode @@ -256,8 +256,8 @@ STATIC FUNCTION proc_cart() RETURN NIL ENDIF - ORDSCOPE( 0, session["user"] ) - ORDSCOPE( 1, session["user"] ) + ordScope( 0, session[ "user" ] ) + ordScope( 1, session[ "user" ] ) nT := 0 carts->( dbEval( {|| nT += FIELD->TOTAL } ) ) @@ -268,8 +268,8 @@ STATIC FUNCTION proc_cart() oW:AddColumn( 104, "Total", "TOTAL" ) oW:AddColumn( 104, "", {|| ULink( "Delete", "?del=" + RTrim( FIELD->CODE ) ) }, .T. ) oW:nPageSize := 10 - IF HB_HHasKey( get, "_pos" ) - oW:nPos := Val( get["_pos"] ) + IF hb_HHasKey( get, "_pos" ) + oW:nPos := Val( get[ "_pos" ] ) ENDIF RETURN { "browse" => oW:Output(), "cartsum" => nT } @@ -277,13 +277,13 @@ STATIC FUNCTION proc_cart() STATIC FUNCTION proc_account() USessionStart() - IF ! HB_HHasKey( session, "user" ) + IF ! hb_HHasKey( session, "user" ) URedirect( "/app/login" ) RETURN NIL ENDIF dbUseArea( .T., , "users", "users", .T., .F. ) - OrdSetFocus( "user" ) - dbSeek( session["user"], .F. ) + ordSetFocus( "user" ) + dbSeek( session[ "user" ], .F. ) RETURN { "user" => users->USER, "name" => users->NAME } @@ -292,27 +292,27 @@ STATIC FUNCTION proc_account_edit() LOCAL cName, cPassword1, cPassword2, aRet USessionStart() - IF ! HB_HHasKey( session, "user" ) + IF ! hb_HHasKey( session, "user" ) URedirect( "/app/login" ) RETURN NIL ENDIF dbUseArea( .T., , "users", "users", .T., .F. ) - OrdSetFocus( "user" ) - dbSeek( session["user"], .F. ) + ordSetFocus( "user" ) + dbSeek( session[ "user" ], .F. ) cName := users->NAME - IF HB_HHasKey( session, "formdata_account/edit" ) - cName := session["formdata_account/edit", "name"] + IF hb_HHasKey( session, "formdata_account/edit" ) + cName := session[ "formdata_account/edit", "name" ] ENDIF - IF server["REQUEST_METHOD"] == "POST" - cName := HB_HGetDef( post, "name", "" ) - cPassword1 := HB_HGetDef( post, "password1", "" ) - cPassword2 := HB_HGetDef( post, "password2", "" ) + IF server[ "REQUEST_METHOD" ] == "POST" + cName := hb_HGetDef( post, "name", "" ) + cPassword1 := hb_HGetDef( post, "password1", "" ) + cPassword2 := hb_HGetDef( post, "password2", "" ) IF Empty( cName ) - session["formdata_account/edit"] := { "name" => cName } + session[ "formdata_account/edit" ] := { "name" => cName } URedirect( "?err=1" ) ELSEIF ( ! Empty( cPassword1 ) .OR. ! Empty( cPassword2 ) ) .AND. ! ( cPassword1 == cPassword2 ) - session["formdata_account/edit"] := { "name" => cName } + session[ "formdata_account/edit" ] := { "name" => cName } URedirect( "?err=2" ) ELSE FLock() @@ -321,8 +321,8 @@ STATIC FUNCTION proc_account_edit() FIELD->PASSWORD := cPassword1 ENDIF dbUnlock() - IF HB_HHasKey( session, "formdata_account/edit" ) - HB_HDel( session, "formdata_account/edit" ) + IF hb_HHasKey( session, "formdata_account/edit" ) + hb_HDel( session, "formdata_account/edit" ) ENDIF URedirect( "/app/account" ) ENDIF @@ -330,11 +330,11 @@ STATIC FUNCTION proc_account_edit() ENDIF aRet := { "user" => users->USER, "name" => cName } - IF HB_HHasKey( get, "err" ) - IF get["err"] == "1" - aRet["errtext"] := "Name value should not be empty!" - ELSEIF get["err"] == "2" - aRet["errtext"] := "Passwords do not match!" + IF hb_HHasKey( get, "err" ) + IF get[ "err" ] == "1" + aRet[ "errtext" ] := "Name value should not be empty!" + ELSEIF get[ "err" ] == "2" + aRet[ "errtext" ] := "Passwords do not match!" ENDIF ENDIF @@ -347,26 +347,26 @@ STATIC FUNCTION proc_register() USessionStart() cUser := "" cName := "" - IF HB_HHasKey( session, "formdata_register" ) - cUser := session["formdata_register", "user"] - cName := session["formdata_register", "name"] + IF hb_HHasKey( session, "formdata_register" ) + cUser := session[ "formdata_register", "user" ] + cName := session[ "formdata_register", "name" ] ENDIF - IF server["REQUEST_METHOD"] == "POST" + IF server[ "REQUEST_METHOD" ] == "POST" dbUseArea( .T., , "users", "users", .T., .F. ) - OrdSetFocus( "user" ) - cUser := HB_HGetDef( post, "user", "" ) - cName := HB_HGetDef( post, "name", "" ) - cPassword1 := HB_HGetDef( post, "password1", "" ) - cPassword2 := HB_HGetDef( post, "password2", "" ) + ordSetFocus( "user" ) + cUser := hb_HGetDef( post, "user", "" ) + cName := hb_HGetDef( post, "name", "" ) + cPassword1 := hb_HGetDef( post, "password1", "" ) + cPassword2 := hb_HGetDef( post, "password2", "" ) IF Empty( cUser ) .OR. Empty( cName ) .OR. Empty( cPassword1 ) .OR. Empty( cPassword2 ) - session["formdata_register"] := { "user" => cUser, "name" => cName } + session[ "formdata_register" ] := { "user" => cUser, "name" => cName } URedirect( "?err=1" ) ELSEIF !( cPassword1 == cPassword2 ) - session["formdata_register"] := { "user" => cUser, "name" => cName } + session[ "formdata_register" ] := { "user" => cUser, "name" => cName } URedirect( "?err=2" ) ELSEIF dbSeek( cUser, .F. ) - session["formdata_register"] := { "user" => cUser, "name" => cName } + session[ "formdata_register" ] := { "user" => cUser, "name" => cName } URedirect( "?err=3" ) ELSE FLock() @@ -377,19 +377,19 @@ STATIC FUNCTION proc_register() dbUnlock() USessionDestroy() USessionStart() - session["user"] := cUser + session[ "user" ] := cUser URedirect( "/app/main" ) ENDIF RETURN NIL ENDIF aRet := { "user" => cUser, "name" => cName } - IF HB_HHasKey( get, "err" ) - IF get["err"] == "1" - aRet["errtext"] := "All fields are required!" - ELSEIF get["err"] == "2" - aRet["errtext"] := "Passwords does not match!" - ELSEIF get["err"] == "3" - aRet["errtext"] := "This user already exists!" + IF hb_HHasKey( get, "err" ) + IF get[ "err" ] == "1" + aRet[ "errtext" ] := "All fields are required!" + ELSEIF get[ "err" ] == "2" + aRet[ "errtext" ] := "Passwords does not match!" + ELSEIF get[ "err" ] == "3" + aRet[ "errtext" ] := "This user already exists!" ENDIF ENDIF diff --git a/harbour/contrib/hbhttpd/tests/tpl/_main.tpl b/harbour/contrib/hbhttpd/tests/tpl/_main.tpl index 52b80d8c5f..ebe26c5794 100644 --- a/harbour/contrib/hbhttpd/tests/tpl/_main.tpl +++ b/harbour/contrib/hbhttpd/tests/tpl/_main.tpl @@ -1,9 +1,9 @@ - + {{:}} - \ No newline at end of file + diff --git a/harbour/contrib/hbhttpd/widgets.prg b/harbour/contrib/hbhttpd/widgets.prg index c12a1014cc..8a21dc07f2 100644 --- a/harbour/contrib/hbhttpd/widgets.prg +++ b/harbour/contrib/hbhttpd/widgets.prg @@ -8,7 +8,7 @@ MEMVAR session, server, get, post -//============================================================ +// ============================================================ CREATE CLASS UWMain @@ -44,7 +44,7 @@ METHOD Add( oWidget ) CLASS UWMain RETURN Self -//============================================================ +// ============================================================ CREATE CLASS UWLayoutGrid @@ -97,11 +97,11 @@ METHOD Add( oWidget, nRow, nCol ) CLASS UWLayoutGrid AEval( Self:aChilds, {| x | AAdd( x, {} ) } ) NEXT ENDIF - AAdd( Self:aChilds[nRow, nCol], oWidget ) + AAdd( Self:aChilds[ nRow, nCol ], oWidget ) RETURN Self -//============================================================ +// ============================================================ CREATE CLASS UWHtml @@ -125,7 +125,7 @@ METHOD Paint() CLASS UWHtml RETURN Self -//============================================================ +// ============================================================ CREATE CLASS UWLabel @@ -155,7 +155,7 @@ METHOD Paint() CLASS UWLabel RETURN Self -//============================================================ +// ============================================================ CREATE CLASS UWForm @@ -190,7 +190,7 @@ METHOD Paint() CLASS UWForm RETURN Self -//============================================================ +// ============================================================ CREATE CLASS UWInput @@ -221,7 +221,7 @@ METHOD Paint() CLASS UWInput RETURN Self -//============================================================ +// ============================================================ CREATE CLASS UWPassword @@ -247,7 +247,7 @@ METHOD Paint() CLASS UWPassword RETURN Self -//============================================================ +// ============================================================ CREATE CLASS UWSubmit @@ -274,7 +274,7 @@ METHOD Paint() CLASS UWSubmit RETURN Self -//============================================================ +// ============================================================ CREATE CLASS UWSeparator @@ -294,7 +294,7 @@ METHOD Paint() CLASS UWSeparator RETURN Self -//============================================================ +// ============================================================ CREATE CLASS UWMenu @@ -326,13 +326,13 @@ METHOD Paint() CLASS UWMenu IF nI != 1 UWrite( ' | ' ) ENDIF - UWrite( '' + UHtmlEncode( Self:aItems[nI, 1] ) + '' ) + UWrite( '' + UHtmlEncode( Self:aItems[ nI, 1 ] ) + '' ) NEXT UWrite( '' ) RETURN Self -//============================================================ +// ============================================================ CREATE CLASS UWBrowse @@ -363,23 +363,23 @@ METHOD Output() CLASS UWBrowse cRet += '' -// Header + // Header cRet += '' FOR nI := 1 TO Len( Self:aColumns ) - cRet += '' + cRet += '' NEXT cRet += '' -// Body + // Body nPos := 0 dbGoTop() IF Self:nPageSize > 0 .AND. Self:nPos > 0 dbSkip( Self:nPos ) ENDIF - DO WHILE ! EOF() + DO WHILE ! Eof() cRet += '' FOR nI := 1 TO Len( Self:aColumns ) - xField := Self:aColumns[nI, 3] + xField := Self:aColumns[ nI, 3 ] IF HB_ISSTRING( xField ) xI := FieldGet( FieldPos( xField ) ) ELSEIF HB_ISBLOCK( xField ) @@ -391,7 +391,7 @@ METHOD Output() CLASS UWBrowse CASE "D" ; xI := DToC( xI ); EXIT OTHERWISE ; xI := "VALTYPE()==" + ValType( xI ) ENDSWITCH - IF ! Self:aColumns[nI, 4] + IF ! Self:aColumns[ nI, 4 ] xI := UHtmlEncode( xI ) ENDIF cRet += '' @@ -403,8 +403,8 @@ METHOD Output() CLASS UWBrowse ENDIF ENDDO cRet += '
' + UHtmlEncode( Self:aColumns[nI, 2] ) + '' + UHtmlEncode( Self:aColumns[ nI, 2 ] ) + '
' + xI + '
' - IF ! EOF() .OR. Self:nPos > 0 - cUrl := server["REQUEST_URI"] + IF ! Eof() .OR. Self:nPos > 0 + cUrl := server[ "REQUEST_URI" ] IF ( nI := At( "?_ucs=", cUrl ) ) == 0 nI := At( "&_ucs=", cUrl ) ENDIF @@ -419,7 +419,7 @@ METHOD Output() CLASS UWBrowse ENDIF cUrl += iif( "?" $ cUrl, "&", "?" ) + "_pos=" cRet := '
' + cRet - IF ! EOF() + IF ! Eof() cI := cUrl + hb_ntos( Self:nPos + Self:nPageSize ) cRet := '>>' + cRet ENDIF @@ -431,7 +431,7 @@ METHOD Output() CLASS UWBrowse RETURN cRet -//============================================================ +// ============================================================ CREATE CLASS UWOption @@ -451,7 +451,7 @@ FUNC UWOptionNew() METHOD Add( cTitle, cCode, lRaw ) CLASS UWOption - AAdd( Self:aOption, { iif( ! Empty(lRaw ), cTitle, UHtmlEncode(cTitle ) ), cCode } ) + AAdd( Self:aOption, { iif( ! Empty( lRaw ), cTitle, UHtmlEncode( cTitle ) ), cCode } ) RETURN Self @@ -505,18 +505,18 @@ PROCEDURE UProcWidgets( cURL, aMap ) lRet := .T. // Enter procedures DO WHILE nI <= Len( aURL ) - cI := uhttpd_join( "/", ASize( AClone(aURL ), nI ) ) + cI := uhttpd_join( "/", ASize( AClone( aURL ), nI ) ) IF hb_HHasKey( aMap, cI ) session[ "_uthis" ] := { "idhash" => { => } } - IF ( lRet := Eval( aMap[cI], "INIT" ) ) == .T. - AAdd( aStack, { aURL[nI], aMap[cI], session[ "_uthis" ] } ) + IF ( lRet := Eval( aMap[ cI ], "INIT" ) ) == .T. + AAdd( aStack, { aURL[ nI ], aMap[ cI ], session[ "_uthis" ] } ) session[ "_uthis" ] := NIL ELSE session[ "_uthis" ] := NIL EXIT ENDIF ELSE - AAdd( aStack, { aURL[nI], NIL, NIL } ) + AAdd( aStack, { aURL[ nI ], NIL, NIL } ) ENDIF nI++ ENDDO diff --git a/harbour/contrib/hblzf/tests/test.prg b/harbour/contrib/hblzf/tests/test.prg index 5c3611720c..ee7d3a358b 100644 --- a/harbour/contrib/hblzf/tests/test.prg +++ b/harbour/contrib/hblzf/tests/test.prg @@ -12,12 +12,13 @@ #define _NREPL_ 128 PROCEDURE Main() + LOCAL cStr, str_compressed, str_decompressed LOCAL b64_expected_result := "BFRoaXMgIAIUdGVzdCBvZiBMWkYgZXh0ZW5zaW9u" LOCAL nLen, nResult := 0 ? "LZF Api version is", ; - hb_ntos( hb_lzf_version() ) + "(0x" + hb_numtohex( hb_lzf_version() ) +")" + hb_ntos( hb_lzf_version() ) + "(0x" + hb_NumToHex( hb_lzf_version() ) + ")" ? "LibLZF optimized for", iif( hb_lzf_optimized_for_speed(), "speed.", "compression." ) ? "--- test 1 ---" @@ -57,7 +58,7 @@ PROCEDURE Main() ? "Lenght of a string is", hb_ntos( Len( cStr ) ) ? "Lenght of a compressed string is", hb_ntos( Len( str_compressed ) ) - ? iif( hb_base64encode( str_compressed ) == b64_expected_result, "OK!", "not OK!" ) + ? iif( hb_base64Encode( str_compressed ) == b64_expected_result, "OK!", "not OK!" ) ELSE ? "hb_lzf_compress() return ", iif( nResult == HB_LZF_BUF_ERROR, "LZF_BUF_ERROR", "LZF_MEM_ERROR" ) ENDIF @@ -73,7 +74,7 @@ PROCEDURE Main() ? "Lenght of a string is", hb_ntos( Len( cStr ) ) ? "Lenght of a compressed string is", hb_ntos( Len( str_compressed ) ) - ? iif( hb_base64encode( str_compressed ) == b64_expected_result, "OK!", "not OK!" ) + ? iif( hb_base64Encode( str_compressed ) == b64_expected_result, "OK!", "not OK!" ) ELSE ? "hb_lzf_compress() return ", iif( nResult == HB_LZF_BUF_ERROR, "LZF_BUF_ERROR", "LZF_MEM_ERROR" ) ENDIF @@ -100,7 +101,7 @@ PROCEDURE Main() ? "--- test 7 ---" cStr := Replicate( TEST_STRING, _NREPL_ ) - str_compressed := hb_zcompress( cStr, NIL, @nResult ) + str_compressed := hb_ZCompress( cStr, NIL, @nResult ) str_decompressed := hb_lzf_decompress( str_compressed, NIL, @nResult ) diff --git a/harbour/contrib/hblzf/tests/test2.prg b/harbour/contrib/hblzf/tests/test2.prg index 205bcad2d9..3dc6e5e722 100644 --- a/harbour/contrib/hblzf/tests/test2.prg +++ b/harbour/contrib/hblzf/tests/test2.prg @@ -10,17 +10,18 @@ #define _NREPL_ 50 PROCEDURE Main() - LOCAL cStr := Replicate( hb_memoRead( hb_argv( 0 ) ), _NREPL_ ) + + LOCAL cStr := Replicate( hb_MemoRead( hb_argv( 0 ) ), _NREPL_ ) LOCAL aCompressedData := { NIL, NIL, NIL, NIL } LOCAL hFuncs := { ; "GZIP" => @hb_gzCompress(), ; - "ZLIB" => @hb_zCompress(), ; + "ZLIB" => @hb_ZCompress(), ; "BZ2 " => @hb_bz2_compress(), ; "LZF " => @hb_lzf_compress(); } LOCAL hFuncs2 := { ; - "GZIP" => @hb_zUncompress(), ; - "ZLIB" => @hb_zUncompress(), ; + "GZIP" => @hb_ZUncompress(), ; + "ZLIB" => @hb_ZUncompress(), ; "BZ2 " => @hb_bz2_uncompress(), ; "LZF " => @hb_lzf_decompress(); } @@ -31,26 +32,28 @@ PROCEDURE Main() RETURN STATIC PROCEDURE MakeTest( ... ) + LOCAL e, e2, cRes, cFmt LOCAL nResult := 0 LOCAL nBegin, nEnd LOCAL lCmp := ( PCount() > 2 ) - FOR EACH e, e2 IN hb_pValue( 1 ), hb_pValue( 2 ) - nBegin := hb_secondsCPU() - cRes := Eval( e:__enumValue(), iif( lCmp, hb_pValue( 3 ), e2 ), NIL, @nResult ) - nEnd := hb_secondsCPU() + FOR EACH e, e2 IN hb_PValue( 1 ), hb_PValue( 2 ) + nBegin := hb_SecondsCPU() + cRes := Eval( e:__enumValue(), iif( lCmp, hb_PValue( 3 ), e2 ), NIL, @nResult ) + nEnd := hb_SecondsCPU() IF lCmp e2 := cRes ENDIF - cFmt := hb_strFormat( ; + cFmt := hb_StrFormat( ; "%s: %d -> %d, Ratio %.2f%%, Times %.2f", ; e:__enumKey(), ; - Len( iif( lCmp, hb_pValue( 3 ), e2 ) ), Len( cRes ), ; - ( Len( cRes ) / Len( iif( lCmp, hb_pValue( 3 ), e2 ) ) ) * 100, ; + Len( iif( lCmp, hb_PValue( 3 ), e2 ) ), Len( cRes ), ; + ( Len( cRes ) / Len( iif( lCmp, hb_PValue( 3 ), e2 ) ) ) * 100, ; nEnd - nBegin; ) ? cFmt NEXT ? + RETURN diff --git a/harbour/contrib/hbmagic/tests/hbmagit.prg b/harbour/contrib/hbmagic/tests/hbmagit.prg index f56ee23e46..6587345553 100644 --- a/harbour/contrib/hbmagic/tests/hbmagit.prg +++ b/harbour/contrib/hbmagic/tests/hbmagit.prg @@ -53,50 +53,55 @@ #require "hbmagic" #include "hbmagic.ch" -#include "simpleio.ch" #xcommand T( <(title)>, <(subject)> ) => ; - magic_setflags( hMagic, MAGIC_NONE ) ;; - OutStd( hb_strFormat( + ": t: [%s] ", magic_buffer( hMagic, <subject> ) ) ) ;; - magic_setflags( hMagic, MAGIC_MIME_TYPE ) ;; - OutStd( hb_strFormat( "m: [%s]", magic_buffer( hMagic, <subject> ) ) + hb_eol() ) + magic_setflags( hMagic, MAGIC_NONE ) ;; + OutStd( hb_StrFormat( <title> + ": t: [%s] ", magic_buffer( hMagic, <subject> ) ) ) ;; + magic_setflags( hMagic, MAGIC_MIME_TYPE ) ;; + OutStd( hb_StrFormat( "m: [%s]", magic_buffer( hMagic, <subject> ) ) + hb_eol() ) PROCEDURE Main() LOCAL cJpeg, cPng, cGif, cElf, cExe, cCom, cText LOCAL hMagic - cJpeg := hb_base64decode( ; - "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB" + ; - "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEB" + ; - "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAABAAEDASIA" + ; - "AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA" + ; - "AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3" + ; - "ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm" + ; - "p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA" + ; - "AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx" + ; - "BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK" + ; - "U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3" + ; - "uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/iii" + ; - "igD/2Q==" ) - cPng := hb_base64decode( ; - "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAAxJREFUCNdj" + ; - "+P//PwAF/gL+3MxZ5wAAAABJRU5ErkJggg==" ) - cGif := hb_base64decode( ; - "R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs=" ) - cElf := hb_base64decode( ; - "f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAA4CZAAAAAAAA=" ) - cExe := hb_base64decode( ; - "TVpAAAEAAAAGAAAA//8AALgAAAAAAAAAYAAAAAAAAAA=" ) - cCom := hb_base64decode( ; - "6fEAUE1PREUvVyBWZXJzaW9uIENoZWNrIFV0aWxpdHk=" ) - cText := hb_base64decode( ; - "H4sICONj7UwCA3Rlc3QAjVFba8IwGH3vr/ioDFosE4YM5qUQayaKtfWyh22M0qZpjWsbMSnz5y+p" + ; - "MjcfhoEcksN3LiFGi1WkqFMKJuFlyat7sjWNC7lNyjhn5IoVrNwXlPGGNlpHLY2rFDYWDCzJZEFt" + ; - "11FHUSc7SqTtgg1DF/oG/KzGNhJUZkWcCwu2viYc8NFk6kWLYIGVpv9bEdRyLVM1mURCHp75oYyl" + ; - "ymviXGiD2QPZg/c78QGmc/ZP6iyjh4v74NxIF7KvA/6v5E99HG1ewxt7meWpy41V2lpOeWGpi2GE" + ; - "q8DD45cVBj9mlaUYlTMPPDQHMtvT3AESVhonLFOIiwaPVKHHy8vwKatRNzroDXVOEgv62E0p4Sm1" + ; - "/vwKgNl52nW6CC3Xn2+zVY5GaInRGo2mCI07D1+jMUJYczdtU72rb3wD2wEd8GQCAAA=" ) + cJpeg := hb_base64Decode( ; + "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB" + ; + "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEB" + ; + "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAABAAEDASIA" + ; + "AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA" + ; + "AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3" + ; + "ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm" + ; + "p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA" + ; + "AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx" + ; + "BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK" + ; + "U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3" + ; + "uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/iii" + ; + "igD/2Q==" ) + + cPng := hb_base64Decode( ; + "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAAxJREFUCNdj" + ; + "+P//PwAF/gL+3MxZ5wAAAABJRU5ErkJggg==" ) + + cGif := hb_base64Decode( ; + "R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs=" ) + + cElf := hb_base64Decode( ; + "f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAA4CZAAAAAAAA=" ) + + cExe := hb_base64Decode( ; + "TVpAAAEAAAAGAAAA//8AALgAAAAAAAAAYAAAAAAAAAA=" ) + + cCom := hb_base64Decode( ; + "6fEAUE1PREUvVyBWZXJzaW9uIENoZWNrIFV0aWxpdHk=" ) + + cText := hb_base64Decode( ; + "H4sICONj7UwCA3Rlc3QAjVFba8IwGH3vr/ioDFosE4YM5qUQayaKtfWyh22M0qZpjWsbMSnz5y+p" + ; + "MjcfhoEcksN3LiFGi1WkqFMKJuFlyat7sjWNC7lNyjhn5IoVrNwXlPGGNlpHLY2rFDYWDCzJZEFt" + ; + "11FHUSc7SqTtgg1DF/oG/KzGNhJUZkWcCwu2viYc8NFk6kWLYIGVpv9bEdRyLVM1mURCHp75oYyl" + ; + "ymviXGiD2QPZg/c78QGmc/ZP6iyjh4v74NxIF7KvA/6v5E99HG1ewxt7meWpy41V2lpOeWGpi2GE" + ; + "q8DD45cVBj9mlaUYlTMPPDQHMtvT3AESVhonLFOIiwaPVKHHy8vwKatRNzroDXVOEgv62E0p4Sm1" + ; + "/vwKgNl52nW6CC3Xn2+zVY5GaInRGo2mCI07D1+jMUJYczdtU72rb3wD2wEd8GQCAAA=" ) hMagic := magic_open() IF Empty( hMagic ) .OR. magic_load( hMagic ) != 0 @@ -114,10 +119,10 @@ PROCEDURE Main() T( "Empty buffer", "" ) T( "Null buffer", NIL ) T( "Compressed data", cText ) - cText := hb_zuncompress( cText ) + cText := hb_ZUncompress( cText ) T( "Plain text", cText ) OutStd( "hb_Magic_Simple(): t: [" + hb_Magic_Simple( hb_argv( 0 ), MAGIC_NONE ) + "] " + ; - "m: [" + hb_Magic_Simple( hb_argv( 0 ), MAGIC_MIME_TYPE ) + "]" + hb_eol() ) + "m: [" + hb_Magic_Simple( hb_argv( 0 ), MAGIC_MIME_TYPE ) + "]" + hb_eol() ) RETURN diff --git a/harbour/contrib/hbmisc/calldll.prg b/harbour/contrib/hbmisc/calldll.prg index 3162099b57..a9a4d7f4a4 100644 --- a/harbour/contrib/hbmisc/calldll.prg +++ b/harbour/contrib/hbmisc/calldll.prg @@ -56,9 +56,11 @@ STATIC s_hDLL := { => } STATIC s_mutex := hb_mutexCreate() PROCEDURE UNLOADALLDLL() + hb_mutexLock( s_mutex ) s_hDLL := { => } hb_mutexUnlock( s_mutex ) + RETURN FUNCTION CALLDLL32( cFunction, cLibrary, ... ) @@ -68,12 +70,13 @@ FUNCTION CALLDLL32( cFunction, cLibrary, ... ) /* Use Windows system .dll calling convention on Windows systems, like in original lib. Original .lib was a Windows-only solution. [vszakats] */ - #define _DEF_CALLCONV_ HB_DYN_CALLCONV_STDCALL +# define _DEF_CALLCONV_ HB_DYN_CALLCONV_STDCALL #else - #define _DEF_CALLCONV_ HB_DYN_CALLCONV_CDECL +# define _DEF_CALLCONV_ HB_DYN_CALLCONV_CDECL #endif FUNCTION HB_DYNACALL1( cFunction, cLibrary, nCount, ... ) + LOCAL aParams LOCAL hHandle @@ -83,7 +86,7 @@ FUNCTION HB_DYNACALL1( cFunction, cLibrary, nCount, ... ) hb_mutexLock( s_mutex ) IF !( cLibrary $ s_hDLL ) - s_hDLL[ cLibrary ] := hb_LibLoad( cLibrary ) + s_hDLL[ cLibrary ] := hb_libLoad( cLibrary ) ENDIF hHandle := s_hDLL[ cLibrary ] @@ -92,9 +95,9 @@ FUNCTION HB_DYNACALL1( cFunction, cLibrary, nCount, ... ) IF HB_ISNUMERIC( nCount ) .AND. nCount >= 0 .AND. nCount < PCount() - 3 aParams := ASize( hb_AParams(), nCount ) - RETURN hb_dynCall( { cFunction, hHandle, _DEF_CALLCONV_ }, hb_arrayToParams( aParams ) ) + RETURN hb_DynCall( { cFunction, hHandle, _DEF_CALLCONV_ }, hb_ArrayToParams( aParams ) ) ELSE - RETURN hb_dynCall( { cFunction, hHandle, _DEF_CALLCONV_ }, ... ) + RETURN hb_DynCall( { cFunction, hHandle, _DEF_CALLCONV_ }, ... ) ENDIF ENDIF diff --git a/harbour/contrib/hbmisc/doc/en/ht_class.txt b/harbour/contrib/hbmisc/doc/en/ht_class.txt index a46ca9ec55..c36c354a0b 100644 --- a/harbour/contrib/hbmisc/doc/en/ht_class.txt +++ b/harbour/contrib/hbmisc/doc/en/ht_class.txt @@ -13,7 +13,7 @@ oFile := TFileRead():New( <cFileName> [, <nReadSize> ] ) $ARGUMENTS$ <cFileName> is the required name of the file to be read. </par> - + <nReadSize> is the optional size to use when reading from the file. The default value is 4096 and the allowed range is 1 through 65535. Any value outside of this range causes the default value to be used. </par> @@ -23,40 +23,40 @@ TFileRead() is used to access a file one line at a time. You must specify the name of the file when an instance of the class is created. </par> The class data should be considered private to the class. </par> - + The class methods are as follows: </par> - + New() Creates a new instance of the TFileRead class. </par> - + Open([<nFlags>]) Opens the file for reading. The optional nFlags parameter can use any of the FOPEN() flags from fileio.ch. The default is FO_READ + FO_SHARED. Calling this method when the file is already open causes the next ReadLine() to start over from the beginning of the file. </par> - + Close() Closes the file. </par> - + ReadLine() Returns one line from the file, stripping the newline characters. The following sequences are treated as one newline: 1) CR CR LF; 2) CR LF; 3) LF; and 4) CR. Note: LF CR is 2 newlines. </par> Name() Returns the name of the file. </par> - + IsOpen() Returns .T. if the file is open. </par> - + MoreToRead() Returns .T. if there are more lines to be read (think of it as an inverse EOF function). - + Error() Returns .T. if an error has occurred. </par> - + ErrorNo() Returns the current error code. </par> - + ErrorMsg([<cPre>]) Returns a formatted error message. </par> $EXAMPLES$ PROCEDURE Main( cFile ) LOCAL oFile := TFileRead():New( cFile ) - + oFile:Open() IF oFile:Error() OutStd( oFile:ErrorMsg( "FileRead: " ) ) diff --git a/harbour/contrib/hbmisc/doc/en/ht_doc.txt b/harbour/contrib/hbmisc/doc/en/ht_doc.txt index bbdcabe6cd..e37fb7ac45 100644 --- a/harbour/contrib/hbmisc/doc/en/ht_doc.txt +++ b/harbour/contrib/hbmisc/doc/en/ht_doc.txt @@ -29,7 +29,7 @@ $EXAMPLES$ PROCEDURE Main() LOCAL oHtm - + oHtm := THTML():New( "www\harbour.html" ) oHtm:WriteTitle( "Harbour Reference Guide" ) oHtm:WritePar( "HARBOUR" ) @@ -38,7 +38,7 @@ oHtm:WriteLink( "http://www.gnu.org/copyleft/gpl" ) oHtm:WritePar( "See the Links Above" ) oHtm:Close() - + RETURN r> $STATUS$ @@ -80,16 +80,16 @@ $EXAMPLES$ PROCEDURE Main() LOCAL oNg - + oNg := TOs2():New( "ngi\harbour.ngi" ) oNg:WriteTitle( "Harbour Reference Guide" ) oNg:WritePar( "HARBOUR" ) oNg:WriteLink( "OverView" ) oNg:WriteLink( "License" ) - + oNg:WritePar( "See the Links Above" ) oNg:Close() - + RETURN $STATUS$ R @@ -128,16 +128,16 @@ $EXAMPLES$ PROCEDURE Main() LOCAL oNg - + oNg := TNortonGuide():New( "ngi\harbour.ngi" ) oNg:WriteTitle( "Harbour Reference Guide" ) oNg:WritePar( "HARBOUR" ) oNg:WriteLink( "OverView" ) oNg:WriteLink( "License" ) - + oNg:WritePar( "See the Links Above" ) oNg:Close() - + RETURN $STATUS$ R @@ -178,17 +178,17 @@ $EXAMPLES$ PROCEDURE Main() LOCAL oRtf - + oRtf := TRtf():New( "rtf\harbour.rtf" ) oRtf:WriteHeader() oRtf:WriteTitle( "Harbour Reference Guide" ) oRtf:WritePar( "HARBOUR" ):Endpar() oRtf:WriteLink( "OverView" ) oRtf:WriteLink( "License" ) - + oRtf:WritePar( "See the Links Above" ):EndPar() oRtf:Close() - + RETURN $STATUS$ R @@ -228,16 +228,16 @@ $EXAMPLES$ PROCEDURE Main() LOCAL oTroff - + oTroff := TTroff():New( "tr\harbour.ngi" ) oTroff:WriteTitle( "Harbour Reference Guide" ) oTroff:WritePar( "HARBOUR" ) oTroff:WriteLink( "OverView" ) oTroff:WriteLink( "License" ) - + oTroff:WritePar( "See the Links Above" ) oTroff:Close() - + RETURN $STATUS$ R diff --git a/harbour/contrib/hbmisc/fcomma.prg b/harbour/contrib/hbmisc/fcomma.prg index 52a497dbfe..4d7c5a976b 100644 --- a/harbour/contrib/hbmisc/fcomma.prg +++ b/harbour/contrib/hbmisc/fcomma.prg @@ -74,10 +74,11 @@ ANNOUNCE FCOMMA * always done by low level USRRDD code */ STATIC FUNCTION FCM_INIT( nRDD ) - LOCAL aRData := ARRAY( 10 ) + + LOCAL aRData := Array( 10 ) /* Set in our private RDD ITEM the array with HB_F*() work are numbers */ - AFILL( aRData, -1 ) + AFill( aRData, -1 ) USRRDD_RDDDATA( nRDD, aRData ) RETURN HB_SUCCESS @@ -90,6 +91,7 @@ STATIC FUNCTION FCM_INIT( nRDD ) * always done by low level USRRDD code */ STATIC FUNCTION FCM_NEW( pWA ) + LOCAL aWData := { -1, .F., .F. } /* @@ -98,43 +100,48 @@ STATIC FUNCTION FCM_NEW( pWA ) * we have to emulate it and there is no phantom record so we * cannot return EOF flag directly. */ + USRRDD_AREADATA( pWA, aWData ) RETURN HB_SUCCESS STATIC FUNCTION FCM_CREATE( nWA, aOpenInfo ) + LOCAL oError := ErrorNew() oError:GenCode := EG_CREATE oError:SubCode := 1004 - oError:Description := HB_LANGERRMSG( EG_CREATE ) + " (" + ; - HB_LANGERRMSG( EG_UNSUPPORTED ) + ")" + oError:Description := hb_langErrMsg( EG_CREATE ) + " (" + ; + hb_langErrMsg( EG_UNSUPPORTED ) + ")" oError:FileName := aOpenInfo[ UR_OI_NAME ] oError:CanDefault := .T. UR_SUPER_ERROR( nWA, oError ) + RETURN HB_FAILURE STATIC FUNCTION FCM_OPEN( nWA, aOpenInfo ) + LOCAL cName, nMode, nSlot, nHandle, aRData, aWData, aField, oError, nResult /* When there is no ALIAS we will create new one using file name */ IF aOpenInfo[ UR_OI_ALIAS ] == NIL - HB_FNAMESPLIT( aOpenInfo[ UR_OI_NAME ], , @cName ) + hb_FNameSplit( aOpenInfo[ UR_OI_NAME ], , @cName ) aOpenInfo[ UR_OI_ALIAS ] := cName ENDIF - nMode := iif( aOpenInfo[ UR_OI_SHARED ], FO_SHARED, FO_EXCLUSIVE ) + ; - iif( aOpenInfo[ UR_OI_READONLY ], FO_READ, FO_READWRITE ) + nMode := ; + iif( aOpenInfo[ UR_OI_SHARED ], FO_SHARED, FO_EXCLUSIVE ) + ; + iif( aOpenInfo[ UR_OI_READONLY ], FO_READ, FO_READWRITE ) aRData := USRRDD_RDDDATA( USRRDD_ID( nWA ) ) aWData := USRRDD_AREADATA( nWA ) - nSlot := ASCAN( aRData, -1 ) + nSlot := AScan( aRData, -1 ) IF nSlot == 0 oError := ErrorNew() oError:GenCode := EG_OPEN oError:SubCode := 1000 - oError:Description := HB_LANGERRMSG( EG_OPEN ) + ", no free slots" + oError:Description := hb_langErrMsg( EG_OPEN ) + ", no free slots" oError:FileName := aOpenInfo[ UR_OI_NAME ] oError:CanDefault := .T. UR_SUPER_ERROR( nWA, oError ) @@ -147,9 +154,9 @@ STATIC FUNCTION FCM_OPEN( nWA, aOpenInfo ) oError := ErrorNew() oError:GenCode := EG_OPEN oError:SubCode := 1001 - oError:Description := HB_LANGERRMSG( EG_OPEN ) + oError:Description := hb_langErrMsg( EG_OPEN ) oError:FileName := aOpenInfo[ UR_OI_NAME ] - oError:OsCode := fError() + oError:OsCode := FError() oError:CanDefault := .T. UR_SUPER_ERROR( nWA, oError ) @@ -161,7 +168,7 @@ STATIC FUNCTION FCM_OPEN( nWA, aOpenInfo ) /* Set one field called LINE to access current record buffer */ UR_SUPER_SETFIELDEXTENT( nWA, 1 ) - aField := ARRAY( UR_FI_SIZE ) + aField := Array( UR_FI_SIZE ) aField[ UR_FI_NAME ] := "LINE" aField[ UR_FI_TYPE ] := HB_FT_STRING aField[ UR_FI_TYPEEXT ] := 0 @@ -179,6 +186,7 @@ STATIC FUNCTION FCM_OPEN( nWA, aOpenInfo ) RETURN nResult STATIC FUNCTION FCM_CLOSE( nWA ) + LOCAL aRData, nSlot := USRRDD_AREADATA( nWA )[ 1 ] IF nSlot >= 0 @@ -187,9 +195,11 @@ STATIC FUNCTION FCM_CLOSE( nWA ) aRData := USRRDD_RDDDATA( USRRDD_ID( nWA ) ) aRData[ nSlot ] := -1 ENDIF + RETURN UR_SUPER_CLOSE( nWA ) STATIC FUNCTION FCM_GETVALUE( nWA, nField, xValue ) + LOCAL aWData := USRRDD_AREADATA( nWA ) IF nField == 1 @@ -202,49 +212,60 @@ STATIC FUNCTION FCM_GETVALUE( nWA, nField, xValue ) ENDIF RETURN HB_SUCCESS ENDIF + RETURN HB_FAILURE STATIC FUNCTION FCM_GOTO( nWA, nRecord ) + LOCAL aWData := USRRDD_AREADATA( nWA ) + HB_FSELECT( aWData[ 1 ] ) IF nRecord <= 0 aWData[ 2 ] := aWData[ 3 ] := .T. ELSEIF nRecord == 1 HB_FGOTOP() - aWData[ 2 ] := aWData[ 3 ] := HB_FEOF() + aWData[ 2 ] := aWData[ 3 ] := hb_FEof() ELSE - HB_FSKIP(0) /* Clear the EOF flag inside HB_F* engin + HB_FSKIP( 0 ) /* Clear the EOF flag inside HB_F* engin - it's not done automatically in HB_FGOBOTTOM() :-( */ HB_FGOTO( nRecord ) aWData[ 2 ] := HB_FRECNO() == 0 - aWData[ 3 ] := HB_FEOF() + aWData[ 3 ] := hb_FEof() ENDIF + RETURN HB_SUCCESS STATIC FUNCTION FCM_GOTOID( nWA, nRecord ) RETURN FCM_GOTO( nWA, nRecord ) STATIC FUNCTION FCM_GOTOP( nWA ) + LOCAL aWData := USRRDD_AREADATA( nWA ) + HB_FSELECT( aWData[ 1 ] ) HB_FGOTOP() - aWData[ 2 ] := aWData[ 3 ] := HB_FEOF() + aWData[ 2 ] := aWData[ 3 ] := hb_FEof() + RETURN HB_SUCCESS STATIC FUNCTION FCM_GOBOTTOM( nWA ) + LOCAL aWData := USRRDD_AREADATA( nWA ) + HB_FSELECT( aWData[ 1 ] ) IF HB_FLASTREC() == 0 aWData[ 2 ] := aWData[ 3 ] := .T. ELSE - HB_FSKIP(0) /* Clear the EOF flag inside HB_F* engin + HB_FSKIP( 0 ) /* Clear the EOF flag inside HB_F* engin - it's not done automatically in HB_FGOBOTTOM() :-( */ HB_FGOBOTTOM() aWData[ 2 ] := aWData[ 3 ] := .F. ENDIF + RETURN HB_SUCCESS STATIC FUNCTION FCM_SKIPRAW( nWA, nRecords ) + LOCAL aWData IF nRecords != 0 @@ -260,43 +281,57 @@ STATIC FUNCTION FCM_SKIPRAW( nWA, nRecords ) IF nRecords < 0 .AND. HB_FRECNO() <= -nRecords HB_FGOTOP() aWData[ 2 ] := .T. - aWData[ 3 ] := HB_FEOF() + aWData[ 3 ] := hb_FEof() ELSEIF nRecords != 0 HB_FSKIP( nRecords ) aWData[ 2 ] := .F. - aWData[ 3 ] := HB_FEOF() + aWData[ 3 ] := hb_FEof() ENDIF ENDIF + RETURN HB_SUCCESS STATIC FUNCTION FCM_BOF( nWA, lBof ) + LOCAL aWData := USRRDD_AREADATA( nWA ) + lBof := aWData[ 2 ] + RETURN HB_SUCCESS STATIC FUNCTION FCM_EOF( nWA, lEof ) + LOCAL aWData := USRRDD_AREADATA( nWA ) + lEof := aWData[ 3 ] + RETURN HB_SUCCESS STATIC FUNCTION FCM_DELETED( nWA, lDeleted ) + HB_SYMBOL_UNUSED( nWA ) lDeleted := .F. + RETURN HB_SUCCESS STATIC FUNCTION FCM_RECID( nWA, nRecNo ) + LOCAL aWData := USRRDD_AREADATA( nWA ) + HB_FSELECT( aWData[ 1 ] ) IF aWData[ 3 ] nRecNo := HB_FLASTREC() + 1 ELSE nRecNo := HB_FRECNO() ENDIF + RETURN HB_SUCCESS STATIC FUNCTION FCM_RECCOUNT( nWA, nRecords ) + HB_FSELECT( USRRDD_AREADATA( nWA )[ 1 ] ) nRecords := HB_FLASTREC() + RETURN HB_SUCCESS /* @@ -304,6 +339,7 @@ STATIC FUNCTION FCM_RECCOUNT( nWA, nRecords ) * format: <RDDNAME>_GETFUNCTABLE */ FUNCTION FCOMMA_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID ) + LOCAL cSuperRDD := NIL /* NO SUPER RDD */ LOCAL aMyFunc[ UR_METHODCOUNT ] @@ -325,8 +361,10 @@ FUNCTION FCOMMA_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID ) aMyFunc[ UR_GETVALUE ] := ( @FCM_GETVALUE() ) RETURN USRRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, ; - cSuperRDD, aMyFunc ) + cSuperRDD, aMyFunc ) INIT PROCEDURE FCOMMA_INIT() + rddRegister( "FCOMMA", RDT_FULL ) + RETURN diff --git a/harbour/contrib/hbmisc/nconvert.prg b/harbour/contrib/hbmisc/nconvert.prg index f8a2db6f64..263c2f6b71 100644 --- a/harbour/contrib/hbmisc/nconvert.prg +++ b/harbour/contrib/hbmisc/nconvert.prg @@ -51,104 +51,136 @@ */ FUNCTION IsBin( cString ) + LOCAL nX + cString := AllTrim( cString ) FOR nX := 1 TO Len( cString ) IF !( SubStr( cString, nX, 1 ) $ "01" ) RETURN .F. ENDIF NEXT + RETURN .T. FUNCTION IsOctal( cString ) + LOCAL nX + cString := AllTrim( cString ) FOR nX := 1 TO Len( cString ) IF !( SubStr( cString, nX, 1 ) $ "01234567" ) RETURN .F. ENDIF NEXT + RETURN .T. FUNCTION IsDec( cString ) + LOCAL nX + cString := AllTrim( cString ) FOR nX := 1 TO Len( cString ) IF !( SubStr( cString, nX, 1 ) $ "0123456789" ) RETURN .F. ENDIF NEXT + RETURN .T. FUNCTION IsHexa( cString ) + LOCAL nX + cString := AllTrim( cString ) FOR nX := 1 TO Len( cString ) IF !( SubStr( cString, nX, 1 ) $ "0123456789ABCDEF" ) RETURN .F. ENDIF NEXT + RETURN .T. FUNCTION DecToBin( nNumber ) + LOCAL cNewString := "" LOCAL nTemp + DO WHILE nNumber > 0 nTemp := nNumber % 2 cNewString := SubStr( "01", nTemp + 1, 1 ) + cNewString nNumber := Int( ( nNumber - nTemp ) / 2 ) ENDDO + RETURN cNewString FUNCTION DecToOctal( nNumber ) + LOCAL cNewString := "" LOCAL nTemp + DO WHILE nNumber > 0 nTemp := nNumber % 8 cNewString := SubStr( "01234567", nTemp + 1, 1 ) + cNewString nNumber := Int( ( nNumber - nTemp ) / 8 ) ENDDO + RETURN cNewString FUNCTION DecToHexa( nNumber ) + LOCAL cNewString := "" LOCAL nTemp + DO WHILE nNumber > 0 nTemp := nNumber % 16 cNewString := SubStr( "0123456789ABCDEF", nTemp + 1, 1 ) + cNewString nNumber := Int( ( nNumber - nTemp ) / 16 ) ENDDO + RETURN cNewString FUNCTION BinToDec( cString ) + LOCAL nNumber := 0, nX LOCAL cNewString := AllTrim( cString ) LOCAL nLen := Len( cNewString ) + FOR nX := 1 TO nLen nNumber += ( At( SubStr( cNewString, nX, 1 ), "01" ) - 1 ) * ( 2 ** ( nLen - nX ) ) NEXT + RETURN nNumber FUNCTION OctalToDec( cString ) + LOCAL nNumber := 0, nX LOCAL cNewString := AllTrim( cString ) LOCAL nLen := Len( cNewString ) + FOR nX := 1 TO nLen nNumber += ( At( SubStr( cNewString, nX, 1 ), "01234567" ) - 1 ) * ( 8 ** ( nLen - nX ) ) NEXT + RETURN nNumber FUNCTION HexaToDec( cString ) + LOCAL nNumber := 0, nX LOCAL cNewString := AllTrim( cString ) LOCAL nLen := Len( cNewString ) + FOR nX := 1 TO nLen nNumber += ( At( SubStr( cNewString, nX, 1 ), "0123456789ABCDEF" ) - 1 ) * ( 16 ** ( nLen - nX ) ) NEXT + RETURN nNumber FUNCTION DecToRoman( nNumber ) + LOCAL cRoman := "" + DO WHILE nNumber >= 1000 cRoman += "M" nNumber -= 1000 @@ -201,4 +233,5 @@ FUNCTION DecToRoman( nNumber ) cRoman += "I" --nNumber ENDDO + RETURN cRoman diff --git a/harbour/contrib/hbmisc/numtxten.prg b/harbour/contrib/hbmisc/numtxten.prg index ab04ceacc6..47fb696237 100644 --- a/harbour/contrib/hbmisc/numtxten.prg +++ b/harbour/contrib/hbmisc/numtxten.prg @@ -8,6 +8,7 @@ // ; Decimals not supported FUNCTION NumToTxtEN( nValue ) + LOCAL cRetVal := "" IF nValue == 0 @@ -53,38 +54,39 @@ FUNCTION NumToTxtEN( nValue ) RETURN RTrim( cRetVal ) STATIC FUNCTION int_to_string( nValue ) - LOCAL cRetVal - LOCAL aArray1 := {; - "one" ,; - "two" ,; - "three" ,; - "four" ,; - "five" ,; - "six" ,; - "seven" ,; - "eight" ,; - "nine" ,; - "ten" ,; - "eleven" ,; - "twelve" ,; - "thirteen" ,; - "fourteen" ,; - "fifteen" ,; - "sixteen" ,; - "seventeen" ,; - "eighteen" ,; - "nineteen" } - LOCAL aArray2 := {; - "ten" ,; - "twenty" ,; - "thirty" ,; - "forty" ,; - "fifty" ,; - "sixty" ,; - "seventy" ,; - "eighty" ,; - "ninety" } + LOCAL cRetVal + LOCAL aArray1 := { ; + "one", ; + "two", ; + "three", ; + "four", ; + "five", ; + "six", ; + "seven", ; + "eight", ; + "nine", ; + "ten", ; + "eleven", ; + "twelve", ; + "thirteen", ; + "fourteen", ; + "fifteen", ; + "sixteen", ; + "seventeen", ; + "eighteen", ; + "nineteen" } + + LOCAL aArray2 := { ; + "ten", ; + "twenty", ; + "thirty", ; + "forty", ; + "fifty", ; + "sixty", ; + "seventy", ; + "eighty", ; + "ninety" } IF nValue < 20 cRetVal := aArray1[ nValue ] diff --git a/harbour/contrib/hbmisc/numtxthu.prg b/harbour/contrib/hbmisc/numtxthu.prg index 8aac9c5e94..1c950609c2 100644 --- a/harbour/contrib/hbmisc/numtxthu.prg +++ b/harbour/contrib/hbmisc/numtxthu.prg @@ -84,6 +84,7 @@ FUNCTION NumToTxtHU( nValue ) RETURN hb_UTF8ToStr( cRetVal ) STATIC FUNCTION NumToTxtRaw( nValue ) + LOCAL aEgesz := { "", "ezer" , "milliĂł", "milliárd", "billiĂł" , "trilliĂł", "kvadrilliĂł", "kvintilliĂł" } // , "szextilliĂł", "szeptilliĂł", "oktilliĂł", "nontilliĂł" } LOCAL aEgyes := { "", "egy" , "kettĹ‘" , "három" , "nĂ©gy" , "öt" , "hat" , "hĂ©t" , "nyolc" , "kilenc" } LOCAL aTizes1 := { "", "tĂ­z" , "hĂşsz" , "harminc" , "negyven", "ötven" , "hatvan" , "hetven" , "nyolcvan" , "kilencven" } @@ -109,11 +110,12 @@ STATIC FUNCTION NumToTxtRaw( nValue ) aDigit[ tmp + 1 ] != 0 .OR. ; aDigit[ tmp + 2 ] != 0 - cValue += iif( Empty( cValue ), "", "-") +; - iif( aDigit[ tmp ] != 0, aEgyes[ aDigit[ tmp ] + 1 ] + "száz", "" ) +; - iif( aDigit[ tmp + 2 ] == 0, aTizes1[ aDigit[ tmp + 1 ] + 1 ], aTizes2[ aDigit[ tmp + 1 ] + 1 ] ) +; - aEgyes[ aDigit[ tmp + 2 ] + 1 ] +; - aEgesz[ ( Int( ( nLen - tmp ) / 3 ) ) + 1 ] + cValue += ; + iif( Empty( cValue ), "", "-") +; + iif( aDigit[ tmp ] != 0, aEgyes[ aDigit[ tmp ] + 1 ] + "száz", "" ) +; + iif( aDigit[ tmp + 2 ] == 0, aTizes1[ aDigit[ tmp + 1 ] + 1 ], aTizes2[ aDigit[ tmp + 1 ] + 1 ] ) +; + aEgyes[ aDigit[ tmp + 2 ] + 1 ] +; + aEgesz[ ( Int( ( nLen - tmp ) / 3 ) ) + 1 ] ENDIF NEXT diff --git a/harbour/contrib/hbmisc/stringp.prg b/harbour/contrib/hbmisc/stringp.prg index 84478e9c30..9ed7a13b60 100644 --- a/harbour/contrib/hbmisc/stringp.prg +++ b/harbour/contrib/hbmisc/stringp.prg @@ -147,7 +147,7 @@ FUNCTION ToChar( xTxt, cSeparator, lDebug ) nLen := Len( aData ) FOR n := 1 TO nLen // For each item : Recurse ! cOut += aData[ n ][ HB_OO_DATA_SYMBOL ] + ":" + ; - ToChar( aData[ n ] [HB_OO_DATA_VALUE ], cSeparator, lDebug ) + ToChar( aData[ n ][ HB_OO_DATA_VALUE ], cSeparator, lDebug ) IF n != nLen cOut += cSeparator ENDIF diff --git a/harbour/contrib/hbmisc/tests/numtxtru.prg b/harbour/contrib/hbmisc/tests/numtxtru.prg index 48e9d51a77..feacc053ed 100644 --- a/harbour/contrib/hbmisc/tests/numtxtru.prg +++ b/harbour/contrib/hbmisc/tests/numtxtru.prg @@ -28,9 +28,10 @@ PROCEDURE Test( cLang ) LOCAL nTemp FOR nTemp := 1 TO 1000000000 - OutStd( PadR( MnyToTxtRU( nTemp + ( nTemp % 100 ) * 0.01, cLang, , 3 ), 100 ) + " " +; - PadR( NumToTxtRU( nTemp, cLang, , .T. ), 100 ) + " " +; - PadR( DateToTxtRU( Date() + nTemp, cLang, .T. ), 50 ) + hb_eol() ) + OutStd( ; + PadR( MnyToTxtRU( nTemp + ( nTemp % 100 ) * 0.01, cLang, , 3 ), 100 ) + " " + ; + PadR( NumToTxtRU( nTemp, cLang, , .T. ), 100 ) + " " + ; + PadR( DateToTxtRU( Date() + nTemp, cLang, .T. ), 50 ) + hb_eol() ) IF nTemp % 1000 == 0 ? nTemp ENDIF diff --git a/harbour/contrib/hbmisc/tests/pe.prg b/harbour/contrib/hbmisc/tests/pe.prg index abaf73ab83..ba4c9773fb 100644 --- a/harbour/contrib/hbmisc/tests/pe.prg +++ b/harbour/contrib/hbmisc/tests/pe.prg @@ -3,6 +3,7 @@ */ PROCEDURE Main( cFile ) + LOCAL cText LOCAL lEdit := .T. @@ -18,11 +19,13 @@ PROCEDURE Main( cFile ) RETURN STATIC FUNCTION MyMemoEdit( cText, nTop, nLeft, nBottom, nRight, lEdit ) + LOCAL oED /* NOTE: In current design of editor it doesn't reallocate the memory buffer used to hold the text */ + oED := EditorNew( nTop, nLeft, nBottom, nRight, 254, , , , Len( cText ) * 2, 168 ) IF oED != NIL EditorSetText( oED, cText ) diff --git a/harbour/contrib/hbmisc/tests/readfile.prg b/harbour/contrib/hbmisc/tests/readfile.prg index 34fddc8323..adfb66ac76 100644 --- a/harbour/contrib/hbmisc/tests/readfile.prg +++ b/harbour/contrib/hbmisc/tests/readfile.prg @@ -12,6 +12,7 @@ #require "hbmisc" PROCEDURE Main( cFile ) + LOCAL oFile := TFileRead():New( cFile ) oFile:Open() diff --git a/harbour/contrib/hbmisc/tests/rtfclass.prg b/harbour/contrib/hbmisc/tests/rtfclass.prg index 4d0c75f0c8..9552a6f0d1 100644 --- a/harbour/contrib/hbmisc/tests/rtfclass.prg +++ b/harbour/contrib/hbmisc/tests/rtfclass.prg @@ -46,7 +46,7 @@ CREATE CLASS TRtf METHOD new( cfilename ) METHOD write( csource ) - METHOD close() + METHOD CLOSE() END CLASS @@ -68,21 +68,20 @@ METHOD write( csource ) CLASS TRtf // + means a turn-on // - means a turn-off LOCAL attrib := { ; - { "+b" , "\b " } /* turn bold on*/, ; - { "+bu" , "\ul\b " } /* turn bold_underline on */, ; - { "+bi" , "\b\i " } /* turn bold_italic on */, ; - { "+bui", "\ul\b\i " } /* turn bold_underline_italic on */, ; - { "+i" , "\i " } /* turn italic on */, ; - { "+il" , "\ul\i " } /* turn italic_underline on */, ; - { "+u" , "\ul " } /* turn underline on */, ; - { "-b" , "\b0 " } /* turn bold off */, ; - { "-bu" , "\b0\ulnone " } /* turn bold_underline off */, ; - { "-bi" , "\b0\i0 " } /* turn bold_italic off */, ; - { "-bui", "\b0\i0\ulnone " } /* turn bold_underline_italic off */, ; - { "-i" , "\i0 " } /* turn italic off */, ; - { "-il" , "\ulnone\i0 " } /* turn italic_underline off */, ; - { "-u" , "\ulnone " } /* turn underline off */; - } + { "+b" , "\b " }, ; /* turn bold on*/ + { "+bu" , "\ul\b " }, ; /* turn bold_underline on */ + { "+bi" , "\b\i " }, ; /* turn bold_italic on */ + { "+bui", "\ul\b\i " }, ; /* turn bold_underline_italic on */ + { "+i" , "\i " }, ; /* turn italic on */ + { "+il" , "\ul\i " }, ; /* turn italic_underline on */ + { "+u" , "\ul " }, ; /* turn underline on */ + { "-b" , "\b0 " }, ; /* turn bold off */ + { "-bu" , "\b0\ulnone " }, ; /* turn bold_underline off */ + { "-bi" , "\b0\i0 " }, ; /* turn bold_italic off */ + { "-bui", "\b0\i0\ulnone " }, ; /* turn bold_underline_italic off */ + { "-i" , "\i0 " }, ; /* turn italic off */ + { "-il" , "\ulnone\i0 " }, ; /* turn italic_underline off */ + { "-u" , "\ulnone " } } /* turn underline off */ hb_fuse( csource ) // open source file WHILE ! hb_FEof() // read the file line by line @@ -130,7 +129,7 @@ METHOD write( csource ) CLASS TRtf RETURN self -METHOD close() CLASS TRtf +METHOD CLOSE() CLASS TRtf FWrite( ::nhandle, "\f1\fs16\par" + hb_eol() + "}" ) FClose( ::nhandle ) diff --git a/harbour/contrib/hbmisc/tests/testbbab.prg b/harbour/contrib/hbmisc/tests/testbbab.prg index b15644675a..5ac635227c 100644 --- a/harbour/contrib/hbmisc/tests/testbbab.prg +++ b/harbour/contrib/hbmisc/tests/testbbab.prg @@ -37,6 +37,7 @@ PROCEDURE Main() /* Harbour implementation */ FUNCTION BubbleBabbleEncode_Prg( cString ) + LOCAL vo := "aeiouy" LOCAL co := "bcdfghklmnprstvzx" @@ -51,17 +52,19 @@ FUNCTION BubbleBabbleEncode_Prg( cString ) DO WHILE .T. IF i > Len( cString ) - cResult += SubStr( vo, nSeed % 6 + 1, 1 ) +; - SubStr( co, 16 + 1, 1 ) +; - SubStr( vo, nSeed / 6 + 1, 1 ) + cResult += ; + SubStr( vo, nSeed % 6 + 1, 1 ) + ; + SubStr( co, 16 + 1, 1 ) + ; + SubStr( vo, nSeed / 6 + 1, 1 ) EXIT ENDIF byte1 := Asc( SubStr( cString, i, 1 ) ) - cResult += SubStr( vo, ( ( hb_bitAnd( hb_bitShift( byte1, -6 ), 3 ) + nSeed ) % 6 ) + 1, 1 ) +; - SubStr( co, hb_bitAnd( hb_bitShift( byte1, -2 ), 15 ) + 1, 1 ) +; - SubStr( vo, ( ( hb_bitAnd( byte1, 3 ) + ( nSeed / 6 ) ) % 6 ) + 1, 1 ) + cResult += ; + SubStr( vo, ( ( hb_bitAnd( hb_bitShift( byte1, -6 ), 3 ) + nSeed ) % 6 ) + 1, 1 ) + ; + SubStr( co, hb_bitAnd( hb_bitShift( byte1, -2 ), 15 ) + 1, 1 ) + ; + SubStr( vo, ( ( hb_bitAnd( byte1, 3 ) + ( nSeed / 6 ) ) % 6 ) + 1, 1 ) IF i + 1 > Len( cString ) EXIT @@ -69,9 +72,10 @@ FUNCTION BubbleBabbleEncode_Prg( cString ) byte2 := Asc( SubStr( cString, i + 1, 1 ) ) - cResult += SubStr( co, hb_bitAnd( hb_bitShift( byte2, -4 ), 15 ) + 1, 1 ) +; - "-" +; - SubStr( co, hb_bitAnd( byte2, 15 ) + 1, 1 ) + cResult += ; + SubStr( co, hb_bitAnd( hb_bitShift( byte2, -4 ), 15 ) + 1, 1 ) + ; + "-" + ; + SubStr( co, hb_bitAnd( byte2, 15 ) + 1, 1 ) nSeed := ( nSeed * 5 + byte1 * 7 + byte2 ) % 36 diff --git a/harbour/contrib/hbmisc/tests/testcall.prg b/harbour/contrib/hbmisc/tests/testcall.prg index b5755d242a..e12184c384 100644 --- a/harbour/contrib/hbmisc/tests/testcall.prg +++ b/harbour/contrib/hbmisc/tests/testcall.prg @@ -13,7 +13,9 @@ #require "hbmisc" PROCEDURE Main() + #if defined( __PLATFORM__WINDOWS ) + LOCAL nFlags nFlags := -1 @@ -21,4 +23,5 @@ PROCEDURE Main() ? nFlags #endif + RETURN diff --git a/harbour/contrib/hbmisc/tests/udpdstst.prg b/harbour/contrib/hbmisc/tests/udpdstst.prg index d7b2311db7..b4ef8bd2c3 100644 --- a/harbour/contrib/hbmisc/tests/udpdstst.prg +++ b/harbour/contrib/hbmisc/tests/udpdstst.prg @@ -8,11 +8,11 @@ #require "hbmisc" -PROCEDURE main( cParam ) +PROCEDURE Main( cParam ) LOCAL h - IF ! hb_MTVM() + IF ! hb_mtvm() ? "This sample should be compiled using MultiThread" RETURN ENDIF @@ -32,7 +32,7 @@ PROCEDURE main( cParam ) ENDIF IF "C" $ Upper( cParam ) - ? HB_VALTOEXP( hb_UDPDS_Find( 39999, "UDPDSDemo" ) ) + ? hb_ValToExp( hb_UDPDS_Find( 39999, "UDPDSDemo" ) ) ENDIF IF "S" $ Upper( cParam ) diff --git a/harbour/contrib/hbmisc/udpds.prg b/harbour/contrib/hbmisc/udpds.prg index 65d957d484..09de2facef 100644 --- a/harbour/contrib/hbmisc/udpds.prg +++ b/harbour/contrib/hbmisc/udpds.prg @@ -33,7 +33,7 @@ FUNCTION hb_UDPDS_Find( nPort, cName ) hb_socketSetBroadcast( hSocket, .T. ) cName := hb_StrToUTF8( cName ) IF hb_socketSendTo( hSocket, hb_BChar( 5 ) + cName + hb_BChar( 0 ), , , { HB_SOCKET_AF_INET, "255.255.255.255", nPort } ) == hb_BLen( cName ) + 2 - nTime := hb_milliseconds() + nTime := hb_MilliSeconds() nEnd := nTime + 100 /* 100ms delay is enough on LAN */ aRet := {} DO WHILE nEnd > nTime @@ -42,7 +42,7 @@ FUNCTION hb_UDPDS_Find( nPort, cName ) IF hb_BLeft( cBuffer, hb_BLen( cName ) + 2 ) == hb_BChar( 6 ) + cName + hb_BChar( 0 ) AAdd( aRet, { aAddr[ 2 ], hb_BSubStr( cBuffer, hb_BLen( cName ) + 3, nLen - hb_BLen( cName ) - 2 ) } ) ENDIF - nTime := hb_milliseconds() + nTime := hb_MilliSeconds() ENDDO ENDIF hb_socketClose( hSocket ) diff --git a/harbour/contrib/hbmlzo/tests/test.prg b/harbour/contrib/hbmlzo/tests/test.prg index d59659da75..acf7631bc2 100644 --- a/harbour/contrib/hbmlzo/tests/test.prg +++ b/harbour/contrib/hbmlzo/tests/test.prg @@ -15,6 +15,7 @@ #define FMT2_STRING "Decompressed %d bytes back into %d bytes (%d)" PROCEDURE Main() + LOCAL cStr, cCompressed, cDeCompressed LOCAL checksum LOCAL nLen, nLenC, nLenD, nResult @@ -25,7 +26,7 @@ PROCEDURE Main() ?? "miniLZO -- mini subset of the LZO real-time data compression library" ? "Ver. " + ; lzo_version_string() + ; - " (0x" + hb_numtohex( lzo_version() ) +"), " + ; + " (0x" + hb_NumToHex( lzo_version() ) + "), " + ; lzo_version_date() ? @@ -46,7 +47,7 @@ PROCEDURE Main() ? cStr := Replicate( TEST_STRING, 500 ) nLen := Len( cStr ) - checksum := hb_adler32( cStr ) + checksum := hb_Adler32( cStr ) cCompressed := hb_lzo1x_1_compress( @cStr, @nLenC, @nResult ) ShowResult( @cStr, @cCompressed, @nLenC, @nResult ) @@ -60,10 +61,10 @@ PROCEDURE Main() nLenD := nLenC cDeCompressed := hb_lzo1x_decompress_safe( @cCompressed, @nLenD, @nResult ) - IF nResult != LZO_E_OK .OR. nLenD != nLen .OR. checksum != hb_adler32( cDeCompressed ) + IF nResult != LZO_E_OK .OR. nLenD != nLen .OR. checksum != hb_Adler32( cDeCompressed ) ? "Internal error - decompression failed: ", hb_ntos( nResult ) ELSE - ? hb_strFormat( FMT2_STRING, nLenC, nLenD, nLen ) + ? hb_StrFormat( FMT2_STRING, nLenC, nLenD, nLen ) ENDIF /* @@ -79,10 +80,10 @@ PROCEDURE Main() nLenD := nLen cDeCompressed := hb_lzo1x_decompress( @cCompressed, @nLenD, @nResult ) - IF nResult != LZO_E_OK .OR. nLenD != nLen .OR. checksum != hb_adler32( cDeCompressed ) + IF nResult != LZO_E_OK .OR. nLenD != nLen .OR. checksum != hb_Adler32( cDeCompressed ) ? "Internal error - decompression failed: ", hb_ntos( nResult ) ELSE - ? hb_strFormat( FMT2_STRING, nLenC, nLenD, nLen ) + ? hb_StrFormat( FMT2_STRING, nLenC, nLenD, nLen ) ENDIF ? @@ -105,12 +106,13 @@ PROCEDURE Main() ? "LZF ", hb_ntos( Len( hb_lzf_compress( cStr, NIL, @nResult ) ) ) ? "LZO ", hb_ntos( Len( hb_lzo1x_1_compress( cStr, NIL, @nResult ) ) ) */ + RETURN STATIC PROCEDURE ShowResult( cStr, cCompressed, nLen, nResult ) IF nResult == LZO_E_OK - ? hb_strFormat( FMT_STRING, Len( cStr ), nLen, Len( cCompressed ) ) + ? hb_StrFormat( FMT_STRING, Len( cStr ), nLen, Len( cCompressed ) ) ELSEIF nResult == LZO_E_OUT_OF_MEMORY ? "Out of memory.." ELSEIF nResult == LZO_E_NOT_COMPRESSIBLE diff --git a/harbour/contrib/hbmxml/format.prg b/harbour/contrib/hbmxml/format.prg index 046541bb9b..22fe2fa1c3 100644 --- a/harbour/contrib/hbmxml/format.prg +++ b/harbour/contrib/hbmxml/format.prg @@ -59,7 +59,7 @@ * ... ) */ FUNCTION mxmlElementSetAttrf( hNode, cName, cFormat, ... ) - RETURN mxmlElementSetAttr( hNode, cName, hb_strFormat( cFormat, ... ) ) + RETURN mxmlElementSetAttr( hNode, cName, hb_StrFormat( cFormat, ... ) ) /* * void mxmlNewTextf( mxml_node_t * node, @@ -68,7 +68,7 @@ FUNCTION mxmlElementSetAttrf( hNode, cName, cFormat, ... ) * ... ) */ FUNCTION mxmlNewTextf( hNode, nWhitespace, cFormat, ... ) - RETURN mxmlNewText( hNode, nWhitespace, hb_strFormat( cFormat, ... ) ) + RETURN mxmlNewText( hNode, nWhitespace, hb_StrFormat( cFormat, ... ) ) /* * int mxmlSetTextf( mxml_node_t * node, @@ -77,4 +77,4 @@ FUNCTION mxmlNewTextf( hNode, nWhitespace, cFormat, ... ) * ... ) */ FUNCTION mxmlSetTextf( hNode, nWhitespace, cFormat, ... ) - RETURN mxmlSetText( hNode, nWhitespace, hb_strFormat( cFormat, ... ) ) + RETURN mxmlSetText( hNode, nWhitespace, hb_StrFormat( cFormat, ... ) ) diff --git a/harbour/contrib/hbmxml/tests/custom.prg b/harbour/contrib/hbmxml/tests/custom.prg index 8106368321..8177a4f162 100644 --- a/harbour/contrib/hbmxml/tests/custom.prg +++ b/harbour/contrib/hbmxml/tests/custom.prg @@ -8,7 +8,7 @@ #include "hbmxml.ch" -PROCEDURE main() +PROCEDURE Main() LOCAL tree, node LOCAL xData @@ -31,7 +31,7 @@ PROCEDURE main() RETURN ENDIF - IF !( hb_md5( _ENCODE( node ) ) == mxmlElementGetAttr( node, "checksum" ) ) + IF !( hb_MD5( _ENCODE( node ) ) == mxmlElementGetAttr( node, "checksum" ) ) OutErr( "Custom data of element <hash> is corrupted!" ) mxmlDelete( tree ) @@ -40,7 +40,7 @@ PROCEDURE main() ENDIF xData := mxmlGetCustom( node ) - IF HB_ISHASH( xData ) .AND. hb_hHasKey( xData, "Today" ) + IF HB_ISHASH( xData ) .AND. hb_HHasKey( xData, "Today" ) OutStd( xData[ "Today" ], hb_eol() ) ENDIF @@ -48,14 +48,15 @@ PROCEDURE main() mxmlSetCustomHandlers( NIL, NIL ) ErrorLevel( 0 ) + RETURN STATIC PROCEDURE create_cust() LOCAL tree, group, element, node - LOCAL hData := {=>} + LOCAL hData := { => } - hData[ "Today" ] := hb_tsToStr( hb_dateTime() ) + hData[ "Today" ] := hb_TSToStr( hb_DateTime() ) /* etc. */ tree := mxmlNewXML() @@ -64,7 +65,7 @@ STATIC PROCEDURE create_cust() node := mxmlNewCustom( element, hData ) mxmlElementSetAttr( element, "type", "custom" ) - mxmlElementSetAttr( element, "checksum", hb_md5( _ENCODE( node ) ) ) + mxmlElementSetAttr( element, "checksum", hb_MD5( _ENCODE( node ) ) ) mxmlSaveFile( tree, "cust.xml", @whitespace_cb() ) @@ -78,7 +79,7 @@ PROCEDURE my_mxmlError( cErrorMsg ) FUNCTION load_c( node, cString ) - mxmlSetCustom( node, hb_deserialize( hb_base64decode( cString ) ) ) + mxmlSetCustom( node, hb_Deserialize( hb_base64Decode( cString ) ) ) RETURN 0 /* 0 on success or non-zero on error */ @@ -102,8 +103,8 @@ FUNCTION whitespace_cb( node, where ) ENDIF ELSEIF where == MXML_WS_BEFORE_OPEN .OR. ; - ( ( name == "choice" .OR. name == "option" ) .AND. ; - where == MXML_WS_BEFORE_CLOSE ) + ( ( name == "choice" .OR. name == "option" ) .AND. ; + where == MXML_WS_BEFORE_CLOSE ) parent := mxmlGetParent( node ) DO WHILE ! Empty( parent ) @@ -120,8 +121,8 @@ FUNCTION whitespace_cb( node, where ) RETURN Replicate( Chr( 9 ), nLevel ) ELSEIF where == MXML_WS_AFTER_CLOSE .OR. ; - ( ( name == "group".OR. name == "option" .OR. name == "choice" ) .AND. ; - where == MXML_WS_AFTER_OPEN ) + ( ( name == "group" .OR. name == "option" .OR. name == "choice" ) .AND. ; + where == MXML_WS_AFTER_OPEN ) RETURN hb_eol() ELSEIF where == MXML_WS_AFTER_OPEN .AND. Empty( mxmlGetFirstChild( node ) ) diff --git a/harbour/contrib/hbmxml/tests/reminder.prg b/harbour/contrib/hbmxml/tests/reminder.prg index bd1b419daf..f1d6f778b7 100644 --- a/harbour/contrib/hbmxml/tests/reminder.prg +++ b/harbour/contrib/hbmxml/tests/reminder.prg @@ -9,13 +9,13 @@ STATIC s_mxml_error := .F. STATIC s_mxml_error_msg := "" -PROCEDURE main() +PROCEDURE Main() LOCAL xml mxmlSetErrorCallback( @my_mxmlError() ) - IF hb_fileExists( "rem.xml" ) + IF hb_FileExists( "rem.xml" ) xml := simplexml_load_file( "rem.xml" ) ELSE RETURN @@ -27,7 +27,7 @@ PROCEDURE main() mxmlDelete( xml ) - IF hb_fileExists( "rem_err.xml" ) + IF hb_FileExists( "rem_err.xml" ) xml := simplexml_load_file( "rem_err.xml" ) IF s_mxml_error @@ -48,7 +48,7 @@ PROCEDURE my_mxmlError( cErrorMsg ) STATIC FUNCTION simplexml_load_file( file ) - RETURN mxmlLoadString( NIL, hb_memoRead( file ), @type_cb() ) + RETURN mxmlLoadString( NIL, hb_MemoRead( file ), @type_cb() ) STATIC FUNCTION asXML( xml ) diff --git a/harbour/contrib/hbmxml/tests/testmxml.prg b/harbour/contrib/hbmxml/tests/testmxml.prg index 34f94b18cb..7c8d8fe6fc 100644 --- a/harbour/contrib/hbmxml/tests/testmxml.prg +++ b/harbour/contrib/hbmxml/tests/testmxml.prg @@ -27,12 +27,11 @@ REQUEST HB_GT_CGI_DEFAULT STATIC s_aTypes := { ; - "MXML_ELEMENT", ; - "MXML_INTEGER", ; - "MXML_OPAQUE", ; - "MXML_REAL", ; - "MXML_TEXT" ; -} + "MXML_ELEMENT", ; + "MXML_INTEGER", ; + "MXML_OPAQUE", ; + "MXML_REAL", ; + "MXML_TEXT" } STATIC s_aSAXEventCounts := { 0, 0, 0, 0, 0, 0 } @@ -71,11 +70,11 @@ PROCEDURE Main( cFileArg ) nNum := mxmlGetType( hTree ) IF nNum != MXML_ELEMENT IF nNum < MXML_ELEMENT .OR. nNum > MXML_TEXT - OutErr( hb_strFormat( "ERROR: Parent has type %s (%d), expected MXML_ELEMENT!", ; - "UNKNOWN", nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Parent has type %s (%d), expected MXML_ELEMENT!", ; + "UNKNOWN", nNum ) + hb_eol() ) ELSE - OutErr( hb_strFormat( "ERROR: Parent has type %s (%d), expected MXML_ELEMENT!", ; - s_aTypes[ nNum + 1 ], nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Parent has type %s (%d), expected MXML_ELEMENT!", ; + s_aTypes[ nNum + 1 ], nNum ) + hb_eol() ) ENDIF mxmlDelete( hTree ) @@ -85,7 +84,7 @@ PROCEDURE Main( cFileArg ) cStr := mxmlGetElement( hTree ) IF !( cStr == "element" ) - OutErr( hb_strFormat( "ERROR: Parent value is '%s', expected 'element'", cStr ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Parent value is '%s', expected 'element'", cStr ) + hb_eol() ) mxmlDelete( hTree ) ErrorLevel( 1 ) @@ -114,11 +113,11 @@ PROCEDURE Main( cFileArg ) nNum := mxmlGetType( hNode ) IF nNum != MXML_INTEGER IF nNum < MXML_ELEMENT .OR. nNum > MXML_TEXT - OutErr( hb_strFormat( "ERROR: First child has type %s (%d), expected MXML_TEXT!", ; - "UNKNOWN", nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: First child has type %s (%d), expected MXML_TEXT!", ; + "UNKNOWN", nNum ) + hb_eol() ) ELSE - OutErr( hb_strFormat( "ERROR: First child has type %s (%d), expected MXML_TEXT!", ; - s_aTypes[ nNum + 1 ], nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: First child has type %s (%d), expected MXML_TEXT!", ; + s_aTypes[ nNum + 1 ], nNum ) + hb_eol() ) ENDIF mxmlDelete( hTree ) @@ -128,7 +127,7 @@ PROCEDURE Main( cFileArg ) nNum := mxmlGetInteger( hNode ) IF nNum != 123 - OutErr( hb_strFormat( "ERROR: First child value is %d, expected 123!", nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: First child value is %d, expected 123!", nNum ) + hb_eol() ) mxmlDelete( hTree ) ErrorLevel( 1 ) @@ -147,11 +146,11 @@ PROCEDURE Main( cFileArg ) nNum := mxmlGetType( hNode ) IF nNum != MXML_OPAQUE IF nNum < MXML_ELEMENT .OR. nNum > MXML_TEXT - OutErr( hb_strFormat( "ERROR: Second child has type %s (%d), expected MXML_OPAQUE!", ; - "UNKNOWN", nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Second child has type %s (%d), expected MXML_OPAQUE!", ; + "UNKNOWN", nNum ) + hb_eol() ) ELSE - OutErr( hb_strFormat( "ERROR: Second child has type %s (%d), expected MXML_OPAQUE!", ; - s_aTypes[ nNum + 1 ], nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Second child has type %s (%d), expected MXML_OPAQUE!", ; + s_aTypes[ nNum + 1 ], nNum ) + hb_eol() ) ENDIF mxmlDelete( hTree ) @@ -171,11 +170,11 @@ PROCEDURE Main( cFileArg ) nNum := mxmlGetType( hNode ) IF nNum != MXML_REAL IF nNum < MXML_ELEMENT .OR. nNum > MXML_TEXT - OutErr( hb_strFormat( "ERROR: Third child has type %s (%d), expected MXML_REAL!", ; - "UNKNOWN", nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Third child has type %s (%d), expected MXML_REAL!", ; + "UNKNOWN", nNum ) + hb_eol() ) ELSE - OutErr( hb_strFormat( "ERROR: Third child has type %s (%d), expected MXML_REAL!", ; - s_aTypes[ nNum + 1 ], nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Third child has type %s (%d), expected MXML_REAL!", ; + s_aTypes[ nNum + 1 ], nNum ) + hb_eol() ) ENDIF mxmlDelete( hTree ) @@ -185,7 +184,7 @@ PROCEDURE Main( cFileArg ) nNum := mxmlGetReal( hNode ) IF nNum != 123.4 - OutErr( hb_strFormat( "ERROR: Third child value is %f, expected 123.4!", nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Third child value is %f, expected 123.4!", nNum ) + hb_eol() ) mxmlDelete( hTree ) ErrorLevel( 1 ) @@ -204,11 +203,11 @@ PROCEDURE Main( cFileArg ) nNum := mxmlGetType( hNode ) IF nNum != MXML_TEXT IF nNum < MXML_ELEMENT .OR. nNum > MXML_TEXT - OutErr( hb_strFormat( "ERROR: Fourth child has type %s (%d), expected MXML_TEXT!", ; - "UNKNOWN", nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Fourth child has type %s (%d), expected MXML_TEXT!", ; + "UNKNOWN", nNum ) + hb_eol() ) ELSE - OutErr( hb_strFormat( "ERROR: Fourth child has type %s (%d), expected MXML_TEXT!", ; - s_aTypes[ nNum + 1 ], nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Fourth child has type %s (%d), expected MXML_TEXT!", ; + s_aTypes[ nNum + 1 ], nNum ) + hb_eol() ) ENDIF mxmlDelete( hTree ) @@ -218,8 +217,8 @@ PROCEDURE Main( cFileArg ) cStr := mxmlGetText( hNode, @nNum ) IF nNum != 1 .OR. Empty( cStr ) .OR. !( cStr == "text" ) - OutErr( hb_strFormat( "ERROR: Fourth child value is %d, '%s', expected 1, 'text'!", ; - nNum, cStr ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Fourth child value is %d, '%s', expected 1, 'text'!", ; + nNum, cStr ) + hb_eol() ) mxmlDelete( hTree ) ErrorLevel( 1 ) @@ -228,7 +227,7 @@ PROCEDURE Main( cFileArg ) FOR i := 0 TO 3 IF Empty( hNode := mxmlGetNextSibling( hNode ) ) - OutErr( hb_strFormat( "ERROR: No group #%d child node in basic test!", i ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: No group #%d child node in basic test!", i ) + hb_eol() ) mxmlDelete( hTree ) ErrorLevel( 1 ) @@ -237,11 +236,11 @@ PROCEDURE Main( cFileArg ) IF ( ( nNum := mxmlGetType( hNode ) ) != MXML_ELEMENT ) IF nNum < MXML_ELEMENT .OR. nNum > MXML_TEXT - OutErr( hb_strFormat( "ERROR: Group child #%d has type %s (%d), expected MXML_ELEMENT!", ; - i + 1, "UNKNOWN", nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Group child #%d has type %s (%d), expected MXML_ELEMENT!", ; + i + 1, "UNKNOWN", nNum ) + hb_eol() ) ELSE - OutErr( hb_strFormat( "ERROR: Group child #%d has type %s (%d), expected MXML_ELEMENT!", ; - s_aTypes[ nNum + 1 ], nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Group child #%d has type %s (%d), expected MXML_ELEMENT!", ; + s_aTypes[ nNum + 1 ], nNum ) + hb_eol() ) ENDIF mxmlDelete( hTree ) @@ -313,7 +312,7 @@ PROCEDURE Main( cFileArg ) ENDIF IF ( nNum := mxmlIndexGetCount( hInd ) ) != 10 - OutErr( hb_strFormat( "ERROR: Index of all nodes contains %d nodes; expected 10!", nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Index of all nodes contains %d nodes; expected 10!", nNum ) + hb_eol() ) mxmlIndexDelete( hInd ) mxmlDelete( hTree ) @@ -343,7 +342,7 @@ PROCEDURE Main( cFileArg ) ENDIF IF ( nNum := mxmlIndexGetCount( hInd ) ) != 4 - OutErr( hb_strFormat( "ERROR: Index of groups contains %d nodes; expected 4!", nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Index of groups contains %d nodes; expected 4!", nNum ) + hb_eol() ) mxmlIndexDelete( hInd ) mxmlDelete( hTree ) @@ -374,7 +373,7 @@ PROCEDURE Main( cFileArg ) ENDIF IF ( nNum := mxmlIndexGetCount( hInd ) ) != 3 - OutErr( hb_strFormat( "ERROR: Index of type attributes contains %d nodes; expected 3!", nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Index of type attributes contains %d nodes; expected 3!", nNum ) + hb_eol() ) mxmlIndexDelete( hInd ) mxmlDelete( hTree ) @@ -404,7 +403,7 @@ PROCEDURE Main( cFileArg ) ENDIF IF ( nNum := mxmlIndexGetCount( hInd ) ) != 3 - OutErr( hb_strFormat( "ERROR: Index of type attributes contains %d nodes; expected 3!", nNum ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Index of type attributes contains %d nodes; expected 3!", nNum ) + hb_eol() ) mxmlIndexDelete( hInd ) mxmlDelete( hTree ) @@ -432,7 +431,7 @@ PROCEDURE Main( cFileArg ) IF ! Empty( mxmlGetFirstChild( hTree ) ) mxmlDelete( mxmlGetFirstChild( hTree ) ) ELSE - OutErr( hb_strFormat( "ERROR: Child pointer prematurely NULL on child #%d", i ) + hb_eol() ) + OutErr( hb_StrFormat( "ERROR: Child pointer prematurely NULL on child #%d", i ) + hb_eol() ) mxmlDelete( hTree ) ErrorLevel( 1 ) @@ -540,43 +539,43 @@ PROCEDURE Main( cFileArg ) IF cFileArg == "test.xml" IF s_aSAXEventCounts[ MXML_SAX_CDATA ] != 1 - OutErr( hb_strFormat( "MXML_SAX_CDATA seen %d times, expected 1 times!", ; - s_aSAXEventCounts[ MXML_SAX_CDATA ] ) + hb_eol() ) + OutErr( hb_StrFormat( "MXML_SAX_CDATA seen %d times, expected 1 times!", ; + s_aSAXEventCounts[ MXML_SAX_CDATA ] ) + hb_eol() ) ErrorLevel( 1 ) QUIT ENDIF IF s_aSAXEventCounts[ MXML_SAX_COMMENT ] != 1 - OutErr( hb_strFormat( "MXML_SAX_COMMENT seen %d times, expected 1 times!", ; - s_aSAXEventCounts[ MXML_SAX_COMMENT ] ) + hb_eol() ) + OutErr( hb_StrFormat( "MXML_SAX_COMMENT seen %d times, expected 1 times!", ; + s_aSAXEventCounts[ MXML_SAX_COMMENT ] ) + hb_eol() ) ErrorLevel( 1 ) QUIT ENDIF IF s_aSAXEventCounts[ MXML_SAX_DATA ] != 60 - OutErr( hb_strFormat( "MXML_SAX_DATA seen %d times, expected 60 times!", ; - s_aSAXEventCounts[ MXML_SAX_DATA ] ) + hb_eol() ) + OutErr( hb_StrFormat( "MXML_SAX_DATA seen %d times, expected 60 times!", ; + s_aSAXEventCounts[ MXML_SAX_DATA ] ) + hb_eol() ) ErrorLevel( 1 ) QUIT ENDIF IF s_aSAXEventCounts[ MXML_SAX_DIRECTIVE ] != 1 - OutErr( hb_strFormat( "MXML_SAX_DIRECTIVE seen %d times, expected 1 times!", ; - s_aSAXEventCounts[ MXML_SAX_DIRECTIVE ] ) + hb_eol() ) + OutErr( hb_StrFormat( "MXML_SAX_DIRECTIVE seen %d times, expected 1 times!", ; + s_aSAXEventCounts[ MXML_SAX_DIRECTIVE ] ) + hb_eol() ) ErrorLevel( 1 ) QUIT ENDIF IF s_aSAXEventCounts[ MXML_SAX_ELEMENT_CLOSE ] != 20 - OutErr( hb_strFormat( "MXML_SAX_ELEMENT_CLOSE seen %d times, expected 20 times!", ; - s_aSAXEventCounts[ MXML_SAX_ELEMENT_CLOSE ] ) + hb_eol() ) + OutErr( hb_StrFormat( "MXML_SAX_ELEMENT_CLOSE seen %d times, expected 20 times!", ; + s_aSAXEventCounts[ MXML_SAX_ELEMENT_CLOSE ] ) + hb_eol() ) ErrorLevel( 1 ) QUIT ENDIF IF s_aSAXEventCounts[ MXML_SAX_ELEMENT_OPEN ] != 20 - OutErr( hb_strFormat( "MXML_SAX_ELEMENT_OPEN seen %d times, expected 20 times!", ; - s_aSAXEventCounts[ MXML_SAX_ELEMENT_OPEN ] ) + hb_eol() ) + OutErr( hb_StrFormat( "MXML_SAX_ELEMENT_OPEN seen %d times, expected 20 times!", ; + s_aSAXEventCounts[ MXML_SAX_ELEMENT_OPEN ] ) + hb_eol() ) ErrorLevel( 1 ) QUIT ENDIF @@ -591,9 +590,12 @@ PROCEDURE Main( cFileArg ) * 'sax_cb()' - Process nodes via SAX. */ -PROCEDURE sax_cb( hNode, hEvent, hData ) /* I - Current node */ - /* I - SAX event */ - /* I - SAX user data */ +/* I - Current node */ +/* I - SAX event */ +/* I - SAX user data */ + +PROCEDURE sax_cb( hNode, hEvent, hData ) + /* * This SAX callback just counts the different events. */ @@ -609,8 +611,11 @@ PROCEDURE sax_cb( hNode, hEvent, hData ) /* I - Current node */ * 'type_cb()' - XML data type callback for mxmlLoadFile()... */ -FUNCTION type_cb( hNode ) /* O - Data type */ - /* I - Element node */ +/* O - Data type */ +/* I - Element node */ + +FUNCTION type_cb( hNode ) + LOCAL cType /* Type string */ /* @@ -634,9 +639,11 @@ FUNCTION type_cb( hNode ) /* O - Data type */ * newlines and tabs... */ -FUNCTION whitespace_cb( hNode, nWhere ) /* O - Whitespace string or NIL */ - /* I - Element node */ - /* I - Open or close tag? */ +/* O - Whitespace string or NIL */ +/* I - Element node */ +/* I - Open or close tag? */ + +FUNCTION whitespace_cb( hNode, nWhere ) LOCAL hParent /* Parent node */ LOCAL nLevel /* Indentation level */ @@ -649,18 +656,18 @@ FUNCTION whitespace_cb( hNode, nWhere ) /* O - Whitespace string or NIL */ cName := Lower( mxmlGetElement( hNode ) ) - IF cName == "html" .OR. cName == "head" .OR. cName == "body" .OR. ; - cName == "pre" .OR. cName == "p" .OR. ; - cName == "h1" .OR. cName == "h2" .OR. cName == "h3" .OR. ; + IF cName == "html" .OR. cName == "head" .OR. cName == "body" .OR. ; + cName == "pre" .OR. cName == "p" .OR. ; + cName == "h1" .OR. cName == "h2" .OR. cName == "h3" .OR. ; cName == "h4" .OR. cName == "h5" .OR. cName == "h6" /* * Newlines before open and after close... */ - IF nWhere == MXML_WS_BEFORE_OPEN .OR. nWhere == MXML_WS_AFTER_CLOSE - RETURN hb_eol() - ENDIF + IF nWhere == MXML_WS_BEFORE_OPEN .OR. nWhere == MXML_WS_AFTER_CLOSE + RETURN hb_eol() + ENDIF ELSEIF cName == "dl" .OR. cName == "ol" .OR. cName == "ul" /* @@ -685,8 +692,8 @@ FUNCTION whitespace_cb( hNode, nWhere ) /* O - Whitespace string or NIL */ ELSE RETURN NIL ENDIF - ELSEIF nWhere == MXML_WS_BEFORE_OPEN .OR. ; - ( ( cName == "choice" .OR. cName == "option" ) .AND. nWhere == MXML_WS_BEFORE_CLOSE ) + ELSEIF nWhere == MXML_WS_BEFORE_OPEN .OR. ; + ( ( cName == "choice" .OR. cName == "option" ) .AND. nWhere == MXML_WS_BEFORE_CLOSE ) nLevel := -1 hParent := mxmlGetParent( hNode ) DO WHILE ! Empty( hParent ) @@ -701,9 +708,9 @@ FUNCTION whitespace_cb( hNode, nWhere ) /* O - Whitespace string or NIL */ ENDIF RETURN Replicate( Chr( 9 ), nLevel ) - ELSEIF nWhere == MXML_WS_AFTER_CLOSE .OR. ; - ( ( cName == "group" .OR. cName == "option" .OR. cName == "choice" ) .AND. ; - nWhere == MXML_WS_AFTER_OPEN ) + ELSEIF nWhere == MXML_WS_AFTER_CLOSE .OR. ; + ( ( cName == "group" .OR. cName == "option" .OR. cName == "choice" ) .AND. ; + nWhere == MXML_WS_AFTER_OPEN ) RETURN hb_eol() ELSEIF nWhere == MXML_WS_AFTER_OPEN .AND. Empty( mxmlGetFirstChild( hNode ) ) diff --git a/harbour/contrib/hbmysql/tests/dbf2mysq.prg b/harbour/contrib/hbmysql/tests/dbf2mysq.prg index 704f2d3fff..857d2595dc 100644 --- a/harbour/contrib/hbmysql/tests/dbf2mysq.prg +++ b/harbour/contrib/hbmysql/tests/dbf2mysq.prg @@ -102,13 +102,13 @@ PROCEDURE Main( ... ) CASE cTok == "-c" lCreateTable := .T. - OTHERWISE + OTHERWISE help() QUIT ENDCASE ENDDO - dbUseArea( .T., , cFile, "dbffile", , .T. ) + dbUseArea( .T.,, cFile, "dbffile",, .T. ) aDbfStruct := dbffile->( dbStruct() ) oServer := TMySQLServer():New( cHostName, cUser, cPassWord ) @@ -124,7 +124,7 @@ PROCEDURE Main( ... ) ENDIF IF lCreateTable - IF hb_AScan( oServer:ListTables(), cTable, , , .T. ) > 0 + IF hb_AScan( oServer:ListTables(), cTable,,, .T. ) > 0 oServer:DeleteTable( cTable ) IF oServer:NetErr() ? oServer:Error() @@ -150,7 +150,7 @@ PROCEDURE Main( ... ) oRecord := oTable:GetBlankRow() FOR i := 1 TO dbffile->( FCount() ) - oRecord:FieldPut( i, dbffile->( FieldGet(i ) ) ) + oRecord:FieldPut( i, dbffile->( FieldGet( i ) ) ) NEXT oTable:Append( oRecord ) @@ -162,7 +162,7 @@ PROCEDURE Main( ... ) DevPos( Row(), 1 ) IF ( dbffile->( RecNo() ) % 100 ) == 0 - DevOut( "imported recs: " + hb_ntos( dbffile->(RecNo() ) ) ) + DevOut( "imported recs: " + hb_ntos( dbffile->( RecNo() ) ) ) ENDIF ENDDO diff --git a/harbour/contrib/hbmysql/tests/test.prg b/harbour/contrib/hbmysql/tests/test.prg index e0446074c7..fa59a70f2e 100644 --- a/harbour/contrib/hbmysql/tests/test.prg +++ b/harbour/contrib/hbmysql/tests/test.prg @@ -88,7 +88,7 @@ PROCEDURE Main( cArg ) oServer:Destroy() - DO WHILE !wn->(Eof()) + DO WHILE !wn->( Eof() ) oQuery2 := oServer:Query( "SELECT * from test where CODF='" + wn->CODF + "' and CODP='" + wn->CODP + "'" ) diff --git a/harbour/contrib/hbmysql/tmysql.prg b/harbour/contrib/hbmysql/tmysql.prg index edffd7bf94..d961d0a2ca 100644 --- a/harbour/contrib/hbmysql/tmysql.prg +++ b/harbour/contrib/hbmysql/tmysql.prg @@ -97,7 +97,7 @@ METHOD New( aRow, aFStruct, cTableName ) CLASS TMySQLRow ENDIF ::aRow := aRow - //DAVID: + // DAVID: ::aOriValue := AClone( aRow ) // Original values ( same as TMySQLtable:aOldValue ) ::aFieldStruct := aFStruct @@ -134,7 +134,7 @@ METHOD FieldPut( cnField, Value ) CLASS TMySQLRow IF nNum > 0 .AND. nNum <= Len( ::aRow ) - IF Valtype( Value ) == Valtype( ::aRow[ nNum ] ) .OR. ::aRow[ nNum ] == NIL + IF ValType( Value ) == ValType( ::aRow[ nNum ] ) .OR. ::aRow[ nNum ] == NIL // if it is a char field remove trailing spaces IF HB_ISSTRING( Value ) @@ -186,8 +186,8 @@ METHOD FieldDec( nNum, lFormat ) CLASS TMySQLRow IF nNum >= 1 .AND. nNum <= Len( ::aFieldStruct ) - IF !lFormat .AND. ( ::aFieldStruct[ nNum ][ MYSQL_FS_TYPE ] == MYSQL_TYPE_FLOAT .OR. ; - ::aFieldStruct[ nNum ][ MYSQL_FS_TYPE ] == MYSQL_TYPE_DOUBLE ) + IF !lFormat .AND. ( ::aFieldStruct[ nNum ][ MYSQL_FS_TYPE ] == MYSQL_TYPE_FLOAT .OR. ; + ::aFieldStruct[ nNum ][ MYSQL_FS_TYPE ] == MYSQL_TYPE_DOUBLE ) RETURN Set( _SET_DECIMALS ) ELSE RETURN ::aFieldStruct[ nNum ][ MYSQL_FS_DECIMALS ] @@ -335,12 +335,12 @@ METHOD New( nSocket, cQuery ) CLASS TMySQLQuery ::nResultHandle := NIL ::nNumFields := 0 ::nNumRows := 0 - //DAVID: + // DAVID: ::lBof := .T. ::lEof := .T. - ::lFieldAsData := .T. //Use fields as object DATA. For compatibility - ::aRow := {} //Values of fields of current row + ::lFieldAsData := .T. // Use fields as object DATA. For compatibility + ::aRow := {} // Values of fields of current row IF mysql_query( nSocket, cQuery ) == 0 @@ -349,16 +349,16 @@ METHOD New( nSocket, cQuery ) CLASS TMySQLQuery ::nNumRows := mysql_num_rows( ::nResultHandle ) ::nNumFields := mysql_num_fields( ::nResultHandle ) - //DAVID: + // DAVID: ::aRow := Array( ::nNumFields ) FOR nI := 1 TO ::nNumFields aField := mysql_fetch_field( ::nResultHandle ) AAdd( ::aFieldStruct, aField ) - //DAVID: + // DAVID: IF ::lFieldAsData - __ObjAddData( Self, ::aFieldStruct[ nI ][ MYSQL_FS_NAME ] ) + __objAddData( Self, ::aFieldStruct[ nI ][ MYSQL_FS_NAME ] ) ENDIF NEXT @@ -411,7 +411,7 @@ METHOD Refresh() CLASS TMySQLQuery METHOD Skip( nRows ) CLASS TMySQLQuery - //DAVID: + // DAVID: LOCAL lbof // NOTE: MySQL row count starts from 0 @@ -419,7 +419,7 @@ METHOD Skip( nRows ) CLASS TMySQLQuery nRows := 1 ENDIF - //DAVID: + // DAVID: ::lBof := Empty( ::LastRec() ) IF nRows == 0 @@ -427,58 +427,59 @@ METHOD Skip( nRows ) CLASS TMySQLQuery ELSEIF nRows < 0 // Negative movement - //DAVID: ::nCurRow := Max( ::nCurRow + nRows, 1 ) - IF ( ( ::recno() + nRows ) + 0 ) < 1 - nRows := - ::recno() + 1 - //Clipper: only SKIP movement can set BOF() to .T. - ::lBof := .T. //Try to skip before first record + // DAVID: ::nCurRow := Max( ::nCurRow + nRows, 1 ) + IF ( ( ::RecNo() + nRows ) + 0 ) < 1 + nRows := - ::RecNo() + 1 + // Clipper: only SKIP movement can set BOF() to .T. + ::lBof := .T. // Try to skip before first record ENDIF ELSE // positive movement - //DAVID: ::nCurRow := Min( ::nCurRow + nRows, ::nNumRows ) - IF ( ( ::recno() + nRows ) + 0 ) > ::lastrec() - nRows := ::lastrec() - ::recno() + 1 + // DAVID: ::nCurRow := Min( ::nCurRow + nRows, ::nNumRows ) + IF ( ( ::RecNo() + nRows ) + 0 ) > ::LastRec() + nRows := ::LastRec() - ::RecNo() + 1 ENDIF ENDIF - //DAVID: + // DAVID: ::nCurRow := ::nCurRow + nRows - //DAVID: maintain ::bof() true until next movement - //Clipper: only SKIP movement can set BOF() to .T. - lbof := ::bof() + // DAVID: maintain ::bof() true until next movement + // Clipper: only SKIP movement can set BOF() to .T. + lbof := ::Bof() -// mysql_data_seek( ::nResultHandle, ::nCurRow - 1 ) +// mysql_data_seek( ::nResultHandle, ::nCurRow - 1 ) ::getRow( ::nCurrow ) IF lbof ::lBof := .T. ENDIF -//DAVID: DBSKIP() RETURN NIL RETURN ::nCurRow + // DAVID: DBSKIP() RETURN NIL RETURN ::nCurRow + RETURN NIL // Get row n of a query and return it as a TMySQLRow object METHOD GetRow( nRow ) CLASS TMySQLQuery - //DAVID: replaced by ::aRow LOCAL aRow := NIL + // DAVID: replaced by ::aRow LOCAL aRow := NIL LOCAL oRow := NIL LOCAL i - //DAVID: use current row DEFAULT nRow TO 0 + // DAVID: use current row DEFAULT nRow TO 0 IF ! HB_ISNUMERIC( nRow ) nRow := ::nCurRow ENDIF IF ::nResultHandle != NIL - //DAVID: + // DAVID: ::lBof := ( Empty( ::LastRec() ) ) - IF nRow < 1 .OR. nRow > ::lastrec() //Out of range + IF nRow < 1 .OR. nRow > ::LastRec() // Out of range // Equal to Clipper behaviour - nRow := ::lastrec() + 1 //LASTREC()+1 - ::nCurRow := ::lastrec() + 1 + nRow := ::LastRec() + 1 // LASTREC()+1 + ::nCurRow := ::LastRec() + 1 // ::lEof := .T. ENDIF @@ -487,15 +488,15 @@ METHOD GetRow( nRow ) CLASS TMySQLQuery // NOTE: row count starts from 0 mysql_data_seek( ::nResultHandle, nRow - 1 ) ::nCurRow := nRow -//DAVID: ELSE - //DAVID: use current row ::nCurRow++ + // DAVID: ELSE + // DAVID: use current row ::nCurRow++ ENDIF - //DAVID: - ::lEof := ( ::Recno() > ::LastRec() ) + // DAVID: + ::lEof := ( ::RecNo() > ::LastRec() ) ::aRow := NIL - IF ::eof() + IF ::Eof() // Phantom record with empty fields ::aRow := Array( Len( ::aFieldStruct ) ) AFill( ::aRow, "" ) @@ -515,7 +516,7 @@ METHOD GetRow( nRow ) CLASS TMySQLQuery CASE MYSQL_TYPE_LONGLONG CASE MYSQL_TYPE_INT24 CASE MYSQL_TYPE_NEWDECIMAL - //DAVID: + // DAVID: IF ::aRow[ i ] == NIL ::aRow[ i ] := "0" ENDIF @@ -524,7 +525,7 @@ METHOD GetRow( nRow ) CLASS TMySQLQuery CASE MYSQL_TYPE_DOUBLE CASE MYSQL_TYPE_FLOAT - //DAVID: + // DAVID: IF ::aRow[ i ] == NIL ::aRow[ i ] := "0" ENDIF @@ -555,14 +556,14 @@ METHOD GetRow( nRow ) CLASS TMySQLQuery OTHERWISE - //DAVID: Alert( "Unknown type from SQL Server Field: " + hb_NToS( i ) + " is type " + hb_NToS( ::aFieldStruct[ i ][ MYSQL_FS_TYPE ] ) ) + // DAVID: Alert( "Unknown type from SQL Server Field: " + hb_NToS( i ) + " is type " + hb_NToS( ::aFieldStruct[ i ][ MYSQL_FS_TYPE ] ) ) // ? "Unknown type from SQL Server Field: " + hb_NToS( i ) + " is type " + hb_NToS( ::aFieldStruct[ i ][ MYSQL_FS_TYPE ] ) ENDSWITCH - //DAVID: + // DAVID: IF ::lFieldAsData - __objsetValuelist( Self, { { ::aFieldStruct[ i ][ MYSQL_FS_NAME ], ::aRow[ i ] } } ) + __objSetValueList( Self, { { ::aFieldStruct[ i ][ MYSQL_FS_NAME ], ::aRow[ i ] } } ) ENDIF NEXT @@ -572,7 +573,7 @@ METHOD GetRow( nRow ) CLASS TMySQLQuery ENDIF ENDIF - //DAVID: IF ::arow == NIL; msginfo( "::arow NIL" ); ENDIF + // DAVID: IF ::arow == NIL; msginfo( "::arow NIL" ); ENDIF RETURN iif( ::aRow == NIL, NIL, oRow ) @@ -603,7 +604,7 @@ METHOD FieldPos( cFieldName ) CLASS TMySQLQuery cUpperName := Upper( cFieldName ) - //DAVID: nPos := AScan( ::aFieldStruct, {| aItem | iif( Upper( aItem[ MYSQL_FS_NAME ] ) == cUpperName, .T., .F. ) } ) + // DAVID: nPos := AScan( ::aFieldStruct, {| aItem | iif( Upper( aItem[ MYSQL_FS_NAME ] ) == cUpperName, .T., .F. ) } ) nPos := AScan( ::aFieldStruct, {| aItem | Upper( aItem[ MYSQL_FS_NAME ] ) == cUpperName } ) /* @@ -643,12 +644,12 @@ METHOD FieldGet( cnField ) CLASS TMySQLQuery ENDIF IF nNum > 0 .AND. nNum <= ::nNumfields - //DAVID: Value := __objsendmsg( Self,::aFieldStruct[ nNum ][ MYSQL_FS_NAME ] ) + // DAVID: Value := __objsendmsg( Self,::aFieldStruct[ nNum ][ MYSQL_FS_NAME ] ) Value := ::aRow[ nNum ] // Char fields are padded with spaces since a real .dbf field would be IF ::FieldType( nNum ) == "C" - RETURN PadR( Value,::aFieldStruct[ nNum ][ MYSQL_FS_LENGTH ] ) + RETURN PadR( Value, ::aFieldStruct[ nNum ][ MYSQL_FS_LENGTH ] ) ELSE RETURN Value ENDIF @@ -659,7 +660,7 @@ METHOD FieldGet( cnField ) CLASS TMySQLQuery METHOD FieldLen( nNum ) CLASS TMySQLQuery - IF nNum >=1 .AND. nNum <= Len( ::aFieldStruct ) + IF nNum >= 1 .AND. nNum <= Len( ::aFieldStruct ) RETURN ::aFieldStruct[ nNum ][ MYSQL_FS_LENGTH ] ENDIF @@ -676,7 +677,7 @@ METHOD FieldDec( nNum, lFormat ) CLASS TMySQLQuery lFormat := .F. ENDIF - IF nNum >=1 .AND. nNum <= Len( ::aFieldStruct ) + IF nNum >= 1 .AND. nNum <= Len( ::aFieldStruct ) IF !lFormat .AND. ( ::aFieldStruct[ nNum ][ MYSQL_FS_TYPE ] == MYSQL_TYPE_FLOAT .OR. ; ::aFieldStruct[ nNum ][ MYSQL_FS_TYPE ] == MYSQL_TYPE_DOUBLE ) RETURN Set( _SET_DECIMALS ) @@ -764,7 +765,7 @@ METHOD New( nSocket, cQuery, cTableName ) CLASS TMySQLTable ::aOldValue := {} FOR i := 1 TO ::nNumFields - AAdd( ::aOldValue, ::fieldget( i ) ) + AAdd( ::aOldValue, ::FieldGet( i ) ) NEXT RETURN Self @@ -778,16 +779,17 @@ METHOD GetRow( nRow ) CLASS TMySQLTable oRow:cTable := ::cTable ENDIF - ::aOldvalue:={} + ::aOldvalue := {} FOR i := 1 TO ::nNumFields // ::aOldValue[ i ] := ::FieldGet( i ) - AAdd( ::aOldvalue, ::fieldget( i ) ) + AAdd( ::aOldvalue, ::FieldGet( i ) ) NEXT RETURN oRow METHOD Skip( nRow ) CLASS TMySQLTable + LOCAL i super:skip( nRow ) @@ -796,23 +798,25 @@ METHOD Skip( nRow ) CLASS TMySQLTable ::aOldValue[ i ] := ::FieldGet( i ) NEXT -//DAVID: DBSKIP() RETURN NIL RETURN Self + // DAVID: DBSKIP() RETURN NIL RETURN Self + RETURN NIL /* Creates an update query for changed fields and submits it to server */ -//DAVID: lOldRecord, lRefresh added +// DAVID: lOldRecord, lRefresh added METHOD Update( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable LOCAL cUpdateQuery := "UPDATE " + ::cTable + " SET " LOCAL i - //DAVID: + + // DAVID: LOCAL ni, cWhere := " WHERE " IF ! HB_ISLOGICAL( lOldRecord ) lOldRecord := .F. ENDIF - //DAVID: too many ::refresh() can slow some processes, so we can desactivate it by parameter + // DAVID: too many ::refresh() can slow some processes, so we can desactivate it by parameter IF ! HB_ISLOGICAL( lRefresh ) lRefresh := .T. ENDIF @@ -835,7 +839,7 @@ METHOD Update( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable // remove last comma cUpdateQuery := Left( cUpdateQuery, Len( cUpdateQuery ) - 1 ) - //DAVID: + // DAVID: IF lOldRecord // based in matching of ALL fields of old record // WARNING: if there are more than one record of ALL fields matching, all of those records will be changed @@ -848,18 +852,18 @@ METHOD Update( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable cUpdateQuery += cWhere ELSE - //MakePrimaryKeyWhere is based in fields part of a primary key + // MakePrimaryKeyWhere is based in fields part of a primary key cUpdateQuery += ::MakePrimaryKeyWhere() ENDIF IF mysql_query( ::nSocket, cUpdateQuery ) == 0 - //DAVID: Clipper maintain same record pointer + // DAVID: Clipper maintain same record pointer - //DAVID: after refresh(), position of current record is often unpredictable + // DAVID: after refresh(), position of current record is often unpredictable IF lRefresh ::refresh() ELSE - //DAVID: just reset values (?) + // DAVID: just reset values (?) FOR i := 1 TO ::nNumFields ::aOldValue[ i ] := ::FieldGet( i ) NEXT @@ -882,7 +886,7 @@ METHOD Update( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable // remove last comma cUpdateQuery := Left( cUpdateQuery, Len( cUpdateQuery ) - 1 ) - //DAVID: + // DAVID: IF lOldRecord // based in matching of ALL fields of old record // WARNING: if there are more than one record of ALL fields matching, all of those records will be changed @@ -895,22 +899,22 @@ METHOD Update( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable cUpdateQuery += cWhere ELSE - //MakePrimaryKeyWhere is based in fields part of a primary key + // MakePrimaryKeyWhere is based in fields part of a primary key cUpdateQuery += oRow:MakePrimaryKeyWhere() ENDIF IF mysql_query( ::nSocket, cUpdateQuery ) == 0 // All values are commited - Afill( oRow:aDirty, .F. ) - Afill( oRow:aOldValue, NIL ) + AFill( oRow:aDirty, .F. ) + AFill( oRow:aOldValue, NIL ) - //DAVID: + // DAVID: oRow:aOriValue := AClone( oRow:aRow ) - //DAVID: Clipper maintain same record pointer + // DAVID: Clipper maintain same record pointer - //DAVID: after refresh(), position of current record is often unpredictable + // DAVID: after refresh(), position of current record is often unpredictable IF lRefresh ::refresh() ENDIF @@ -924,18 +928,18 @@ METHOD Update( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable RETURN !::lError -//DAVID: lOldRecord, lRefresh added +// DAVID: lOldRecord, lRefresh added METHOD Delete( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable - LOCAL cDeleteQuery := "DELETE FROM " + ::cTable , i + LOCAL cDeleteQuery := "DELETE FROM " + ::cTable, i - //DAVID: + // DAVID: LOCAL ni, cWhere := " WHERE " IF ! HB_ISLOGICAL( lOldRecord ) lOldRecord := .F. ENDIF - //DAVID: too many ::refresh() can slow some processes, so we can desactivate it by parameter + // DAVID: too many ::refresh() can slow some processes, so we can desactivate it by parameter IF ! HB_ISLOGICAL( lRefresh ) lRefresh := .T. ENDIF @@ -943,7 +947,7 @@ METHOD Delete( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable // is this a row of this table ? IF oRow == NIL - //DAVID: + // DAVID: IF lOldRecord // based in matching of ALL fields of old record // WARNING: if there are more than one record of ALL fields matching, all of those records will be changed @@ -959,22 +963,22 @@ METHOD Delete( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable cDeleteQuery += cWhere ELSE - //MakePrimaryKeyWhere is based in fields part of a primary key + // MakePrimaryKeyWhere is based in fields part of a primary key cDeleteQuery += ::MakePrimaryKeyWhere() ENDIF IF mysql_query( ::nSocket, cDeleteQuery ) == 0 ::lError := .F. - //DAVID: Clipper maintain same record pointer - //DAVID: ::nCurRow-- + // DAVID: Clipper maintain same record pointer + // DAVID: ::nCurRow-- - //DAVID: after refresh(), position of current record is often unpredictable + // DAVID: after refresh(), position of current record is often unpredictable IF lRefresh ::refresh() ELSE - //DAVID: just reset values (?) + // DAVID: just reset values (?) FOR i := 1 TO ::nNumFields - ::aOldValue[ i ] := ::FieldGet( i ) + ::aOldValue[ i ] := ::FieldGet( i ) NEXT ENDIF ELSE @@ -985,7 +989,7 @@ METHOD Delete( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable IF oRow:cTable == ::cTable - //DAVID: + // DAVID: IF lOldRecord // based in matching of ALL fields of old record // WARNING: if there are more than one record of ALL fields matching, all of those records will be changed @@ -1001,14 +1005,14 @@ METHOD Delete( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable cDeleteQuery += cWhere ELSE - //MakePrimaryKeyWhere is based in fields part of a primary key + // MakePrimaryKeyWhere is based in fields part of a primary key cDeleteQuery += oRow:MakePrimaryKeyWhere() ENDIF IF mysql_query( ::nSocket, cDeleteQuery ) == 0 ::lError := .F. - //DAVID: after refresh(), position of current record is often unpredictable + // DAVID: after refresh(), position of current record is often unpredictable IF lRefresh ::refresh() ENDIF @@ -1023,13 +1027,13 @@ METHOD Delete( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable // Adds a row with values passed into oRow -//DAVID: lRefresh added +// DAVID: lRefresh added METHOD Append( oRow, lRefresh ) CLASS TMySQLTable LOCAL cInsertQuery := "INSERT INTO " + ::cTable + " (" LOCAL i - //DAVID: too many ::refresh() can slow some processes, so we can desactivate it by parameter + // DAVID: too many ::refresh() can slow some processes, so we can desactivate it by parameter IF ! HB_ISLOGICAL( lRefresh ) lRefresh := .T. ENDIF @@ -1057,14 +1061,14 @@ METHOD Append( oRow, lRefresh ) CLASS TMySQLTable IF mysql_query( ::nSocket, cInsertQuery ) == 0 ::lError := .F. - //DAVID: Clipper add record at end - ::nCurRow := ::lastrec() + 1 + // DAVID: Clipper add record at end + ::nCurRow := ::LastRec() + 1 - //DAVID: after refresh(), position of current record is often unpredictable + // DAVID: after refresh(), position of current record is often unpredictable IF lRefresh ::refresh() ELSE - //DAVID: just reset values in memory (?) + // DAVID: just reset values in memory (?) /* was same values from fieldget( i ) ! FOR i := 1 TO ::nNumFields ::aOldValue[ i ] := ::FieldGet( i ) @@ -1101,21 +1105,21 @@ METHOD Append( oRow, lRefresh ) CLASS TMySQLTable cInsertQuery := Left( cInsertQuery, Len( cInsertQuery ) - 1 ) + ")" IF mysql_query( ::nSocket, cInsertQuery ) == 0 - //DAVID: + // DAVID: ::lError := .F. - //DAVID: + // DAVID: // All values are commited AFill( oRow:aDirty, .F. ) AFill( oRow:aOldValue, NIL ) - //DAVID: + // DAVID: oRow:aOriValue := AClone( oRow:aRow ) - //DAVID: Clipper add record at end - ::nCurRow := ::lastrec() + 1 + // DAVID: Clipper add record at end + ::nCurRow := ::LastRec() + 1 - //DAVID: after refresh(), position of current record is often unpredictable + // DAVID: after refresh(), position of current record is often unpredictable IF lRefresh ::refresh() ENDIF @@ -1131,13 +1135,13 @@ METHOD Append( oRow, lRefresh ) CLASS TMySQLTable RETURN .F. -//DAVID: lSetValues added METHOD GetBlankRow() CLASS TMySQLTable +// DAVID: lSetValues added METHOD GetBlankRow() CLASS TMySQLTable METHOD GetBlankRow( lSetValues ) CLASS TMySQLTable LOCAL i LOCAL aRow := Array( ::nNumFields ) - //DAVID: It is not current row, so do not change it + // DAVID: It is not current row, so do not change it IF ! HB_ISLOGICAL( lSetValues ) lSetValues := .F. ENDIF @@ -1177,8 +1181,8 @@ METHOD GetBlankRow( lSetValues ) CLASS TMySQLTable ENDSWITCH NEXT - //DAVID: - IF lSetValues //Assign values as current row values + // DAVID: + IF lSetValues // Assign values as current row values FOR i := 1 TO ::nNumFields ::FieldPut( i, aRow[ i ] ) ::aOldValue[ i ] := aRow[ i ] @@ -1200,18 +1204,18 @@ METHOD FieldPut( cnField, Value ) CLASS TMySQLTable IF nNum > 0 .AND. nNum <= ::nNumFields -//DAVID: IF Valtype( Value ) == Valtype( ::FieldGet( nNum ) ) .OR. Empty( ::Fieldget( nNum ) ) - IF Valtype( Value ) == Valtype( ::aRow[ nNum ] ) .OR. ::aRow[ nNum ] == NIL + // DAVID: IF Valtype( Value ) == Valtype( ::FieldGet( nNum ) ) .OR. Empty( ::Fieldget( nNum ) ) + IF ValType( Value ) == ValType( ::aRow[ nNum ] ) .OR. ::aRow[ nNum ] == NIL // if it is a char field remove trailing spaces IF HB_ISSTRING( Value ) Value := RTrim( Value ) ENDIF - //DAVID: + // DAVID: ::aRow[ nNum ] := Value IF ::lFieldAsData - __objsetValueList( Self, { { ::aFieldStruct[ nNum ][ MYSQL_FS_NAME ], Value } } ) + __objSetValueList( Self, { { ::aFieldStruct[ nNum ][ MYSQL_FS_NAME ], Value } } ) ENDIF RETURN Value @@ -1341,7 +1345,9 @@ METHOD New( cServer, cUser, cPassword, nPort ) CLASS TMySQLServer RETURN Self METHOD Destroy() CLASS TMySQLServer + ::nSocket := NIL + RETURN Self METHOD sql_commit() CLASS TMySQLServer @@ -1355,19 +1361,19 @@ METHOD sql_version() CLASS TMySQLServer -*METHOD SelectDB( cDBName ) CLASS TMySQLServer -* -* IF mysql_select_db( ::nSocket, cDBName ) == 0 -* ::cDBName := cDBName -* RETURN .T. -* ELSE -* ::cDBName := "" -* ENDIF -* -* RETURN .F. +// METHOD SelectDB( cDBName ) CLASS TMySQLServer +// +// IF mysql_select_db( ::nSocket, cDBName ) == 0 +// ::cDBName := cDBName +// RETURN .T. +// ELSE +// ::cDBName := "" +// ENDIF +// +// RETURN .F. -*****************alterado +// ****************alterado METHOD SelectDB( cDBName ) CLASS TMySQLServer ::lError := .F. @@ -1385,6 +1391,7 @@ METHOD SelectDB( cDBName ) CLASS TMySQLServer METHOD CreateDatabase( cDataBase ) CLASS TMySQLServer + LOCAL cCreateQuery := "CREATE DATABASE " + Lower( cDatabase ) IF mysql_query( ::nSocket, cCreateQuery ) == 0 @@ -1412,7 +1419,7 @@ METHOD CreateTable( cTable, aStruct, cPrimaryKey, cUniqueKey, cAuto ) CLASS TMyS SWITCH aStruct[ i ][ DBS_TYPE ] CASE "C" - ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " char(" + hb_NToS( aStruct[ i ][ DBS_LEN ]) + ")" + Eval( cNN, aStruct[ i ] ) + iif( aStruct[ i ][ DBS_NAME ] == cPrimaryKey, " NOT NULL ", "" ) + "," + ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " char(" + hb_ntos( aStruct[ i ][ DBS_LEN ] ) + ")" + Eval( cNN, aStruct[ i ] ) + iif( aStruct[ i ][ DBS_NAME ] == cPrimaryKey, " NOT NULL ", "" ) + "," EXIT CASE "M" @@ -1430,19 +1437,19 @@ METHOD CreateTable( cTable, aStruct, cPrimaryKey, cUniqueKey, cAuto ) CLASS TMyS IF aStruct[ i ][ DBS_DEC ] == 0 .AND. aStruct[ i ][ DBS_LEN ] <= 18 DO CASE CASE aStruct[ i ][ DBS_LEN ] <= 2 - ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " tinyint(" + hb_NToS( aStruct[ i ][ DBS_LEN ] ) + ")" + ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " tinyint(" + hb_ntos( aStruct[ i ][ DBS_LEN ] ) + ")" CASE aStruct[ i ][ DBS_LEN ] <= 4 - ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " smallint(" + hb_NToS( aStruct[ i ][ DBS_LEN ] ) + ")" + ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " smallint(" + hb_ntos( aStruct[ i ][ DBS_LEN ] ) + ")" CASE aStruct[ i ][ DBS_LEN ] <= 6 - ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " mediumint(" + hb_NToS( aStruct[ i ][ DBS_LEN ] ) + ")" + ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " mediumint(" + hb_ntos( aStruct[ i ][ DBS_LEN ] ) + ")" CASE aStruct[ i ][ DBS_LEN ] <= 9 - ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " int(" + hb_NToS( aStruct[ i ][ DBS_LEN ] ) + ")" + ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " int(" + hb_ntos( aStruct[ i ][ DBS_LEN ] ) + ")" OTHERWISE - ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " bigint(" + hb_NToS( aStruct[ i ][ DBS_LEN ] ) + ")" + ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " bigint(" + hb_ntos( aStruct[ i ][ DBS_LEN ] ) + ")" ENDCASE - ::cCreateQuery += Eval(cNN, aStruct[ i ]) + iif( aStruct[ i ][ DBS_NAME ] == cPrimaryKey, " NOT NULL ", "" ) + iif( aStruct[ i ][ DBS_NAME ] == cAuto, " auto_increment ", "" ) + "," + ::cCreateQuery += Eval( cNN, aStruct[ i ] ) + iif( aStruct[ i ][ DBS_NAME ] == cPrimaryKey, " NOT NULL ", "" ) + iif( aStruct[ i ][ DBS_NAME ] == cAuto, " auto_increment ", "" ) + "," ELSE - ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " real(" + hb_NToS( aStruct[ i ][ DBS_LEN ] ) + "," + hb_NToS( aStruct[ i ][ DBS_DEC ]) + ")" + Eval( cNN, aStruct[ i ] ) + "," + ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " real(" + hb_ntos( aStruct[ i ][ DBS_LEN ] ) + "," + hb_ntos( aStruct[ i ][ DBS_DEC ] ) + ")" + Eval( cNN, aStruct[ i ] ) + "," ENDIF EXIT @@ -1459,7 +1466,7 @@ METHOD CreateTable( cTable, aStruct, cPrimaryKey, cUniqueKey, cAuto ) CLASS TMyS EXIT OTHERWISE - ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " char(" + hb_NToS( aStruct[ i ][ DBS_LEN ] ) + ")" + Eval( cNN, aStruct[ i ] ) + "," + ::cCreateQuery += aStruct[ i ][ DBS_NAME ] + " char(" + hb_ntos( aStruct[ i ][ DBS_LEN ] ) + ")" + Eval( cNN, aStruct[ i ] ) + "," ENDSWITCH @@ -1681,7 +1688,7 @@ STATIC FUNCTION ClipValue2SQL( Value ) SWITCH ValType( Value ) CASE "N" - RETURN hb_NToS( Value ) + RETURN hb_ntos( Value ) CASE "D" IF Empty( Value ) diff --git a/harbour/contrib/hbmysql/tsqlbrw.prg b/harbour/contrib/hbmysql/tsqlbrw.prg index 343e4a9f8f..9fbf1ed23b 100644 --- a/harbour/contrib/hbmysql/tsqlbrw.prg +++ b/harbour/contrib/hbmysql/tsqlbrw.prg @@ -215,7 +215,7 @@ STATIC FUNCTION Skipper( nSkip, oQuery ) CASE nSkip > 0 DO WHILE i < nSkip // Skip Foward - //DAVID: change in TMySQLquery:eof() definition if oQuery:eof() + // DAVID: change in TMySQLquery:eof() definition if oQuery:eof() IF oQuery:recno() == oQuery:lastrec() EXIT ENDIF @@ -227,7 +227,7 @@ STATIC FUNCTION Skipper( nSkip, oQuery ) CASE nSkip < 0 DO WHILE i > nSkip // Skip backward - //DAVID: change in TMySQLquery:bof() definition if oQuery:bof() + // DAVID: change in TMySQLquery:bof() definition if oQuery:bof() IF oQuery:recno() == 1 EXIT ENDIF diff --git a/harbour/contrib/hbnetio/netiomt.prg b/harbour/contrib/hbnetio/netiomt.prg index 9f87e7215b..29b76c7041 100644 --- a/harbour/contrib/hbnetio/netiomt.prg +++ b/harbour/contrib/hbnetio/netiomt.prg @@ -62,8 +62,9 @@ #include "error.ch" FUNCTION NETIO_MTSERVER( nPort, cIfAddr, cRootDir, xRPC, ; - cPasswd, nCompressLevel, nStrategy, ; - sSrvFunc ) + cPasswd, nCompressLevel, nStrategy, ; + sSrvFunc ) + LOCAL pListenSocket, lRPC LOCAL oError @@ -88,8 +89,8 @@ FUNCTION NETIO_MTSERVER( nPort, cIfAddr, cRootDir, xRPC, ; pListenSocket := netio_listen( nPort, cIfAddr, cRootDir, lRPC ) IF !Empty( pListenSocket ) hb_threadDetach( hb_threadStart( @netio_srvloop(), pListenSocket, ; - xRPC, sSrvFunc, ; - cPasswd, nCompressLevel, nStrategy ) ) + xRPC, sSrvFunc, ; + cPasswd, nCompressLevel, nStrategy ) ) ENDIF ELSE oError := ErrorNew() @@ -98,7 +99,7 @@ FUNCTION NETIO_MTSERVER( nPort, cIfAddr, cRootDir, xRPC, ; oError:genCode := EG_UNSUPPORTED oError:subSystem := "HBNETIO" oError:subCode := 0 - oError:description := hb_LangErrMsg( EG_UNSUPPORTED ) + oError:description := hb_langErrMsg( EG_UNSUPPORTED ) oError:canRetry := .F. oError:canDefault := .F. oError:fileName := "" @@ -106,10 +107,12 @@ FUNCTION NETIO_MTSERVER( nPort, cIfAddr, cRootDir, xRPC, ; Eval( ErrorBlock(), oError ) ENDIF + RETURN pListenSocket STATIC FUNCTION NETIO_SRVLOOP( pListenSocket, xRPC, sSrvFunc, ... ) + LOCAL pConnectionSocket WHILE .T. @@ -123,4 +126,5 @@ STATIC FUNCTION NETIO_SRVLOOP( pListenSocket, xRPC, sSrvFunc, ... ) hb_threadDetach( hb_threadStart( sSrvFunc, pConnectionSocket ) ) pConnectionSocket := NIL ENDDO + RETURN NIL diff --git a/harbour/contrib/hbnetio/utils/hbnetio/netiocon.prg b/harbour/contrib/hbnetio/utils/hbnetio/netiocon.prg index f3d2d1206e..1a0ea1a78c 100644 --- a/harbour/contrib/hbnetio/utils/hbnetio/netiocon.prg +++ b/harbour/contrib/hbnetio/utils/hbnetio/netiocon.prg @@ -33,6 +33,7 @@ #include "hbgtinfo.ch" PROCEDURE hbnetiocon_cmdUI( cIP, nPort, cPassword ) + LOCAL GetList := {} LOCAL hCommands LOCAL nSavedRow @@ -54,8 +55,8 @@ PROCEDURE hbnetiocon_cmdUI( cIP, nPort, cPassword ) LOCAL netclictx LOCAL netcliID - LOCAL hConIO := {; - "displine" => {| c | hbnetiocon_ToConsole( c ) } ,; + LOCAL hConIO := { ; + "displine" => {| c | hbnetiocon_ToConsole( c ) },; "gethidden" => {|| hbnetiocon_GetHidden() } } Set( _SET_CONFIRM, .F. ) @@ -77,8 +78,8 @@ PROCEDURE hbnetiocon_cmdUI( cIP, nPort, cPassword ) nHistIndex := Len( aHistory ) + 1 hCommands := { ; - "?" => { "", "Synonym for 'help'." , {|| ShowHelp( hCommands ), Eval( netclictrl[ "cmd" ], netclictx, "?" ) } } ,; - "help" => { "", "Display this help." , {|| ShowHelp( hCommands ), Eval( netclictrl[ "cmd" ], netclictx, "?" ) } } ,; + "?" => { "", "Synonym for 'help'." , {|| ShowHelp( hCommands ), Eval( netclictrl[ "cmd" ], netclictx, "?" ) } }, ; + "help" => { "", "Display this help." , {|| ShowHelp( hCommands ), Eval( netclictrl[ "cmd" ], netclictx, "?" ) } }, ; "quit" => { "", "Exit console." , {|| lQuit := .T. } } } lQuit := .F. @@ -94,19 +95,19 @@ PROCEDURE hbnetiocon_cmdUI( cIP, nPort, cPassword ) SetCursor( iif( ReadInsert(), SC_INSERT, SC_NORMAL ) ) - bKeyIns := SetKey( K_INS,; - {|| SetCursor( iif( ReadInsert( ! ReadInsert() ),; + bKeyIns := SetKey( K_INS, ; + {|| SetCursor( iif( ReadInsert( ! ReadInsert() ), ; SC_NORMAL, SC_INSERT ) ) } ) - bKeyUp := SetKey( K_UP,; - {|| iif( nHistIndex > 1,; - cCommand := PadR( aHistory[ --nHistIndex ], Len( cCommand ) ), ),; + bKeyUp := SetKey( K_UP, ; + {|| iif( nHistIndex > 1, ; + cCommand := PadR( aHistory[ --nHistIndex ], Len( cCommand ) ), ), ; ManageCursor( cCommand ) } ) - bKeyDown := SetKey( K_DOWN,; - {|| cCommand := PadR( iif( nHistIndex < Len( aHistory ),; - aHistory[ ++nHistIndex ],; - ( nHistIndex := Len( aHistory ) + 1, "" ) ), Len( cCommand ) ),; + bKeyDown := SetKey( K_DOWN, ; + {|| cCommand := PadR( iif( nHistIndex < Len( aHistory ), ; + aHistory[ ++nHistIndex ], ; + ( nHistIndex := Len( aHistory ) + 1, "" ) ), Len( cCommand ) ), ; ManageCursor( cCommand ) } ) - bKeyPaste := SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE )}) + bKeyPaste := SetKey( K_ALT_V, {|| hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) } ) bKeyTab := SetKey( K_TAB, {|| CompleteCmd( @cCommand, hCommands ) } ) @@ -164,15 +165,16 @@ PROCEDURE hbnetiocon_cmdUI( cIP, nPort, cPassword ) /* Adjusted the positioning of cursor on navigate through history. [vailtom] */ STATIC PROCEDURE ManageCursor( cCommand ) - hb_KeyPut( K_HOME ) + hb_keyPut( K_HOME ) IF ! Empty( cCommand ) - hb_KeyPut( K_END ) + hb_keyPut( K_END ) ENDIF RETURN /* Complete the command line, based on the first characters that the user typed. [vailtom] */ STATIC PROCEDURE CompleteCmd( cCommand, hCommands ) + LOCAL s := Lower( AllTrim( cCommand ) ) LOCAL n @@ -190,6 +192,7 @@ STATIC PROCEDURE CompleteCmd( cCommand, hCommands ) RETURN STATIC PROCEDURE ShowHelp( hCommands ) + LOCAL aTexts := {} LOCAL n, c, m @@ -230,10 +233,13 @@ STATIC PROCEDURE ShowHelp( hCommands ) RETURN STATIC PROCEDURE hbnetiocon_ToConsole( cText ) + QQOut( cText + hb_eol() ) + RETURN STATIC FUNCTION hbnetiocon_GetHidden() + LOCAL GetList := {} LOCAL cPassword := Space( 128 ) LOCAL nSavedRow diff --git a/harbour/contrib/hbnetio/utils/hbnetio/netiomgm.hb b/harbour/contrib/hbnetio/utils/hbnetio/netiomgm.hb index cd7c24f184..ad04de5d70 100644 --- a/harbour/contrib/hbnetio/utils/hbnetio/netiomgm.hb +++ b/harbour/contrib/hbnetio/utils/hbnetio/netiomgm.hb @@ -40,13 +40,14 @@ #define _NETIOCLI_MAX_ 8 FUNCTION __hbshell_plugin() - RETURN {; - "id" => "netio",; - "init" => {| hConIO, ... | hbnetiocon_init( hConIO, ... ) } ,; - "exit" => {| context | hbnetiocon_exit( context ) } ,; + RETURN { ; + "id" => "netio", ; + "init" => {| hConIO, ... | hbnetiocon_init( hConIO, ... ) }, ; + "exit" => {| context | hbnetiocon_exit( context ) }, ; "cmd" => {| context, cCommand | hbnetiocon_command( context, cCommand ) } } STATIC PROCEDURE hbnetiocon_dispevent( netiocli, cText ) + LOCAL cPrompt IF Empty( netiocli[ _NETIOCLI_pConnection ] ) @@ -60,6 +61,7 @@ STATIC PROCEDURE hbnetiocon_dispevent( netiocli, cText ) RETURN STATIC FUNCTION hbnetiocon_init( hConIO, aParam ) + LOCAL netiocli[ _NETIOCLI_MAX_ ] LOCAL cParam @@ -131,6 +133,7 @@ STATIC PROCEDURE hbnetiocon_exit( netiocli ) RETURN STATIC FUNCTION hbnetiocon_command( netiocli, cCommand ) + LOCAL aCommand LOCAL nPos @@ -145,6 +148,7 @@ STATIC FUNCTION hbnetiocon_command( netiocli, cCommand ) RETURN .F. STATIC PROCEDURE hbnetiocon_IPPortSplit( cAddr, /* @ */ cIP, /* @ */ nPort ) + LOCAL tmp IF ! Empty( cAddr ) @@ -174,17 +178,18 @@ STATIC FUNCTION hbnetiocon_acceptStreamData( netiocli, xItem ) RETURN .T. STATIC PROCEDURE hbnetiocon_waitStream( netiocli, bBlock ) /* in separate thread */ + LOCAL lExit := .F. LOCAL xList LOCAL xItem LOCAL xRetVal - LOCAL nLastPing := hb_milliSeconds() + LOCAL nLastPing := hb_MilliSeconds() DO WHILE netiocli[ _NETIOCLI_lWaitStream ] IF ! Empty( netiocli[ _NETIOCLI_pConnection ] ) - IF hb_milliSeconds() > nLastPing + 5000 + IF hb_MilliSeconds() > nLastPing + 5000 /* Is connection alive? */ BEGIN SEQUENCE WITH {| oError | Break( oError ) } netio_funcexec( netiocli[ _NETIOCLI_pConnection ], "hbnetiomgm_ping" ) @@ -192,7 +197,7 @@ STATIC PROCEDURE hbnetiocon_waitStream( netiocli, bBlock ) /* in separate thread hbnetiocon_dispevent( netiocli, "Connection lost." ) EXIT END SEQUENCE - nLastPing := hb_milliSeconds() + nLastPing := hb_MilliSeconds() ENDIF ENDIF @@ -262,6 +267,7 @@ STATIC PROCEDURE DisconnectLow( netiocli ) RETURN STATIC FUNCTION MyClientInfo() + LOCAL hInfo := { => } hb_HKeepOrder( hInfo, .T. ) @@ -275,6 +281,7 @@ STATIC FUNCTION MyClientInfo() RETURN hInfo STATIC FUNCTION XToStrX( xValue ) + LOCAL cType := ValType( xValue ) LOCAL tmp @@ -340,6 +347,7 @@ STATIC PROCEDURE cmdAbout( netiocli ) RETURN STATIC PROCEDURE cmdHelp( netiocli ) + LOCAL hCommands := netiocli[ _NETIOCLI_hCommands ] LOCAL aTexts := {} LOCAL n, m @@ -363,6 +371,7 @@ STATIC PROCEDURE cmdHelp( netiocli ) RETURN STATIC PROCEDURE cmdConnect( netiocli, cCommand ) + LOCAL cIP LOCAL nPort LOCAL aToken @@ -404,6 +413,7 @@ STATIC PROCEDURE cmdDisconnect( netiocli ) RETURN STATIC PROCEDURE cmdSysInfo( netiocli ) + LOCAL cLine IF Empty( netiocli[ _NETIOCLI_pConnection ] ) @@ -417,6 +427,7 @@ STATIC PROCEDURE cmdSysInfo( netiocli ) RETURN STATIC PROCEDURE cmdServerConfig( netiocli ) + LOCAL cLine IF Empty( netiocli[ _NETIOCLI_pConnection ] ) @@ -430,6 +441,7 @@ STATIC PROCEDURE cmdServerConfig( netiocli ) RETURN STATIC PROCEDURE cmdConnStop( netiocli, cCommand ) + LOCAL aToken IF Empty( netiocli[ _NETIOCLI_pConnection ] ) @@ -446,6 +458,7 @@ STATIC PROCEDURE cmdConnStop( netiocli, cCommand ) RETURN STATIC PROCEDURE cmdConnClientInfo( netiocli, cCommand ) + LOCAL aToken LOCAL xCargo @@ -468,6 +481,7 @@ STATIC PROCEDURE cmdConnClientInfo( netiocli, cCommand ) RETURN STATIC PROCEDURE cmdConnInfo( netiocli, lManagement ) + LOCAL aArray LOCAL hConn @@ -479,14 +493,14 @@ STATIC PROCEDURE cmdConnInfo( netiocli, lManagement ) hbnetiocon_dispevent( netiocli, hb_StrFormat( "Number of connections: %1$d", Len( aArray ) ) ) FOR EACH hConn IN aArray - hbnetiocon_dispevent( netiocli, "#" + PadR( hb_ntos( hConn[ "nThreadID" ] ), Len( Str( hConn[ "nThreadID" ] ) ) ) + " " +; - hb_TToC( hConn[ "tStart" ] ) + " " +; - PadR( hConn[ "cStatus" ], 12 ) + " " +; - "fcnt: " + Str( hConn[ "nFilesCount" ] ) + " " +; - "send: " + Str( hConn[ "nBytesSent" ] ) + " " +; - "recv: " + Str( hConn[ "nBytesReceived" ] ) + " " +; - hConn[ "cAddressPeer" ] + " " +; - iif( "xCargo" $ hconn, hb_ValToStr( hConn[ "xCargo" ] ), "" ) ) + hbnetiocon_dispevent( netiocli, "#" + PadR( hb_ntos( hConn[ "nThreadID" ] ), Len( Str( hConn[ "nThreadID" ] ) ) ) + " " + ; + hb_TToC( hConn[ "tStart" ] ) + " " + ; + PadR( hConn[ "cStatus" ], 12 ) + " " + ; + "fcnt: " + Str( hConn[ "nFilesCount" ] ) + " " + ; + "send: " + Str( hConn[ "nBytesSent" ] ) + " " + ; + "recv: " + Str( hConn[ "nBytesReceived" ] ) + " " + ; + hConn[ "cAddressPeer" ] + " " + ; + iif( "xCargo" $ hconn, hb_ValToStr( hConn[ "xCargo" ] ), "" ) ) NEXT ENDIF @@ -523,6 +537,7 @@ STATIC PROCEDURE cmdConnLogEnable( netiocli, lValue ) RETURN STATIC PROCEDURE cmdConnFilterMod( netiocli, cCommand, cRPC ) + LOCAL aToken IF Empty( netiocli[ _NETIOCLI_pConnection ] ) @@ -543,6 +558,7 @@ STATIC PROCEDURE cmdConnFilterMod( netiocli, cCommand, cRPC ) RETURN STATIC PROCEDURE cmdConnFilters( netiocli, lManagement ) + LOCAL aArray LOCAL hFilter @@ -552,8 +568,8 @@ STATIC PROCEDURE cmdConnFilters( netiocli, lManagement ) aArray := netio_funcexec( netiocli[ _NETIOCLI_pConnection ], iif( lManagement, "hbnetiomgm_filtersadmin", "hbnetiomgm_filters" ) ) FOR EACH hFilter IN aArray - hbnetiocon_dispevent( netiocli, hFilter[ "cType" ],; - hFilter[ "cAddress" ] ) + hbnetiocon_dispevent( netiocli, hFilter[ "cType" ], ; + hFilter[ "cAddress" ] ) NEXT ENDIF diff --git a/harbour/contrib/hbnetio/utils/hbnetio/netiosrv.prg b/harbour/contrib/hbnetio/utils/hbnetio/netiosrv.prg index f63b9241d2..146d6a10d7 100644 --- a/harbour/contrib/hbnetio/utils/hbnetio/netiosrv.prg +++ b/harbour/contrib/hbnetio/utils/hbnetio/netiosrv.prg @@ -52,7 +52,7 @@ /* enable this if you need all core functions in RPC support */ #ifdef HB_EXTERN - REQUEST __HB_EXTERN__ +REQUEST __HB_EXTERN__ #endif #define _NETIOSRV_cName 1 @@ -83,10 +83,13 @@ #define _NETIOSRV_CONN_MAX_ 4 PROCEDURE Main( ... ) + netiosrv_Main( .T., ... ) + RETURN PROCEDURE netiosrv_Main( lUI, ... ) + LOCAL netiosrv[ _NETIOSRV_MAX_ ] LOCAL netiomgm[ _NETIOSRV_MAX_ ] @@ -185,8 +188,8 @@ PROCEDURE netiosrv_Main( lUI, ... ) SWITCH cExt CASE ".prg" CASE ".hb" - cFile := hb_compileBuf( hb_argv( 0 ), "-n2", "-w", "-es2", "-q0",; - "-D" + "__HBSCRIPT__HBNETIOSRV", netiosrv[ _NETIOSRV_cRPCFFileName ] ) + cFile := hb_compileBuf( hb_argv( 0 ), "-n2", "-w", "-es2", "-q0", ; + "-D" + "__HBSCRIPT__HBNETIOSRV", netiosrv[ _NETIOSRV_cRPCFFileName ] ) IF cFile != NIL netiosrv[ _NETIOSRV_hRPCFHRB ] := hb_hrbLoad( HB_HRB_BIND_FORCELOCAL, cFile ) ENDIF @@ -220,15 +223,15 @@ PROCEDURE netiosrv_Main( lUI, ... ) hb_DirBuild( netiosrv[ _NETIOSRV_cRootDir ] ) - netiosrv[ _NETIOSRV_pListenSocket ] := ; - netio_mtserver( netiosrv[ _NETIOSRV_nPort ],; - netiosrv[ _NETIOSRV_cIFAddr ],; - netiosrv[ _NETIOSRV_cRootDir ],; - iif( Empty( netiosrv[ _NETIOSRV_hRPCFHRB ] ), netiosrv[ _NETIOSRV_lRPC ], hb_hrbGetFunSym( netiosrv[ _NETIOSRV_hRPCFHRB ], _RPC_FILTER ) ),; - cPassword,; - NIL,; - NIL,; - {| pConnectionSocket | netiosrv_callback( netiomgm, netiosrv, pConnectionSocket, .F. ) } ) + netiosrv[ _NETIOSRV_pListenSocket ] := netio_mtserver( ; + netiosrv[ _NETIOSRV_nPort ], ; + netiosrv[ _NETIOSRV_cIFAddr ], ; + netiosrv[ _NETIOSRV_cRootDir ], ; + iif( Empty( netiosrv[ _NETIOSRV_hRPCFHRB ] ), netiosrv[ _NETIOSRV_lRPC ], hb_hrbGetFunSym( netiosrv[ _NETIOSRV_hRPCFHRB ], _RPC_FILTER ) ), ; + cPassword, ; + NIL, ; + NIL, ; + {| pConnectionSocket | netiosrv_callback( netiomgm, netiosrv, pConnectionSocket, .F. ) } ) netiosrv[ _NETIOSRV_lEncryption ] := ! Empty( cPassword ) cPassword := NIL @@ -240,39 +243,39 @@ PROCEDURE netiosrv_Main( lUI, ... ) IF ! Empty( cPasswordManagement ) - netiomgm[ _NETIOSRV_pListenSocket ] := ; - netio_mtserver( netiomgm[ _NETIOSRV_nPort ],; - netiomgm[ _NETIOSRV_cIFAddr ],; - netiomgm[ _NETIOSRV_cRootDir ],; - { "hbnetiomgm_ping" => {| ... | .T. } ,; - "hbnetiomgm_setclientinfo" => {| ... | netiomgm_rpc_setclientinfo( netiomgm, ... ) } ,; - "hbnetiomgm_sysinfo" => {| ... | netiomgm_rpc_sysinfo() } ,; - "hbnetiomgm_serverconfig" => {| ... | netiomgm_rpc_serverconfig( netiosrv, netiomgm ) } ,; - "hbnetiomgm_clientinfo" => {| ... | netiomgm_rpc_clientinfo( netiosrv, netiomgm, ... ) } ,; - "hbnetiomgm_shutdown" => {| ... | netiomgm_rpc_shutdown( netiosrv, netiomgm ) } ,; - "hbnetiomgm_conninfo" => {| ... | netiomgm_rpc_conninfo( netiosrv ) } ,; - "hbnetiomgm_adminfo" => {| ... | netiomgm_rpc_conninfo( netiomgm ) } ,; - "hbnetiomgm_allowadd" => {| ... | netiomgm_rpc_filtermod( netiosrv, netiosrv[ _NETIOSRV_hAllow ], .T., ... ) } ,; - "hbnetiomgm_allowdel" => {| ... | netiomgm_rpc_filtermod( netiosrv, netiosrv[ _NETIOSRV_hAllow ], .F., ... ) } ,; - "hbnetiomgm_blockadd" => {| ... | netiomgm_rpc_filtermod( netiosrv, netiosrv[ _NETIOSRV_hBlock ], .T., ... ) } ,; - "hbnetiomgm_blockdel" => {| ... | netiomgm_rpc_filtermod( netiosrv, netiosrv[ _NETIOSRV_hBlock ], .F., ... ) } ,; - "hbnetiomgm_allowaddadmin" => {| ... | netiomgm_rpc_filtermod( netiomgm, netiomgm[ _NETIOSRV_hAllow ], .T., ... ) } ,; - "hbnetiomgm_allowdeladmin" => {| ... | netiomgm_rpc_filtermod( netiomgm, netiomgm[ _NETIOSRV_hAllow ], .F., ... ) } ,; - "hbnetiomgm_blockaddadmin" => {| ... | netiomgm_rpc_filtermod( netiomgm, netiomgm[ _NETIOSRV_hBlock ], .T., ... ) } ,; - "hbnetiomgm_blockdeladmin" => {| ... | netiomgm_rpc_filtermod( netiomgm, netiomgm[ _NETIOSRV_hBlock ], .F., ... ) } ,; - "hbnetiomgm_filters" => {| ... | netiomgm_rpc_filters( netiosrv ) } ,; - "hbnetiomgm_filtersadmin" => {| ... | netiomgm_rpc_filters( netiomgm ) } ,; - "hbnetiomgm_filtersave" => {| ... | netiomgm_rpc_filtersave( netiosrv, netiomgm ) } ,; - "hbnetiomgm_stop" => {| ... | netiomgm_rpc_stop( netiosrv, ... ) } ,; - "hbnetiomgm_conn" => {| ... | netiomgm_rpc_conn( netiosrv, .T. ) } ,; - "hbnetiomgm_noconn" => {| ... | netiomgm_rpc_conn( netiosrv, .F. ) } ,; - "hbnetiomgm_logconn" => {| ... | netiomgm_rpc_logconn( netiosrv, .T. ) } ,; - "hbnetiomgm_nologconn" => {| ... | netiomgm_rpc_logconn( netiosrv, .F. ) } ,; - "hbnetiomgm_regnotif" => {| ... | netiomgm_rpc_regnotif( netiomgm, ... ) } },; - cPasswordManagement,; - NIL,; - NIL,; - {| pConnectionSocket | netiosrv_callback( netiomgm, netiomgm, pConnectionSocket, .T. ) } ) + netiomgm[ _NETIOSRV_pListenSocket ] := netio_mtserver( ; + netiomgm[ _NETIOSRV_nPort ], ; + netiomgm[ _NETIOSRV_cIFAddr ], ; + netiomgm[ _NETIOSRV_cRootDir ], { ; + "hbnetiomgm_ping" => {| ... | .T. },; + "hbnetiomgm_setclientinfo" => {| ... | netiomgm_rpc_setclientinfo( netiomgm, ... ) },; + "hbnetiomgm_sysinfo" => {| ... | netiomgm_rpc_sysinfo() },; + "hbnetiomgm_serverconfig" => {| ... | netiomgm_rpc_serverconfig( netiosrv, netiomgm ) },; + "hbnetiomgm_clientinfo" => {| ... | netiomgm_rpc_clientinfo( netiosrv, netiomgm, ... ) },; + "hbnetiomgm_shutdown" => {| ... | netiomgm_rpc_shutdown( netiosrv, netiomgm ) },; + "hbnetiomgm_conninfo" => {| ... | netiomgm_rpc_conninfo( netiosrv ) },; + "hbnetiomgm_adminfo" => {| ... | netiomgm_rpc_conninfo( netiomgm ) },; + "hbnetiomgm_allowadd" => {| ... | netiomgm_rpc_filtermod( netiosrv, netiosrv[ _NETIOSRV_hAllow ], .T., ... ) },; + "hbnetiomgm_allowdel" => {| ... | netiomgm_rpc_filtermod( netiosrv, netiosrv[ _NETIOSRV_hAllow ], .F., ... ) },; + "hbnetiomgm_blockadd" => {| ... | netiomgm_rpc_filtermod( netiosrv, netiosrv[ _NETIOSRV_hBlock ], .T., ... ) },; + "hbnetiomgm_blockdel" => {| ... | netiomgm_rpc_filtermod( netiosrv, netiosrv[ _NETIOSRV_hBlock ], .F., ... ) },; + "hbnetiomgm_allowaddadmin" => {| ... | netiomgm_rpc_filtermod( netiomgm, netiomgm[ _NETIOSRV_hAllow ], .T., ... ) },; + "hbnetiomgm_allowdeladmin" => {| ... | netiomgm_rpc_filtermod( netiomgm, netiomgm[ _NETIOSRV_hAllow ], .F., ... ) },; + "hbnetiomgm_blockaddadmin" => {| ... | netiomgm_rpc_filtermod( netiomgm, netiomgm[ _NETIOSRV_hBlock ], .T., ... ) },; + "hbnetiomgm_blockdeladmin" => {| ... | netiomgm_rpc_filtermod( netiomgm, netiomgm[ _NETIOSRV_hBlock ], .F., ... ) },; + "hbnetiomgm_filters" => {| ... | netiomgm_rpc_filters( netiosrv ) },; + "hbnetiomgm_filtersadmin" => {| ... | netiomgm_rpc_filters( netiomgm ) },; + "hbnetiomgm_filtersave" => {| ... | netiomgm_rpc_filtersave( netiosrv, netiomgm ) },; + "hbnetiomgm_stop" => {| ... | netiomgm_rpc_stop( netiosrv, ... ) },; + "hbnetiomgm_conn" => {| ... | netiomgm_rpc_conn( netiosrv, .T. ) },; + "hbnetiomgm_noconn" => {| ... | netiomgm_rpc_conn( netiosrv, .F. ) },; + "hbnetiomgm_logconn" => {| ... | netiomgm_rpc_logconn( netiosrv, .T. ) },; + "hbnetiomgm_nologconn" => {| ... | netiomgm_rpc_logconn( netiosrv, .F. ) },; + "hbnetiomgm_regnotif" => {| ... | netiomgm_rpc_regnotif( netiomgm, ... ) } }, ; + cPasswordManagement, ; + NIL, ; + NIL, ; + {| pConnectionSocket | netiosrv_callback( netiomgm, netiomgm, pConnectionSocket, .T. ) } ) IF Empty( netiomgm[ _NETIOSRV_pListenSocket ] ) netiosrv_LogEvent( "Warning: Cannot start server management." ) @@ -310,7 +313,9 @@ PROCEDURE netiosrv_Main( lUI, ... ) RETURN STATIC PROCEDURE netiosrv_LogEvent( cText ) + QQOut( hb_TToC( hb_DateTime() ) + " " + cText + hb_eol() ) + RETURN #define _NETIOSRV_SIGNATURE "netiosrv" @@ -319,6 +324,7 @@ STATIC FUNCTION netiosrv_ConfName() RETURN hb_ProgName() + ".config" STATIC FUNCTION netiosrv_ConfSave( netiosrv, netiomgm ) + LOCAL hConf := { => } hb_HKeepOrder( hConf, .T. ) @@ -335,6 +341,7 @@ STATIC FUNCTION netiosrv_ConfSave( netiosrv, netiomgm ) RETURN hb_MemoWrit( netiosrv_ConfName(), hb_Serialize( hConf ) ) STATIC FUNCTION netiosrv_ConfLoad( netiosrv, netiomgm ) + LOCAL hConf := hb_Deserialize( hb_MemoRead( netiosrv_ConfName() ) ) IF HB_ISHASH( hConf ) .AND. ; @@ -365,12 +372,13 @@ STATIC FUNCTION netiosrv_ConfLoad( netiosrv, netiomgm ) RETURN .F. STATIC FUNCTION netiosrv_config( netiosrv, netiomgm ) - LOCAL aArray := {; - hb_StrFormat( "Listening on: %1$s:%2$d" , netiosrv[ _NETIOSRV_cIFAddr ], netiosrv[ _NETIOSRV_nPort] ),; - hb_StrFormat( "Root filesystem: %1$s" , netiosrv[ _NETIOSRV_cRootDir ] ),; - hb_StrFormat( "RPC support: %1$s" , iif( netiosrv[ _NETIOSRV_lRPC ], "enabled", "disabled" ) ),; - hb_StrFormat( "Encryption: %1$s" , iif( netiosrv[ _NETIOSRV_lEncryption ], "enabled", "disabled" ) ),; - hb_StrFormat( "RPC filter module: %1$s" , iif( Empty( netiosrv[ _NETIOSRV_hRPCFHRB ] ), iif( netiosrv[ _NETIOSRV_lRPC ], "not set (WARNING: unsafe open server)", "not set" ), netiosrv[ _NETIOSRV_cRPCFFileName ] ) ) } + + LOCAL aArray := { ; + hb_StrFormat( "Listening on: %1$s:%2$d", netiosrv[ _NETIOSRV_cIFAddr ], netiosrv[ _NETIOSRV_nPort ] ), ; + hb_StrFormat( "Root filesystem: %1$s", netiosrv[ _NETIOSRV_cRootDir ] ), ; + hb_StrFormat( "RPC support: %1$s", iif( netiosrv[ _NETIOSRV_lRPC ], "enabled", "disabled" ) ), ; + hb_StrFormat( "Encryption: %1$s", iif( netiosrv[ _NETIOSRV_lEncryption ], "enabled", "disabled" ) ), ; + hb_StrFormat( "RPC filter module: %1$s", iif( Empty( netiosrv[ _NETIOSRV_hRPCFHRB ] ), iif( netiosrv[ _NETIOSRV_lRPC ], "not set (WARNING: unsafe open server)", "not set" ), netiosrv[ _NETIOSRV_cRPCFFileName ] ) ) } IF ! Empty( netiomgm[ _NETIOSRV_pListenSocket ] ) AAdd( aArray, hb_StrFormat( "Management iface: %1$s:%2$d", netiomgm[ _NETIOSRV_cIFAddr ], netiomgm[ _NETIOSRV_nPort ] ) ) @@ -385,6 +393,7 @@ STATIC FUNCTION netiosrv_config( netiosrv, netiomgm ) #define _CLI_MAX_ 4 STATIC PROCEDURE netiosrv_notifyclients( netiomgm, cMsg ) + LOCAL aClient hb_mutexLock( netiomgm[ _NETIOSRV_mtxNotifStream ] ) @@ -412,6 +421,7 @@ STATIC PROCEDURE netiosrv_notifyclients( netiomgm, cMsg ) /* Server connect callback */ STATIC FUNCTION netiosrv_callback( netiomgm, netiosrv, pConnectionSocket, lManagement ) + LOCAL aAddressPeer LOCAL cAddressPeer LOCAL lBlocked @@ -487,6 +497,7 @@ STATIC FUNCTION netiosrv_callback( netiomgm, netiosrv, pConnectionSocket, lManag RETURN NIL STATIC PROCEDURE netiosrv_conn_register( netiosrv, pConnectionSocket ) + LOCAL nconn[ _NETIOSRV_CONN_MAX_ ] nconn[ _NETIOSRV_CONN_pConnection ] := pConnectionSocket @@ -518,19 +529,20 @@ STATIC PROCEDURE netiosrv_conn_unregister( netiosrv, pConnectionSocket ) /* RPC management interface */ STATIC FUNCTION netiomgm_rpc_regnotif( netiomgm, pConnSock, nStreamID, lRegister ) - LOCAL index := hb_ValToStr( pConnSock ) + + LOCAL cIndex := hb_ValToStr( pConnSock ) LOCAL cli SWITCH PCount() #if 0 CASE 2 - RETURN iif( index $ netiomgm[ _NETIOSRV_hNotifStream ], netiomgm[ _NETIOSRV_hNotifStream ][ index ][ _CLI_xCargo ], NIL ) + RETURN iif( cIndex $ netiomgm[ _NETIOSRV_hNotifStream ], netiomgm[ _NETIOSRV_hNotifStream ][ cIndex ][ _CLI_xCargo ], NIL ) #endif CASE 4 IF ! HB_ISLOGICAL( lRegister ) .OR. ! lRegister hb_mutexLock( netiomgm[ _NETIOSRV_mtxNotifStream ] ) - IF index $ netiomgm[ _NETIOSRV_hNotifStream ] - hb_HDel( netiomgm[ _NETIOSRV_hNotifStream ], index ) + IF cIndex $ netiomgm[ _NETIOSRV_hNotifStream ] + hb_HDel( netiomgm[ _NETIOSRV_hNotifStream ], cIndex ) ENDIF hb_mutexUnlock( netiomgm[ _NETIOSRV_mtxNotifStream ] ) RETURN -1 @@ -541,7 +553,7 @@ STATIC FUNCTION netiomgm_rpc_regnotif( netiomgm, pConnSock, nStreamID, lRegister cli[ _CLI_lNotify ] := .T. cli[ _CLI_nSendErrors ] := 0 hb_mutexLock( netiomgm[ _NETIOSRV_mtxNotifStream ] ) - netiomgm[ _NETIOSRV_hNotifStream ][ index ] := cli + netiomgm[ _NETIOSRV_hNotifStream ][ cIndex ] := cli hb_mutexUnlock( netiomgm[ _NETIOSRV_mtxNotifStream ] ) RETURN nStreamID ENDIF @@ -550,6 +562,7 @@ STATIC FUNCTION netiomgm_rpc_regnotif( netiomgm, pConnSock, nStreamID, lRegister RETURN NIL STATIC FUNCTION netiomgm_rpc_setclientinfo( netiosrv, hInfo ) + LOCAL nconn IF HB_ISHASH( hInfo ) @@ -569,16 +582,17 @@ STATIC FUNCTION netiomgm_rpc_setclientinfo( netiosrv, hInfo ) RETURN NIL STATIC FUNCTION netiomgm_rpc_sysinfo() - RETURN {; - hb_StrFormat( "OS: %1$s" , OS() ) ,; - hb_StrFormat( "Harbour: %1$s" , Version() ) ,; - hb_StrFormat( "C Compiler: %1$s" , hb_Compiler() ) ,; - hb_StrFormat( "Memory (KB): %1$d" , Memory( 0 ) ) } + RETURN { ; + hb_StrFormat( "OS: %1$s", OS() ), ; + hb_StrFormat( "Harbour: %1$s", Version() ), ; + hb_StrFormat( "C Compiler: %1$s", hb_Compiler() ), ; + hb_StrFormat( "Memory (KB): %1$d", Memory( 0 ) ) } STATIC FUNCTION netiomgm_rpc_serverconfig( netiosrv, netiomgm ) RETURN netiosrv_config( netiosrv, netiomgm ) STATIC FUNCTION netiomgm_rpc_logconn( netiosrv, lValue ) + LOCAL lOldValue := netiosrv[ _NETIOSRV_lShowConn ] IF HB_ISLOGICAL( lValue ) @@ -588,6 +602,7 @@ STATIC FUNCTION netiomgm_rpc_logconn( netiosrv, lValue ) RETURN lOldValue STATIC FUNCTION netiomgm_rpc_conn( netiosrv, lValue ) + LOCAL lOldValue := netiosrv[ _NETIOSRV_lAcceptConn ] IF HB_ISLOGICAL( lValue ) @@ -597,6 +612,7 @@ STATIC FUNCTION netiomgm_rpc_conn( netiosrv, lValue ) RETURN lOldValue STATIC FUNCTION netiomgm_rpc_stop( netiosrv, cIPPort ) + LOCAL nconn LOCAL aAddressPeer @@ -625,6 +641,7 @@ STATIC FUNCTION netiomgm_rpc_stop( netiosrv, cIPPort ) RETURN .F. STATIC FUNCTION netiomgm_rpc_clientinfo( netiosrv, netiomgm, cIPPort ) + LOCAL nconn LOCAL aAddressPeer LOCAL xCargo := NIL @@ -644,9 +661,9 @@ STATIC FUNCTION netiomgm_rpc_clientinfo( netiosrv, netiomgm, cIPPort ) netio_srvStatus( nconn[ _NETIOSRV_CONN_pConnection ], NETIO_SRVINFO_PEERADDRESS, @aAddressPeer ) IF cIPPort == AddrToIPPort( aAddressPeer ) - xCargo := nconn[ _NETIOSRV_CONN_hInfo ] - lDone := .T. - EXIT + xCargo := nconn[ _NETIOSRV_CONN_hInfo ] + lDone := .T. + EXIT ENDIF NEXT hb_mutexUnlock( netiosrv[ _NETIOSRV_mtxConnection ] ) @@ -660,8 +677,8 @@ STATIC FUNCTION netiomgm_rpc_clientinfo( netiosrv, netiomgm, cIPPort ) netio_srvStatus( nconn[ _NETIOSRV_CONN_pConnection ], NETIO_SRVINFO_PEERADDRESS, @aAddressPeer ) IF cIPPort == AddrToIPPort( aAddressPeer ) - xCargo := nconn[ _NETIOSRV_CONN_hInfo ] - EXIT + xCargo := nconn[ _NETIOSRV_CONN_hInfo ] + EXIT ENDIF NEXT hb_mutexUnlock( netiomgm[ _NETIOSRV_mtxConnection ] ) @@ -681,6 +698,7 @@ STATIC FUNCTION netiomgm_rpc_shutdown( netiosrv, netiomgm ) RETURN .T. STATIC FUNCTION netiomgm_rpc_conninfo( netiosrv ) + LOCAL nconn LOCAL nStatus @@ -701,19 +719,19 @@ STATIC FUNCTION netiomgm_rpc_conninfo( netiosrv ) aAddressPeer := NIL nStatus := ; - netio_srvStatus( nconn[ _NETIOSRV_CONN_pConnection ], NETIO_SRVINFO_FILESCOUNT , @nFilesCount ) - netio_srvStatus( nconn[ _NETIOSRV_CONN_pConnection ], NETIO_SRVINFO_BYTESSENT , @nBytesSent ) + netio_srvStatus( nconn[ _NETIOSRV_CONN_pConnection ], NETIO_SRVINFO_FILESCOUNT, @nFilesCount ) + netio_srvStatus( nconn[ _NETIOSRV_CONN_pConnection ], NETIO_SRVINFO_BYTESSENT, @nBytesSent ) netio_srvStatus( nconn[ _NETIOSRV_CONN_pConnection ], NETIO_SRVINFO_BYTESRECEIVED, @nBytesReceived ) - netio_srvStatus( nconn[ _NETIOSRV_CONN_pConnection ], NETIO_SRVINFO_PEERADDRESS , @aAddressPeer ) + netio_srvStatus( nconn[ _NETIOSRV_CONN_pConnection ], NETIO_SRVINFO_PEERADDRESS, @aAddressPeer ) - AAdd( aArray, {; - "nThreadID" => nconn[ _NETIOSRV_CONN_nThreadID ],; - "tStart" => nconn[ _NETIOSRV_CONN_tStart ],; - "cStatus" => ConnStatusStr( nStatus ),; - "nFilesCount" => nFilesCount,; - "nBytesSent" => nBytesSent,; - "nBytesReceived" => nBytesReceived,; - "cAddressPeer" => AddrToIPPort( aAddressPeer ),; + AAdd( aArray, { ; + "nThreadID" => nconn[ _NETIOSRV_CONN_nThreadID ], ; + "tStart" => nconn[ _NETIOSRV_CONN_tStart ], ; + "cStatus" => ConnStatusStr( nStatus ), ; + "nFilesCount" => nFilesCount, ; + "nBytesSent" => nBytesSent, ; + "nBytesReceived" => nBytesReceived, ; + "cAddressPeer" => AddrToIPPort( aAddressPeer ), ; "xCargo" => nconn[ _NETIOSRV_CONN_hInfo ] } ) NEXT @@ -722,6 +740,7 @@ STATIC FUNCTION netiomgm_rpc_conninfo( netiosrv ) RETURN aArray STATIC FUNCTION netiomgm_rpc_filtermod( netiosrv, hList, lAdd, cAddress ) + LOCAL lSuccess := .T. hb_mutexLock( netiosrv[ _NETIOSRV_mtxFilters ] ) @@ -745,6 +764,7 @@ STATIC FUNCTION netiomgm_rpc_filtermod( netiosrv, hList, lAdd, cAddress ) RETURN lSuccess STATIC FUNCTION netiomgm_rpc_filters( netiosrv ) + LOCAL cType LOCAL hFilter LOCAL cAddress @@ -755,8 +775,8 @@ STATIC FUNCTION netiomgm_rpc_filters( netiosrv ) FOR EACH cType, hFilter IN { "allow", "block" }, { netiosrv[ _NETIOSRV_hAllow ], netiosrv[ _NETIOSRV_hBlock ] } FOR EACH cAddress IN hFilter - AAdd( aArray, {; - "cType" => cType,; + AAdd( aArray, { ; + "cType" => cType, ; "cAddress" => cAddress:__enumKey() } ) NEXT NEXT @@ -782,6 +802,7 @@ STATIC FUNCTION ConnStatusStr( nStatus ) RETURN "UNKNOWN:" + hb_ntos( nStatus ) STATIC FUNCTION AddrToIPPort( aAddr ) + LOCAL cIP IF HB_ISARRAY( aAddr ) .AND. ; @@ -797,6 +818,7 @@ STATIC FUNCTION AddrToIPPort( aAddr ) /* Helper functions */ STATIC FUNCTION FileSig( cFile ) + LOCAL hFile LOCAL cBuff, cSig, cExt @@ -822,10 +844,11 @@ STATIC PROCEDURE ShowConfig( netiosrv, netiomgm ) STATIC PROCEDURE HB_Logo() - OutStd( "Harbour NETIO Server " + StrTran( Version(), "Harbour " ) + hb_eol() +; - "Copyright (c) 2009-2012, Przemyslaw Czerpak, Viktor Szakats" + hb_eol() + ; - "http://harbour-project.org/" + hb_eol() +; - hb_eol() ) + OutStd( ; + "Harbour NETIO Server " + StrTran( Version(), "Harbour " ) + hb_eol() + ; + "Copyright (c) 2009-2012, Przemyslaw Czerpak, Viktor Szakats" + hb_eol() + ; + "http://harbour-project.org/" + hb_eol() + ; + hb_eol() ) RETURN diff --git a/harbour/contrib/hbnetio/utils/hbnetio/netiosvc.prg b/harbour/contrib/hbnetio/utils/hbnetio/netiosvc.prg index 1d61f0aa4d..7806eb4521 100644 --- a/harbour/contrib/hbnetio/utils/hbnetio/netiosvc.prg +++ b/harbour/contrib/hbnetio/utils/hbnetio/netiosvc.prg @@ -31,6 +31,7 @@ #define _SERVICE_NAME "Harbour_NetIO_Service" PROCEDURE WinMain( ... ) + LOCAL cMode := hb_PValue( 1 ) LOCAL cMsg, nError @@ -86,6 +87,7 @@ PROCEDURE WinMain( ... ) RETURN PROCEDURE hbnetio_WinServiceEntry( ... ) + // LOCAL bSignal := {|| win_serviceGetStatus() != WIN_SERVICE_RUNNING } netiosrv_Main( .F., ... ) /* Non-interactive */ diff --git a/harbour/contrib/hbnf/adapter.prg b/harbour/contrib/hbnf/adapter.prg index da898942b1..50cef9c396 100644 --- a/harbour/contrib/hbnf/adapter.prg +++ b/harbour/contrib/hbnf/adapter.prg @@ -51,4 +51,5 @@ */ FUNCTION FT_ADAPTER() + RETURN iif( IsColor(), 3 /* VGA */, 0 /* monochrome */ ) diff --git a/harbour/contrib/hbnf/any2any.prg b/harbour/contrib/hbnf/any2any.prg index e174864c79..abe2d9aa9d 100644 --- a/harbour/contrib/hbnf/any2any.prg +++ b/harbour/contrib/hbnf/any2any.prg @@ -25,8 +25,8 @@ #define CASE_AT( x, y, z ) z[ At( x, y ) + 1 ] #define NULL "" -#define EARLIEST_DATE SToD( "01000101" ) -#define BLANK_DATE SToD() +#define EARLIEST_DATE hb_SToD( "01000101" ) +#define BLANK_DATE hb_SToD() #define XTOC( x ) CASE_AT( ValType( x ), "CNDLM", ; { NULL, ; diff --git a/harbour/contrib/hbnf/aredit.prg b/harbour/contrib/hbnf/aredit.prg index b43f96ecde..d2fc8cdf9b 100644 --- a/harbour/contrib/hbnf/aredit.prg +++ b/harbour/contrib/hbnf/aredit.prg @@ -131,7 +131,7 @@ FUNCTION FT_ArEdit( nTop, nLeft, nBot, nRight, ; ELSEIF cType == "L" ar[ nDim, nElem ] := .F. ELSEIF cType == "D" - ar[ nDim, nElem ] := SToD() + ar[ nDim, nElem ] := hb_SToD() ENDIF NEXT b:refreshAll() diff --git a/harbour/contrib/hbnf/asum.prg b/harbour/contrib/hbnf/asum.prg index 4029b76991..cba34a3adb 100644 --- a/harbour/contrib/hbnf/asum.prg +++ b/harbour/contrib/hbnf/asum.prg @@ -41,8 +41,8 @@ FUNCTION FT_ASUM( aArray, nStartIndex, nEndIndex ) {| xElement | ; nSumTotal += ; CASE_AT( ValType( xElement ), "NC", ; - { 0, xElement, ; - iif( HB_ISSTRING( xElement ), Len( xElement ), 0 ) } ) }, ; - nStartIndex, nEndIndex - nStartIndex + 1 ) + { 0, xElement, ; + iif( HB_ISSTRING( xElement ), Len( xElement ), 0 ) } ) }, ; + nStartIndex, nEndIndex - nStartIndex + 1 ) RETURN nSumTotal diff --git a/harbour/contrib/hbnf/at2.prg b/harbour/contrib/hbnf/at2.prg index ac6ee1c031..b42c49a7ab 100644 --- a/harbour/contrib/hbnf/at2.prg +++ b/harbour/contrib/hbnf/at2.prg @@ -32,6 +32,7 @@ FUNCTION FT_AT2( cSearch, cTarget, nOccurs, lCaseSens ) LOCAL cSubstr := cTarget // Set default parameters as necessary. + __defaultNIL( @lCaseSens, .T. ) __defaultNIL( @nOccurs, 1 ) @@ -65,6 +66,7 @@ FUNCTION FT_RAT2( cSearch, cTarget, nOccurs, lCaseSens ) LOCAL cSubstr := cTarget // Set default parameters as necessary. + __defaultNIL( @lCaseSens, .T. ) __defaultNIL( @nOccurs, 1 ) diff --git a/harbour/contrib/hbnf/blink.prg b/harbour/contrib/hbnf/blink.prg index 12fbada60e..6c0be7eac6 100644 --- a/harbour/contrib/hbnf/blink.prg +++ b/harbour/contrib/hbnf/blink.prg @@ -25,6 +25,7 @@ /* NOTE: In its original version, this function changed cursor position, in Harbour it doesn't. */ + FUNCTION FT_BLINK( cMsg, nRow, nCol ) LOCAL cSavColor @@ -34,10 +35,11 @@ FUNCTION FT_BLINK( cMsg, nRow, nCol ) cSavColor := SetColor() // If blink colors not already set, add blink to current foreground color. - hb_DispOutAt( iif( nRow == NIL, Row(), nRow ), ; - iif( nCol == NIL, Col(), nCol ), ; - cMsg, ; - iif( "*" $ Left( cSavColor, 4 ), cSavColor, "*" + cSavColor ) ) + hb_DispOutAt( ; + iif( nRow == NIL, Row(), nRow ), ; + iif( nCol == NIL, Col(), nCol ), ; + cMsg, ; + iif( "*" $ Left( cSavColor, 4 ), cSavColor, "*" + cSavColor ) ) ENDIF RETURN NIL diff --git a/harbour/contrib/hbnf/calendar.prg b/harbour/contrib/hbnf/calendar.prg index 5db026c427..e8323dc537 100644 --- a/harbour/contrib/hbnf/calendar.prg +++ b/harbour/contrib/hbnf/calendar.prg @@ -30,10 +30,10 @@ FUNCTION FT_CALENDAR( nRow, nCol, cColor, lShadow, lShowHelp ) LOCAL aRetVal[ 8 ] LOCAL nHelpRow, cSaveHelp, lHelpIsDisplayed := .F. - __defaultNIL( @nRow , 1 ) // check display row - __defaultNIL( @nCol , 63 ) // check display col - __defaultNIL( @cColor , "W+/G" ) // check display color - __defaultNIL( @lShadow , .F. ) // check shadow switch + __defaultNIL( @nRow, 1 ) // check display row + __defaultNIL( @nCol, 63 ) // check display col + __defaultNIL( @cColor, "W+/G" ) // check display color + __defaultNIL( @lShadow, .F. ) // check shadow switch __defaultNIL( @lShowHelp, .F. ) // check help switch nRow := iif( nRow < 1 .OR. nRow > 21, 1, nRow ) // check row bounds @@ -86,7 +86,7 @@ FUNCTION FT_CALENDAR( nRow, nCol, cColor, lShadow, lShowHelp ) IF lShowHelp .AND. ! lHelpIsDisplayed lHelpIsDisplayed := .T. cSaveHelp := SaveScreen( nHelpRow - 1, 1, nHelpRow + 7, 80 ) - FT_XBOX( "L", , , cColor, cColor, nHelpRow, 1, ; + FT_XBOX( "L",,, cColor, cColor, nHelpRow, 1, ; "Home, Up_Arrow or PgUp keys page by day, month or year to a past date.", ; "End, Dn_Arrow or PgDn keys page by day, month or year to a future date.", ; "Left_Arrow or Right_Arrow keys page by week to a past or future date.", ; @@ -101,7 +101,7 @@ FUNCTION FT_CALENDAR( nRow, nCol, cColor, lShadow, lShowHelp ) aRetVal[ 3 ] := Day( Date() + nJump ) aRetVal[ 4 ] := Year( Date() + nJump ) aRetVal[ 5 ] := CMonth( Date() + nJump ) - aRetVal[ 6 ] := CDOW( Date() + nJump ) + aRetVal[ 6 ] := CDoW( Date() + nJump ) aRetVal[ 7 ] := JDOY( aRetVal[ 4 ], aRetVal[ 2 ], aRetVal[ 3 ] ) hb_DispOutAt( nRow, nCol, ; @@ -121,9 +121,9 @@ FUNCTION FT_CALENDAR( nRow, nCol, cColor, lShadow, lShowHelp ) aRetVal[ 8 ] := Time() ENDDO - SetColor( cSavColor ) //restore colors. - SetCursor( cSaveCursor ) //restore cursor. - RestScreen( nRow - 1, nCol - 1, nRow + 3, nCol + 17, cSaveScreen ) //restore screen. + SetColor( cSavColor ) // restore colors. + SetCursor( cSaveCursor ) // restore cursor. + RestScreen( nRow - 1, nCol - 1, nRow + 3, nCol + 17, cSaveScreen ) // restore screen. IF lHelpIsDisplayed RestScreen( nHelpRow - 1, 1, nHelpRow + 7, 80, cSaveHelp ) ENDIF @@ -138,4 +138,5 @@ STATIC FUNCTION JDOY( nYear, nMonth, nDay ) iif( nYear % 4 == 0 .AND. nMonth > 2, 1, 0 ) STATIC FUNCTION VALS( cString, nOffset, nChar ) + RETURN Val( SubStr( cString, nOffset, nChar ) ) diff --git a/harbour/contrib/hbnf/caplock.c b/harbour/contrib/hbnf/caplock.c index 6c71f626c0..6faf9f2c42 100644 --- a/harbour/contrib/hbnf/caplock.c +++ b/harbour/contrib/hbnf/caplock.c @@ -36,7 +36,7 @@ HB_FUNC( FT_CAPLOCK ) { - int iState = 0; + int iState = 0; HB_GT_INFO gtInfo; memset( >Info, 0, sizeof( gtInfo ) ); @@ -51,8 +51,8 @@ HB_FUNC( FT_CAPLOCK ) if( HB_ISLOG( 1 ) ) { int iNewState = hb_parl( 1 ) ? - ( iState | HB_GTI_KBD_CAPSLOCK ) : - ( iState & ~HB_GTI_KBD_CAPSLOCK ); + ( iState | HB_GTI_KBD_CAPSLOCK ) : + ( iState & ~HB_GTI_KBD_CAPSLOCK ); gtInfo.pNewVal = hb_itemPutNI( gtInfo.pNewVal, iNewState ); hb_gtInfo( HB_GTI_KBDSHIFTS, >Info ); } diff --git a/harbour/contrib/hbnf/cint86.c b/harbour/contrib/hbnf/cint86.c index 3f9986221c..15e0837cba 100644 --- a/harbour/contrib/hbnf/cint86.c +++ b/harbour/contrib/hbnf/cint86.c @@ -8,7 +8,7 @@ HB_FUNC( FT_INT86 ) { #if defined( HB_OS_DOS ) { - int iTODO; + int iTODO; } #endif hb_retl( HB_FALSE ); diff --git a/harbour/contrib/hbnf/clrsel.prg b/harbour/contrib/hbnf/clrsel.prg index 196e5e94bf..1e21c29a40 100644 --- a/harbour/contrib/hbnf/clrsel.prg +++ b/harbour/contrib/hbnf/clrsel.prg @@ -57,20 +57,15 @@ #define C_TYPE 3 #define C_CHAR 4 -#translate Single( <t>, <l>, <b>, <r> ) =>; - hb_DispBox( <t>, <l>, <b>, <r>, hb_UTF8ToStrBox( "┌─â”│â”─└│" ) ) +#translate Single( <t>, <l>, <b>, <r> ) => hb_DispBox( <t>, <l>, <b>, <r>, hb_UTF8ToStrBox( "┌─â”│â”─└│" ) ) +#translate Double( <t>, <l>, <b>, <r> ) => hb_DispBox( <t>, <l>, <b>, <r>, hb_UTF8ToStrBox( "â•”â•╗║╝â•╚║" ) ) +#translate BkGrnd( <t>, <l>, <b>, <r>, <c> ) => hb_DispBox( <t>, <l>, <b>, <r>, Replicate( <c>, 9 ) ) -#translate Double( <t>, <l>, <b>, <r> ) =>; - hb_DispBox( <t>, <l>, <b>, <r>, hb_UTF8ToStrBox( "â•”â•╗║╝â•╚║" ) ) - -#translate BkGrnd( <t>, <l>, <b>, <r>, <c> ) =>; - hb_DispBox( <t>, <l>, <b>, <r>, Replicate( <c>, 9 ) ) +// Colour selection routine +// Return -> the same array that was passed but with modified colours FUNCTION FT_ClrSel( aClrs, lColour, cChr ) - // Colour selection routine - // Return -> the same array that was passed but with modified colours - LOCAL aClrOld := AClone( aClrs ) LOCAL aOptions LOCAL nB, nT, nL, nR @@ -94,36 +89,36 @@ FUNCTION FT_ClrSel( aClrs, lColour, cChr ) SetColor( iif( lColour, "GR+/N,,N/N", "W+/N,,N/N" ) ) hb_Scroll() - //.... initialize the colour palette + // .... initialize the colour palette aClrPal := _ftInitPal( iif( lColour, aClrTab, aClrBW ) ) - //.... paint the colours on the screen + // .... paint the colours on the screen _ftShowPal( aClrPal, cChr ) - //.... Determine length of longest name and make sure not greater than 20 + // .... Determine length of longest name and make sure not greater than 20 AEval( aClrs, {| aOpt | nLen := Max( nLen, Len( aOpt[ C_NAME ] ) ) } ) nLen := Min( Max( nLen, 1 ), 20 ) + 2 - //.... prepare an array for use with aChoice(); truncate names at 20 chrs. + // .... prepare an array for use with aChoice(); truncate names at 20 chrs. aPrompt := Array( Len( aClrs ) ) AEval( aClrs, ; {| aOpt, nE | aPrompt[ nE ] := " " + SubStr( aOpt[ C_NAME ], 1, nLen - 2 ) + " " }; ) - //.... determine co-ordinates for the achoice window + // .... determine co-ordinates for the achoice window nT := Max( Int( ( 18 - Len( aPrompt ) ) / 2 ) - 1, 1 ) nB := Min( nT + Len( aPrompt ) + 1, 17 ) nL := Max( Int( ( 27 - nLen ) / 2 ) - 2, 1 ) nR := Min( nL + nLen + 3, 26 ) - //.... set up the window for aChoice + // .... set up the window for aChoice SetColor( iif( lColour, "N/W,W+/R", "N/W,W+/N" ) ) hb_Scroll( nT, nL, nB, nR ) - //.... prompt for colour setting and modify + // .... prompt for colour setting and modify DO WHILE nChoice != 0 Double( nT, nL + 1, nB, nR - 1 ) - nChoice := AChoice( nt + 1, nL + 2, nB - 1, nR - 2, aPrompt, , , nChoice ) + nChoice := AChoice( nt + 1, nL + 2, nB - 1, nR - 2, aPrompt,,, nChoice ) IF nChoice != 0 _ftHiLite( Row(), nL + 2, aPrompt[ nChoice ], nLen ) Single( nT, nL + 1, nB, nR - 1 ) @@ -144,8 +139,6 @@ FUNCTION FT_ClrSel( aClrs, lColour, cChr ) RETURN iif( nChoice == 1, aClrs, aClrOld ) -// - // Highlight the current selected aChoice element // Return -> NIL @@ -157,8 +150,6 @@ STATIC FUNCTION _ftHiLite( nRow, nCol, cStr, nLen ) RETURN NIL -// - // Colour selection for specific type of colour setting // Return -> aOpt with modified colour strings @@ -182,7 +173,7 @@ STATIC FUNCTION _ftColours( aOpt, aClrPal, lColour ) __defaultNIL( @lColour, IsColor() ) - //.... display appropriate prompts based on type of colour setting + // .... display appropriate prompts based on type of colour setting nChoice := 1 DO CASE CASE aOpt[ C_TYPE ] == "D" @@ -197,7 +188,7 @@ STATIC FUNCTION _ftColours( aOpt, aClrPal, lColour ) ENDCASE IF !( aOpt[ C_TYPE ] == "T" ) // no prompt for titles - //.... we need to know top,left,bottom,right for the prompt window + // .... we need to know top,left,bottom,right for the prompt window AEval( aPrompt, {| cPrompt | nLen := Max( nLen, Len( cPrompt ) ) } ) nLen := Max( nLen, Len( aOpt[ C_NAME ] ) + 2 ) nT := iif( aOpt[ C_TYPE ] == "M", 18, 19 ) @@ -205,14 +196,14 @@ STATIC FUNCTION _ftColours( aOpt, aClrPal, lColour ) nL := Max( Int( ( 27 - nLen ) / 2 ) - 2, 1 ) nR := Min( nL + nLen + 3, 26 ) - //.... set up the window for prompt + // .... set up the window for prompt SetColor( "N/W" ) hb_Scroll( nT, nL, nB, nR ) ENDIF DO WHILE .T. - //.... show sample window + // .... show sample window _ftShowIt( aOpt ) IF !( aOpt[ C_TYPE ] == "T" ) // no prompt for titles @@ -228,7 +219,7 @@ STATIC FUNCTION _ftColours( aOpt, aClrPal, lColour ) CASE nChoice == 0 EXIT CASE nChoice == 2 .AND. aOpt[ C_TYPE ] == "D" - //.... desktop character + // .... desktop character aOpt := _ftDeskChar( aOpt ) LOOP CASE nChoice == 4 .AND. !( aOpt[ C_TYPE ] == "M" ) @@ -236,10 +227,10 @@ STATIC FUNCTION _ftColours( aOpt, aClrPal, lColour ) ENDCASE ENDIF - //.... get the specific colour combination + // .... get the specific colour combination aClrs := _ftChr2Arr( aOpt[ C_CLR ] ) // place color string in an array ASize( aClrs, 5 ) // make sure there are 5 settings - //.... empty elements are made NIL so they can be defaulted + // .... empty elements are made NIL so they can be defaulted AEval( aClrs, {| v, e | aClrs[ e ] := iif( Empty( v ), NIL, AllTrim( v ) ) } ) __defaultNIL( @aClrs[ 1 ], "W/N" ) __defaultNIL( @aClrs[ 2 ], "N/W" ) // place default colours into @@ -248,7 +239,7 @@ STATIC FUNCTION _ftColours( aOpt, aClrPal, lColour ) __defaultNIL( @aClrs[ 5 ], "N/W" ) cClr := aClrs[ nChoice ] // selected colour - //.... allow change to specific part of colour string + // .... allow change to specific part of colour string IF !( aOpt[ C_TYPE ] == "T" ) Single( nT, nL + 1, nB, nR - 1 ) hb_DispOutAt( nT, nL + 2, PadC( " " + aOpt[ C_NAME ] + " ", nR - nL - 3, hb_UTF8ToStr( "─" ) ) ) @@ -263,14 +254,12 @@ STATIC FUNCTION _ftColours( aOpt, aClrPal, lColour ) ENDDO - //.... restore the lower 1/2 of screen, and colour + // .... restore the lower 1/2 of screen, and colour RestScreen( 18, 00, MaxRow(), MaxCol(), cScrSav ) SetColor( cColour ) RETURN aOpt -// - // Show an example of the colour setting // Return -> NIL @@ -381,8 +370,6 @@ STATIC FUNCTION _ftShowIt( aOpt ) RETURN NIL -// - // select the colour combination from aClrPal and place in cClr // cClr is the current colour being modified // Return -> selected colour combination @@ -404,7 +391,7 @@ STATIC FUNCTION _ftClrSel( aClrPal, cClr, nElem, aOpt ) SetColor( "W+/N" ) - //.... find the starting row and column for the current colour + // .... find the starting row and column for the current colour FOR nR := 1 TO nDim FOR nC := 1 TO nDim IF aClrPal[ nR, nC ] == AllTrim( cClr ) @@ -424,17 +411,17 @@ STATIC FUNCTION _ftClrSel( aClrPal, cClr, nElem, aOpt ) DO WHILE .T. - //.... make sure array boundary not exceeded + // .... make sure array boundary not exceeded nR := iif( nR > nDim, 1, iif( nR == 0, nDim, nR ) ) nC := iif( nC > nDim, 1, iif( nC == 0, nDim, nC ) ) - //.... place selected colour in the appropriate spot in clr string + // .... place selected colour in the appropriate spot in clr string aOpt[ C_CLR ] := _ftClrPut( aOpt[ C_CLR ], nElem, aClrPal[ nR, nC ] ) - //.... show sample window + // .... show sample window _ftShowIt( aOpt ) - //.... highlight the colour palette element + // .... highlight the colour palette element SetColor( "W+/N" ) hb_DispOutAt( nR, nC * 3 + 26, "" ) /* LOW-ASCII "â–ş" */ hb_DispOutAt( nR, nC * 3 + 29, "" ) /* LOW-ASCII "â—„" */ @@ -442,7 +429,7 @@ STATIC FUNCTION _ftClrSel( aClrPal, cClr, nElem, aOpt ) hb_DispOutAt( nR, nC * 3 + 26, " " ) hb_DispOutAt( nR, nC * 3 + 29, " " ) - //.... check key movement and modify co-ordinates + // .... check key movement and modify co-ordinates DO CASE CASE nKey == K_ESC ; EXIT CASE nKey == K_ENTER ; cClr := aClrPal[ nR, nC ] ; EXIT @@ -459,8 +446,6 @@ STATIC FUNCTION _ftClrSel( aClrPal, cClr, nElem, aOpt ) RETURN cClr -// - // Place a colour setting in the colour string // Return -> modified colour string @@ -472,8 +457,6 @@ STATIC FUNCTION _ftClrPut( cClrStr, nElem, cClr ) RETURN _ftArr2Chr( aClr ) -// - // Select the character to be used for the desktop background // Return -> same array with new character @@ -482,7 +465,7 @@ STATIC FUNCTION _ftDeskChar( aOpt ) LOCAL aChar := { " ", "â–‘", "â–’", "â–“" } LOCAL cChar := aOpt[ C_CHAR ] LOCAL cClr := aOpt[ C_CLR ] - LOCAL nElem := hb_AScan( aChar, cChar, , , .T. ) + LOCAL nElem := hb_AScan( aChar, cChar,,, .T. ) LOCAL n, nKey IF nElem == 0 // this allows another character to be selected @@ -490,7 +473,7 @@ STATIC FUNCTION _ftDeskChar( aOpt ) nElem := 5 // not be available if they ever select another ENDIF // char and store it. It's up to you to put it in - //.... draw the choices on the screen + // .... draw the choices on the screen SetColor( cClr ) FOR n := 1 TO Len( aChar ) hb_DispOutAt( n + 18, 29, Replicate( hb_UTF8ToStr( aChar[ n ] ), 10 ) ) @@ -498,10 +481,10 @@ STATIC FUNCTION _ftDeskChar( aOpt ) n := nElem + 18 DO WHILE .T. - //.... make sure boundary not exeeded + // .... make sure boundary not exeeded n := iif( n > Len( aChar ) + 18, 19, iif( n < 19, Len( aChar ) + 18, n ) ) - //.... show sample window + // .... show sample window aOpt[ C_CHAR ] := aChar[ n - 18 ] // place in array _ftShowIt( aOpt ) @@ -512,7 +495,7 @@ STATIC FUNCTION _ftDeskChar( aOpt ) hb_DispOutAt( n, 28, " " ) hb_DispOutAt( n, 39, " " ) - //.... check key movement and modify co-ordinates + // .... check key movement and modify co-ordinates DO CASE CASE nKey == K_ESC ; aOpt[ C_CHAR ] := cChar ; EXIT CASE nKey == K_ENTER ; EXIT @@ -527,8 +510,6 @@ STATIC FUNCTION _ftDeskChar( aOpt ) RETURN aOpt -// - // Convert a chr string to an array // Return -> array @@ -552,8 +533,6 @@ STATIC FUNCTION _ftChr2Arr( cString, cDelim ) RETURN aArray -// - // convert an array to a chr string // Return -> string @@ -568,8 +547,6 @@ STATIC FUNCTION _ftArr2Chr( aArray, cDelim ) RETURN cString -// - // Paint the palette on the screen // Return -> NIL @@ -581,7 +558,8 @@ STATIC FUNCTION _ftShowPal( aClrPal, cChr ) LOCAL nBottom := nTop + Len( aClrPal ) + 1 LOCAL nRight := nLeft + ( Len( aClrPal ) * 3 ) + 2 - //.... Buffer the screen output + // .... Buffer the screen output + DispBegin() Single( nTop, nLeft, nBottom, nRight ) FOR nF := 1 TO Len( aClrPal ) @@ -594,8 +572,6 @@ STATIC FUNCTION _ftShowPal( aClrPal, cChr ) RETURN NIL -// - // Initialise the colour palette based on the passed colour table aClrTab // Load the palette with colours // Return -> Colour pallette array @@ -616,8 +592,6 @@ STATIC FUNCTION _ftInitPal( aClrTab ) RETURN aClrPal -// - // Compares the contents of 2 arrays // Return -> logical diff --git a/harbour/contrib/hbnf/datecnfg.prg b/harbour/contrib/hbnf/datecnfg.prg index e2e8cc5f54..2332537e80 100644 --- a/harbour/contrib/hbnf/datecnfg.prg +++ b/harbour/contrib/hbnf/datecnfg.prg @@ -28,7 +28,7 @@ FUNCTION FT_DATECNFG( cFYStart, nDow ) - THREAD STATIC t_aDatePar := { SToD( "19800101" ), 1 } + THREAD STATIC t_aDatePar := { hb_SToD( "19800101" ), 1 } LOCAL dCheck diff --git a/harbour/contrib/hbnf/daytobow.prg b/harbour/contrib/hbnf/daytobow.prg index 9659f96ca6..ca6edfd7a3 100644 --- a/harbour/contrib/hbnf/daytobow.prg +++ b/harbour/contrib/hbnf/daytobow.prg @@ -36,7 +36,7 @@ FUNCTION FT_DAYTOBOW( dGivenDate ) dGivenDate := Date() ENDIF - nRetVal := DOW( dGivenDate ) - nDOW_Start + nRetVal := DoW( dGivenDate ) - nDOW_Start IF nRetVal < 0 nRetVal += 7 ENDIF diff --git a/harbour/contrib/hbnf/descendn.c b/harbour/contrib/hbnf/descendn.c index e791779e34..c3bc038636 100644 --- a/harbour/contrib/hbnf/descendn.c +++ b/harbour/contrib/hbnf/descendn.c @@ -25,10 +25,10 @@ HB_FUNC( FT_DESCEND ) { - PHB_ITEM iP = hb_itemParam( 1 ); - HB_TYPE uiType = hb_itemType( iP ); + PHB_ITEM iP = hb_itemParam( 1 ); + HB_TYPE uiType = hb_itemType( iP ); - PHB_ITEM iR = NULL; + PHB_ITEM iR = NULL; if( ( uiType & HB_IT_NUMERIC ) && ( uiType & HB_IT_DOUBLE ) ) iR = hb_itemPutND( 0, 0 - hb_itemGetND( iP ) ); diff --git a/harbour/contrib/hbnf/dhkey.h b/harbour/contrib/hbnf/dhkey.h index 62aafb5805..bfe36882a2 100644 --- a/harbour/contrib/hbnf/dhkey.h +++ b/harbour/contrib/hbnf/dhkey.h @@ -27,48 +27,48 @@ /* cursor movement. for example ctrl-x is 0x18 and it's mapped */ /* to the down arrow. */ -#define UP 5 /* Ctrl-e */ -#define DN 24 /* Ctrl-x */ -#define LFT 19 /* Ctrl-s */ -#define RGT 4 /* Ctrl-d */ -#define CLFT 1 /* Ctrl-a */ -#define CRGT 6 /* Ctrl-f */ -#define HOME 210 -#define ENND 211 -#define PGUP 18 /* Ctrl-r */ -#define PGDN 3 /* Ctrl-c */ -#define INS 22 /* Ctrl-v */ -#define DEL 7 /* Ctrl-g */ -#define ESC 27 /* escape */ -#define RET 13 /* return */ -#define TAB 9 /* horiz. tab */ -#define BKSP 8 /* backspace */ -#define CTRLA 1 /* Ctrl-a */ -#define CTRLB 2 /* Ctrl-b */ -#define CTRLC 3 /* Ctrl-c */ -#define CTRLD 4 /* Ctrl-d */ -#define CTRLE 5 /* Ctrl-e */ -#define CTRLF 6 /* Ctrl-f */ -#define CTRLG 7 /* Ctrl-g */ -#define CTRLH 8 /* Ctrl-h */ -#define CTRLI 9 /* Ctrl-i */ -#define CTRLJ 10 /* Ctrl-j */ -#define CTRLK 11 /* Ctrl-k */ -#define CTRLL 12 /* Ctrl-l */ -#define CTRLM 13 /* Ctrl-m */ -#define CTRLN 14 /* Ctrl-n */ -#define CTRLO 15 /* Ctrl-o */ -#define CTRLP 16 /* Ctrl-p */ -#define CTRLQ 17 /* Ctrl-q */ -#define CTRLR 18 /* Ctrl-r */ -#define CTRLS 19 /* Ctrl-s */ -#define CTRLT 20 /* Ctrl-t */ -#define CTRLU 21 /* Ctrl-u */ -#define CTRLV 22 /* Ctrl-v */ -#define CTRLW 23 /* Ctrl-w */ -#define CTRLX 24 /* Ctrl-x */ -#define CTRLY 25 /* Ctrl-y */ -#define CTRLZ 26 /* Ctrl-z */ +#define UP 5 /* Ctrl-e */ +#define DN 24 /* Ctrl-x */ +#define LFT 19 /* Ctrl-s */ +#define RGT 4 /* Ctrl-d */ +#define CLFT 1 /* Ctrl-a */ +#define CRGT 6 /* Ctrl-f */ +#define HOME 210 +#define ENND 211 +#define PGUP 18 /* Ctrl-r */ +#define PGDN 3 /* Ctrl-c */ +#define INS 22 /* Ctrl-v */ +#define DEL 7 /* Ctrl-g */ +#define ESC 27 /* escape */ +#define RET 13 /* return */ +#define TAB 9 /* horiz. tab */ +#define BKSP 8 /* backspace */ +#define CTRLA 1 /* Ctrl-a */ +#define CTRLB 2 /* Ctrl-b */ +#define CTRLC 3 /* Ctrl-c */ +#define CTRLD 4 /* Ctrl-d */ +#define CTRLE 5 /* Ctrl-e */ +#define CTRLF 6 /* Ctrl-f */ +#define CTRLG 7 /* Ctrl-g */ +#define CTRLH 8 /* Ctrl-h */ +#define CTRLI 9 /* Ctrl-i */ +#define CTRLJ 10 /* Ctrl-j */ +#define CTRLK 11 /* Ctrl-k */ +#define CTRLL 12 /* Ctrl-l */ +#define CTRLM 13 /* Ctrl-m */ +#define CTRLN 14 /* Ctrl-n */ +#define CTRLO 15 /* Ctrl-o */ +#define CTRLP 16 /* Ctrl-p */ +#define CTRLQ 17 /* Ctrl-q */ +#define CTRLR 18 /* Ctrl-r */ +#define CTRLS 19 /* Ctrl-s */ +#define CTRLT 20 /* Ctrl-t */ +#define CTRLU 21 /* Ctrl-u */ +#define CTRLV 22 /* Ctrl-v */ +#define CTRLW 23 /* Ctrl-w */ +#define CTRLX 24 /* Ctrl-x */ +#define CTRLY 25 /* Ctrl-y */ +#define CTRLZ 26 /* Ctrl-z */ /* the following values are mapped into > 128 so that the cannot */ /* be mistaken for an actual keypress, keyin() performs all of */ diff --git a/harbour/contrib/hbnf/dispc.c b/harbour/contrib/hbnf/dispc.c index 6a6a0ccc76..3b94420bf4 100644 --- a/harbour/contrib/hbnf/dispc.c +++ b/harbour/contrib/hbnf/dispc.c @@ -58,45 +58,45 @@ #include "hbapigt.h" #include "hbstack.h" -#define K_STRING 0 -#define K_LIST ( ! K_STRING ) +#define K_STRING 0 +#define K_LIST ( ! K_STRING ) -#define CR ( ( char ) 13 ) -#define LF ( ( char ) 10 ) -#define FEOF ( ( char ) 26 ) +#define CR ( ( char ) 13 ) +#define LF ( ( char ) 10 ) +#define FEOF ( ( char ) 26 ) -#define BUFFERSIZE 4096 /* maximum size of the file buffer */ -#define MAXLINE 255 /* default maximum size of a line */ +#define BUFFERSIZE 4096 /* maximum size of the file buffer */ +#define MAXLINE 255 /* default maximum size of a line */ -#define TABSET 8 +#define TABSET 8 typedef struct { HB_FOFFSET buffoffset; /* offset into buffer of current line */ HB_FOFFSET fsize; /* file size in bytes */ - HB_ISIZ bufftop, buffbot; /* first and last character in buffer */ - int wintop, winbot; /* first and last character in window */ - int winrow, wincol; /* row and column of window highlight */ - int sline, eline; /* start and end line of window */ - int scol, ecol; /* start and end col of window */ - int height, width; /* height and width of window */ + HB_ISIZ bufftop, buffbot; /* first and last character in buffer */ + int wintop, winbot; /* first and last character in window */ + int winrow, wincol; /* row and column of window highlight */ + int sline, eline; /* start and end line of window */ + int scol, ecol; /* start and end col of window */ + int height, width; /* height and width of window */ HB_FHANDLE infile; /* input file handle */ - int maxlin; /* line size */ - HB_ISIZ buffsize; /* buffer size */ - int hlight; /* highlight attribute */ - int norm; /* normal attribute */ - HB_ISIZ kcount; /* number of keys in terminate key list*/ - int colinc; /* col increment amount */ - HB_BOOL bBrowse; /* browse flag */ - HB_BOOL bRefresh; /* HB_TRUE means refresh screen */ - int keylist[ 24 ]; /* terminate key list */ - int keytype; /* K_STRING or K_LIST */ + int maxlin; /* line size */ + HB_ISIZ buffsize; /* buffer size */ + int hlight; /* highlight attribute */ + int norm; /* normal attribute */ + HB_ISIZ kcount; /* number of keys in terminate key list*/ + int colinc; /* col increment amount */ + HB_BOOL bBrowse; /* browse flag */ + HB_BOOL bRefresh; /* HB_TRUE means refresh screen */ + int keylist[ 24 ]; /* terminate key list */ + int keytype; /* K_STRING or K_LIST */ - HB_BOOL bIsAllocated; /* if buffers were allocated */ - char * buffer; /* file buffer pointer */ - char * lbuff; /* line buffer pointer */ + HB_BOOL bIsAllocated; /* if buffers were allocated */ + char * buffer; /* file buffer pointer */ + char * lbuff; /* line buffer pointer */ HB_UCHAR * vseg; /* video segment variable */ - int iCellSize; /* size of one buffer cell */ + int iCellSize; /* size of one buffer cell */ } FT_DISPC, * PFT_DISPC; static HB_TSD_NEW( s_dispc, sizeof( FT_DISPC ), NULL, NULL ); @@ -246,8 +246,8 @@ static void win_align( PFT_DISPC dispc ) { int i; - dispc->winbot = dispc->wintop; /* find out if there is enough text for */ - i = 0; /* full window. */ + dispc->winbot = dispc->wintop; /* find out if there is enough text for */ + i = 0; /* full window. */ while( dispc->winbot < dispc->buffbot && i < dispc->height ) { @@ -262,8 +262,8 @@ static void win_align( PFT_DISPC dispc ) while( dispc->buffer[ dispc->winbot ] != LF && dispc->winbot > dispc->bufftop ) dispc->winbot--; - dispc->wintop = dispc->winbot; - i = 0; /* and setup dispc->wintop */ + dispc->wintop = dispc->winbot; + i = 0; /* and setup dispc->wintop */ while( dispc->wintop > dispc->bufftop && i <= dispc->height ) { @@ -290,8 +290,8 @@ static void disp_update( PFT_DISPC dispc, int offset ) { int line, col, pos, i; - dispc->bRefresh = HB_FALSE; - line = 0; + dispc->bRefresh = HB_FALSE; + line = 0; while( line < dispc->height ) { @@ -333,8 +333,8 @@ static void disp_update( PFT_DISPC dispc, int offset ) *vmem = dispc->lbuff[ i++ ]; } - line += 1; - offset += 2; + line += 1; + offset += 2; } hb_gtRest( dispc->sline, dispc->scol, dispc->eline, dispc->ecol, dispc->vseg ); } @@ -348,11 +348,11 @@ static void disp_update( PFT_DISPC dispc, int offset ) static void winup( PFT_DISPC dispc ) { - int k; - HB_FOFFSET i, j; + int k; + HB_FOFFSET i, j; - dispc->bRefresh = HB_TRUE; - k = dispc->wintop - 3; + dispc->bRefresh = HB_TRUE; + k = dispc->wintop - 3; while( dispc->buffer[ k ] != CR && k > dispc->bufftop ) k--; @@ -362,8 +362,8 @@ static void winup( PFT_DISPC dispc ) if( dispc->buffer[ k ] == CR ) k += 2; - dispc->wintop = k; - k = dispc->winbot - 3; + dispc->wintop = k; + k = dispc->winbot - 3; while( dispc->buffer[ k ] != CR ) k--; @@ -372,8 +372,8 @@ static void winup( PFT_DISPC dispc ) } else if( dispc->bufftop + dispc->buffoffset > 0 && dispc->fsize > dispc->buffsize ) { - i = dispc->buffoffset + dispc->wintop; - j = dispc->buffoffset - ( dispc->buffsize / 2 ); + i = dispc->buffoffset + dispc->wintop; + j = dispc->buffoffset - ( dispc->buffsize / 2 ); if( j < 0 ) j = 0; @@ -395,11 +395,11 @@ static void winup( PFT_DISPC dispc ) static void windown( PFT_DISPC dispc ) { - int k; - HB_FOFFSET i, j; + int k; + HB_FOFFSET i, j; - dispc->bRefresh = HB_TRUE; - k = dispc->winbot; + dispc->bRefresh = HB_TRUE; + k = dispc->winbot; while( dispc->buffer[ k ] != CR && k <= dispc->buffbot ) k++; @@ -407,8 +407,8 @@ static void windown( PFT_DISPC dispc ) if( k <= dispc->buffbot ) { - dispc->winbot = k; - k = dispc->wintop; + dispc->winbot = k; + k = dispc->wintop; while( dispc->buffer[ k ] != CR ) k++; @@ -416,8 +416,8 @@ static void windown( PFT_DISPC dispc ) } else if( ( dispc->buffbot + dispc->buffoffset ) < dispc->fsize && dispc->fsize > dispc->buffsize ) { - i = dispc->buffoffset + dispc->wintop; - j = i; + i = dispc->buffoffset + dispc->wintop; + j = i; if( j > dispc->fsize ) j = dispc->fsize - dispc->buffsize; @@ -465,10 +465,10 @@ static void filetop( PFT_DISPC dispc ) buff_align( dispc ); } - dispc->bRefresh = HB_TRUE; - dispc->wintop = ( int ) dispc->buffoffset; - dispc->winrow = dispc->sline; - dispc->wincol = 0; + dispc->bRefresh = HB_TRUE; + dispc->wintop = ( int ) dispc->buffoffset; + dispc->winrow = dispc->sline; + dispc->wincol = 0; win_align( dispc ); } @@ -484,49 +484,49 @@ static void filebot( PFT_DISPC dispc ) buff_align( dispc ); } - dispc->bRefresh = HB_TRUE; - dispc->wintop = ( int ) dispc->buffbot - 3; - dispc->winrow = dispc->eline; - dispc->wincol = 0; + dispc->bRefresh = HB_TRUE; + dispc->wintop = ( int ) dispc->buffbot - 3; + dispc->winrow = dispc->eline; + dispc->wincol = 0; win_align( dispc ); } HB_FUNC( _FT_DFINIT ) { - PFT_DISPC dispc = ( PFT_DISPC ) hb_stackGetTSD( &s_dispc ); + PFT_DISPC dispc = ( PFT_DISPC ) hb_stackGetTSD( &s_dispc ); - int rval; - HB_ISIZ j; - HB_ISIZ i; - HB_SIZE nSize; + int rval; + HB_ISIZ j; + HB_ISIZ i; + HB_SIZE nSize; - rval = 0; + rval = 0; - dispc->sline = hb_parni( 2 ); /* top row of window */ - dispc->scol = hb_parni( 3 ); /* left col */ - dispc->eline = hb_parni( 4 ); /* bottom row */ - dispc->ecol = hb_parni( 5 ); /* right col */ + dispc->sline = hb_parni( 2 ); /* top row of window */ + dispc->scol = hb_parni( 3 ); /* left col */ + dispc->eline = hb_parni( 4 ); /* bottom row */ + dispc->ecol = hb_parni( 5 ); /* right col */ - dispc->width = dispc->ecol - dispc->scol; /* calc width of window */ - dispc->height = dispc->eline - dispc->sline + 1; /* calc height of window */ + dispc->width = dispc->ecol - dispc->scol; /* calc width of window */ + dispc->height = dispc->eline - dispc->sline + 1; /* calc height of window */ hb_gtRectSize( 0, 0, 0, 0, &nSize ); dispc->iCellSize = ( int ) nSize; hb_gtRectSize( dispc->sline, dispc->scol, dispc->eline, dispc->ecol, &nSize ); - dispc->vseg = ( HB_UCHAR * ) hb_xalloc( nSize ); + dispc->vseg = ( HB_UCHAR * ) hb_xalloc( nSize ); if( dispc->vseg != NULL ) hb_gtSave( dispc->sline, dispc->scol, dispc->eline, dispc->ecol, dispc->vseg ); - dispc->maxlin = hb_parni( 12 ); - dispc->buffsize = hb_parns( 13 ); /* yes - load value */ + dispc->maxlin = hb_parni( 12 ); + dispc->buffsize = hb_parns( 13 ); /* yes - load value */ - dispc->buffer = ( char * ) hb_xalloc( dispc->buffsize ); /* allocate memory */ - dispc->lbuff = ( char * ) hb_xalloc( dispc->maxlin + 1 ); /* for buffers */ + dispc->buffer = ( char * ) hb_xalloc( dispc->buffsize ); /* allocate memory */ + dispc->lbuff = ( char * ) hb_xalloc( dispc->maxlin + 1 ); /* for buffers */ - dispc->bIsAllocated = ! ( dispc->buffer == NULL || dispc->lbuff == NULL || dispc->vseg == NULL ); + dispc->bIsAllocated = ! ( dispc->buffer == NULL || dispc->lbuff == NULL || dispc->vseg == NULL ); /* memory allocated? */ if( ! dispc->bIsAllocated ) { @@ -540,10 +540,10 @@ HB_FUNC( _FT_DFINIT ) } else /* get parameters */ { - dispc->infile = hb_numToHandle( hb_parnint( 1 ) ); /* file handle */ - j = hb_parni( 6 ); /* starting line value */ - dispc->norm = hb_parni( 7 ); /* normal color attribute */ - dispc->hlight = hb_parni( 8 ); /* highlight color attribute */ + dispc->infile = hb_numToHandle( hb_parnint( 1 ) ); /* file handle */ + j = hb_parni( 6 ); /* starting line value */ + dispc->norm = hb_parni( 7 ); /* normal color attribute */ + dispc->hlight = hb_parni( 8 ); /* highlight color attribute */ if( HB_ISARRAY( 9 ) ) { @@ -565,9 +565,9 @@ HB_FUNC( _FT_DFINIT ) dispc->keylist[ i - 1 ] = pszKeys[ i - 1 ]; /* get exit key list */ } - dispc->bBrowse = hb_parl( 10 ); /* get browse flag */ + dispc->bBrowse = hb_parl( 10 ); /* get browse flag */ - dispc->colinc = hb_parni( 11 ); /* column skip value */ + dispc->colinc = hb_parni( 11 ); /* column skip value */ dispc->bufftop = 0; /* init buffer top pointer */ dispc->buffbot = dispc->buffsize; /* init buffer bottom pointer */ @@ -627,19 +627,19 @@ HB_FUNC( _FT_DFCLOS ) HB_FUNC( FT_DISPFILE ) { - PFT_DISPC dispc = ( PFT_DISPC ) hb_stackGetTSD( &s_dispc ); + PFT_DISPC dispc = ( PFT_DISPC ) hb_stackGetTSD( &s_dispc ); - int i; - char rval[ 2 ]; - HB_BOOL bDone; + int i; + char rval[ 2 ]; + HB_BOOL bDone; - int ch; + int ch; /* make sure buffers were allocated and file was opened */ if( dispc->bIsAllocated && dispc->infile > 0 ) { - bDone = HB_FALSE; - dispc->bRefresh = HB_TRUE; + bDone = HB_FALSE; + dispc->bRefresh = HB_TRUE; /* draw inside of window with normal color attribute */ @@ -699,7 +699,7 @@ HB_FUNC( FT_DISPFILE ) case K_LEFT: - dispc->wincol -= dispc->colinc; /* move cursor */ + dispc->wincol -= dispc->colinc; /* move cursor */ dispc->bRefresh = HB_TRUE; /* to the left */ if( dispc->wincol < 0 ) @@ -709,7 +709,7 @@ HB_FUNC( FT_DISPFILE ) case K_RIGHT: - dispc->wincol += dispc->colinc; /* move cursor */ + dispc->wincol += dispc->colinc; /* move cursor */ dispc->bRefresh = HB_TRUE; /* to the right */ if( dispc->wincol > ( dispc->maxlin - dispc->width ) ) @@ -719,7 +719,7 @@ HB_FUNC( FT_DISPFILE ) case K_HOME: - dispc->wincol = 0; /* move cursor */ + dispc->wincol = 0; /* move cursor */ dispc->bRefresh = HB_TRUE; /* to first col */ break; @@ -728,14 +728,14 @@ HB_FUNC( FT_DISPFILE ) case K_END: - dispc->wincol = dispc->maxlin - dispc->width; + dispc->wincol = dispc->maxlin - dispc->width; dispc->bRefresh = HB_TRUE; break; case K_CTRL_LEFT: - dispc->wincol -= 16; /* move cursor */ + dispc->wincol -= 16; /* move cursor */ dispc->bRefresh = HB_TRUE; /* 16 col to left */ if( dispc->wincol < 0 ) @@ -745,7 +745,7 @@ HB_FUNC( FT_DISPFILE ) case K_CTRL_RIGHT: - dispc->wincol += 16; /* move cursor */ + dispc->wincol += 16; /* move cursor */ dispc->bRefresh = HB_TRUE; /* 16 col to right */ if( dispc->wincol > ( dispc->maxlin - dispc->width ) ) @@ -809,8 +809,8 @@ HB_FUNC( FT_DISPFILE ) if( dispc->keytype == K_STRING ) { - rval[ 0 ] = ( char ) ch; - rval[ 1 ] = '\0'; + rval[ 0 ] = ( char ) ch; + rval[ 1 ] = '\0'; hb_retc( rval ); } else diff --git a/harbour/contrib/hbnf/dispmsg.prg b/harbour/contrib/hbnf/dispmsg.prg index be980fe166..afa1d3d80f 100644 --- a/harbour/contrib/hbnf/dispmsg.prg +++ b/harbour/contrib/hbnf/dispmsg.prg @@ -29,6 +29,7 @@ #include "setcurs.ch" // beginning of demo program + FUNCTION FT_DispMsg( aInfo, cKey, nBoxTop, nBoxLeft, cnBoxString, lShadow ) LOCAL xRtnVal := .F. diff --git a/harbour/contrib/hbnf/doc/en/aavg.txt b/harbour/contrib/hbnf/doc/en/aavg.txt index 1af3ea6c15..6ba4eed7a6 100644 --- a/harbour/contrib/hbnf/doc/en/aavg.txt +++ b/harbour/contrib/hbnf/doc/en/aavg.txt @@ -13,10 +13,10 @@ FT_AAVG( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> nAverage $ARGUMENTS$ <aArray> is the array containing the elements to be averaged. - + <nStartIndex> is the first array item to include, defaults to first element. - + <nEndIndex> is the last array element to include, defaults to all elements. $RETURNS$ @@ -24,15 +24,15 @@ $DESCRIPTION$ This function is used to get a numeric average of selected or all elements of an array. - + This routine requires FT_ASUM(). $EXAMPLES$ FT_AAVG( aSubTotals ) // Get Average of Entire Array - + FT_AAVG( aSubTotals, 5 ) // Get Average of 5th Element On - + FT_AAVG( aSubTotals, , 10 ) // Get Average of 1st 10 Elements - + FT_AAVG( aSubTotals, 5, 10 ) // Get Average of Elements 5-10 $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/acctmnth.txt b/harbour/contrib/hbnf/doc/en/acctmnth.txt index 8195a32ea1..77529f34d9 100644 --- a/harbour/contrib/hbnf/doc/en/acctmnth.txt +++ b/harbour/contrib/hbnf/doc/en/acctmnth.txt @@ -14,25 +14,25 @@ $ARGUMENTS$ <dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. - + <nMonthNum> is a number from 1 to 12 signifying a month. Defaults to current month if not supplied. $RETURNS$ A three element array containing the following data: - + aDateInfo[ 1 ] - The year and month as a character string "YYYYMM" aDateInfo[ 2 ] - The beginning date of the accounting month aDateInfo[ 3 ] - The ending date of the accounting month $DESCRIPTION$ FT_ACCTMONTH() creates an array containing data about the accounting month containing the given date. - + An accounting period has the following characteristics: - + If the first week of the period contains 4 or more 'work' days, it is included in the period; otherwise, the first week was included in the prior period. - + If the last week of the period contains 4 or more 'work' days it is included in the period; otherwise, the last week is included in the next period. This results in 13 week @@ -45,7 +45,7 @@ ? aDateInfo[ 1 ] // 199009 (9th month) ? aDateInfo[ 2 ] // 09/02/90 beginning of month 9 ? aDateInfo[ 3 ] // 09/29/90 end of month 9 - + // get info about accounting month 5 in year containing 9/15/90 aDateInfo := FT_ACCTMONTH( SToD( "19900915" ), 5 ) ? aDateInfo[ 1 ] // 199005 diff --git a/harbour/contrib/hbnf/doc/en/acctqtr.txt b/harbour/contrib/hbnf/doc/en/acctqtr.txt index 729fd9582f..89c0337880 100644 --- a/harbour/contrib/hbnf/doc/en/acctqtr.txt +++ b/harbour/contrib/hbnf/doc/en/acctqtr.txt @@ -14,25 +14,25 @@ $ARGUMENTS$ <dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. - + <nQtrNum> is a number from 1 to 4 signifying a quarter. Defaults to current quarter if not supplied. $RETURNS$ A three element array containing the following data: - + aDateInfo[ 1 ] - The year and qtr. as a character string "YYYYQQ" aDateInfo[ 2 ] - The beginning date of the accounting quarter aDateInfo[ 3 ] - The ending date of the accounting quarter $DESCRIPTION$ FT_ACCTQTR() creates an array containing data about the accounting quarter containing the given date. - + An accounting period has the following characteristics: - + If the first week of the period contains 4 or more 'work' days, it is included in the period; otherwise, the first week was included in the prior period. - + If the last week of the period contains 4 or more 'work' days it is included in the period; otherwise, the last week is included in the next period. This results in 13 week @@ -45,7 +45,7 @@ ? aDateInfo[ 1 ] // 199003 (3rd quarter) ? aDateInfo[ 2 ] // 07/01/90 beginning of quarter 3 ? aDateInfo[ 3 ] // 09/29/90 end of quarter 3 - + // get info about accounting qtr. 2 in year containing 9/15/90 aDateInfo := FT_ACCTQTR( SToD( "19900915" ), 2 ) ? aDateInfo[ 1 ] // 199002 diff --git a/harbour/contrib/hbnf/doc/en/acctweek.txt b/harbour/contrib/hbnf/doc/en/acctweek.txt index c7e351836b..ae3577b506 100644 --- a/harbour/contrib/hbnf/doc/en/acctweek.txt +++ b/harbour/contrib/hbnf/doc/en/acctweek.txt @@ -14,25 +14,25 @@ $ARGUMENTS$ <dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. - + <nWeekNum> is a number from 1 to 52 signifying a week. Defaults to current week if not supplied. $RETURNS$ A three element array containing the following data: - + aDateInfo[ 1 ] - The year and week as a character string "YYYYWW" aDateInfo[ 2 ] - The beginning date of the accounting week aDateInfo[ 3 ] - The ending date of the accounting week $DESCRIPTION$ FT_ACCTWEEK() returns an array containing data about the accounting week containing the given date. - + An accounting period has the following characteristics: - + If the first week of the period contains 4 or more 'work' days, it is included in the period; otherwise, the first week was included in the prior period. - + If the last week of the period contains 4 or more 'work' days it is included in the period; otherwise, the last week is included in the next period. This results in 13 week @@ -45,7 +45,7 @@ ? aDateInfo[ 1 ] // 199037 (37th week) ? aDateInfo[ 2 ] // 09/09/90 beginning of week 37 ? aDateInfo[ 3 ] // 09/15/90 end of week 37 - + // get info about accounting week 25 in year containing 9/15/90 aDateInfo := FT_ACCTWEEK( SToD( "19900915" ), 25 ) ? aDateInfo[ 1 ] // 199025 diff --git a/harbour/contrib/hbnf/doc/en/acctyear.txt b/harbour/contrib/hbnf/doc/en/acctyear.txt index f69d9f2969..d4c3cda07d 100644 --- a/harbour/contrib/hbnf/doc/en/acctyear.txt +++ b/harbour/contrib/hbnf/doc/en/acctyear.txt @@ -16,20 +16,20 @@ to current system date if not supplied. $RETURNS$ A three element array containing the following data: - + aDateInfo[ 1 ] - The year as a character string "YYYY" aDateInfo[ 2 ] - The beginning date of the accounting year aDateInfo[ 3 ] - The ending date of the accounting year $DESCRIPTION$ FT_ACCTYEAR() creates an array containing data about the accounting year containing the given date. - + An accounting period has the following characteristics: - + If the first week of the period contains 4 or more 'work' days, it is included in the period; otherwise, the first week was included in the prior period. - + If the last week of the period contains 4 or more 'work' days it is included in the period; otherwise, the last week is included in the next period. This results in 13 week diff --git a/harbour/contrib/hbnf/doc/en/adapter.txt b/harbour/contrib/hbnf/doc/en/adapter.txt index 3de7b06ee1..208701fd85 100644 --- a/harbour/contrib/hbnf/doc/en/adapter.txt +++ b/harbour/contrib/hbnf/doc/en/adapter.txt @@ -15,7 +15,7 @@ None $RETURNS$ Integer representing type of video adapter - + 0 - monochrome 1 - CGA 2 - EGA @@ -23,14 +23,14 @@ $DESCRIPTION$ This function is valuable if you use a graphics library and need to know what type of graphics adapter is installed. - + The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very minor task). $EXAMPLES$ iVideo := FT_ADAPTER() - + DO CASE CASE iVideo == 0 QOut( "You have a monochrome adapter." ) diff --git a/harbour/contrib/hbnf/doc/en/adessort.txt b/harbour/contrib/hbnf/doc/en/adessort.txt index bdcf4de790..3daf1eacdf 100644 --- a/harbour/contrib/hbnf/doc/en/adessort.txt +++ b/harbour/contrib/hbnf/doc/en/adessort.txt @@ -13,10 +13,10 @@ FT_ADESSORT( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> aSorted $ARGUMENTS$ <aArray> is the array to be sorted - + <nStartIndex> is the first array item to include in the sort, defaults to first element - + <nEndIndex> is the last array element to include in the sort, defaults to all elements $RETURNS$ @@ -25,11 +25,11 @@ This function is used to sort an array in descending order, i.e., Z-A $EXAMPLES$ FT_ADESSORT( aNames ) // Sort the Entire Array - + FT_ADESSORT( aNames, 5 ) // Sort from the 5th Element On - + FT_ADESSORT( aNames, , 10 ) // Sort the 1st 10 Elements - + FT_ADESSORT( aNames, 5, 10 ) // Sort Elements 5-10 $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/aemaxlen.txt b/harbour/contrib/hbnf/doc/en/aemaxlen.txt index 1536feca3d..3b8bebc711 100644 --- a/harbour/contrib/hbnf/doc/en/aemaxlen.txt +++ b/harbour/contrib/hbnf/doc/en/aemaxlen.txt @@ -14,13 +14,13 @@ -> nMaxlen $ARGUMENTS$ <aArray> is the array containing the elements to be measured. - + <nDimension> is the array dimension to be measured, defaults to first dimension. - + <nStart> is the starting array element to include, defaults to first array element. - + <nCount> is the number of array elements to process from from <nStart>, defaults to remaining elements in array. @@ -31,15 +31,15 @@ dimension and return the longest element. $EXAMPLES$ FT_AEMAXLEN( aArray ) // Measure the 1st dimension of an Array - + FT_AEMAXLEN( aArray, 2 ) // Measure the 2nd dimension of an Array - + FT_AEMAXLEN( aArray, 2, , 9 ) // Measure Elements 1-9 of the 2nd dimension or subarray - + FT_AEMAXLEN( aArray, 3, 5, 9 ) // Measure Elements 5-9 of the 3rd dimension or subarray - + FT_AEMAXLEN( aArray, 3, 5 ) // Measure Elements 5 to last in the 3rd dimension or subarray $SEEALSO$ diff --git a/harbour/contrib/hbnf/doc/en/aeminlen.txt b/harbour/contrib/hbnf/doc/en/aeminlen.txt index 2b46682a6d..b311e61319 100644 --- a/harbour/contrib/hbnf/doc/en/aeminlen.txt +++ b/harbour/contrib/hbnf/doc/en/aeminlen.txt @@ -14,13 +14,13 @@ -> nMinlen $ARGUMENTS$ <aArray> is the array containing the elements to be measured. - + <nDimension> is the array dimension to be measured, defaults to first dimension. - + <nStart> is the starting array element to include, defaults to first array element. - + <nCount> is the number of array elements to process from from <nStart>, defaults to remaining elements in array. @@ -31,13 +31,13 @@ dimension and return the shortest element. $EXAMPLES$ FT_AEMINLEN( aArray ) // Measure the 1st dimension of an Array - + FT_AEMINLEN( aArray, 2 ) // Measure the 2nd dimension of an Array - + FT_AEMINLEN( aArray, 2, , 9 ) // Measure Elements 1-9 of 2nd dimension - + FT_AEMINLEN( aArray, 3, 5, 9 ) // Measure Elements 5-9 of 3rd dimension - + FT_AEMINLEN( aArray, 3, 5 ) // Measure Elements 5 to end of 3rd dimension $SEEALSO$ FT_AEMAXLEN() diff --git a/harbour/contrib/hbnf/doc/en/amedian.txt b/harbour/contrib/hbnf/doc/en/amedian.txt index b9fff3629a..794966e970 100644 --- a/harbour/contrib/hbnf/doc/en/amedian.txt +++ b/harbour/contrib/hbnf/doc/en/amedian.txt @@ -14,10 +14,10 @@ -> nMedian $ARGUMENTS$ <aArray> is the array containing the elements to be averaged. - + <nStart> is the first array element to include, defaults to first element. - + <nEnd> is the last array element to include, defaults to last element. $RETURNS$ @@ -32,11 +32,11 @@ values in the set. $EXAMPLES$ FT_AMEDIAN( aArray ) // Return Median for entire array - + FT_AMEDIAN( aArray, 2 ) // Return Median for elements from 2 to end - + FT_AMEDIAN( aArray, , 9 ) // Return Median for 1st 9 elements - + FT_AMEDIAN( aArray, 8, 40 ) // Return Median for elements 8 to 40 $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/anomatch.txt b/harbour/contrib/hbnf/doc/en/anomatch.txt index 3e38aa8da7..2b90f28697 100644 --- a/harbour/contrib/hbnf/doc/en/anomatch.txt +++ b/harbour/contrib/hbnf/doc/en/anomatch.txt @@ -14,15 +14,15 @@ [, <nStartIndex> [, <nEndIndex> ] ] ) -> nNoOfMatches $ARGUMENTS$ <aArray> is the array to be searched - + <bCompareBlock> is a code block containing the expression for the array elements to be tested with. Each element is passed as a parameter to the block. If the block returns .T., the number of matches will be incremented by one. - + <nStartIndex> is the first array item to include in the search, defaults to first element. - + <nEndIndex> is the last array element to include in the search, defaults to all elements. $RETURNS$ @@ -33,13 +33,13 @@ $EXAMPLES$ // Search the Entire Array FT_ANOMATCHES( aTries, {| x | x <= 100 } ) - + // Search from the 5th Element On FT_ANOMATCHES( aCodes, {| x | Upper( x ) == cCurrentCode }, 5 ) - + // Search the 1st 10 Elements FT_ANOMATCHES( aDates, {| x | IS_BETWEEN( Date() - 7, x, Date() + 7 ) }, 10 ) - + // Search Elements 5-10 FT_ANOMATCHES( aNames, {| x | x <= cLastGoodName }, 5, 10 ) $END$ diff --git a/harbour/contrib/hbnf/doc/en/any2any.txt b/harbour/contrib/hbnf/doc/en/any2any.txt index a675283d1d..c64fe7766b 100644 --- a/harbour/contrib/hbnf/doc/en/any2any.txt +++ b/harbour/contrib/hbnf/doc/en/any2any.txt @@ -14,10 +14,10 @@ [, <lWantYesNo> ] ) -> xResult $ARGUMENTS$ <xValueToConvert> is the value to convert. - + <cTypeToConvertTo> is the type of value to convert to ("C","D","L","N","A" or "B"). - + <lWantYesNo> is a logical to signal if 'Y' or 'N' is to be returned if Converting a logical, otherwise '.T.' or '.F.' will be returned for logicals. diff --git a/harbour/contrib/hbnf/doc/en/aredit.txt b/harbour/contrib/hbnf/doc/en/aredit.txt index ef4fd6c963..798a0823fa 100644 --- a/harbour/contrib/hbnf/doc/en/aredit.txt +++ b/harbour/contrib/hbnf/doc/en/aredit.txt @@ -14,15 +14,15 @@ <nElem>, <aHeadings>, <aBlocks> [, <bGetFunc> ] ) -> xElement $ARGUMENTS$ <nTop>, <nLeft>, <nBottom>, <nRight> are coordinates for TBrowse - + <Array Name> is name of 2 dimensional to array edit - + <nElem> is pointer for element in array - + <aHeadings> is array of column headings - + <aBlocks> is array of blocks describing each array element - + [ <bGetFunc> ] is get editing function for handling individual elements $RETURNS$ Value of element positioned on when exit FT_AREDIT() @@ -33,43 +33,43 @@ and pass a UDF with information to edit the individual gets. $EXAMPLES$ FT_AREDIT(3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks) - + This example will allow you to browse a 2 dimensional array But you can't edit it since there is no GetBlock UDF It allows the user to hit ENTER to select an element or ESC to return 0 - + * This second example shows how to edit a 2 dimensional array * as might be done to edit an invoice - + LOCAL i, ar[ 3, 26 ], aBlocks[ 3 ], aHeadings[ 3 ] LOCAL nElem := 1, bGetFunc - + * Set up two dimensional array "ar" - + FOR i := 1 TO 26 ar[ 1, i ] := i // 1 -> 26 Numeric ar[ 2, i ] := Chr( Asc( "A" ) + i - 1 ) // "A" -> "Z" Character ar[ 3, i ] := Chr( Asc( "Z" ) - i + 1 ) // "Z" -> "A" Character NEXT - + * SET UP aHeadings Array for column headings - + aHeadings := { "Numbers", "Letters", "Reverse" } - + * Need to set up individual array blocks for each TBrowse column - + aBlocks[ 1 ] := {|| Str( ar[ 1, nElem ], 2 ) } // prevent default 10 spaces aBlocks[ 2 ] := {|| ar[ 2, nElem ] } aBlocks[ 3 ] := {|| ar[ 3, nElem ] } - + * set up TestGet() as the passed Get Function so FT_ArEdit knows how * to edit the individual gets. - + bGetFunc := {| b, ar, nDim, nElem | TestGet( b, ar, nDim, nElem ) } SetColor( "N/W, W/N, , , W/N" ) CLS FT_AREDIT( 3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks, bGetFunc ) - + $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/asum.txt b/harbour/contrib/hbnf/doc/en/asum.txt index 7055bd799c..ce1d34aa77 100644 --- a/harbour/contrib/hbnf/doc/en/asum.txt +++ b/harbour/contrib/hbnf/doc/en/asum.txt @@ -13,10 +13,10 @@ FT_ASUM( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> nSum $ARGUMENTS$ <aArray> is the array containing the elements to be summed. - + <nStartIndex> is the first array item to include, defaults to first element. - + <nEndIndex> is the last array element to include, defaults to all elements. $RETURNS$ @@ -26,11 +26,11 @@ lengths of a character array. $EXAMPLES$ FT_ASUM( aSubTotals ) // Sum the Entire Array - + FT_ASUM( aSubTotals, 5 ) // Sum from the 5th Element On - + FT_ASUM( aSubTotals, , 10 ) // Sum the 1st 10 Elements - + FT_ASUM( aSubTotals, 5, 10 ) // Sum Elements 5-10 $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/at2.txt b/harbour/contrib/hbnf/doc/en/at2.txt index c5fc21b4b3..bae94d5f4a 100644 --- a/harbour/contrib/hbnf/doc/en/at2.txt +++ b/harbour/contrib/hbnf/doc/en/at2.txt @@ -13,12 +13,12 @@ FT_AT2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) -> nPos $ARGUMENTS$ <cSearch> is the character substring to search for. - + <cTarget> is the character string to search. - + <nOccurs> is the occurrence of cSearch to look for, defaults to 1. - + <lCaseSens> is a logical value denoting case sensitivity. If .F., then search is NOT sensitive to case, defaults to .T. @@ -30,11 +30,11 @@ $EXAMPLES$ cSearch := "t" cTarget := "This is the day that the Lord has made." - + FT_AT2( cSearch, cTarget ) // Returns ( 9 ) - + FT_AT2( cSearch, cTarget, 2 ) // Returns ( 17 ) - + FT_AT2( cSearch, cTarget, 2, .F. ) // Returns ( 9 ) $SEEALSO$ FT_FINDITH(), FT_RAT2() @@ -52,12 +52,12 @@ FT_RAT2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) -> nPos $ARGUMENTS$ <cSearch> is the character substring to search for. - + <cTarget> is the character string to search. - + <nOccurs> is the occurrence of cSearch to look for, defaults to 1. - + <lCaseSens> is a logical value denoting case sensitivity. If .F., then search is NOT sensitive to case, defaults to .T. @@ -69,11 +69,11 @@ $EXAMPLES$ cSearch := "t" cTarget := "This is the day that the Lord has made." - + FT_RAT2( cSearch, cTarget ) // Returns ( 22 ) - + FT_RAT2( cSearch, cTarget, 2 ) // Returns ( 20 ) - + FT_RAT2( cSearch, cTarget, 2, .F. ) // Returns ( 22 ) $SEEALSO$ FT_FINDITH(), FT_AT2() diff --git a/harbour/contrib/hbnf/doc/en/bitclr.txt b/harbour/contrib/hbnf/doc/en/bitclr.txt index 30ecf2779d..e7e9e0677d 100644 --- a/harbour/contrib/hbnf/doc/en/bitclr.txt +++ b/harbour/contrib/hbnf/doc/en/bitclr.txt @@ -13,7 +13,7 @@ FT_BITCLR( <cByte>, <nBitPos> ) -> cByte $ARGUMENTS$ <cByte> is a character from Chr(0) to Chr(255). - + <nBitPos> is a number from 0 to 7 conforming to standard right-to-left bit numbering convention and representing the position of the bit within the byte. @@ -24,19 +24,19 @@ In effect, ANDs argument byte with a byte that has all bits set except the target bit. If bit is already clear (0), it remains clear. Note: Calls FT_ISBIT() which is also in this Library. - + This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .c or .asm versions and use the Clipper Extend system. $EXAMPLES$ This code would clear bit 4 in a byte represented by Chr( 115 ): - + cNewByte := FT_BITCLR( Chr( 115 ), 4 ) ? Asc( cNewbyte ) // result: 99 ? cNewByte // result: "c" - + This code would clear bit 5 in the byte represented by letter "A": - + FT_BITCLR( "A", 5 ) // result: "A", since // bit 5 already clear $SEEALSO$ diff --git a/harbour/contrib/hbnf/doc/en/bitset.txt b/harbour/contrib/hbnf/doc/en/bitset.txt index 98363615c3..57fa1a2a79 100644 --- a/harbour/contrib/hbnf/doc/en/bitset.txt +++ b/harbour/contrib/hbnf/doc/en/bitset.txt @@ -13,7 +13,7 @@ FT_BITSET( <cByte>, <nBitPos> ) -> cByte $ARGUMENTS$ <cByte> is a character from Chr(0) to Chr(255). - + <nBitPos> is a number from 0 to 7 conforming to standard right-to-left bit numbering convention and representing the position of the bit within the byte. @@ -24,20 +24,20 @@ In effect, ORs argument byte with a byte that has only the target bit set. If bit is already set, it remains set. Note: Calls FT_ISBIT() which is also in this Library. - + This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .c or .asm versions and use the Clipper Extend system. $EXAMPLES$ This code would set bit 4 in a byte represented by Chr( 107 ): - + cNewbyte := FT_BITSET( Chr( 107 ), 4 ) ? Asc( cNewbyte ) // result: 123 ? cNewbyte // result: "{" - - + + This code would set bit 5 in the byte represented by the letter "A". - + ? FT_BITSET( "A", 5 ) // result: "a" // bit 5 set $SEEALSO$ diff --git a/harbour/contrib/hbnf/doc/en/blink.txt b/harbour/contrib/hbnf/doc/en/blink.txt index 045ee71d95..b3afd65453 100644 --- a/harbour/contrib/hbnf/doc/en/blink.txt +++ b/harbour/contrib/hbnf/doc/en/blink.txt @@ -13,9 +13,9 @@ FT_BLINK( <cMsg>, [ <nRow> ], [ <nCol> ] ) -> NIL $ARGUMENTS$ <cMsg> is the string to blink. - + <nRow> is an optional screen row for @...SAY, default current. - + <nCol> is an optional screen col for @...say, default current. $RETURNS$ NIL @@ -24,7 +24,7 @@ Restores colors on return. $EXAMPLES$ FT_BLINK( "WAIT", 5, 10 ) // Blinks "WAIT" in current colors @ 5,10 - + @ 5,10 SAY "WAIT - Printing Report" FT_BLINK( "..." ) // Blink "..." after wait message... $END$ diff --git a/harbour/contrib/hbnf/doc/en/byt2bit.txt b/harbour/contrib/hbnf/doc/en/byt2bit.txt index 911a5f7e8c..934bf5aa0f 100644 --- a/harbour/contrib/hbnf/doc/en/byt2bit.txt +++ b/harbour/contrib/hbnf/doc/en/byt2bit.txt @@ -22,7 +22,7 @@ Binary representation follows right-to-left convention of bit position numbering, 0 through 7. Space between high and low nibbles for clarity and easy comparison to hexadecimal notation. - + This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .c or .asm versions and use the Clipper Extend system. @@ -30,10 +30,10 @@ These three code lines perform a bitwise AND on bytes with values of Chr(20) and Chr(36), and deliver the result as a string in binary (bit) format. - + ? FT_BYT2BIT( Chr( 20 ) ) // byte1: '0001 0100' ? FT_BYT2BIT( Chr( 36 ) ) // byte2: '0010 0100' - + ? FT_BYT2BIT( FT_BYTEAND( Chr( 20 ), Chr( 36 ) ) ) // result: '0000 0100' $SEEALSO$ diff --git a/harbour/contrib/hbnf/doc/en/byt2hex.txt b/harbour/contrib/hbnf/doc/en/byt2hex.txt index f92db02a43..f69a1427c2 100644 --- a/harbour/contrib/hbnf/doc/en/byt2hex.txt +++ b/harbour/contrib/hbnf/doc/en/byt2hex.txt @@ -19,7 +19,7 @@ faulty. $DESCRIPTION$ Can be used to show results of bit manipulation, both before and after. - + This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .c or .asm versions and use the Clipper Extend system. @@ -27,10 +27,10 @@ These three code lines perform a bitwise AND on bytes with values of Chr(20) and Chr(36), and deliver the result as a string in hexadecimal format, using 'h' to signify hexadecimal. - + ? FT_BYT2HEX( Chr( 20 ) ) // byte1: '14h' ? FT_BYT2HEX( Chr( 36 ) ) // byte2: '24h' - + ? FT_BYT2HEX( FT_BYTEAND( Chr( 20 ), Chr( 36 ) ) ) // result: '04h' $SEEALSO$ diff --git a/harbour/contrib/hbnf/doc/en/byteand.txt b/harbour/contrib/hbnf/doc/en/byteand.txt index cf8e78c1e5..e4ec1139f8 100644 --- a/harbour/contrib/hbnf/doc/en/byteand.txt +++ b/harbour/contrib/hbnf/doc/en/byteand.txt @@ -21,7 +21,7 @@ $DESCRIPTION$ Can be used for any bit-wise masking operation. In effect, this is a bit-by-bit AND operation. Equivalent to AND assembler instruction. - + This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .c or .asm versions and use the Clipper Extend system. @@ -29,7 +29,7 @@ This code would mask out the high nibble (four most significant bits) of the byte represented by Chr(123) and leave the low nibble bits as in the parameter byte. - + cNewbyte := FT_BYTEAND( Chr( 123 ), Chr( 15 ) ) ? Asc( cNewByte ) // result: 11 ? cNewByte // result: non-printable character diff --git a/harbour/contrib/hbnf/doc/en/byteneg.txt b/harbour/contrib/hbnf/doc/en/byteneg.txt index 3a905e41bd..65222b2d63 100644 --- a/harbour/contrib/hbnf/doc/en/byteneg.txt +++ b/harbour/contrib/hbnf/doc/en/byteneg.txt @@ -22,13 +22,13 @@ Can be used for bit-wise byte manipulation. In effect, this is a bit-by-bit NEG (two's complement) operation. Equivalent to NEG assembler instruction. - + This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .c or .asm versions and use the Clipper Extend system. $EXAMPLES$ This code performs a bit-wise NEG on byte represented by Chr( 32 ): - + cNewByte := FT_BYTENOT( Chr( 32 ) ) ? Asc( cNewByte ) // result: 224 $SEEALSO$ diff --git a/harbour/contrib/hbnf/doc/en/bytenot.txt b/harbour/contrib/hbnf/doc/en/bytenot.txt index 793af7b7bb..504206c5da 100644 --- a/harbour/contrib/hbnf/doc/en/bytenot.txt +++ b/harbour/contrib/hbnf/doc/en/bytenot.txt @@ -22,13 +22,13 @@ Can be used for bitwise byte manipulation. In effect, this is a bit-by-bit NOT (one's complement) operation. Equivalent to the NOT assembler instruction. - + This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .c or .asm versions and use the Clipper Extend system. $EXAMPLES$ This code performs a bitwise NOT on byte represented by Chr( 32 ): - + cNewByte := FT_BYTENOT( Chr( 32 ) ) ? Asc( cNewByte ) // result: 223 $SEEALSO$ diff --git a/harbour/contrib/hbnf/doc/en/byteor.txt b/harbour/contrib/hbnf/doc/en/byteor.txt index 5005ad6bd3..7d15c18bd2 100644 --- a/harbour/contrib/hbnf/doc/en/byteor.txt +++ b/harbour/contrib/hbnf/doc/en/byteor.txt @@ -21,14 +21,14 @@ $DESCRIPTION$ Can be used for bit-wise byte manipulation. In effect, this is a bit-by-bit OR operation. Equivalent to OR assembler instruction. - + This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .c or .asm versions and use the Clipper Extend system. $EXAMPLES$ This code performs a bit-wise OR on two bytes represented by Chr( 20 ) and Chr( 10 ): - + cNewByte := FT_BYTEOR( Chr( 20 ), Chr( 10 ) ) ? Asc( cNewByte ) // result: 30 ? cNewByte // result: non-printable character diff --git a/harbour/contrib/hbnf/doc/en/bytexor.txt b/harbour/contrib/hbnf/doc/en/bytexor.txt index e17eaa2d6b..ec7c4cdc00 100644 --- a/harbour/contrib/hbnf/doc/en/bytexor.txt +++ b/harbour/contrib/hbnf/doc/en/bytexor.txt @@ -21,14 +21,14 @@ $DESCRIPTION$ Can be used for bit-wise byte manipulation. In effect, this is a bit-by-bit XOR operation. Equivalent to XOR assembler instruction. - + This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .c or .asm versions and use the Clipper Extend system. $EXAMPLES$ This code performs a bit-wise XOR on two bytes represented by Chr( 32 ) and Chr( 55 ): - + cNewByte := FT_BYTEXOR( Chr( 32 ), Chr( 55 ) ) ? Asc( cNewByte ) // result: 23 ? cNewByte // result: non-printable character diff --git a/harbour/contrib/hbnf/doc/en/calendar.txt b/harbour/contrib/hbnf/doc/en/calendar.txt index 6b58e0ba15..ba48a4641d 100644 --- a/harbour/contrib/hbnf/doc/en/calendar.txt +++ b/harbour/contrib/hbnf/doc/en/calendar.txt @@ -15,32 +15,32 @@ $ARGUMENTS$ <nRow> is an optional screen row for calendar display, default row 1. - + <nCol> is an optional screen col for calendar display, default col 63. - + <cColor> is an optional color string for displayed messages, default is bright white text over green background. - + <lShadow> is an optional logical variable. If true (.T.), it uses FT_SHADOW() to add a transparent shadow to the display, default (.F.). - + <lShowHelp> is an optional logical variable. If true, uses FT_XBOX to display a four line help message if the F1 key is pressed, default (.F.). - + $RETURNS$ aRetVal is an 8 element array containing date, month, day, year, month (in character format), day of the week, julian day and current time. - + $DESCRIPTION$ FT_CALENDAR() simply displays today's date, time and julian day in a two line display with an optional box shadow. Cursor keys may be used to page through the calendar by day, week, month or year increments. Returns an 8 element array of calendar data: - + Element Value [1] Date in current date format. [2] Numeric month number. @@ -50,10 +50,10 @@ [6] Day of the week in character format. [7] Numeric Julian day. [8] Current time in time format. - + WARNING: FT_CALENDAR uses FT_SHADOW and FT_XBOX from the Nanforum Toolkit! - + $EXAMPLES$ LOCAL aRetVal[ 8 ] CLS @@ -66,9 +66,9 @@ ? aRetVal[ 6 ] // Result: Saturday ? aRetVal[ 7 ] // Result: 110 ? aRetVal[ 8 ] // Result: 12:45:20 - + $SEEALSO$ FT_DAYOFYR() - + $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/chdir.txt b/harbour/contrib/hbnf/doc/en/chdir.txt index 133e672947..eff2e228cf 100644 --- a/harbour/contrib/hbnf/doc/en/chdir.txt +++ b/harbour/contrib/hbnf/doc/en/chdir.txt @@ -20,7 +20,7 @@ $DESCRIPTION$ Use this function if you prefer to change the active directory instead of relying on the SET PATH command. - + The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very diff --git a/harbour/contrib/hbnf/doc/en/cint86.txt b/harbour/contrib/hbnf/doc/en/cint86.txt index ebf245b092..96f2595d65 100644 --- a/harbour/contrib/hbnf/doc/en/cint86.txt +++ b/harbour/contrib/hbnf/doc/en/cint86.txt @@ -13,11 +13,11 @@ FT_INT86( <nInterruptNumber>, <aRegisterValues> ) -> lResult $ARGUMENTS$ <nInterruptNumber> is the interrupt to execute. - + <aRegisterValues> is an array that contains values to be loaded into the various CPU registers. The correspondence between registers and array elements is as follows: - + aElement[1] == AX register aElement[2] == BX register aElement[3] == CX register @@ -34,7 +34,7 @@ .F. if invalid parameters passed. If you call this function in protected mode, .F. may also be returned if an allocation of low DOS memory fails. - + n addition, the array elements will contain whatever values were in he CPU registers immediately after the interrupt was executed. If ither of the string parameters were altered by the interrupt, these @@ -43,7 +43,7 @@ It is occasionally useful to be able to call interrupts directly from Clipper, without having to write a separate routine in C or ASM. This function allows you that capability. - + Given Clipper's high-level orientation, this function is necessarily somewhat messy to use. First, declare an array of ten elements to hold the eight values for the CPU registers and two string parameters. @@ -52,14 +52,14 @@ initialize all the elements. For example, if the interrupt requires you to specify values for AX, DX, and DS, you would only need to initialize elements 1, 4, and 8. - + Once you have done the required register setup, call FT_INT86(), passing the interrupt number and the register array as parameters. The function will load the CPU with your specified values, execute the interrupt, and then store the contents of the CPU registers back into your array. This will allow you to evaluate the results of the interrupt. - + Some interrupt services require you to pass the address of a string in a pair of registers. This function is capable of handling these sorts of situations, but it will take a little work on your part. If you need @@ -67,7 +67,7 @@ 8; if you need to pass a string that uses the ES register, store the string in element 9. FT_INT86() will detect that you've supplied a string instead of a numeric value and will behave accordingly. - + That takes care of obtaining the segment portion of the pointer. To specify which register is to contain the offset, use the values REG_DS and REG_ES which are defined in the FTINT86.CH file. When one of these @@ -75,23 +75,23 @@ offset portion of a pointer instead of a numeric value. REG_DS tells FT_Int86() to use the offset of the string in element 8, while REG_ES tells FT_Int86() to use the offset of the string in element 9. - + All the CPU registers are sixteen bits in size. Some, however, are also split into two 8-bit registers. This function is only capable of receiving and returning registers that are 16 bits in size. To split a 16-bit register into two 8-bit values, you can use the pseudo-functions HighByte() and LowByte(), contained in the .CH file. - + To alter an 8-bit number so it will appear in the high-order byte of a register when passed to the FT_INT86() function, use the MakeHI() pseudo-function contained in the .CH file. - + When run in real mode, this function is a shell for __ftint86(), which is written in assembler and does the actual work of executing the interrupt. __ftint86() is callable from C, so feel free to incorporate it into any C routines for which it might be useful. The source for __ftint86() can be found in the file AINT86.ASM. - + When run in protected mode, this function is a shell for cpmiInt86(), which is written in assembler and makes a DPMI call to drop into real mode and execute the interrupt. cpmiInt86() is also callable @@ -101,49 +101,49 @@ $EXAMPLES$ * This example shows how to call the DOS "create file" service. Take * special note of how to set up string parameters. - + #include "ftint86.ch" - + LOCAL aRegs[ 10 ] // Declare the register array aRegs[ AX ] := makehi( 60 ) // DOS service, create file aRegs[ CX ] := 0 // Specify file attribute - + * Pay attention here, this is crucial. Note how to set up the string * so it appears in DS:DX. - + aRegs[ DS ] := "C:\misc\myfile.xxx" aRegs[ DX ] := REG_DS FT_INT86( 33, aRegs ) // Make the call to the DOS interrupt - - + + * This example shows how to call the DOS "get current directory" * service. This one also uses a string parameter, but note that it * uses a different offset register. - + #include "ftint86.ch" - + LOCAL aRegs[ 10 ] aRegs[ AX ] := makehi( 71 ) aRegs[ DX ] := 0 // Choose default drive - + * This service requires a 64-byte buffer whose address is in DS:SI. DOS * will fill the buffer with the current directory. - + aRegs[ DS ] := Space( 64 ) aRegs[ SI ] := REG_DS FT_INT86( 33, aRegs ) - + ? aRegs[ DS ] // Display the directory name - - - + + + * For the sake of completeness, here's an example that doesn't use a * string. This one changes the video mode. - + #include "ftint86.ch" - + LOCAL aRegs[ 10 ] - + aRegs[ AX ] := 16 // Choose hi-res graphics FT_INT86( 16, aRegs ) $INCLUDE$ diff --git a/harbour/contrib/hbnf/doc/en/clrsel.txt b/harbour/contrib/hbnf/doc/en/clrsel.txt index 0c73f236b6..d69d6b12ff 100644 --- a/harbour/contrib/hbnf/doc/en/clrsel.txt +++ b/harbour/contrib/hbnf/doc/en/clrsel.txt @@ -14,33 +14,33 @@ $ARGUMENTS$ <aClrData> is an array of subarrays, with each subarray containing information about the colour settings. - + The subarray has the following structure: - + [1] cName is the name of this colour setting i.e. "Pick List" Maximum length is 20 bytes - + [2] cClrStr is the current colour string Default is "W/N,N/W,N/N,N/N,N/W" - + If Setting type is "M" (Menu) the colours are... 1. Prompt Colour 2. Message Colour 3. HotKey Colour 4. LightBar Colour 5. LightBar HotKey Colour - + Note: While there are many ways to code the individual colour combinations, they should be in the same format that gets returned from SETCOLOR(), so the defaults can be found in the colour palette. - + foreground [+] / background [*] i.e. "GR+/BG*, N/W*, N+/N, , W/N" - + [3] cType is the type of colour setting Default is "W" (Window) - + T = Title Only 1 colour element D = Desktop Background colour and character M = Menu For FT_Menuto() style menus @@ -48,23 +48,23 @@ G = Get For use with @ SAY... B = Browse For tBrowse() and *dbEdit() A = aChoice Pick-lists etc... - + W/G/B/A are functionally the same but will provide a more appropriate test display. - + [4] cFillChar is the character (for desktop background only) Default is Chr(177) "â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’" - - + + <lClrMode> .T. use colour palette .F. use monochrome palette - + Default is the ISCOLOR() setting - + <cTestChr> 2 Byte character string for colour test display - + Default is the Chr(254)+Chr(254) "â– â– " - + $RETURNS$ An array identical to the one passed, with new selected colours $DESCRIPTION$ @@ -78,10 +78,10 @@ LOCAL aClrs := {} LOCAL lColour := IsColor() LOCAL cChr := Chr( 254 ) + Chr( 254 ) - + SET SCOREBOARD Off SETBLINK( .F. ) // Allow bright backgrounds - + *.... a typical application might have the following different settings * normally these would be stored in a .dbf/.dbv aClrs := {; @@ -96,7 +96,7 @@ { "Database Query", "N/BG, N/GR*,,,N+/BG", "B" }, ; { "Pick List", "N/GR*,W+/B,,, BG/GR*", "A" } ; } - + aClrs := FT_ClrSel( aClrs, lColour, cChr ) $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/cntryset.txt b/harbour/contrib/hbnf/doc/en/cntryset.txt index 4f06a62de7..ef21d01d85 100644 --- a/harbour/contrib/hbnf/doc/en/cntryset.txt +++ b/harbour/contrib/hbnf/doc/en/cntryset.txt @@ -23,10 +23,10 @@ and optionally sets it ON or OFF. $EXAMPLES$ lOldState := FT_SETCENTURY() // Get current CENTURY Setting - + lOldState := FT_SETCENTURY( .T. ) // Get the current CENTURY Setting // and turn it on (set it to TRUE) - + lOldState := FT_SETCENTURY( .F. ) // Get the current CENTURY Setting // and turn it off (set it to FALSE) $END$ diff --git a/harbour/contrib/hbnf/doc/en/color2n.txt b/harbour/contrib/hbnf/doc/en/color2n.txt index bf2b1389d0..b987246437 100644 --- a/harbour/contrib/hbnf/doc/en/color2n.txt +++ b/harbour/contrib/hbnf/doc/en/color2n.txt @@ -23,7 +23,7 @@ corresponding number. $EXAMPLES$ nColor := FT_COLOR2N( "gr+/b" ) // returns 30 - + FT_SETATTR( 0, 0, 10, 10, nColor ) $SEEALSO$ FT_N2COLOR() diff --git a/harbour/contrib/hbnf/doc/en/d2e.txt b/harbour/contrib/hbnf/doc/en/d2e.txt index 8880dcd159..9409a1241f 100644 --- a/harbour/contrib/hbnf/doc/en/d2e.txt +++ b/harbour/contrib/hbnf/doc/en/d2e.txt @@ -13,7 +13,7 @@ FT_D2E( <nDec>, <nPrecision> ) -> <cNumE> $ARGUMENTS$ <nDec> Decimal number to convert - + <nPrecision> Number of decimal places in result. Defaults to 6 decimal places. $RETURNS$ @@ -25,9 +25,9 @@ notation is returned. $EXAMPLES$ ? FT_D2E( 12.345, 2 ) -> 1.23E1 - + ? FT_D2E( -12.345, 3 ) -> -1.235E1 - + ? FT_D2E( 0.00000543, 2 ) -> 5.43E-6 $SEEALSO$ FT_E2D() diff --git a/harbour/contrib/hbnf/doc/en/datecnfg.txt b/harbour/contrib/hbnf/doc/en/datecnfg.txt index f3a438efe1..7885909281 100644 --- a/harbour/contrib/hbnf/doc/en/datecnfg.txt +++ b/harbour/contrib/hbnf/doc/en/datecnfg.txt @@ -15,41 +15,41 @@ <cFYStart> is a character date string in the user's system date format, i.e., the same as the user would enter for CTOD(). If this argument is NIL, the current value is unchanged. - + Note: The year portion of the date string must be present and be a valid year; however, it has no real meaning. - + <nDow> is a number from 1 to 7 (1 = Sunday) indicating the desired start of a work week. If this argument is NIL, the current value is unchanged. - + $RETURNS$ A 2-element array containing the following information: - + aDateInfo[1] - an ANSI date string indicating the beginning date of the year. Only the month and day are meaningful. - + aDateInfo[2] - the number of the first day of the week (1 = Sunday) - + $DESCRIPTION$ FT_DATECNFG() is called internally by many of the date functions in the library to determine the beginning of year date and beginning of week day. - + The default beginning of the year is January 1st and the default beginning of the week is Sunday (day 1). Either or both of these settings may be changed by calling FT_DATECNFG() with the proper arguments. They will retain their values for the duration of the program or until they are changed again by a subsequent call to FT_DATECNFG(). - + It is not necessary to call FT_DATECNFG() unless you need to change the defaults. - + FT_DATECNFG() affects the following library functions: - + FT_WEEK() FT_ACCTWEEK() FT_DAYTOBOW() FT_MONTH() FT_ACCTMONTH() FT_DAYOFYR() FT_QTR() FT_ACCTQTR() FT_ACCTADJ() @@ -57,20 +57,20 @@ $EXAMPLES$ // Configure library date functions to begin year on // July 1st. - + FT_DATECNFG( "07/01/80" ) // year is insignificant - + // Examples of return values: - + // System date format: American aArray[1] aArray[2] - + aArray := FT_DATECNFG() // "1980.01.01" 1 (Sun.) aArray := FT_DATECNFG( "07/01/80" ) // "1980.07.01" 1 (Sun.) aArray := FT_DATECNFG( "07/01/80", 2 ) // "1980.07.01" 2 (Mon.) aArray := FT_DATECNFG( , 2 ) // "1980.01.01" 2 (Mon.) - + // System date format: British - + aArray := FT_DATECNFG( "01/07/80", 2 ) // "1980.07.01" 2 (Mon.) $SEEALSO$ FT_ACCTADJ() diff --git a/harbour/contrib/hbnf/doc/en/dayofyr.txt b/harbour/contrib/hbnf/doc/en/dayofyr.txt index a73a8991bb..aaa41dca53 100644 --- a/harbour/contrib/hbnf/doc/en/dayofyr.txt +++ b/harbour/contrib/hbnf/doc/en/dayofyr.txt @@ -15,31 +15,31 @@ $ARGUMENTS$ <dGivenDate> is any valid date in any valid format. Defaults to current system date if not supplied. - + <nDayNum> is a number from 1 to 371, signifying a day of a year. Defaults to current day if not supplied. - + <lIsAcct> is a logical which specifies the type of year to base the return value on: .F. = calendar or fiscal year, .T. = accounting year. $RETURNS$ A three element array containing the following data: - + If <nDayNum> is specified: - + aDateInfo[ 1 ] - The date of the specified day number aDateInfo[ 2 ] - The beginning date of the year aDateInfo[ 3 ] - The ending date of the year - + If <nDayNum> is not specified: - + aDateInfo[ 1 ] - The year and day as a character string "YYYYDDD" aDateInfo[ 2 ] - The beginning date of the year aDateInfo[ 3 ] - The ending date of the year $DESCRIPTION$ FT_DAYOFYR() returns an array containing data about a day in the calendar or fiscal year containing the given date. - + The beginning of year date defaults to January 1st but may be changed with FT_DATECNFG(). $EXAMPLES$ @@ -47,12 +47,12 @@ ? aDateInfo[ 1 ] // 1991090 (90th day of year 1991) ? aDateInfo[ 2 ] // 01/01/91 ? aDateInfo[ 3 ] // 12/31/91 - + aDateInfo := FT_DAYOFYR( , 90 ) // assume current date is 3/31/91 ? aDateInfo[ 1 ] // 03/31/91 (90th day of year) ? aDateInfo[ 2 ] // 01/01/91 ? aDateInfo[ 3 ] // 12/31/91 - + aDateInfo := FT_DAYOFYR( , 90, .T. ) ? aDateInfo[ 1 ] // 03/29/91 (90th day of accounting year) ? aDateInfo[ 2 ] // 12/30/90 (1st day of accounting year) diff --git a/harbour/contrib/hbnf/doc/en/daytobow.txt b/harbour/contrib/hbnf/doc/en/daytobow.txt index 64b65ba457..5de86e2abe 100644 --- a/harbour/contrib/hbnf/doc/en/daytobow.txt +++ b/harbour/contrib/hbnf/doc/en/daytobow.txt @@ -24,11 +24,11 @@ FT_DATECNFG(). $EXAMPLES$ dDate := SToD( "19900915" ) - + ? DOW( dDate ) // 7 ? CDOW( dDate ) // Saturday ? FT_DAYTOBOW( dDate ) // 6 - + // change beginning of week to Friday (yeah!) FT_DATECNFG( , 6 ) ? DOW( dDate ) // 7 diff --git a/harbour/contrib/hbnf/doc/en/default.txt b/harbour/contrib/hbnf/doc/en/default.txt index b8ba273737..daf30b3d37 100644 --- a/harbour/contrib/hbnf/doc/en/default.txt +++ b/harbour/contrib/hbnf/doc/en/default.txt @@ -24,7 +24,7 @@ $EXAMPLES$ cDrive := FT_DEFAULT() // Get the current drive FT_DEFAULT( "C" ) // Switch to drive C - + IF !( FT_DEFAULT( "E" ) == "E" ) QOut( "Drive E does not exist!" ) ENDIF diff --git a/harbour/contrib/hbnf/doc/en/dfile.txt b/harbour/contrib/hbnf/doc/en/dfile.txt index 0be265490f..1de11acb67 100644 --- a/harbour/contrib/hbnf/doc/en/dfile.txt +++ b/harbour/contrib/hbnf/doc/en/dfile.txt @@ -34,21 +34,21 @@ Note: make sure you allocate a buffer large enough to hold enough data for the number of lines that you have in the window. Use the following formula as a guideline: - + buffer size = (# of line) + 1 * RMargin - + This is the smallest you should make the buffer. For normal use, 4096 bytes is recommended $EXAMPLES$ @ 4, 9 TO 11, 71 - + FT_DFSETUP( "test.txt", 5, 10, 10, 70, 1, 7, 15,; "AaBb" + Chr( 143 ), .T., 5, 132, 4096 ) - + cKey := FT_DISPFILE() - + FT_DFCLOSE() - + @ 20, 0 SAY "Key that terminated FT_DISPFILE() was: " + "[" + cKey + "]" $SEEALSO$ FT_DISPFILE() FT_DFCLOSE() @@ -72,14 +72,14 @@ Closes the file opened by FT_DFSETUP() $EXAMPLES$ @ 4, 9 TO 11, 71 - + FT_DFSETUP( "test.txt", 5, 10, 10, 70, 1, 7, 15,; "AaBb" + Chr( 143 ), .T., 5, 132, 4096 ) - + cKey := FT_DISPFILE() - + FT_DFCLOSE() - + @ 20, 0 SAY "Key that terminated FT_DISPFILE() was: " + "[" + cKey + "]" $SEEALSO$ FT_DFSETUP() FT_DISPFILE() diff --git a/harbour/contrib/hbnf/doc/en/diskfunc.txt b/harbour/contrib/hbnf/doc/en/diskfunc.txt index 8a93491e8d..9a6b030f91 100644 --- a/harbour/contrib/hbnf/doc/en/diskfunc.txt +++ b/harbour/contrib/hbnf/doc/en/diskfunc.txt @@ -44,7 +44,7 @@ $DESCRIPTION$ Function to return the available space on the passed drive letter or the default drive if no drive is passed. - + Uses FT_INT86() through the internal function _ftDiskInfo(). $EXAMPLES$ ? FT_DSKFREE() // Returns free space on default drive. diff --git a/harbour/contrib/hbnf/doc/en/dispc.txt b/harbour/contrib/hbnf/doc/en/dispc.txt index 8b9d3c4947..12a9696176 100644 --- a/harbour/contrib/hbnf/doc/en/dispc.txt +++ b/harbour/contrib/hbnf/doc/en/dispc.txt @@ -19,17 +19,17 @@ This routine displays a text file within a defined window using as little memory as possible. The text file to display has to be present or an error value of 0 is returned (as a character.) - + Assumptions: The routine assumes that all lines are terminated with a CR/LF sequence (0x0d and 0x0a). - + Note: Make sure you allocate a buffer large enough to hold enough data for the number of lines that you have in the window. Use the following formula as a guideline - buffer size = (# of line) + 1 * RMargin this is the smallest you should make the buffer and for normal use I recommend 4096 bytes. - + Cursor Keys: Up, Down - moves the highlight line Left, Right - moves the window over nColSkip col's Home - moves the window to the far left @@ -39,9 +39,9 @@ Ctrl-PgDn - moves the highlight to the file bottom Ctrl-Right - moves the window 16 col's to the right Ctrl-Left - moves the window 16 col's to the left - + Esc, Return - terminates the function - + All other keys are ignored unless they are specified within cExitKeys parameter. This list will tell the routine what keys terminate the function. Special @@ -49,14 +49,14 @@ can be found by looking in the keys.h file. $EXAMPLES$ @ 4, 9 TO 11, 71 - + FT_DFSETUP( "test.txt", 5, 10, 10, 70, 1, 7, 15,; "AaBb" + Chr( 143 ), .T., 5, 132, 4096 ) - + cKey := FT_DISPFILE() - + FT_DFCLOSE() - + @ 20, 0 SAY "Key that terminated FT_DISPFILE() was: " + "[" + cKey + "]" $SEEALSO$ FT_DFSETUP() FT_DFCLOSE() diff --git a/harbour/contrib/hbnf/doc/en/dispmsg.txt b/harbour/contrib/hbnf/doc/en/dispmsg.txt index b9f9b6f357..8c17b5658c 100644 --- a/harbour/contrib/hbnf/doc/en/dispmsg.txt +++ b/harbour/contrib/hbnf/doc/en/dispmsg.txt @@ -16,22 +16,22 @@ $ARGUMENTS$ <aMessageArray> is a multidimensional array of messages to be displayed and the color attributes for each message. - + The first dimension of the array contains one or more elements, each representing one line in the message box, up to the maximum number of rows on the screen. - + Within each line of the message individual characters or groups of characters may be delimited with braces ([]). The braces will be stripped out and the character(s) inside those braces will be highlighted. - + The second dimension of the array contains a color attribute for the corresponding element in dimension one, plus one additional element for the color of the box border. Dimension two will always contain one more element than dimension one. If an attribute is omitted, the last color selected will be used. - + <Key2Check> is a character string of one or more keys to check for. If omitted, the message is displayed and control is returned to the calling procedure. If one character is specified, @@ -39,28 +39,28 @@ returns. If multiple characters are specified, FT_DISPMSG() remains in a loop until one of the specified keys has been pressed, then restores the screen and returns. - + <nTopBoxRow> is the upper row for the message box. If omitted, the box is centered vertically. - + <nLeftBoxColumn> is the leftmost column for the box. If omitted, the box is centered horizontally. - + <cnBoxType> is a string of characters or a variable for the box border. See the DISPBOX() function. If omitted, a double box is drawn. - + <lShadow> is a logical variable. If true (.T.) or omitted, it uses FT_SHADOW() to add a transparent shadow to the box. If false (.F.), the box is drawn without the shadow. $RETURNS$ If <Key2Check> is not specified, FT_DISPMSG() will return false (.F.). - + If <Key2Check> is a one-character string, FT_DISPMSG() will return true (.T.) if the user presses that key, or false (.F.) if any other key is pressed. - + If <Key2Check> consists of multiple characters, it will lock the user in a loop until one of those keys are pressed and return the INKEY() value of the keypress. @@ -73,21 +73,21 @@ $EXAMPLES$ The following example displays a simple two-line message and returns immediately to the calling routine. - + FT_DISPMSG( { { "Printing Report" , ; "Press [ESC] To Interrupt" } , ; { "W+/B*", "W/B", "GR+/B" } } ) - + The next example displays a message and waits for a key press. - + FT_DISPMSG( { { "Press [D] To Confirm Deletion" , ; "Or Any Other Key To Abort" } , ; { "W+/B", "W+/B", "GR+/B" } } , ; "D" ) - + The next example displays a one-line message centered on row 5 and returns to the calling procedure. - + FT_DISPMSG( { { "Please Do Not Interrupt" } , ; { "W+/B", "GR+/B" } } , ; , 5, ) diff --git a/harbour/contrib/hbnf/doc/en/dosver.txt b/harbour/contrib/hbnf/doc/en/dosver.txt index 07c6339edc..69dc066a99 100644 --- a/harbour/contrib/hbnf/doc/en/dosver.txt +++ b/harbour/contrib/hbnf/doc/en/dosver.txt @@ -21,12 +21,12 @@ return the current DOS version. It does this by setting up an array corresponding to machine registers and then calling the toolkit function FT_INT86(). - + It returns a character string corresponding to the DOS version, as follows: The major version, a period ("."), then the minor version. - - + + $EXAMPLES$ PROCEDURE Main() ? "Dos version: " + FT_DOSVER() diff --git a/harbour/contrib/hbnf/doc/en/e2d.txt b/harbour/contrib/hbnf/doc/en/e2d.txt index c3c550d9d1..7bb59bb10b 100644 --- a/harbour/contrib/hbnf/doc/en/e2d.txt +++ b/harbour/contrib/hbnf/doc/en/e2d.txt @@ -20,9 +20,9 @@ equivalent is returned. $EXAMPLES$ ? FT_E2D( "1.23E1" ) -> 12.3 - + ? FT_E2D( "-1.235E1" ) -> -12.35 - + ? ft_d2e( "5.43E-6" ) -> 0.0000543 $SEEALSO$ FT_D2E() diff --git a/harbour/contrib/hbnf/doc/en/easter.txt b/harbour/contrib/hbnf/doc/en/easter.txt index 732d5e0c41..7d4b4fea7e 100644 --- a/harbour/contrib/hbnf/doc/en/easter.txt +++ b/harbour/contrib/hbnf/doc/en/easter.txt @@ -20,7 +20,7 @@ Returns the date of Easter for any year after 1582 up to Clipper's limit which the manual states is 9999, but the Guide agrees with the actual imposed limit of 2999. - + This function can be useful in calender type programs that indicate when holidays occur. $EXAMPLES$ diff --git a/harbour/contrib/hbnf/doc/en/elapsed.txt b/harbour/contrib/hbnf/doc/en/elapsed.txt index 2e3386d807..73a11cded2 100644 --- a/harbour/contrib/hbnf/doc/en/elapsed.txt +++ b/harbour/contrib/hbnf/doc/en/elapsed.txt @@ -14,21 +14,21 @@ <cTimeStart>, <cTimeEnd>) -> aTimedata $ARGUMENTS$ <dStart> is any valid date in any date format. Defaults to DATE(). - + <dEnd> is any valid date in any date format. Defaults to DATE(). - + <cTimeStart> is a valid Time string of the format 'hh:mm:ss' where hh is hours in 24-hour format. - + <cTimeEnd> is a valid Time string of the format 'hh:mm:ss' where hh is hours in 24-hour format. $RETURNS$ A two-dimensional array containing elapsed time data. $DESCRIPTION$ FT_ELAPSED() calculates the elapsed time between two Date/Time events. - + It returns an array which contains the following data: - + aRetVal[ 1, 1 ] Integer Days aRetVal[ 1, 2 ] Total Days (nn.nnnn) aRetVal[ 2, 1 ] Integer Hours aRetVal[ 2, 2 ] Total Hours (nn.nnnn) aRetVal[ 3, 1 ] Integer Minutes aRetVal[ 3, 2 ] Total Minutes (nn.nnnn) @@ -36,7 +36,7 @@ $EXAMPLES$ FT_ELAPSED( SToD( "19901128" ), SToD( "19901130" ), "08:00:00", "12:10:30" ) will return: - + aRetVal[ 1, 1 ] -> 2 (Days) aRetVal[ 1, 2 ] -> 2.1740 Days aRetVal[ 2, 1 ] -> 4 (Hours) aRetVal[ 2, 2 ] -> 52.1750 Hours aRetVal[ 3, 1 ] -> 10 (Minutes) aRetVal[ 3, 2 ] -> 3130.5000 Minutes diff --git a/harbour/contrib/hbnf/doc/en/findith.txt b/harbour/contrib/hbnf/doc/en/findith.txt index b7c1e8890d..2457a32119 100644 --- a/harbour/contrib/hbnf/doc/en/findith.txt +++ b/harbour/contrib/hbnf/doc/en/findith.txt @@ -14,11 +14,11 @@ [, <lIgnoreCase> ] ) -> <nStringPosition> $ARGUMENTS$ <cCheckFor> is the string to search for. - + <cCheckIn> is the string to search. - + <nWhichOccurrence> is the number of the occurrence to find. - + <lIgnoreCase> is a logical indicating if the search is to be case sensitive. The default is no case sensitivity (.F.). $RETURNS$ @@ -30,7 +30,7 @@ // Find the Position in cMemoString of // the 10th Occurrence of "the", case // insensitive - + nNextPosition := FT_FINDITH( "the", cMemoString, 10 ) $SEEALSO$ FT_AT2() diff --git a/harbour/contrib/hbnf/doc/en/floptst.txt b/harbour/contrib/hbnf/doc/en/floptst.txt index 4ccc586b60..07713caddb 100644 --- a/harbour/contrib/hbnf/doc/en/floptst.txt +++ b/harbour/contrib/hbnf/doc/en/floptst.txt @@ -25,19 +25,19 @@ ISDRIVE() returns just .T. or .F. depending if the diskette drive is ready or not, FT_FLOPTST() returns a numeric code designating the diskette drive's status. - + FT_FLOPTST() is particularly useful in backup and restore programs that need to test the floppy drive before writing/reading from a floppy disk. - + No testing has been performed on systems with more than 2 floppy drives. If the third drive is "C" and the fourth "D" then there should be no problems. - + This function does not currently check subst'd drives. So if you have SUBST E: A:\ then FT_FLOPTST( Asc( "E" ) - Asc( "A" ) ) == 4 Any suggestions to fix this limitation are appreciated. - + $EXAMPLES$ iStatus := FT_FLOPTST( 0 ) DO CASE diff --git a/harbour/contrib/hbnf/doc/en/ftattr.txt b/harbour/contrib/hbnf/doc/en/ftattr.txt index 8314388aa1..787a0cadbf 100644 --- a/harbour/contrib/hbnf/doc/en/ftattr.txt +++ b/harbour/contrib/hbnf/doc/en/ftattr.txt @@ -21,16 +21,16 @@ This function is similar to Clipper's SaveScreen(), except that it only saves the attribute bytes. This is useful if you want to change the screen color without affecting the text. - + *** INTERNALS ALERT *** - + This function calls the Clipper internal __gtMaxCol to obtain the maximum column value for the current video mode. If you're too gutless to use internals, then this function isn't for you. $EXAMPLES$ // Save attributes of row 4 cBuffer := FT_SAVEATT( 4, 0, 4, MaxCol() ) - + // Save attributes from middle of screen cBuffer := FT_SAVEATT( 10, 20, 14, 59 ) $SEEALSO$ @@ -59,16 +59,16 @@ This function is similar to Clipper's RestScreen(), except that it only restores the attribute bytes. This is useful if you want to change the screen color without affecting the text. - + *** INTERNALS ALERT *** - + This function calls the Clipper internals __gtSave and __gtRest to manipulate the the screen image. If you're too gutless to use internals, then this function isn't for you. $EXAMPLES$ // Restore attributes of row 4 FT_RESTATT( 4, 0, 4, MaxCol(), cBuffer ) - + // Restore attributes to middle of screen FT_RESTATT( 10, 20, 14, 59, cBuffer ) $SEEALSO$ diff --git a/harbour/contrib/hbnf/doc/en/fttext.txt b/harbour/contrib/hbnf/doc/en/fttext.txt index 8b6b65ef69..c226de964e 100644 --- a/harbour/contrib/hbnf/doc/en/fttext.txt +++ b/harbour/contrib/hbnf/doc/en/fttext.txt @@ -11,50 +11,50 @@ Open or close a text file for use by the FT_F* functions $SYNTAX$ FT_FUSE( [ <cFile> ] [, <nMode> ] ) -> nHandle | 0 - + $ARGUMENTS$ ^b<cFile>^n is the text file you want to open. If not specified, the file currently open, if any, will be closed. - + ^b<nMode>^n is the open mode for the file. Please refer to the discussion of open modes under FOPEN() in the Clipper manual and fileio.ch for a list of allowable open modes. If not specified, the file will be opened with a mode of FO_READ + FO_SHARED (64). - + $RETURNS$ If ^b<cFile>^n is passed and the file is opened successfully, an integer containing the text file's workarea. If the file cannot be opened, -1 will be returned. In this case, check the return value of ^bft_fError()^n for the cause of the error. - + If FT_FUSE() is called without any arguments, it will close the text file in the current "text area" and return 0. - + If a read error occurs ^ft_fError()^n will contain the error code. - + $DESCRIPTION$ The FT_F*() file functions are for reading text files, that is, files where each line (record) is delimited by a CRLF pair. - + Each file is opened in its own "workarea", similar to the concept use by dbf files. As provided, a maximum of 10 files (in 10 workareas) can be opened (assuming there are sufficient file handles available). That number may be increased by modifying the #define TEXT_WORKAREAS in the C source code and recompiling. - + $EXAMPLES$ #include "fileio.ch" - + // open a text file for reading ft_fUse( "text.txt" ) - + // open a text file for reading and writing ft_fUse( "text.txt", FO_READWRITE + FO_SHARED ) - + // close file ft_fUse() - + $SEEALSO$ FT_FUSE() FT_FSELECT() $END$ @@ -69,46 +69,46 @@ Select a text file workarea $SYNTAX$ FT_FSELECT( [ <nNewArea> ] ) -> nPreviousArea - + $ARGUMENTS$ ^b<nNewArea>^n is the text file workarea to select. - + $RETURNS$ The current selected text file area. - + $DESCRIPTION$ This function selects a text file "workarea" from 1 to 10. A file may or may not be open in the selected area. - + Passing 0 for ^b<nNewArea>^n selects the next available workarea, similar to Clipper's SELECT 0 command. If no more workareas are available the current workarea is not changed. - + Each file is opened in its own "workarea", similar to the concept used by dbf files. As provided, a maximum of 10 files (in 10 workareas) can be opened (assuming there are sufficient file handles available). That number may be increased by modifying the #define TEXT_WORKAREAS in the C source code and recompiling. - + All the FT_F*() file functions operate on the file in the currently selected text file workarea. - + Text file workareas are separate from and independent of Clipper's database workareas. - + $EXAMPLES$ FT_FSELECT( 1 ) - + nFile1 := FT_FUSE( "temp.c" ) - + ? FT_FLASTRE() // no. of lines in temp.c - + FT_FSELECT( 2 ) - + nFile2 := FT_FUSE( "temp.h" ) - + ? FT_FLASTRE() // no. of lines in temp.h - + $SEEALSO$ FT_FUSE() $END$ @@ -123,34 +123,34 @@ Go to the first record in a text file $SYNTAX$ FT_FGOTOP() -> NIL - + $ARGUMENTS$ None - + $RETURNS$ NIL - + $DESCRIPTION$ This function moves the record pointer to the first record in the currently selected text file workarea. - + A text file "record" is a line of text terminated by a CRLF pair. - + $EXAMPLES$ FT_FUSE( "text.c" ) // open text file - + DO WHILE !FT_FEOF() - + ? FT_FREADLN() // read thru file - + FT_FSKIP() - + ENDDO - + FT_FGOTOP() // go back to top - + ? FT_FRECNO() // 1 - + $SEEALSO$ FT_FSELECT() FT_FUSE() FT_FRECNO() FT_FGOBOT() $END$ @@ -165,30 +165,30 @@ Return the error code for a text file operation $SYNTAX$ FT_FERROR() -> nErrorNo - + $ARGUMENTS$ None - + $RETURNS$ The DOS error code if one occurred. See a reference on DOS error codes for an explanation of what the code means. - + $DESCRIPTION$ This function returns the DOS error code associated with a file operation on the currently selected text file. - + Errors could stem from any open, create, read or write operation, among others. - + $EXAMPLES$ IF ft_fUse( "text.c" ) < 0 // open text file err := ft_fError() ? 'Error opening file "rext.c", error code (' + ; hb_ntos( err ) + ')' ENDIF - + $SEEALSO$ - + $END$ */ @@ -201,34 +201,34 @@ Return the current record number of a text file $SYNTAX$ FT_FRECNO() -> nRecNo - + $ARGUMENTS$ None - + $RETURNS$ The current record number of a text file or 0 if no file is open. - + $DESCRIPTION$ This function returns the current record number of the file open in the currently selected text file workarea. - + A text file "record" is a line of text terminated by a CRLF pair. - + $EXAMPLES$ FT_FUSE( "text.c" ) // open text file - + DO WHILE ! FT_FEOF() - + ? FT_FREADLN() // read thru file - + FT_FSKIP() - + ENDDO - + FT_FGOTOP() // go back to top - + ? FT_FRECNO() // 1 - + $SEEALSO$ FT_FSELECT() FT_FUSE() FT_FGOTOP() FT_FGOBOT() $END$ @@ -243,29 +243,29 @@ Go to the last record in a text file $SYNTAX$ FT_FGOBOT() -> NIL - + $ARGUMENTS$ None - + $RETURNS$ NIL - + $DESCRIPTION$ This function moves the record pointer to the last record of the file in the currently selected text file workarea. - + If a read error occurs ^ft_fError()^n will contain the error code. - + A text file "record" is a line of text terminated by a CRLF pair. - + $EXAMPLES$ // read last line FT_FUSE( "text.c" ) - + FT_FGOBOT() - + ? FT_FREADLN() - + $SEEALSO$ FT_FSELECT() FT_FUSE() FT_FGOTOP() FT_FRECNO() FT_FREADLN() $END$ @@ -280,42 +280,42 @@ Move the record pointer to a new position in a text file $SYNTAX$ FT_FSKIP( [ <nLines> ] ) -> nLinesSkipped - + $ARGUMENTS$ <nLines> is the number of lines to skip. Defaults to 1 if not specified. - + $RETURNS$ The number of lines actually skipped. If the file's EOF or BOF was encountered before ^b<nLines>^n could be skipped, the return value will be less than ^b<nLines>^n. - + $DESCRIPTION$ This function moves the text file record pointer, similar to the CLIPPER SKIP command. - + Use the return value to determine how many records were actually skipped, for example to write a custom skipper function for TBrowse'g text files. - + If a read error occurs ^ft_fError()^n will contain the error code. - + A text file "record" is a line of text terminated by a CRLF pair. - + $EXAMPLES$ // display each record of a text file - + FT_FUSE( "text.c" ) - + DO WHILE ! FT_FEOF() - + ? FT_FREADLN() - + FT_FSKIP() - + ENDDO - - + + $SEEALSO$ FT_FRECNO() FT_FGOTOP() $END$ @@ -330,41 +330,41 @@ Read a line from the currently selected text file $SYNTAX$ FT_FREADLN() -> cLine - + $ARGUMENTS$ None - + $RETURNS$ A string containing the current record in a text file. - + $DESCRIPTION$ This function returns a line of text read from the file in the currently selected text file workarea. Text lines are delimited with a CRLF pair. The record pointer is not moved. - + Currently the maximum record size is 4096 characters. You may increase the maximum record size by changing the value of ^b#define ^bBUFFSIZE^n in the C source and recompiling, however you should consider the performance implications if you do (all read and writes use this buffer size, including ft_fSkip()'s and ft_fGoto()'s). - + If a read error occurs ^ft_fError()^n will contain the error code. - + A text file "record" is a line of text terminated by a CRLF pair. - + $EXAMPLES$ // display each record of a text file - + FT_FUSE( "text.c" ) - + DO WHILE ! FT_FEOF() - + ? FT_FREADLN() - + FT_FSKIP() - + ENDDO - + $SEEALSO$ FT_FUSE() FT_FWRITELN() FT_FRECNO() FT_FGOTOP() $END$ @@ -379,16 +379,16 @@ Deletes a line from the currently selected text file $SYNTAX$ FT_FDELETE( [ <nLines> ] ) -> lSuccess - + $ARGUMENTS$ ^b<nLines>^n is the number of lines to be eliminated, beginning with the current record position. - + If ^b<nLines>^n is omitted, the current record is deleted only. - + $RETURNS$ TRUE if successful, otherwise check ^ft_fError()^n for error code. - + $DESCRIPTION$ This function deletes one or several lines of text from the file in the currently selected text file workarea. Text lines are @@ -396,13 +396,13 @@ unless the deleted lines occur at the end of the file, in which case ^bft_fRecno()^n will equal ^bft_fLastRe()^n and ^bft_fEOF()^n will be set to TRUE. - + $EXAMPLES$ // delete the next 4 lines from a file FT_FUSE( "test.txt" ) - + FT_FDELETE( 4 ) - + $SEEALSO$ FT_FAPPEND() FT_FRECNO() FT_FINSERT() $END$ @@ -417,35 +417,35 @@ Inserts a line in the currently selected text file $SYNTAX$ FT_FINSERT( [ <nLines> ] ) -> lSuccess - + $ARGUMENTS$ ^b<nLines>^n is the number of lines that should be inserted at the current record position. - + If ^b<nLines>^n is omitted, one record is inserted. - + $RETURNS$ ^blSuccess^n is TRUE if the insert succeeded, FALSE if not. If false check the return value of ^bft_fError()^n for the reason. - + $DESCRIPTION$ This function inserts a line of text in the file in the currently selected text file workarea. Text lines are delimited with a CRLF pair. - + The record pointer is not moved. - + A text file "record" is a line of text terminated by a CRLF pair. Each line inserted with this function will be empty. - + $EXAMPLES$ // add a couple of blank lines of text to a file ft_fUse( "test.txt" ) - + ft_fGoTo( 10 ) - + ft_fInsert( 5 ) - + $SEEALSO$ FT_FAPPEND() FT_FRECNO() FT_FDELETE() FT_FLASTRE() $END$ @@ -460,27 +460,27 @@ Appends a line to the currently selected text file $SYNTAX$ FT_FAPPEND( [ < nLines > ] ) -> NIL - + $ARGUMENTS$ <nLines> is the number of lines that should be appended to the end of the currently selected text file. - + If <nLines> is omitted, one record is appended. - + $RETURNS$ lSuccess. If FALSE, check ^bft_fError()^n for the error code. - + $DESCRIPTION$ This function appends a line of text to the file in the currently selected text file workarea. Text lines are delimited with a CRLF pair. The record pointer is moved to the last appended record. - + Multiple lines may be appended with one call to FT_FAPPEND(). - + A text file "record" is a line of text terminated by a CRLF pair. Each line appended with this function will be empty. - + NOTE: Occasionally a text file may contain a non-CRLF terminated line, at the end of the file ("stragglers"). This function assumes these stragglers to be the last line of the file, and begins @@ -488,17 +488,17 @@ last line in the text file is not terminated with a CRLF pair prior to calling FT_FAPPEND(), the function will terminate that last line before appending any new lines. - + $EXAMPLES$ // add a blank line of text to a file FT_FUSE( "test.txt" ) - + ? FT_FRECNO() // displays 5 - + FT_FAPPEND() - + ? FT_FRECNO() // displays 6 - + $SEEALSO$ FT_FRECNO() FT_FDELETE() FT_FINSERT() FT_FLASTRE() $END$ @@ -513,49 +513,49 @@ Write a line to the currently selected text file $SYNTAX$ FT_FWRITELN( < cData >, [ < lInsert > ] ) -> lSuccess - + $ARGUMENTS$ <cData> is a string of data to write to the file at the current record position. - + <lInsert> is a logical indicating whether the contents of the current record are to be preserved, that is, if lInsert evaluates to .T., the a new record is inserted at the current position. The current record then is pushed down to FT_FRECNO()+1. - + If lInsert is .F. or omitted, the current record is replaced by cData. - + $RETURNS$ TRUE if successful, otherwise check ^ft_fError()^n for error code. - + $DESCRIPTION$ This function writes a line of text to the file in the currently selected text file workarea. Text lines are delimited with a CRLF pair. The record pointer is not moved. - + The contents of the current record are updated to reflect the new new line written, unless the Insert option is selected. - + Writing a null string has the effect of clearing the current line if in overstrike mode, else inserting a new line (same as FT_FINSERT()). - + A text file "record" is a line of text terminated by a CRLF pair. - + $EXAMPLES$ // write a line of text to a file - + FT_FUSE( "config.sys" ) - + DO WHILE UPPER( FT_FREADLN() ) != "FILES=" .AND. !F_FEOF() - + FT_FSKIP() - + ENDDO - + FT_FWRITELN( "FILES=30", FT_FEOF() ) - + $SEEALSO$ FT_FREADLN() FT_FRECNO() FT_FINSERT() FT_FDELETE() $END$ @@ -570,25 +570,25 @@ Get the no. of records in the currently selected text file $SYNTAX$ FT_FLASTRE() -> nLastRecordNum - + $ARGUMENTS$ None - + $RETURNS$ An integer containing the number of records in the text file in the currently selected text file workarea, or zero if no file is currently open in the workarea. - + $DESCRIPTION$ This function returns the number of the last record in a text file. - + A text file "record" is a line of text terminated by a CRLF pair. - + $EXAMPLES$ FT_FUSE( "text.c" ) - + ? FT_FLASTRE() - + $SEEALSO$ FT_FUSE() FT_FRECNO() $END$ @@ -603,28 +603,28 @@ Determine if end of text file has been encountered $SYNTAX$ FT_FEOF() -> lResult - + $ARGUMENTS$ None - + $RETURNS$ .T. if an attempt was made to skip past the last record of the currently selected text file, otherwise .F. - + $DESCRIPTION$ This function is similar to the CLIPPER Eof() function. - + A text file "record" is a line of text terminated by a CRLF pair. - + $EXAMPLES$ FT_FUSE( "fttext.c" ) - + ? FT_FEOF() // .F. - + FT_FSKIP() - + ? FT_FEOF() // .T. - + $SEEALSO$ FT_FUSE() FT_FSKIP() $END$ @@ -639,30 +639,30 @@ Determine if attempt to skip past beginning of text file $SYNTAX$ FT_FBOF() -> lResult - + $ARGUMENTS$ None - + $RETURNS$ .T. if an attempt was made to skip past the first record of the currently selected text file, otherwise .F. - + $DESCRIPTION$ This function is similar to the CLIPPER Bof() function. - + A text file "record" is a line of text terminated by a CRLF pair. - + $EXAMPLES$ FT_FUSE( "fttext.c" ) - + FT_FGOTOP() - + ? FT_FBOF() // .F. - + FT_FSKIP( -1 ) - + ? FT_FBOF() // .T. - + $SEEALSO$ FT_FSKIP() FT_EOF() FT_GOTOP() $END$ @@ -677,20 +677,20 @@ Move record pointer to specific record in a text file $SYNTAX$ FT_FGOTO( nLine ) -> NIL - + $ARGUMENTS$ <nLine> is the record number to go to. - + $RETURNS$ NIL - + $DESCRIPTION$ This function moves the record pointer to a specific record in the file in the currently selected text file workarea. If the record number requested is greater than the number of records in the file, the record pointer will be positioned at the last record. - + Internally, the function operates differently depending on how you invoke it. Passing a value for ^b<nLine>^n results in what is effectively a skip operation, which is fairly quick. However @@ -699,18 +699,18 @@ required number of records. Hence if your file is relatively large and the current record is a high number, you may see some delay as ft_fGoTo(0) skips through the file. - + A text file "record" is a line of text terminated by a CRLF pair. - + $EXAMPLES$ // read 5th line of text from file - + ft_fUse( "fttext.c" ) - + ft_fGoTo(5) - + cText := ft_fReadLN() - + $SEEALSO$ FT_FRECNO() FT_FGOTOP() FT_FREADLN() $END$ diff --git a/harbour/contrib/hbnf/doc/en/gcd.txt b/harbour/contrib/hbnf/doc/en/gcd.txt index 1b2f5c0bc5..24beb8465d 100644 --- a/harbour/contrib/hbnf/doc/en/gcd.txt +++ b/harbour/contrib/hbnf/doc/en/gcd.txt @@ -13,7 +13,7 @@ FT_GCD( <nNumber1>, <nNumber2> ) -> nGCD $ARGUMENTS$ <nNumber1> is the first number to find the GCD of. - + <nNumber2> is the second number to find the GCD of. $RETURNS$ The greatest common divisor of the 2 numbers, or 0 if either is 0. diff --git a/harbour/contrib/hbnf/doc/en/getenvrn.txt b/harbour/contrib/hbnf/doc/en/getenvrn.txt index 5a3740371f..d2475f0ab7 100644 --- a/harbour/contrib/hbnf/doc/en/getenvrn.txt +++ b/harbour/contrib/hbnf/doc/en/getenvrn.txt @@ -13,21 +13,21 @@ FT_GETE( [ @<xReceiveVar> ] ) -> nNumStrings $ARGUMENTS$ <xReceiveVar> is the variable to receive the environment data. - + <xReceiveVar> can be a character type variable, in which case the function will place all environment strings in the variable separated by carriage return/line feeds (chr 13 + Chr(10)). - + <xReceiveVar> can be an array type, in which case the function will place each string in an array element. The array MUST be declared with the proper number of elements prior to passing it to the function. This can be done by calling FT_GETE() without parameters first to get the number of strings in the environment. - + Note that the argument MUST be passed by reference. Since arrays are by nature passed by reference, the "@" symbol is optional when passing an array. - + If no argument is passed, FT_GETE() merely returns the number of strings in the environment. $RETURNS$ @@ -42,21 +42,21 @@ desired, use Clipper's built-in GETE() function. $EXAMPLES$ Get the environment in text form and browse it: - + cEnvBlock := "" nNumStrings := FT_GETE( @cEnvBlock ) @ 0, 0 TO MaxRow() - 1, MaxCol() @ MaxRow(), 0 SAY 'Browse strings, press ESC to exit...' MemoWrit( cEnvBlock, 1, 1, MaxRow() - 2, MaxCol() - 1, .F. ) - + Get the environment in text form and write it to a file: - + cEnvBlock := "" FT_GETE( @cEnvBlock ) MEMOWRIT( "environ.txt", cEnvBlock ) - + Get the environment in Array form: - + aEnvArray := Array( FT_GETE() ) FT_GETE( aEnvArray ) ? aEnvArray[ 1 ] // "COMSPEC=C:\command.com" diff --git a/harbour/contrib/hbnf/doc/en/hex2dec.txt b/harbour/contrib/hbnf/doc/en/hex2dec.txt index 17e1713795..a81fd4cd58 100644 --- a/harbour/contrib/hbnf/doc/en/hex2dec.txt +++ b/harbour/contrib/hbnf/doc/en/hex2dec.txt @@ -20,7 +20,7 @@ Useful for using FT_INT86(). $EXAMPLES$ FT_INT86( HEX2DEC( "21" ), aRegs ) - + Converts 21h, the Dos Interrupt, to its decimal equivalent, 33, for use by FT_INT86(). $END$ diff --git a/harbour/contrib/hbnf/doc/en/iamidle.txt b/harbour/contrib/hbnf/doc/en/iamidle.txt index 10f7eb3255..f1c7a56a2d 100644 --- a/harbour/contrib/hbnf/doc/en/iamidle.txt +++ b/harbour/contrib/hbnf/doc/en/iamidle.txt @@ -20,7 +20,7 @@ function more efficiently when applications release the CPU during idle states. This function allows you "announce" to the operating system that your application is idle. - + Note that if you use this function in conjunction with FT_OnIdle(), you can cause Clipper to automatically release the CPU whenever Clipper itself detects an idle state. @@ -28,11 +28,11 @@ DO WHILE Inkey() != K_ESC FT_IAmIdle() // Wait for ESC and announce idleness ENDDO - + * Here's another way to do it: - + FT_OnIdle( {|| FT_IAmIdle() } ) - + Inkey( 0 ) // Automatically reports idleness until key // is pressed! $SEEALSO$ diff --git a/harbour/contrib/hbnf/doc/en/idle.txt b/harbour/contrib/hbnf/doc/en/idle.txt index a71834753c..8d19e0d860 100644 --- a/harbour/contrib/hbnf/doc/en/idle.txt +++ b/harbour/contrib/hbnf/doc/en/idle.txt @@ -20,22 +20,22 @@ the way of idle states, the Clipper runtime may not get a chance to perform garbage collection of discarded memory. This can eventually lead to any of a variety of memory-related internal errors. - + This function attempts to alleviate the problem by providing a mechanism by which an idle event can be artifically generated at will. The idle event will cause the CA-Cl*pper runtime to perform an incremental memory scavenge. - + This function makes use of an undocumented interal routine. If this this fact makes you uncomfortable then don't use this function, you miserable jello-spined lump of human debris. $EXAMPLES$ DO WHILE Whatever // Some batch process - + Something() // Create 'n' discard a bunch of stuff - + FT_Idle() // Take out the garbage - + ENDDO $SEEALSO$ FT_OnIdle() diff --git a/harbour/contrib/hbnf/doc/en/inp.txt b/harbour/contrib/hbnf/doc/en/inp.txt index effbf5705c..92cc3355f9 100644 --- a/harbour/contrib/hbnf/doc/en/inp.txt +++ b/harbour/contrib/hbnf/doc/en/inp.txt @@ -19,7 +19,7 @@ $DESCRIPTION$ It may sometimes be useful to read a byte from a port without having to resort to C or assembler. This function allows you to do so. - + The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very diff --git a/harbour/contrib/hbnf/doc/en/isbit.txt b/harbour/contrib/hbnf/doc/en/isbit.txt index 904fea43e1..91d4a4edfb 100644 --- a/harbour/contrib/hbnf/doc/en/isbit.txt +++ b/harbour/contrib/hbnf/doc/en/isbit.txt @@ -13,7 +13,7 @@ FT_ISBIT( <cByte>, <nBitPos> ) -> lResult $ARGUMENTS$ <cByte> is a character from Chr(0) to Chr(255) - + <nBitPos> is a number from 0 to 7 conforming to standard right-to-left bit-numbering convention and representing the position of the bit within the byte. @@ -24,20 +24,20 @@ Tests for status of any selected bit in the byte passed as a parameter. Byte must be presented in Chr() form, as a literal constant, or as the one-byte character result of an expression. - + This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .c or .asm versions and use the Clipper Extend system. $EXAMPLES$ This code tests whether bit 3 is set in the byte represented by Chr( 107 ): - + lBitflag := FT_ISBIT( Chr( 107 ), 3 ) ? lBitflag // result: .T. - + This code tests whether bit 5 is set in the byte represented by ASCII 65 (letter "A") - + ? FT_ISBIT( "A", 5 ) // result: .F. $SEEALSO$ FT_BITSET() FT_BITCLR() diff --git a/harbour/contrib/hbnf/doc/en/isbiton.txt b/harbour/contrib/hbnf/doc/en/isbiton.txt index 7f5b88afeb..428958e317 100644 --- a/harbour/contrib/hbnf/doc/en/isbiton.txt +++ b/harbour/contrib/hbnf/doc/en/isbiton.txt @@ -13,7 +13,7 @@ FT_ISBITON( <nNumber>, <nBit> ) -> lResult $ARGUMENTS$ <nNumber> is an integer for which a bit state needs to be checked. - + <nBit> is a number from 0 to 15 that indicates which bit to test. $RETURNS$ .T. if the specified bit was on., .F. if off. @@ -26,7 +26,7 @@ IF FT_ISBITON( nCPUFlags, 0 ) ? "The carry flag was set." ENDIF - + IF FT_ISBITON( nCPUFlags, 7 ) ? "The sign flag was set." ENDIF diff --git a/harbour/contrib/hbnf/doc/en/isprint.txt b/harbour/contrib/hbnf/doc/en/isprint.txt index 8a13955297..efa7d7b2e7 100644 --- a/harbour/contrib/hbnf/doc/en/isprint.txt +++ b/harbour/contrib/hbnf/doc/en/isprint.txt @@ -26,25 +26,25 @@ works with LPT1. Furthermore, it talks directly to the hardware, so if you have redirected LPT1 via the DOS MODE command, the IsPrinter() function will return erroneous results. - + This function offers a better alternative. Instead of talking to the hardware, it issues a DOS call that checks to see if the device is ready or not. That gives DOS an opportunity to deal with any redirections, and since you pass the device name as a parameter, you can test any device, not just LPT1 (note that the function defaults to PRN if you fail to pass a valid parameter). - + The function also temporarily traps the DOS critical error handler so you don't get any nasty error messages if the device isn't ready. It restores the old critical error handler before exiting. - + Note that although this function is mainly designed for testing printers, you can also check to see if a drive is ready. Since DOS thinks the NUL device exists on every drive, you can pass a drive letter followed by NUL as a parameter. If DOS is able to open the NUL device, then the drive is ready, otherwise the door is open or something else is wrong. - + The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very @@ -53,11 +53,11 @@ IF ! FT_ISPRINT() ? "PRN is not ready!" ENDIF - + IF ! FT_ISPRINT( "COM2" ) ? "Check the device on COM2. Something is wrong." ENDIF - + IF ! FT_ISPRINT( "A:\nul" ) ? "Oops, better check drive A!" ENDIF diff --git a/harbour/contrib/hbnf/doc/en/isshare.txt b/harbour/contrib/hbnf/doc/en/isshare.txt index d0a9624508..d7c013599a 100644 --- a/harbour/contrib/hbnf/doc/en/isshare.txt +++ b/harbour/contrib/hbnf/doc/en/isshare.txt @@ -15,7 +15,7 @@ None $RETURNS$ nRetcode will be set as follows on exit: - + 0 if SHARE not loaded but ok to load 1 if SHARE not loaded and not ok to load 255 if SHARE loaded diff --git a/harbour/contrib/hbnf/doc/en/kspeed.txt b/harbour/contrib/hbnf/doc/en/kspeed.txt index ce8598a523..2496076fb6 100644 --- a/harbour/contrib/hbnf/doc/en/kspeed.txt +++ b/harbour/contrib/hbnf/doc/en/kspeed.txt @@ -13,9 +13,9 @@ FT_SETRATE( [ <nDelayTime> ] [, <nRepeatRate> ] ) -> NIL $ARGUMENTS$ <nDelayTime> is the keyboard delay time. - + <nRepeatRate> is the keyboard repeat rate. - + ┌───────────────────────┠┌────────────────────────┠│ nDelayTime DELAY │ │ RepeatRate SPEED │ ├───────────────────────┤ ├────────────────────────┤ @@ -58,7 +58,7 @@ This routine is used to adjust the IBM PC/AT and PS/2 "typematic" repeat and delay feature. This is used to allow the users of your application to adjust these speeds to the most comfortable level. - + This source code is written for Microsoft Assembler v5.1. $EXAMPLES$ FT_SETRATE( 0, 0 ) // Set keyboard to fastest possible settings diff --git a/harbour/contrib/hbnf/doc/en/linked.txt b/harbour/contrib/hbnf/doc/en/linked.txt index ee694ed47b..9127b92396 100644 --- a/harbour/contrib/hbnf/doc/en/linked.txt +++ b/harbour/contrib/hbnf/doc/en/linked.txt @@ -21,19 +21,19 @@ $DESCRIPTION$ This function would be used in data driven application to determine whether or not a macro compiled function was linked in. - + Several functions can be passed, and nested, in <cString>. - + Caveat: Some function calls are converted by the preprocessor into other function calls. You cannot have these types of functions in a macro compiled string as they never exist at runtime. FT_LINKED will correctly tell you that they are invalid. - + For instance: there is no function called SORT() in any of the Nantucket LIBraries, but it is a valid CLIPPER command because the preprocessor will convert it to other function calls. - - + + $EXAMPLES$ cString := "FT_GoodFunc( BadFunc( 3, 2 ) )" IF FT_LINKED( cString ) diff --git a/harbour/contrib/hbnf/doc/en/madd.txt b/harbour/contrib/hbnf/doc/en/madd.txt index 8621449959..6f8cf52383 100644 --- a/harbour/contrib/hbnf/doc/en/madd.txt +++ b/harbour/contrib/hbnf/doc/en/madd.txt @@ -15,10 +15,10 @@ $ARGUMENTS$ <dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. - + <nAddMonths> is the number of months to be added or subtracted. Defaults to 0 if not supplied. - + <lMakeEOM> is a logical variable indicating whether or not to force the returned date to the last date of the month. It only affects the returned date if <dGivenDate> is an end-of-month date. @@ -26,7 +26,7 @@ A date. $DESCRIPTION$ FT_MADD() adds or subtracts months to/from a given date. - + If MakeEOM is passed and dGivenDate is the last day of a month, it will return the EOM of calculated month. Otherwise it will return the same day as the day of the passed date. @@ -34,7 +34,7 @@ dDate := SToD( "19900915" ) ? FT_MADD( dDate, 1 ) // 10/15/90 ? FT_MADD( dDate, -2 ) // 07/15/90 - + // force EOM dDate := SToD( "19910430" ) ? FT_MADD( dDate, 1 ) // 05/30/91 diff --git a/harbour/contrib/hbnf/doc/en/menu1.txt b/harbour/contrib/hbnf/doc/en/menu1.txt index 558da2ee6e..86dc951025 100644 --- a/harbour/contrib/hbnf/doc/en/menu1.txt +++ b/harbour/contrib/hbnf/doc/en/menu1.txt @@ -15,20 +15,20 @@ $ARGUMENTS$ <acBarNames> is a character array containing the names to appear on the menu bar. - + <acOptions> is a multi-dimensional array with one element for each selection to appear on the pulldown menus. - + <acColors> is an array containing the colors for the menu groups. - + <nTopRow> is a numeric value that determines the row for the menu bar. If omitted, it defaults to 0. - + <lShadow> is a logical variable. If true (.T.) or omitted, it uses FT_SHADOW() to add a transparent shadow to the each pulldown menu. If false (.F.), the menu is drawn without the shadow. - + All arguments except nTopRow and lShadow are required. $RETURNS$ NIL @@ -37,9 +37,9 @@ on the menu bar and executes the corresponding function for the item selected. When a called function returns false, FT_MENU1 returns control to the calling program. - + Valid keystrokes and their corresponding actions: - + Home - Activates Pulldown for first item on the menu bar End - Activates Pulldown for last item on the menu bar Left Arrow - Activates next Pulldown to the left @@ -57,55 +57,55 @@ // Declare arrays LOCAL aColors := {} LOCAL aBar := { " ENTER/EDIT ", " REPORTS ", " DISPLAY " } - + // Include the following two lines of code in your program, as is. // The first creates aOptions with the same length as aBar. The // second assigns a three-element array to each element of aOptions. LOCAL aOptions[ Len( aBar ) ] AEval( aBar, {| x, i | aOptions[ i ] := { {}, {}, {} } } ) - + // fill color array // Box Border, Menu Options, Menu Bar, Current Selection, Unselected aColors := iif( lColor, { "W+/G", "N/G", "N/G", "N/W", "N+/G" }, ; { "W+/N", "W+/N", "W/N", "N/W","W/N" } ) - + // array for first pulldown menu FT_FILL( aOptions[ 1 ], "A. Execute A Dummy Procedure" , {|| fubar() }, .T. ) FT_FILL( aOptions[ 1 ], "B. Enter Daily Charges" , {|| .T. }, .F. ) FT_FILL( aOptions[ 1 ], "C. Enter Payments On Accounts", {|| .T. }, .T. ) - + // array for second pulldown menu FT_FILL( aOptions[ 2 ], "A. Print Member List" , {|| .T. }, .T. ) FT_FILL( aOptions[ 2 ], "B. Print Active Auto Charges" , {|| .T. }, .T. ) - + // array for third pulldown menu FT_FILL( aOptions[ 3 ], "A. Transaction Totals Display", {|| .T. }, .T. ) FT_FILL( aOptions[ 3 ], "B. Display Invoice Totals" , {|| .T. }, .T. ) FT_FILL( aOptions[ 3 ], "C. Exit To DOS" , {|| .F. }, .T. ) - + Call FT_FILL() once for each item on each pulldown menu, passing it three parameters: - + FT_FILL( <cMenuSelection>, <bCodeBlock>, <lSelectable> - + <cMenuSelection> is a character string which will be displayed on the pulldown menu. - + <bCodeBlock> should contain one of the following: - + A function name to execute, which in turn should return .T. or .F. FT_MENU1 WILL RETURN CONTROL TO THE CALLING PROGRAM IF .F. IS RETURNED OR CONTINUE IF .T. IS RETURNED. - + .F. WHICH WILL CAUSE FT_MENU1 TO RETURN CONTROL TO THE CALLING PROGRAM. - + .T. WHICH WILL DO NOTHING. THIS ALLOWS THE DEVELOPER TO DESIGN A SKELETON MENU STRUCTURE PRIOR TO COMPLETING ALL OF THE SUBROUTINES. - + // CALL FT_MENU1 FT_MENU1( aBar, aOptions, aColors, 0 ) - + NOTE: FT_MENU1() disables Alt-C and Alt-D in order to make them available for the menu bar. It enables Alt-D and resets Alt-C to its previous state prior to calling each function. @@ -128,16 +128,16 @@ <aSubArrayName> is a sub-array of <acOptions> in FT_MENU1() denoting the group in which to include the selection -- e.g., acOptions[ 1 ] - + <cMenuSelection> is the character string that will appear on the menu. - + <bFunction> is the code block to be executed when that menu option is selected. i.e. {|| MyFunction() } would execute the function called MyFunction(). {|| .F. } would exit the FT_MENU1 and return to the calling routine. {|| .T. } would do nothing. - + <lSelectable> is a logical variable that determines whether the corresponding menu option is selectable or not. $RETURNS$ @@ -147,26 +147,26 @@ to calling FT_MENU1(). $EXAMPLES$ FT_FILL( aOptions[ 1 ], "A. Execute A Dummy Procedure" , {|| fubar() }, .T. ) - + The above would be added to the sub-menu associated with the first menu bar item, would execute the function FUBAR() when that option was selected, and would be selectable. - - + + FT_FILL( aOptions[ 3 ], "B. Enter Daily Charges" , {|| .T. }, .F. ) - + The above would be added to the sub-menu associated with the third menu bar item, and would be unselectable. - - + + FT_FILL( aOptions[ 2 ], "C. Enter Payments On Accounts", {|| .T. }, .T. ) - + The above would be added to the sub-menu associated with the second menu bar item, and would be selectable, but would do nothing when selected. - - + + FT_FILL( aOptions[ 4 ], "C. Exit" , {|| .F. }, .T. ) - + The above would be added to the sub-menu associated with the fourth menu bar item, and would be selectable, and would exit FT_MENU1() when chosen. $SEEALSO$ diff --git a/harbour/contrib/hbnf/doc/en/menutonf.txt b/harbour/contrib/hbnf/doc/en/menutonf.txt index 111e73882c..b1499e91e7 100644 --- a/harbour/contrib/hbnf/doc/en/menutonf.txt +++ b/harbour/contrib/hbnf/doc/en/menutonf.txt @@ -11,7 +11,7 @@ Define a menu item for use with FT_MenuTo() $SYNTAX$ #include "ftmenuto.ch" - + @ <nRow>, <nCol> PROMPT <cPrompt> ; [COLOR <cColor>] ; [MESSAGE <cMessage>] ; @@ -27,74 +27,74 @@ [LEFT <nLeft>] ; [RIGHT <nRight>] ; [EXECUTE <bExec>] ; - + $ARGUMENTS$ <nRow> is the row at which the prompt is to appear. - + <nCol> is the column at which the prompt will appear. - + <cPrompt> is the menu item string. - + <cColor> is optional and is the color attribute of the prompt. Note that two colors are required; one for the standard setting and one for the enhanced setting (i.e. the light bar color). See the example below if this isn't clear. If <cColor> is not specified then the current SetColor() value is used by default. - + <cMessage> is optional and is the message associated with the prompt. If not specified, then no message will be displayed. - + <nMsgRow> is optional and is the row at which the message, if any, will appear. If not specified, the default is the current setting of the SET MESSAGE TO command. - + <nMsgCol> is optional and is the column at which the message, if any, will appear. If not specified, the default is either zero or centered, depending on the current setting of the CENTER option of the SET MESSAGE TO command. - + <cMsgColor> is optional and is the color attribute of the message. If not specified, the default is the same as the prompt color. - + <nTrigger> is optional and is the position within the prompt string where the trigger character is located. If not specified, the default is one. - + <cTriggerColor> is optional and is the color attribute of the trigger character. Note that two colors are required; one for the standard setting and one for the enhanced setting (i.e. the light bar color). See the example below if this isn't clear. If <cTriggerColor> is not specified then the default is the same color as the rest of the prompt. - + <nHome> is optional and specifies which prompt becomes active when the home key is pressed. If not specified, the default is the first prompt. - + <nEnd> is optional and specifies which prompt becomes active when the end key is pressed. If not specified, the default is the last prompt. - + <nUp> is optional and specifies which prompt becomes active when the up arrow key is pressed. If not specified, the default is the previous prompt. The current setting of SET WRAP TO is obeyed. - + <nDown> is optional and specifies which prompt becomes active when the down arrow key is pressed. If not specified, the default is the next prompt. The current setting of SET WRAP TO is obeyed. - + <nRight> is optional and specifies which prompt becomes active when the right arrow key is pressed. If not specified, the default is the next prompt. The current setting of SET WRAP TO is obeyed. - + <nLeft> is optional and specifies which prompt becomes active when the left arrow is pressed. If not specified, the default is the previous prompt. The current setting of SET WRAP TO is obeyed. - + <bExec> is optional and is a code block to evaluate whenever the menu item to which it belongs is selected. $DESCRIPTION$ @@ -108,45 +108,45 @@ vertical movement, or even disable certain arrow keys if you so desire. Support for nested menus is also available, since the prompts are stored in stack-based static arrays. - + Note that this command can also be called using function-style syntax. See the entry for FT_PROMPT() for further details. - + This enhanced version of @...PROMPT requires the inclusion of the header file ftmenuto.ch in any source file that uses it. It is may be used in place of the standard Clipper @...PROMPT command. However, in the interests of functionality it is NOT 100% compatible. No whining! If compatibility is such a big deal then use the standard Clipper commands. - + $EXAMPLES$ #include "ftmenuto.ch" - + // Simple prompt @ 1, 1 PROMPT "Menu choice #1" - + // Prompt with color @ 3, 1 PROMPT "Menu choice #2" COLOR "W+/R,W+/B" - + // Prompt with a message @ 5, 1 PROMPT "Menu choice #3" MESSAGE "Go to lunch" - + // Prompt with pinpoint message control @ 7, 1 PROMPT "Menu choice #4" MESSAGE "Drop Dead" ; MSGROW 22 MSGCOL 4 MSGCOLOR "GR+/N" - + // Prompt with a trigger character ("#" character) @ 11, 1 PROMPT "Menu choice #6" TRIGGER 13 - + // Prompt with trigger character color control @ 13, 1 PROMPT "Menu Choice #7" TRIGGER 13 TRIGGERCOLOR "R+/BG,G+/N" - + // Prompt with right and left arrow keys disabled @ 15, 1 PROMPT "Menu Choice #8" RIGHT 8 LEFT 8 $INCLUDE$ ftmenuto.ch $SEEALSO$ - + $END$ */ @@ -159,12 +159,12 @@ Execute light bar menu using prompts created with @...PROMPT $SYNTAX$ #include "ftmenuto.ch" - + MENU TO <var> [COLD] $ARGUMENTS$ <var> is the name of the variable to which the result of the menu selection should be assigned. - + [COLD] is optional and if specified indicates that trigger characters should be treated as "cold," i.e. rather than causing the menu item to be selected it only causes the light bar to move to that selection. @@ -178,16 +178,16 @@ if it does not already exist, but this version does not). No whining! If compatibility is such a big deal then use the standard Clipper command. - + Note that this command can also be called using function-style syntax. See the entry for FT_MENUTO() for further details. $EXAMPLES$ #include "ftmenuto.ch" - + // Simple command - + MENU TO memvar - + $INCLUDE$ ftmenuto.ch $SEEALSO$ diff --git a/harbour/contrib/hbnf/doc/en/metaph.txt b/harbour/contrib/hbnf/doc/en/metaph.txt index 8ad3304f62..60686beec0 100644 --- a/harbour/contrib/hbnf/doc/en/metaph.txt +++ b/harbour/contrib/hbnf/doc/en/metaph.txt @@ -13,7 +13,7 @@ FT_METAPH( <cName> [, <nSize> ] ) -> cMetaPhone $ARGUMENTS$ <cName> is the character string to convert - + <nSize> is the length of the character string to be returned. If not specified the default length is 4 bytes. $RETURNS$ diff --git a/harbour/contrib/hbnf/doc/en/miltime.txt b/harbour/contrib/hbnf/doc/en/miltime.txt index 8c42dfc05c..a3c81f1071 100644 --- a/harbour/contrib/hbnf/doc/en/miltime.txt +++ b/harbour/contrib/hbnf/doc/en/miltime.txt @@ -64,15 +64,15 @@ Converts time from military to civilian format $EXAMPLES$ FT_MIL2CIV( "1640" ) // 4:40 pm - + FT_MIL2CIV( "0440" ) // 4:40 am - + FT_MIL2CIV( "1200" ) // 12:00 n - + FT_MIL2CIV( "0000" ) // 12:00 m - + FT_MIL2CIV( "2400" ) // 12:00 m - + Caution: leading blanks are irrelevant. $SEEALSO$ FT_CIV2MIL() FT_SYS2MIL() FT_MIL2MIN() FT_MIN2MIL() @@ -97,13 +97,13 @@ Converts time from 12-hour civilian format to military. $EXAMPLES$ FT_CIV2MIL( " 5:40 pm" ) // 1740 - + FT_CIV2MIL( " 5:40 am" ) // 0540 - + FT_CIV2MIL( "12:00 n" ) // 1200 - + FT_CIV2MIL( "12:00 m" ) // 0000 - + Caution: leading blanks are irrelevant; p,a,n,m must be preceded by one and only one space. $SEEALSO$ diff --git a/harbour/contrib/hbnf/doc/en/mkdir.txt b/harbour/contrib/hbnf/doc/en/mkdir.txt index 2b69dc3ee0..ea22b571ec 100644 --- a/harbour/contrib/hbnf/doc/en/mkdir.txt +++ b/harbour/contrib/hbnf/doc/en/mkdir.txt @@ -22,7 +22,7 @@ Use this function to create the subdirectories needed by your application. It might be especially useful in an installation program. - + The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very diff --git a/harbour/contrib/hbnf/doc/en/month.txt b/harbour/contrib/hbnf/doc/en/month.txt index 8742aba8b0..2eb64a4849 100644 --- a/harbour/contrib/hbnf/doc/en/month.txt +++ b/harbour/contrib/hbnf/doc/en/month.txt @@ -14,26 +14,26 @@ $ARGUMENTS$ <dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. - + <nMonthNum> is a number from 1 to 12 signifying a month. Defaults to current month if not supplied. $RETURNS$ A three element array containing the following data: - + aDateInfo[ 1 ] - The year and month as a character string "YYYYMM" aDateInfo[ 2 ] - The beginning date of the month aDateInfo[ 3 ] - The ending date of the month $DESCRIPTION$ FT_MONTH() returns an array containing data about the month containing the given date. - + Normally the return data will be based on a year beginning on January 1st with weeks beginning on Sunday. - + The beginning of year date and/or beginning of week day can be changed by using FT_DATECNFG(), which will affect all subsequent calls to FT_MONTH() until another call to FT_DATECNFG(). - + The beginning of year date and beginning of week day may be reset to January 1 and Sunday by calling FT_DATECNFG() with no parameters. @@ -43,13 +43,13 @@ ? aDateInfo[ 1 ] // 199009 (9th month) ? aDateInfo[ 2 ] // 09/01/90 beginning of month 9 ? aDateInfo[ 3 ] // 09/30/90 end of week month 9 - + // get info about month 5 in year containing 9/15/90 aDateInfo := FT_MONTH( SToD( "19900915" ), 5 ) ? aDateInfo[ 1 ] // 199005 ? aDateInfo[ 2 ] // 05/01/90 beginning of month 5 ? aDateInfo[ 3 ] // 05/31/90 end of month 5 - + // get info about month 5 in current year (1991) aDateInfo := FT_MONTH( , 5 ) ? aDateInfo[ 1 ] // 199105 diff --git a/harbour/contrib/hbnf/doc/en/mouse1.txt b/harbour/contrib/hbnf/doc/en/mouse1.txt index 6aa4dc24cd..75ac13fbd9 100644 --- a/harbour/contrib/hbnf/doc/en/mouse1.txt +++ b/harbour/contrib/hbnf/doc/en/mouse1.txt @@ -41,7 +41,7 @@ FT_MMICKEYS( @<nX>, @<nY> ) -> NIL $ARGUMENTS$ <nX> is a variable that will receive the vertical mickey count. - + <nY> is a variable that will receive the horizontal mickey count. $RETURNS$ NIL @@ -72,24 +72,24 @@ routine is called from one which in turn responded to a button press. If it is not present or not equal to 0, then FT_MDBLCLK() will wait for two presses of the specified button. - + <nButton> is the mouse button number 0 - Left Button 1 - Right Button 2 - Middle Button [if applicable] - + <nInterval> is the interval to wait for the first click if requested and the time to wait for the second. If not present then defaults to 0.5 second. - + <nRow> is the row number for the mouse cursor location for a double click to be valid. If not present then the current position is taken as the valid location. - + <nCol> is the column number for the mouse cursor location for a double click to be valid. If not present, then the current position is taken as the valid location. - + <nTime> is an optional start time for the waiting period for the first click (of either one or two requested). If not given then the time is set at entry into this routine. This is useful when this @@ -106,7 +106,7 @@ FT_MDBLCLK( 0, 1,, FT_MGETX(), FT_MGETY() ) // double click, right button // at current location with // default interval - + MnuItem1() ENDIF $SEEALSO$ @@ -133,7 +133,7 @@ the given region. The driver hides the cursor by decrementing the cursor flag. A call to FT_MSHOWCRS is required to turn the cursor back on. Calling FT_MSHOWCRS also disables this function. - + See FT_MSHOWCRS for a discussion of the cursor display flag. $EXAMPLES$ FT_MCONOFF( 10, 10, 11, 20 ) @@ -202,15 +202,15 @@ and 2 inches of vertical mouse movement to cover the entire screen. A value of 100 requires about 0.9 inches of horizontal mouse movement to cover the screen from one side to the other. - + The third argument changes the threshold above which the mouse moves at twice the normal speed. The value is a percentage of full sensitivity with the default (50) providing doubling at 64 mickeys per second. - + NOTE: These values are NOT restored after resetting the mouse driver/ hardware. A well behaved application should reset them to the original value upon exiting. - + NOTE: The above description is counter to all of the documentation I have available. However, it does not work the way it is documented with Microsoft drivers versions 6.16, 6.24, 7.04 and 8.20. The above @@ -220,8 +220,8 @@ to 32K but the driver forces a maximum of 100. Also the documentation states that resetting the mouse will reset these values. This is not the case. - - + + $EXAMPLES$ FT_MSETSENS( 75, 75, 50 ) // a little less mouse movement necessary. $SEEALSO$ @@ -287,7 +287,7 @@ number and type. The major version would be 6 and the minor version would be 10 if the driver were version 6.10. The mouse type and IRQ numbers are also returned. - + NOTE: It appears that the values reported when one starts the mouse driver actually have the minor version in hexadecimal! Thus on bootup my screen showed 6.24 but this routine returned 30 for the minor version @@ -372,7 +372,7 @@ because at least some versions of the mouse drivers do not operate according to the documentation when confronted with a 43 or 50 line screen. - + Normally, FT_MINIT() should be used to initialize the mouse since it will not reinitialize if already done. $EXAMPLES$ @@ -428,7 +428,7 @@ when redrawing screens. The mouse cursor dutifully saves the screen under it, so if you draw over the mouse cursor it will create a "hole" in your screen when you move the mouse cursor. - + Note: A call to FT_MHIDECRS() decrements a mouse driver variable which indicates whether the cursor is shown. The cursor is visible only when the variable = 0. Thus multiple calls to FT_MHIDECRS() @@ -462,7 +462,7 @@ redrawing screens. The mouse cursor dutifully saves the screen under it, so if you draw over the mouse cursor it will create a "hole" in your screen when you move the mouse cursor. - + Note: A call to FT_MHIDECRS() decrements a mouse driver variable which indicates whether the cursor is shown. The cursor is visible only when the variable = 0. Thus multiple calls to FT_MHIDECRS() @@ -490,12 +490,12 @@ $ARGUMENTS$ <nX> is a variable that will receive the mouse X position in virtual screen coordinates. It must be passed by reference. - + <nY> is a variable that will receive the mouse Y position in virtual screen coordinates. It must be passed by reference. $RETURNS$ an integer representing button status - + - 0 for no button pressed - 1 for left pressed - 2 for right pressed @@ -582,7 +582,7 @@ FT_MSETPOS( <nX>, <nY> ) -> NIL $ARGUMENTS$ <nX> is the desired mouse row. - + <nY> is the desired mouse column. $RETURNS$ NIL @@ -609,7 +609,7 @@ FT_MSETPOS( <nX>, <nY> ) -> NIL $ARGUMENTS$ <nX> is the desired mouse row. - + <nY> is the desired mouse column. $RETURNS$ NIL @@ -635,7 +635,7 @@ FT_MXLIMIT( <nX1>, <nX2> ) -> NIL $ARGUMENTS$ <nX1> is the top row limit. - + <nX2> is the bottom row limit. $RETURNS$ NIL @@ -659,7 +659,7 @@ FT_MYLIMIT( <nY1>, <nY2> ) -> NIL $ARGUMENTS$ <nY1> is the left column limit. - + <nY2> is the right column limit. $RETURNS$ NIL @@ -683,21 +683,21 @@ FT_MBUTPRS( <nButton> [, @nButPrs [, @nX [, @nY] ] ] ) -> nButStatus $ARGUMENTS$ <nButton> is the mouse button number: - + 0 - Left Button 1 - Right Button 2 - Middle Button [if applicable] - + <nButPrs> is the number of times the specified button was pressed since the last call to this routine. PASSED BY REFERENCE. <nX> is the X position of the cursor when the last press occurred. PASSED BY REFERENCE. <nY> is the Y position of the cursor when the last press occurred. PASSED BY REFERENCE. - + $RETURNS$ An integer representing the button status: - + 0 - no buttons pressed 1 - left button pressed 2 - right button pressed @@ -732,13 +732,13 @@ 0 - Left Button 1 - Right Button 2 - Middle Button [if applicable] - + <nButRel> is the number of times the specified button was released since the last call to this routine. PASSED BY REFERENCE. - + <nX> is the X position of the cursor when the last release occurred. PASSED BY REFERENCE. - + <nY> is the Y position of the cursor when the last release occurred. PASSED BY REFERENCE. $RETURNS$ @@ -771,11 +771,11 @@ $ARGUMENTS$ <nCrsType> is the cursor type. A value of 0 indicates the software cursor (the default) and a value of 1 indicates the hardware cursor. - + <nScrMask> is the screen mask for the software cursor or the first scan line of the hardware cursor. See the description for more information. - + <nCrsMask> is the cursor mask for the software cursor of the last scan line of the hardware cursor. See the description for more information. @@ -793,10 +793,10 @@ high order bits represent the display atributes such as blinking, intensity and forground and background colors. The mask is represented in the diagram below: - + Bit: │15 │14 12│11 │10 8│7 0│ Function:│blink │background│intensity│foreground│character│ - + Blinking and high intensity are on when the bit is 1. The background and foreground indicate which colors are used for each. The software mouse cursor uses these two values by taking the mask from the screen cell it @@ -804,12 +804,12 @@ value. The result is then logically XOR'ed with the cursor mask value. Thus to keep the character the same but invert the foreground and background colors the following values would be used: - + Bit: │15 │14 12│11 │10 8│7 0│ Function:│blink │background│intensity│foreground│character│ screen: │ 0 │ 111 │ 0 │ 111 │11111111 │ =30719 cursor: │ 0 │ 111 │ 0 │ 111 │00000000 │ =30464 - + The hardware cursor is the text cursor provided by the video board. One specifies the range of scan lines which are on using <nScrMask> and <nCrsMask>. The range of values is dependant upon the type of monitor. @@ -829,12 +829,12 @@ $ARGUMENTS$ <nX> is a variable that will receive the mouse X position in text screen coordinates. It must be passed by reference. - + <nY> is a variable that will receive the mouse Y position in text screen coordinates. It must be passed by reference. $RETURNS$ an integer representing button status - + - 0 for no button pressed - 1 for left pressed - 2 for right pressed diff --git a/harbour/contrib/hbnf/doc/en/netpv.txt b/harbour/contrib/hbnf/doc/en/netpv.txt index 0cbaf3d596..a24786785d 100644 --- a/harbour/contrib/hbnf/doc/en/netpv.txt +++ b/harbour/contrib/hbnf/doc/en/netpv.txt @@ -15,12 +15,12 @@ $ARGUMENTS$ <nInitialInvestment> is the amount of cash invested for purposes of generating the cash flows. - + <nInterestRate> is the annual interest rate used to discount expected cash flows (10.5% = 10.5, not .105). - + <aCashFlow> is an array of the expected cash receipts each year. - + <nNoOfCashFlows> is the number of years cash flows are expected (optional, Len( aCashFlow ) ). $RETURNS$ @@ -32,12 +32,12 @@ of the expected cash flow(s) from the investment. The present value of the expected cashflow(s) is calculated at the specified interest rate, which is often referred to as the "cost of capital". - + This function can be used to evaluate alternative investments. The larger the NPV, the more profitable the investment. See also the FutureValue and PresentValue for further explanations. The formula to calculate the net present value is: - + NetPresentValue := SUM( CashFlow[ i ] / ( ( 1 + InterestRate ) ** i ) ) FOR i := 1 TO NoOfCashFlows $EXAMPLES$ diff --git a/harbour/contrib/hbnf/doc/en/nooccur.txt b/harbour/contrib/hbnf/doc/en/nooccur.txt index d6d2d61b46..a97527fa4c 100644 --- a/harbour/contrib/hbnf/doc/en/nooccur.txt +++ b/harbour/contrib/hbnf/doc/en/nooccur.txt @@ -14,9 +14,9 @@ [, <lIgnoreCase> ] ) -> <nOccurrences> $ARGUMENTS$ <cCheckFor> is the string to search for - + <cCheckIn> is the string to search - + <lIgnoreCase> is a boolean variable to force case sensitivity (optional, defaults to .F.). $RETURNS$ @@ -27,12 +27,12 @@ $EXAMPLES$ // Find the number of times "the" appears in cMemoString, case // insensitive - + nNoOfOccurrences := FT_NOOCCUR( "the", cMemoString ) - + // Find the number of times "the" appears in cMemoString, case // sensitive - + nNoOfOccurrences := FT_NOOCCUR( "the", cMemoString, .T. ) $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/ntow.txt b/harbour/contrib/hbnf/doc/en/ntow.txt index 9cdb2520d4..997ec1821e 100644 --- a/harbour/contrib/hbnf/doc/en/ntow.txt +++ b/harbour/contrib/hbnf/doc/en/ntow.txt @@ -17,28 +17,28 @@ A text string representing <nNumber> $DESCRIPTION$ Translates numeric input to a text string. - + FT_NTOW is intended to be used with integers only. Since I don't know what your application will be, I can't assume the type of fraction you want returned (ninety nine cents, 99/100, .99, etc). If you want the fraction in words, just pass it as an integer. - + Do not pass a negative number! Handle negative numbers any way you need to in your code. (ie: CR, DB, Negative, Minus, etc.) - + Also, numeric 0 is returned as a null string. You will need to make a decision how to output it (zero dollars, no dollars, etc). $EXAMPLES$ ? FT_NTOW( 999 ) -> Nine Hundred Ninety Nine - + ? FT_NTOW( 1000 ) -> One Thousand - + ? FT_NTOW( 23 ) + " Dollars and " + FT_NTOW( 99 ) + " Cents" -> Twenty Three Dollars and Ninety Nine Cents - + ? FT_NTOW( 23 ) + " Dollars and " + "99/100" -> Twenty Three Dollars and 99/100 - + x := -23.99 cents := Str( ( x - Int( x ) ) * 100, 2, 0 ) + "/100" x := Int( x ) diff --git a/harbour/contrib/hbnf/doc/en/numlock.txt b/harbour/contrib/hbnf/doc/en/numlock.txt index 08ba23e49b..f120c297d4 100644 --- a/harbour/contrib/hbnf/doc/en/numlock.txt +++ b/harbour/contrib/hbnf/doc/en/numlock.txt @@ -26,18 +26,18 @@ IF FT_NUMLOCK() ? "NumLock is active" ENDIF - + Another one, slightly strange, courtesy of Glenn Scott: - + #include "inkey.ch" - + FUNCTION numBlink() LOCAL lOldNum := ft_numlock() - + DO WHILE Inkey( 0.5 ) != K_ESC ft_numlock( ! ft_numlock() ) ENDDO - + RETURN ft_numlock( lOldNum ) $SEEALSO$ FT_CAPLOCK() FT_CTRL() FT_PRTSCR() FT_SHIFT() FT_ALT() diff --git a/harbour/contrib/hbnf/doc/en/nwlstat.txt b/harbour/contrib/hbnf/doc/en/nwlstat.txt index 7699dd7a96..efbd06b731 100644 --- a/harbour/contrib/hbnf/doc/en/nwlstat.txt +++ b/harbour/contrib/hbnf/doc/en/nwlstat.txt @@ -23,9 +23,9 @@ function will return that number. This will be a number from 1 to 100 under NetWare 286, or from 1 to 250 under NetWare 386. This is *not* the same as a physical station number. - + This function requires FT_INT86(). - + This function does NOT test for the existence of the NetWare shell. The behavior is undefined if no shell is loaded. $EXAMPLES$ diff --git a/harbour/contrib/hbnf/doc/en/nwsem.txt b/harbour/contrib/hbnf/doc/en/nwsem.txt index 6822d3925a..5e1d501ee5 100644 --- a/harbour/contrib/hbnf/doc/en/nwsem.txt +++ b/harbour/contrib/hbnf/doc/en/nwsem.txt @@ -13,25 +13,25 @@ FT_NWSEMOPEN( <cName>, <nInitVal>, <@nHandle>, <@nOpenCnt> ) -> nRc $ARGUMENTS$ <cName> is the semaphore name, maximum length is 127 characters. - + <nInitVal> is the initial value for the semaphore. It must start as a positive number, to a maximum of 127. - + <@nHandle> is the semaphore handle. THIS MUST BE PASSED BY REFERENCE! On exit, <nHandle> will contain a numeric value that refers to the opened semaphore. You will need it to pass to other semaphore functions! PASS IT BY REFERENCE! - + <@nOpenCnt> is the number of stations that have opened the semaphore. THIS MUST BE PASSED BY REFERENCE! On exit, <nOpenCnt> will contain a numeric value. $RETURNS$ nRc, a numeric result code, as follows: - + 0 - success 254 - Invalid semaphore name length 255 - Invalid semaphore value - + <nHandle> will contain the semaphore handle, and <nOpenCnt> will contain the number of stations that have opened the semaphore. @@ -40,19 +40,19 @@ activity. There is a semaphore name, which can be up to 127 characters, and an associated value, which can range from 0 to 127. - + A semaphore can be used for many things, but is most often used to limit the number of users in an application, and to control access to a network resource. - + A semaphore essentially allows you to place locks on resources other than files. - + An application begins the process by calling FT_NWSEMOPEN(). If the semaphore doesn't exist, NetWare will create it. FT_NWSEMOPEN() returns a handle that is used in other semaphore calls. - + Applications use FT_NWSEMWAIT() to wait for a semaphore to become available. FT_NWSEMWAIT() decrements the semaphore's value by 1. If the value > 0, then the application should @@ -62,15 +62,15 @@ set the timeout parameter. If you can't get the resource in the time you allot, you're let out of the queue and the value increments by 1 again. - + When an application finishes with a semaphore, it should call FT_NWSEMSIG() to increment the value, and then FT_NWSEMCLOSE() to close the semaphore. When the semaphore's open count goes to 0, NetWare deletes it. - + FT_NWSEMEX() can be used to examine the value and open count without affecting them. - + For an interesting discussion on the operating system aspects of semaphores, check "Operating Systems Design and Implementation" by A. Tanenbaum, page 60. For more details on NetWare's @@ -80,11 +80,11 @@ functions in the Nanforum Toolkit. $EXAMPLES$ LOCAL nInitVal, nRc, nHandle, nOpenCnt - + nInitVal := 2 nRc := FT_NWSEMOPEN( "Semaphore Test", nInitVal, ; @nHandle, @nOpenCnt ) - + IF nRc != 0 ? "Error: " + Str( nRc ) QUIT @@ -106,19 +106,19 @@ $ARGUMENTS$ <nHandle> is the semaphore handle, returned from a previous call to FT_NWSEMOPEN(). - + <@nValue> will get the current semaphore value. THIS NUMERIC ARGUMENT MUST BE PASSED BY REFERENCE! - + <@nOpenCnt> will get the current number of workstations that have opened the semaphore. THIS NUMERIC ARGUMENT MUST BE PASSED BY REFERENCE! $RETURNS$ nRc, a numeric, as follows: - + 0 - success 255 - invalid semaphore handle - + In addition, nValue will be set to the semaphore's current value, and nOpenCnt will be set to the number of stations that have opened the semaphore. @@ -128,15 +128,15 @@ nInitVal := 2 nHandle := 0 nOpenCnt := 0 - + FT_NWSEMOPEN( "Semaphore Test", nInitVal, @nHandle, @nOpenCnt ) - + nRc := FT_NWSEMWAIT( nHandle ) IF nRc == 254 ? "All slots for this resource are currently in use" QUIT ENDIF - + FT_NWSEMEX( nHandle, @nValue, @nOpenCnt ) ? "Semaphore test -> Open at [" + ; hb_ntos( nOpenCnt ) + ; @@ -159,14 +159,14 @@ $ARGUMENTS$ <nHandle> is the semaphore handle, returned from a previous call to FT_NWSEMOPEN(). - + <nTimeOut> is an optional parameter telling how long you wish to wait on this semaphore. This is a numeric indicating the number of clock ticks (approx 1/18 sec ) to wait. A zero (the default) means "don't wait." $RETURNS$ nRc, a numeric, as follows: - + 0 - success 254 - timeout failure 255 - invalid semaphore handle @@ -174,7 +174,7 @@ See the description for the FT_NWSEMOPEN() function. $EXAMPLES$ FT_NWSEMOPEN( "Semaphore Test", nInitVal, @nHandle, @nOpenCnt ) - + nRc := FT_NWSEMWAIT( nHandle ) IF nRc == 254 ? "All slots for this resource are currently in use" @@ -199,7 +199,7 @@ to FT_NWSEMOPEN(). $RETURNS$ nRc, a numeric, as follows - + 0 - success 1 - semaphore overflow ( value > 127 ) 255 - invalid semaphore handle @@ -207,7 +207,7 @@ Use FT_NWSEMSIG() when your app has finished with the resource locked by a semaphore. This will increase the value (thus making a slot available to another app). - + For more information, see the description under FT_NWSEMOPEN(). $EXAMPLES$ ? "Signal returns: " + Str( FT_NWSEMSIG( nHandle ) ) @@ -230,7 +230,7 @@ to FT_NWSEMOPEN(). $RETURNS$ nRc, a numeric, as follows: - + 0 - success 255 - invalid semaphore handle $DESCRIPTION$ @@ -261,30 +261,30 @@ lRet == .T. if you get the lock, .T. if you don't. If the lock succeeds, <nHandle> will contain the semaphore handle. If it fails, the value of <nHandle> is undefined. - + $DESCRIPTION$ FT_NWSEMLOCK() uses the Nanforum Toolkit's NetWare Semaphore API functions in order to provide a general purpose "lock" you can use in a NetWare environment. - + An interesting byproduct of NetWare's semaphore functions is the "open count" which tells you how many connections have this semaphore open. This is different from the semaphore's _value_, which is set when the semaphore is opened and changed with signal() and wait(). - + The point of semaphores is that you don't care how many users are using the resource; you merely wait on a semaphore until the resource becomes available or you give up. When you're done, you signal it and off you go. - + Back to the open count. FT_NWSEMLOCK() opens the semaphore as named in <cSemaphore>. After it is opened, the open count is checked. If it is anything other than 1, that means someone else has it (or you failed in your open) so the semaphore is closed and the "lock" is refused. If the value is 1, then your app is that 1 station so the "lock" is granted. - + You can use a semaphore lock to control access to anything that Clipper's RLOCK() and FLOCK() can't help you with, such as text files written with the low level file i/o functions, @@ -302,7 +302,7 @@ ENDIF // Processing, then: FT_NWSEMUNLOCK( nHandle ) - + $SEEALSO$ FT_NWSEMOPEN() FT_NWSEMEX() FT_NWSEMWAIT() FT_NWSEMSIG() FT_NWSEMUNLOCK() $END$ @@ -342,7 +342,7 @@ ENDIF // Processing, then: FT_NWSEMUNLOCK( nHandle ) - + $SEEALSO$ FT_NWSEMOPEN() FT_NWSEMEX() FT_NWSEMWAIT() FT_NWSEMSIG() FT_NWSEMLOCK() $END$ diff --git a/harbour/contrib/hbnf/doc/en/nwuid.txt b/harbour/contrib/hbnf/doc/en/nwuid.txt index b364e92326..09f36a8d9f 100644 --- a/harbour/contrib/hbnf/doc/en/nwuid.txt +++ b/harbour/contrib/hbnf/doc/en/nwuid.txt @@ -25,18 +25,18 @@ FT_NWUID() returns the current NetWare userid, or "login name." This is useful for implementing security or audit trail procedures within your programs. - + There is no simple way a user can "fool" this function into retrieving an incorrect value, provided a NetWare shell is loaded. - + This function requires FT_INT86() and FT_NWLSTAT() - + This function does NOT test for the existence of the NetWare shell. The behavior is undefined if no shell is loaded. You'll usually get garbage. This function has not been tested on NetWare 386. $EXAMPLES$ ? "I am: " + FT_NWUID() - + FOR x := 1 TO 100 cUid := FT_NWUID( x ) IF ! Empty( cUid ) diff --git a/harbour/contrib/hbnf/doc/en/ontick.txt b/harbour/contrib/hbnf/doc/en/ontick.txt index 7808b23e3f..0fcda96d15 100644 --- a/harbour/contrib/hbnf/doc/en/ontick.txt +++ b/harbour/contrib/hbnf/doc/en/ontick.txt @@ -20,30 +20,30 @@ $DESCRIPTION$ This function effectively allows you to run tasks in the background by transparently and periodically calling a designated routine. - + To halt the execution of the background function, call FT_OnTick() with no arguments. - + This function makes heavy use of several undocumented internal routines. If this fact makes you uncomfortable then don't use this function, you quivering sack of cowardly slime. $EXAMPLES$ // Set up a self-updating on-screen clock - + FT_OnTick( "CLOCK", 9 ) - + PROCEDURE Clock() - + LOCAL nRow := Row() LOCAL nCol := Col() - + @ 0, 0 SAY Time() - + SetPos( nRow, nCol ) - + RETURN - + $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/origin.txt b/harbour/contrib/hbnf/doc/en/origin.txt index 9d47289c18..ecb5661649 100644 --- a/harbour/contrib/hbnf/doc/en/origin.txt +++ b/harbour/contrib/hbnf/doc/en/origin.txt @@ -20,15 +20,15 @@ Often users will install multiple copies of application software, especially on networks and in situations where the user is trying to get around a copy protection scheme. - + This function enables you to learn the name and source location of the currently executing file, so that you may take whatever action you need to. - + Requires DOS v3.xx and above. $EXAMPLES$ cMyFile := FT_ORIGIN() - + IF !( cMyFile == "C:\appdir\myfile.exe" ) ? "Incorrect startup file. Please remove/rename and start again" QUIT diff --git a/harbour/contrib/hbnf/doc/en/outp.txt b/harbour/contrib/hbnf/doc/en/outp.txt index fc43898a51..a740348be5 100644 --- a/harbour/contrib/hbnf/doc/en/outp.txt +++ b/harbour/contrib/hbnf/doc/en/outp.txt @@ -13,7 +13,7 @@ FT_OUTP( <nPort>, <nValue> ) -> lResult $ARGUMENTS$ <nPort> is the port from which to retrieve the byte. - + <nValue> is the value between 0 and 255 to write to the port. $RETURNS$ .T. if all parameters were valid and the byte was written to @@ -22,7 +22,7 @@ $DESCRIPTION$ It may sometimes be useful to write a byte to a port without having to resort to C or assembler. This function allows you to do so. - + The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very diff --git a/harbour/contrib/hbnf/doc/en/page.txt b/harbour/contrib/hbnf/doc/en/page.txt index 04f28fe029..781cfc8f28 100644 --- a/harbour/contrib/hbnf/doc/en/page.txt +++ b/harbour/contrib/hbnf/doc/en/page.txt @@ -17,13 +17,13 @@ NIL $DESCRIPTION$ Selects the video page. - + For more information on graphics programming and video pages, consult a reference such as "Programmer's Guide to PC and PS/2 Video Systems" (Microsoft Press). $EXAMPLES$ // The following sets the current video page to 1 - + FT_SETVPG( 1 ) $SEEALSO$ FT_GETVPG() @@ -45,11 +45,11 @@ The video page, as a numeric. $DESCRIPTION$ Get the currently selected video page - + For more information on graphics programming and video pages, consult a reference such as _Programmer's Guide to PC and PS/2 Video Systems_ (Microsoft Press). - + $EXAMPLES$ nPage := FT_GETVPG() $SEEALSO$ diff --git a/harbour/contrib/hbnf/doc/en/pchr.txt b/harbour/contrib/hbnf/doc/en/pchr.txt index 1a5ffd18ce..6ea135a748 100644 --- a/harbour/contrib/hbnf/doc/en/pchr.txt +++ b/harbour/contrib/hbnf/doc/en/pchr.txt @@ -22,20 +22,20 @@ control codes in text (enclosed in double quotes), numeric, hexadecimal, or Epson commands preceded by a slash and returns the printer control code equivalent. - + NOTES" - + - Combinations of text, numbers, hex, and commands must be separated by commas ("A",27,&1B,/RESET). - Text must be enclosed in double quotes ("x"). - Hexadecimal must be preceded by an ampersand (&1B). - Epson commands, listed below, must be preceded by a forward slash (/RESET). - + Epson commands: (slash commands are specific to the Epson) - + Job Control: - + /RESET or /INIT Reset or initialize the printer /BELL or /BEEP Cause the printer's speaker to beep (not HS) /CAN Clear print buffers (not MX) @@ -45,18 +45,18 @@ /TWO Select Directional mode /ON Activate printer /OFF Turn off printer - + /FF or /EJECT Form Feed - + Page Control: - + /1/6 Set 6 lines per inch /1/8 Set 8 lines per inch /SKIP Set Skip perforation ON /SKIPOFF Set Skip perforation OFF - + Font Selection and Manipulation: - + /ITALIC Select italic char. set (only FX86, EX, LX, no LQ-1500, SX) /GRAPHIC Select graphic char. set (only FX86, EX, LX, @@ -72,21 +72,21 @@ /EMPHOFF Turn emphasize off /SPANISH Select spanish international char set /USA Select USA international char set - + $EXAMPLES$ cSetUp := "27,116,1" SET PRINT ON ? FT_PChr( cSetUp ) -> (Chr(27)+Chr(116)+Chr(1)) <select Epson char. graphics> - + ? FT_PChr( '27,"x",0' ) -> (Chr(27)+Chr(120)+Chr(0)) <Epson draft mode> - + ? FT_PChr( '&1B,"E"' ) -> (Chr(27)+Chr(69)) <HP reset> - + ? FT_PChr( "/ELITE,/NLQ" ) ->(Chr(27)+Chr(77)+Chr(27)+Chr(120)+Chr(1)) <Epson elite & near letter quality> $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/peek.txt b/harbour/contrib/hbnf/doc/en/peek.txt index 1b0851b86f..b5244d86e5 100644 --- a/harbour/contrib/hbnf/doc/en/peek.txt +++ b/harbour/contrib/hbnf/doc/en/peek.txt @@ -13,7 +13,7 @@ FT_PEEK( <nSegment>, <nOffset> ) -> nValue $ARGUMENTS$ <nSegment> is the segment of the desired memory address. - + <nOffset> is the offset of the desired memory address. $RETURNS$ <nValue> will be a value from 0 to 255 if all parameters were valid and @@ -24,7 +24,7 @@ location. The function will return the byte at the specified address as a numeric value. If you need this value as a character, use the Chr() function to convert it. - + This function was written for version 5.1 of MicroSoft C. You may have to modify the source code to use another compiler. $EXAMPLES$ diff --git a/harbour/contrib/hbnf/doc/en/pending.txt b/harbour/contrib/hbnf/doc/en/pending.txt index b85de8fd34..e37dbec207 100644 --- a/harbour/contrib/hbnf/doc/en/pending.txt +++ b/harbour/contrib/hbnf/doc/en/pending.txt @@ -14,13 +14,13 @@ [ <nWait> ], [ <cColor> ] ) -> NIL $ARGUMENTS$ <cMsg> is the message string to display. - + <nRow> is an optional screen row for message display, default row 24. - + <nCol> is an optional screen col for message display, default col 0. - + <nWait> is an optional wait (sec) between messages, default 5 sec. - + <cColor> is an optional color string for displayed messages, default is white text over red background. $RETURNS$ @@ -31,11 +31,11 @@ screen where users are expected to look for them. In order to give users a chance to read the current message before the next one is displayed we may need to insert a delay after each message. - + FT_PENDING() function displays messages by keeping track of the time of the last message and providing a delay ONLY if the next pending message is issued much too soon after the current one. - + $EXAMPLES$ FT_PENDING( "Message one",20,0,3,"W+/G" ) // Displays "Message one." // sets row to 20, col to 0. @@ -43,11 +43,11 @@ // bright white over green. FT_PENDING( "Message two" ) // Displays "Message two", after 5 sec. FT_PENDING( "Message three" ) // Displays "Message three", after 5 sec. - - + + Note that default row, col, wait time and color need to be set only once in the very first call to FT_PENDING() and only if the internal default values are not appropriate. - + $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/poke.txt b/harbour/contrib/hbnf/doc/en/poke.txt index 8b093efde5..cfb3d642d9 100644 --- a/harbour/contrib/hbnf/doc/en/poke.txt +++ b/harbour/contrib/hbnf/doc/en/poke.txt @@ -13,9 +13,9 @@ FT_POKE( <nSegment>, <nOffset>, <nValue> ) -> lResult $ARGUMENTS$ <nSegment> is the segment of the desired memory address. - + <nOffset> is the offset of the desired memory address. - + <nValue> is the value to write to the desired memory address. $RETURNS$ <lResult> will be .T. if all parameters were valid and the function was @@ -27,7 +27,7 @@ specified address. The value must be passed as a numeric; if the byte you wish to use is stored as a character, use the Asc() function to convert it. - + This function was written for version 5.1 of MicroSoft C. You may have to modify the source code to use another compiler. $EXAMPLES$ diff --git a/harbour/contrib/hbnf/doc/en/popadder.txt b/harbour/contrib/hbnf/doc/en/popadder.txt index 734e46d705..8e0f138bc1 100644 --- a/harbour/contrib/hbnf/doc/en/popadder.txt +++ b/harbour/contrib/hbnf/doc/en/popadder.txt @@ -21,10 +21,10 @@ application. It has the basic functions add, subtract, multiply, and divide. You may move it from one side of the screen to the other. It even displays a scrollable tape, if you want it. - - + + There are a few HOT Keys while using the Adder: - + <D>ecimals - change # of decimals <M>ove - the Adder from right display to left <T>ape - turn the Tape Display On or Off @@ -33,50 +33,50 @@ +-- 2nd Clear ADDER <ESC> - Quit <F10> - return a <TOTAL> to the active get - - + + A couple of notes about the adder: - - + + 1.) It was designed to be used on an Enhanced keyboard with separate <DELETE> key. <DELETE> is used to clear the adder. However, it will still work on a Standard keyboard. - + 2.) You do not have to display the tape. You may turn it on at any time by pressing <T>. You may SCROLL back through the tape once there are more than 16 entries in the adder, by pressing <S>. - + 3.) To Quit the Adder just press <ESC>. To return your Total to the application press <F10>. The adder will place the Total in the active GET variable using oGet:VarPut(). The adder will only return a Total to a numerical GET! - + 4.) There are many support functions that you might find interesting. They are part of my personal library, but are necessary to the operation of the adder. You might want to pull these out to reduce the overall size of the adder. Many are worth at least a little time studying. - + 5.) To make FT_Adder a Hot key from inside your application at the beginning of your application add the line: - + SET KEY K_ALT_A TO FT_Adder - + This will make <ALT-A> a key "Hot" and permit you to Pop - Up the adder from anywhere in the application. - + 6.) If you use FT_INKEY(), you can even have active hotkeys in an INKEY(). - - - - + + + + $EXAMPLES$ - + $SEEALSO$ - + $INCLUDE$ inkey.ch, setcurs.ch, achoice.ch $END$ diff --git a/harbour/contrib/hbnf/doc/en/proper.txt b/harbour/contrib/hbnf/doc/en/proper.txt index 590cff8c68..855d87e7e1 100644 --- a/harbour/contrib/hbnf/doc/en/proper.txt +++ b/harbour/contrib/hbnf/doc/en/proper.txt @@ -23,11 +23,11 @@ catches most names, including special cases such as names beginning with O' (O'Malley, O'Reilly) and hyphenated names (such as Susan Chia-Mei Lo). - + Next, it does a specific adjustment for words beginning in "Mc" It finds the first 'Mc' and capitalizes the next character after it. It does this for all occurrences of Mc. - + The original FT_PROPER() was written in Clipper by Glenn Scott and Mark Zechiel; it was re-written in C (and thus, optimized and enhanced) by Robert DiFalco. diff --git a/harbour/contrib/hbnf/doc/en/prtesc.txt b/harbour/contrib/hbnf/doc/en/prtesc.txt index 8099c3b905..3b3491b13d 100644 --- a/harbour/contrib/hbnf/doc/en/prtesc.txt +++ b/harbour/contrib/hbnf/doc/en/prtesc.txt @@ -14,7 +14,7 @@ $ARGUMENTS$ <cASCII> is the ASCII representation of the printer control codes in Lotus 123 format (e.g. "\027E" for Chr(27)+"E") - + "\nnn" will be converted to Chr(nnn) "\\" will be converted to "\" $RETURNS$ diff --git a/harbour/contrib/hbnf/doc/en/putkey.txt b/harbour/contrib/hbnf/doc/en/putkey.txt index 54ec869a0f..9a3efb44ca 100644 --- a/harbour/contrib/hbnf/doc/en/putkey.txt +++ b/harbour/contrib/hbnf/doc/en/putkey.txt @@ -23,20 +23,20 @@ Inkey() value, you can stuff any key, including function keys, into the keyboard buffer. However, this also means that unlike the KEYBOARD command, you can only stuff one keystroke at a time. - + You can easily create a User-Defined Command that makes this function even more like the KEYBOARD command. For example, - + #command KEYSTROKE <key> => FT_PUTKEY( <key> ) - + will create a command called KEYSTROKE that could be used as a companion command to KEYBOARD. The only difference is that it would insert a single keystroke instead of a string. - + Be aware that this function makes use of Clipper's internal event handler. If you don't like using internals, then don't use this function, you sniveling coward. - + This function is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, rearrange the SEGMENT and PROC directives and make any other necessary changes to the source code. diff --git a/harbour/contrib/hbnf/doc/en/qtr.txt b/harbour/contrib/hbnf/doc/en/qtr.txt index 238713a30a..006aeacc52 100644 --- a/harbour/contrib/hbnf/doc/en/qtr.txt +++ b/harbour/contrib/hbnf/doc/en/qtr.txt @@ -14,26 +14,26 @@ $ARGUMENTS$ <dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. - + <nQtrNum> is a number from 1 to 4 signifying a quarter. Defaults to current quarter if not supplied. $RETURNS$ A three element array containing the following data: - + aDateInfo[ 1 ] - The year and quarter as a character string "YYYYQQ" aDateInfo[ 2 ] - The beginning date of the quarter aDateInfo[ 3 ] - The ending date of the quarter $DESCRIPTION$ FT_QTR() returns an array containing data about the quarter containing the given date. - + Normally the return data will be based on a year beginning on January 1st with weeks beginning on Sunday. - + The beginning of year date and/or beginning of week day can be changed by using FT_DATECNFG(), which will affect all subsequent calls to FT_QTR() until another call to FT_DATECNFG(). - + The beginning of year date and beginning of week day may be reset to January 1 and Sunday by calling FT_DATECNFG() with no parameters. @@ -43,13 +43,13 @@ ? aDateInfo[ 1 ] // 199003 (3rd quarter) ? aDateInfo[ 2 ] // 07/01/90 beginning of quarter 3 ? aDateInfo[ 3 ] // 09/30/90 end of week quarter 3 - + // get info about quarter 2 in year containing 9/15/90 aDateInfo := FT_QTR( SToD( "19900915" ), 2 ) ? aDateInfo[ 1 ] // 199002 ? aDateInfo[ 2 ] // 04/01/90 beginning of quarter 2 ? aDateInfo[ 3 ] // 06/30/90 end of quarter 2 - + // get info about quarter 2 in current year (1991) aDateInfo := FT_QTR( , 2 ) ? aDateInfo[ 1 ] // 199102 diff --git a/harbour/contrib/hbnf/doc/en/rand1.txt b/harbour/contrib/hbnf/doc/en/rand1.txt index f10a2012bb..9395020655 100644 --- a/harbour/contrib/hbnf/doc/en/rand1.txt +++ b/harbour/contrib/hbnf/doc/en/rand1.txt @@ -18,10 +18,10 @@ $DESCRIPTION$ Generates a non-integer random number based on the Linear Congruential Method. - + If you need a random number between 1 and <nMax> inclusive, INT() the result and add 1. - + If you need a random number between 0 and <nMax> inclusive, then you should ROUND() the result. $EXAMPLES$ diff --git a/harbour/contrib/hbnf/doc/en/reboot.txt b/harbour/contrib/hbnf/doc/en/reboot.txt index 86eadb7940..333ffac12d 100644 --- a/harbour/contrib/hbnf/doc/en/reboot.txt +++ b/harbour/contrib/hbnf/doc/en/reboot.txt @@ -20,7 +20,7 @@ This function is valuable if you need to reboot the PC for some reason; e.g. an installation routine that modifies CONFIG.SYS or AUTOEXEC.BAT. - + The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very @@ -28,10 +28,10 @@ $EXAMPLES$ #define COLD 0 #define WARM 1 - + // Issue a warm boot - + FT_Reboot( WARM ) - + $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/rmdir.txt b/harbour/contrib/hbnf/doc/en/rmdir.txt index 5cd3df21e5..71b8114a8f 100644 --- a/harbour/contrib/hbnf/doc/en/rmdir.txt +++ b/harbour/contrib/hbnf/doc/en/rmdir.txt @@ -22,7 +22,7 @@ $DESCRIPTION$ This function is useful if you need to remove a subdirectory for some reason. - + The source code is written to adhere to Turbo Assembler's IDEAL mode. To use another assembler, you will need to rearrange the PROC and SEGMENT directives, and also the ENDP and ENDS directives (a very diff --git a/harbour/contrib/hbnf/doc/en/round.txt b/harbour/contrib/hbnf/doc/en/round.txt index 2ab9bbc842..99b005375c 100644 --- a/harbour/contrib/hbnf/doc/en/round.txt +++ b/harbour/contrib/hbnf/doc/en/round.txt @@ -15,18 +15,18 @@ [, <nAcceptableError> ] ] ] ] ) -> nNumber $ARGUMENTS$ <nNumber> is the number to round - + <nRoundToAmount> is the fraction to round to or the number of places, default is 2. - + <cRoundType> is the type of rounding desired - + "D" for Decimal (3 for thousandth, 1/1000) (default) "F" for Fraction (3 for thirds, 1/3) "W" for Whole numbers (3 for thousand, 1000) - + <cRoundDirection> is the direction to round the number toward - + "U" to round Up 1.31 -> 1.4 -1.31 -> -1.4 "D" to round Down 1.36 -> 1.3 @@ -35,7 +35,7 @@ -1.5 -> -2 1.49 -> 1 -1.49 -> -1 - + <nAcceptableError> is the amount that is considered acceptable to be within, i.e., if you're within this amount of the number you don't need to round @@ -50,16 +50,16 @@ $EXAMPLES$ // round normal to 2 decimal places nDollars := FT_ROUND( nDollars ) - + // round normal to 6 decimal places nIntRate := FT_ROUND( nIntRate, 6 ) - + // round to nearest thousands nPrice := FT_ROUND( nPrice, 3, NEAREST_WHOLE_NUMBER ) - + // round Up to nearest third nAmount := FT_ROUND( nAmount, 3, NEAREST_FRACTION, ROUND_UP ) - + // round down to 3 decimals Within .005 nAvg := FT_ROUND( nAvg, 3, , ROUND_DOWN, .005 ) $END$ diff --git a/harbour/contrib/hbnf/doc/en/savearr.txt b/harbour/contrib/hbnf/doc/en/savearr.txt index b9f7af36ba..8b6bc7b8f2 100644 --- a/harbour/contrib/hbnf/doc/en/savearr.txt +++ b/harbour/contrib/hbnf/doc/en/savearr.txt @@ -14,13 +14,13 @@ $ARGUMENTS$ <aArray> is any Clipper array except those containing compiled code blocks. - + <cFileName> is a DOS file name. - + <nErrorCode> will return any DOS file error. - + All arguments are required. - + $RETURNS$ .F. if there was a DOS file error or the array contained code blocks, otherwise returns .T. @@ -29,14 +29,14 @@ containing compiled code blocks, to a disc file. The array can be restored from the disc file using FT_RESTARR(). - + [10/1/92 Librarian note: - + This function does not appear to work with multi-dimensional arrays. If you'd care to modify it to support this feature, please do and send it to Glenn Scott 71620,1521.] - - + + $EXAMPLES$ aArray := { { "Invoice 1", SToD( "19910415" ), 1234.32, .T. },; { "Invoice 2", Date(), 234.98, .F. },; @@ -51,7 +51,7 @@ ELSE ? "Error writing array" ENDIF - + $SEEALSO$ FT_RESTARR() $END$ @@ -68,22 +68,22 @@ FT_RESTARR( <cFileName>, <nErrorCode> ) -> aArray $ARGUMENTS$ <cFileName> is a DOS file name. - + <nErrorCode> will return any DOS file error. - + All arguments are required. $RETURNS$ Return an array variable. $DESCRIPTION$ FT_RESTARR() restores an array which was saved to a disc file using FT_SAVEARR(). - + [10/1/92 Librarian note: - + This function does not appear to work with multi-dimensional arrays. If you'd care to modify it to support this feature, please do and send it to Glenn Scott 71620,1521.] - + $EXAMPLES$ aArray := { { "Invoice 1", SToD( "19910415" ), 1234.32, .T. },; { "Invoice 2", Date(), 234.98, .F. },; @@ -98,7 +98,7 @@ ELSE ? "Error writing array" ENDIF - + $SEEALSO$ FT_SAVEARR() $END$ diff --git a/harbour/contrib/hbnf/doc/en/scancode.txt b/harbour/contrib/hbnf/doc/en/scancode.txt index 499c325450..a85caf0c05 100644 --- a/harbour/contrib/hbnf/doc/en/scancode.txt +++ b/harbour/contrib/hbnf/doc/en/scancode.txt @@ -19,29 +19,29 @@ FT_SCANCODE() enables you to distinguish the different scancodes of similar keys (such as Grey minus versus regular minus), thus increasing the number of keys your input routine can recognize. - + It works like INKEY(), in that it waits for a key to be pressed. The scan code consists of two bytes, which are returned as a two-character string. - + For example, calling FT_SCANCODE() and pressing the Grey-minus key will return a two character string: - + Chr( 45 ) + Chr( 74 ) - + LASTKEY() is not updated by FT_SCANCODE(), so don't try to test LASTKEY() to see what was pressed during an FT_SCANCODE() call. Simply assign the return value to a variable and test that (see the test driver below). - + * This was adapted from a short C routine posted by John Kaster on NANFORUM. It was written in Clipper to help demonstrate the FT_INT86 function of the Nanforum Toolkit. - + This program requires FT_INT86(). $EXAMPLES$ cKey := FT_SCANCODE() - + [grey-] returns: Chr( 45 ) + Chr( 74 ) [-] returns: Chr( 45 ) + Chr( 12 ) [grey+] returns: Chr( 43 ) + Chr( 78 ) diff --git a/harbour/contrib/hbnf/doc/en/scregion.txt b/harbour/contrib/hbnf/doc/en/scregion.txt index 7be231fded..6b60684174 100644 --- a/harbour/contrib/hbnf/doc/en/scregion.txt +++ b/harbour/contrib/hbnf/doc/en/scregion.txt @@ -21,17 +21,17 @@ FT_SAVRGN() is similar to Clipper's SAVESCREEN(), but it saves the screen coordinates as well as the display information. The saved area can be restored by passing the returned string to FT_RSTRGN(). - + Note that the strings returned from FT_SAVRGN() and Clipper's SAVESCREEN() are not interchangeable. A screen region saved with with FT_SAVRGN() must be restored using FT_RSTRGN(). - + FT_SAVRGN() calls Clipper's SAVESCREEN(). Refer to the Clipper documentation for more information regarding this function. $EXAMPLES$ The following example uses FT_SAVRGN() and FT_RSTRGN() to save and restore a portion of the screen. - + @ 00, 00, 24, 79 BOX "111111111" // fill the screen with 1's cScreen = FT_SAVRGN(10, 10, 20, 30) // save a region @ 00, 00, 24, 79 BOX "222222222" // fill the screen with 2's @@ -52,7 +52,7 @@ FT_RSTRGN( <cScreen>, [ <nTop> ], [ <nLeft> ] ) -> NIL $ARGUMENTS$ <cScreen> is a screen region previously returned from FT_SAVRGN(). - + <nTop> and <nLeft> are optional parameters that define a new location for the upper left corner of the screen area contained in <cScreen>. Allowable values are 0 through 255. @@ -64,16 +64,16 @@ parameter will restore the saved region to its original location. <nTop> and <nLeft> may be used to define a new location for the upper left corner of the saved region. - + <nTop> and <nLeft> are dependent upon each other. You may not specify one without the other. - + FT_RSTRGN() calls Clipper's RESTSCREEN(). Refer to the Clipper documentation for more information regarding this function. $EXAMPLES$ The following example uses FT_RSTRGN() to restore a saved portion of the screen to different locations. - + @ 00, 00, 24, 79 BOX "111111111" // fill the screen with 1's cScreen = FT_SAVRGN(10, 10, 20, 30) // save a region @ 00, 00, 24, 79 BOX "222222222" // fill the screen with 2's @@ -102,12 +102,12 @@ allowable values for this parameter are "push", "pop", and "pop all". If the function is called with any other string as the first parameter no action is performed. - + <cAction> with a value of "push" will push a saved screen region onto the stack. A value of "pop" will restore the most recently pushed screen region. "pop all" tells the function to restore all screen images which are currently on the stack. - + The use of <nTop>, <nLeft>, <nBottom>, and <nRight> depends on the <cAction> parameter. If <cAction> is "push", the next four parameters define the screen region to save. If <cAction> is "pop" or "pop all" @@ -118,26 +118,26 @@ FT_RGNSTACK() allows multiple screens to be saved and restored from a stack. The stack is implemented with Clipper static array that is visible only to FT_RGNSTACK(). - + The purpose of FT_RGNSTACK() is to allow multiple screen regions to be managed without the need to remember the original coordinates or to create variables for each one. - + When called with "push", FT_RGNSTACK() places the saved screen area at the end of the static array. The array size is incremented by one to accommodate the new screen area. - + When called with "pop", the function restores the screen image stored in the last element of the array, and the array size is decremented by one. If "pop all" is specified, all the saved screens are restored until the array is empty. - + FT_RGNSTACK() calls FT_SAVRGN() and FT_RSTRGN(). Refer to the documentation for these two functions for more information. $EXAMPLES$ The following example uses FT_RGNSTACK() to save and restore various sections of the screen. - + @ 00, 00, 24, 79 BOX "111111111" // fill the screen with 1's FT_RGNSTACK( "push", 10, 05, 15, 15 ) // push a region @ 00, 00, 24, 79 BOX "222222222" // fill the screen with 2's diff --git a/harbour/contrib/hbnf/doc/en/setdate.txt b/harbour/contrib/hbnf/doc/en/setdate.txt index 8f1a9c8ecc..ea3dc292ff 100644 --- a/harbour/contrib/hbnf/doc/en/setdate.txt +++ b/harbour/contrib/hbnf/doc/en/setdate.txt @@ -14,31 +14,31 @@ $ARGUMENTS$ <dDate> is a Clipper date variable that you want to set the current DOS system date to. - + It is up to you to send in a valid date. The year must be within the range 1980 through 2099. If DOS thinks the date is not valid, it won't change the date. - + $RETURNS$ <lResult> is simply the result of FT_INT86(), passed back to your program. - + $DESCRIPTION$ FT_SETDATE() uses NANFOR.LIB's FT_INT86() function to invoke the DOS Set Date service (Interrupt 33, service 43). - + $EXAMPLES$ The following program takes a date from the command line and sets the DOS system date: - + PROCEDURE Main( cDate ) - + cDate := iif( cDate == NIL, DToS( Date() ), cDate ) ? "Setting date to: " + cDate + "... " FT_SETDATE( SToD( cDate ) ) ? "Today is now: " + DToC( Date() ) - + RETURN - + $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/setkeys.txt b/harbour/contrib/hbnf/doc/en/setkeys.txt index 69ac8fd6a4..4a631c68e1 100644 --- a/harbour/contrib/hbnf/doc/en/setkeys.txt +++ b/harbour/contrib/hbnf/doc/en/setkeys.txt @@ -23,18 +23,18 @@ function accomplishes the same task but without the side effects. It does so by directly modifying the memory location where Clipper stores the LastKey() value. - + Some highly unorthodox programming techniques, not to mention rather strange use of Clipper internals, was necessary to make this function work. If this makes you uncomfortable, then don't use this function, you worthless crybaby. $EXAMPLES$ hb_keyPut( K_ESC ) - + ? LastKey() // returns 27 - + FT_LastKey( K_F1 ) - + ? LastKey() // now returns 28 $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/setlastk.txt b/harbour/contrib/hbnf/doc/en/setlastk.txt index 69ac8fd6a4..4a631c68e1 100644 --- a/harbour/contrib/hbnf/doc/en/setlastk.txt +++ b/harbour/contrib/hbnf/doc/en/setlastk.txt @@ -23,18 +23,18 @@ function accomplishes the same task but without the side effects. It does so by directly modifying the memory location where Clipper stores the LastKey() value. - + Some highly unorthodox programming techniques, not to mention rather strange use of Clipper internals, was necessary to make this function work. If this makes you uncomfortable, then don't use this function, you worthless crybaby. $EXAMPLES$ hb_keyPut( K_ESC ) - + ? LastKey() // returns 27 - + FT_LastKey( K_F1 ) - + ? LastKey() // now returns 28 $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/settime.txt b/harbour/contrib/hbnf/doc/en/settime.txt index 2896985bf9..4be8f0dbc4 100644 --- a/harbour/contrib/hbnf/doc/en/settime.txt +++ b/harbour/contrib/hbnf/doc/en/settime.txt @@ -14,29 +14,29 @@ $ARGUMENTS$ <cTime> is a string in the form <hh:mm:ss> that you want to set the current DOS system time to. - + Use 24-hour time. It is up to you to send in a valid time. If DOS doesn't think it is valid, it won't reset the time anyway. $RETURNS$ <lResult> is simply the result of FT_INT86(), passed back to your program. - + $DESCRIPTION$ FT_SETTIME() uses NANFOR.LIB's FT_INT86() function to invoke the DOS Set Time service (Interrupt 33, service 45). - + $EXAMPLES$ The following program takes a time string from the command line and sets the DOS system time: - + PROCEDURE Main( cTime ) - + cTime := iif( cTime == NIL, Time(), cTime ) ? "Setting time to: " + cTime + "... " FT_SETTIME( cTime ) ? "Time is now: " + Time() - + RETURN - + $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/shadow.txt b/harbour/contrib/hbnf/doc/en/shadow.txt index cdfaeb79f6..6acb5baa53 100644 --- a/harbour/contrib/hbnf/doc/en/shadow.txt +++ b/harbour/contrib/hbnf/doc/en/shadow.txt @@ -24,11 +24,11 @@ This function allows you to implement the popular "shadow effect." It draws a shadow using the specified screen coordinates. The shadow is drawn along the bottom and right side of the specified region. - + The source code is written to TASM IDEAL mode. $EXAMPLES$ FT_Shadow( 10, 10, 15, 50, 8 ) // draw a dim shadow - + FT_Shadow( 10, 10, 15, 40, 47 ) // draw a green shadow $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/sinkey.txt b/harbour/contrib/hbnf/doc/en/sinkey.txt index 42a89a4b32..d265991910 100644 --- a/harbour/contrib/hbnf/doc/en/sinkey.txt +++ b/harbour/contrib/hbnf/doc/en/sinkey.txt @@ -25,7 +25,7 @@ for keypress). Therefore, it is necessary to differentiate between an explicit NIL and one that is a result of a formal parameter NOT being received. - + FT_SINKEY() differs from the standard INKEY() in that it will respond to any keys set with SET KEY TO or SetKey(). $EXAMPLES$ diff --git a/harbour/contrib/hbnf/doc/en/sleep.txt b/harbour/contrib/hbnf/doc/en/sleep.txt index 620c7dc4e2..19813bafe6 100644 --- a/harbour/contrib/hbnf/doc/en/sleep.txt +++ b/harbour/contrib/hbnf/doc/en/sleep.txt @@ -13,7 +13,7 @@ FT_SLEEP( <nSeconds>, [<nInitial>] ) -> nil $ARGUMENTS$ <nSeconds> is the number of seconds to pause - + <nInitial> is an optional clock value (from a call to SECONDS()) from which the <nSeconds> seconds are to elapse. Useful for setting a minimum time between the start of events @@ -26,13 +26,13 @@ resolution based upon the execution of the SECONDS() function. It does not use an input state such as INKEY(). The specified time is the minimum time sleeping and will usually be slightly longer. - + The second optional argument allows one to begin timing an event prior to executing some operation. This is useful when, for example, you input a key or mouse click and wish to do something but still want to note if the user double entered (mouse or key) within a certain time which in turn may have meaning within your program's context. - + The routine correctly handles passing through midnight but will not work for more than 24 hours. $EXAMPLES$ @@ -41,11 +41,11 @@ Example 2: nTime := SECONDS() // usually after some interupt from mouse or // keyboard - + ... intervening code ... - + FT_SLEEP( 0.5, nTime ) // Sleep until the sytem clock is // nTime+0.5 seconds. - + $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/sqzn.txt b/harbour/contrib/hbnf/doc/en/sqzn.txt index 7cbcf5d6ec..703f8aaa5c 100644 --- a/harbour/contrib/hbnf/doc/en/sqzn.txt +++ b/harbour/contrib/hbnf/doc/en/sqzn.txt @@ -22,15 +22,15 @@ stored in the database. The compression is 50% the storage space of the original number. The companion function, FT_UNSQZN returns the original number from the compressed string. - + $EXAMPLES$ REPLACE TRANS->cust_id WITH FT_SQZN( mcust_id, 8 ),; TRANS->amount WITH FT_SQZN( mamount, 12, 2 ) - + $SEEALSO$ FT_UNSQZN() $INCLUDE$ - + $END$ */ @@ -45,9 +45,9 @@ FT_UNSQZN( <cCompressed>, <nSize> [, <nDecimals> ] ) -> nValue $ARGUMENTS$ <cCompressed> - Compressed string, obtained from FT_SQZN() - + <nSize> - Size of numeric field - + <nDecimals> - Optional number of decimal places $RETURNS$ nValue - Uncompressed numeric value @@ -56,17 +56,17 @@ string. The compression is 50% the storage space of the original number. The original number must have been compressed using the FT_SQZN() function. - + This function, along with FT_SQZN() can be used to reduce disk storage requirements for numeric fields in a database file. - + $EXAMPLES$ mcust_id := FT_UNSQZN( TRANS->cust_id, 8 ),; mamount := FT_UNSQZN( TRANS->amount, 12, 2 ) - + $SEEALSO$ FT_SQZN() $INCLUDE$ - + $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/sysmem.txt b/harbour/contrib/hbnf/doc/en/sysmem.txt index 8f30b9ce8d..851f51e48d 100644 --- a/harbour/contrib/hbnf/doc/en/sysmem.txt +++ b/harbour/contrib/hbnf/doc/en/sysmem.txt @@ -18,11 +18,11 @@ $DESCRIPTION$ FT_SYSMEM() simply reports the amount of conventional memory (up to 640K) installed. - + FT_SYSMEM() uses DOS interrupt 12h to get this information. For information, refer to Peter Norton's _Programmer's Guide to the IBM PC_ (Brady). - + $EXAMPLES$ ? "Conventional memory installed: " + Str( FT_SYSMEM() ) + "K" $END$ diff --git a/harbour/contrib/hbnf/doc/en/tbwhile.txt b/harbour/contrib/hbnf/doc/en/tbwhile.txt index 72998cd406..d85a2e656b 100644 --- a/harbour/contrib/hbnf/doc/en/tbwhile.txt +++ b/harbour/contrib/hbnf/doc/en/tbwhile.txt @@ -20,34 +20,34 @@ aFields := {} AAdd( aFields, { "Last Name" , {|| Names->Last } } ) AAdd( aFields, { "First Name", {|| Names->First } } ) - + <bWhileCond> is the limiting WHILE condition as a block. Example 1: {|| Names->Last == "JONES" } Example 2: {|| Names->Last == "JONES" .AND. Names->First == "A" } - + <cKey> is the key to find top condition of WHILE. cLast := "JONES " cFirst := "A" Example 1: cKey := cLast Example 2: cKey := cLast + cFirst - + <nFreeze> is number of fields to freeze in TBrowse. Defaults to 0 if not passed. - + <lSaveScrn> is a logical indicating whether or not you want to save the screen from the calling program. Defaults to .T. if not passed. - + <cColorList> is a list of colors for the TBrowse columns. The 1st color is used as SAY/TBrowse Background and the 3rd and 4th colors are used as part of column:defColor := {3, 4} - + Thus if you pass a cColorList, you MUST pass at least 4 colors. Defaults to "N/W, N/BG, B/W, B/BG, B/W, B/BG, R/W, B/R" if not passed. - + <cColorShad> is the color of the TBrowse box shadow. Defaults to "N/N" if not passed. - + <nTop>, <nLeft>, <nBottom>, <nRight> are the coordinates of the area to display the TBrowse in. Defaults to 2, 2, MAXROW() - 2, MAXCOL() - 2 with shadowed box, i.e. full screen. @@ -70,15 +70,15 @@ LOCAL lSaveScrn := .T. LOCAL cColorList := "N/W, N/BG, B/W, B/BG, B/W, B/BG, R/W, B/R" LOCAL cColorShad := "N/N" - + USE TBNames INDEX TBNames NEW // indexed on Last + First - + * Pass Heading as character and Field as Block including Alias * To eliminate the need to use FIELDWBLOCK() function in FT_BRWSWHL() AAdd( aFields, { "Last Name" , {|| TBNames->Last } } ) AAdd( aFields, { "First Name", {|| TBNames->First } } ) AAdd( aFields, { "City" , {|| TBNames->City } } ) - + IF FT_BRWSWHL( aFields, bWhile, cKey, nFreeze, lSaveScrn, ; cColorList, cColorShad, 3, 6, MaxRow() - 2, MaxCol() - 6 ) == 0 ? "Sorry, NO Records Were Selected" diff --git a/harbour/contrib/hbnf/doc/en/tempfile.txt b/harbour/contrib/hbnf/doc/en/tempfile.txt index d14ee8af4f..98789fba78 100644 --- a/harbour/contrib/hbnf/doc/en/tempfile.txt +++ b/harbour/contrib/hbnf/doc/en/tempfile.txt @@ -15,35 +15,35 @@ <cPath> is the directory where you want to create the temporary file. If you omit this argument, the root of the current drive is assumed ("\"). - + If <lHide> is .T., then the file will be created with the hidden attribute set. The default is .F. $RETURNS$ <cFileSpec> should be your path, including the name of the newly created unique file. Use this with FOPEN(), etc. - + If a DOS error occurred when trying to create the file, a null string will be returned. - + $DESCRIPTION$ This function uses DOS Interrupt 21, service 5Ah (Create temporary file) to create a unique filename in a directory you specify. There will be no extension. After the file is created, you may then fopen() it and do any i/o you need (see the test driver in the source code). - + This function requires FT_INT86(). $EXAMPLES$ Create a unique file in the root of the current drive: - + myFile := FT_TEMPFIL() - + Create a unique file in the current directory and hide it: - + myFile := FT_TEMPFIL( "." + hb_ps(), .T. ) - + Create a unique file on another drive, but do not hide it: - + myFile := FT_TEMPFIL( "E:\nanfor\src\" ) $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/vertmenu.txt b/harbour/contrib/hbnf/doc/en/vertmenu.txt index 9a5f5f562b..8c9851adec 100644 --- a/harbour/contrib/hbnf/doc/en/vertmenu.txt +++ b/harbour/contrib/hbnf/doc/en/vertmenu.txt @@ -14,13 +14,13 @@ $ARGUMENTS$ <aMenuarray> is an array of menu options, messages, and action blocks. - + Each element in this array is a nested array with the structure: - + element[ x, 1 ] = menu option element[ x, 2 ] = message to be displayed when option is highlighted element[ x, 3 ] = code block to be executed when option is selected - + <cColors> is a string containing colors for the prompts, in the same format as that returned by Set( _SET_COLOR ). If not supplied, colors default to the current color setting. @@ -32,7 +32,7 @@ length, a box is drawn around the prompts, the box is automatically centered on the screen, and the underlying screen is restored after a menu selection has been made. - + Additionally, because you can tie action blocks to each menu option, you can save on a lot of DO CASE or IF..ELSEIF code in your main program. See the test code for a succinct demonstration. diff --git a/harbour/contrib/hbnf/doc/en/vidcur.txt b/harbour/contrib/hbnf/doc/en/vidcur.txt index d1711c1453..28ac1bda60 100644 --- a/harbour/contrib/hbnf/doc/en/vidcur.txt +++ b/harbour/contrib/hbnf/doc/en/vidcur.txt @@ -14,23 +14,23 @@ $ARGUMENTS$ <nPage> is the video page (defaults to current page, determined by FT_GETVPG() - + <nRow> is the row coordinate (defaults to 0 ) - + <nCol> is the column coordinate (defaults to 0 ) $RETURNS$ NIL $DESCRIPTION$ FT_SETVCUR() sets the cursor position on a specific video page. It uses FT_INT86() to invoke interrupt 10h, function 2. - + For more information on graphics programming, cursors, and video pages, refer to Richard Wilton's _Programmer's Guide to PC and PS/2 Video Systems_ (Microsoft Press). - + $EXAMPLES$ // Set the position to row 5, column 10 on video page 1: - + FT_SETVCUR( 1, 5, 10 ) $END$ */ @@ -49,28 +49,28 @@ Defaults to the current page, as returned by FT_GETVPG(). $RETURNS$ A four-element array (<aCurInfo>), set up as follows: - + aCurInfo[ 1 ] = Top line of cursor aCurInfo[ 2 ] = Bottom line of cursor aCurInfo[ 3 ] = Character row aCurInfo[ 4 ] = Character column - + $DESCRIPTION$ FT_GETVCUR() uses FT_INT86() to invoke interrupt 10h, function 3, to return the character cursor location for the specified video page. - + The top line and bottom line of cursor are set depending on the current cursor mode, and are only meaningful in alphanumeric video modes. - + For more information on graphics programming, cursors, and cursor modes, refer to Richard Wilton's _Programmer's Guide to PC and PS/2 Video Systems_ (Microsoft Press). - + $EXAMPLES$ aCurInfo := getVCur( 1 ) // Get info on cursor pos in page 1 ? "Row: " + Str( aCurInfo[ 3 ] ) + " Col: " + Str( aCurInfo[ 4 ] ) - + $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/video1.txt b/harbour/contrib/hbnf/doc/en/video1.txt index 05481362ba..059e13eccd 100644 --- a/harbour/contrib/hbnf/doc/en/video1.txt +++ b/harbour/contrib/hbnf/doc/en/video1.txt @@ -13,14 +13,14 @@ FT_VIDSTR( <nRow>, <nCol>, <cString> [, <nColor> ] ) -> NIL $ARGUMENTS$ <nRow> and <nCol> are the screen coordinates. - + <cString> is the string to be printed on the screen. - + <nColor> is an integer representing the color attribute. The formula is: - + nFore + ( nBack * 16 ) - + FT_VIDSTR() will display the string in the current color if <nColor> is not passed. $RETURNS$ @@ -32,10 +32,10 @@ screen prints where speed is important. $EXAMPLES$ FT_VIDSTR( 10, 20, "Enter Name :", 165 ) - + This example will print the specified text at coordinates 10, 20 in bright white on top of Magenta. - + $END$ */ @@ -50,12 +50,12 @@ FT_WRTChr( <nRow>, <nCol>, <cChar>, <nColor> ) -> NIL $ARGUMENTS$ <nRow> and <nCol> are the screen coordinates. - + <cChar> is the single character to print on the screen. - + <nColor> is an integer representing the color attribute. The formula is: - + nFore + ( nBack * 16 ) $RETURNS$ NIL @@ -71,11 +71,11 @@ FT_WRTChr( nX, nY, "â™", ( nX - 1 ) + ( nY * 16 ) ) NEXT NEXT - + This example will write the ASCII character 249 to every location on screen in every possible color combination. It will recognize the status of SetBlink(). It uses direct video writes for speed. - + $END$ */ @@ -91,12 +91,12 @@ $ARGUMENTS$ <nTRow>, <nLCol>, <nBRow> and <nRCol> are the screen coordinates to clear. - + <nColor> is an integer representing the color attribute. The formula is: - + nFore + ( nBack * 16 ) - + The default is black. $RETURNS$ NIL @@ -104,10 +104,10 @@ This is a high speed function to clear the screen at the given coordinates with the given color attribute. This does not change Clipper's color settings. It uses direct video writes for speed. - + $EXAMPLES$ FT_CLS( 0, 0, MaxRow(), MaxCol(), 165 ) - + This example will clear the entire screen with the colors bright white on magenta. $END$ @@ -125,10 +125,10 @@ $ARGUMENTS$ <nTRow>, <nLCol>, <nBRow>, and <nRCol> are the coordinates of the screen region. - + <nColor> is an integer representing the new color attribute. The formula is: - + nFore + ( nBack * 16 ) $RETURNS$ NIL @@ -138,7 +138,7 @@ video writes. $EXAMPLES$ FT_SETATTR( 0, 0, MaxRow(), MaxCol(), 95 ) - + This example will change the entire screen's colors to bright white on magenta without changing or overwriting any text on the screen. $END$ @@ -165,7 +165,7 @@ containing multiple color combinations. $EXAMPLES$ FT_REVATTR( 0, 0, MaxRow(), MaxCol() ) - + This example will change the entire screen's colors to their reverse attributes without changing or overwriting any text. $END$ @@ -191,7 +191,7 @@ only one character on screen and hence is faster and uses less memory. $EXAMPLES$ FT_REVCHR( 10, 20 ) - + This example will change the text and background at 10, 20 to it's reverse color attributes without changing or overwriting the character itself. diff --git a/harbour/contrib/hbnf/doc/en/wda.txt b/harbour/contrib/hbnf/doc/en/wda.txt index b6441f8372..05f9e5c48f 100644 --- a/harbour/contrib/hbnf/doc/en/wda.txt +++ b/harbour/contrib/hbnf/doc/en/wda.txt @@ -19,27 +19,27 @@ order to add the required <nWorkDays> $DESCRIPTION$ Let's say you are given the problem: - + "All invoices are due 10 working days from the date they are printed. Please display the due date on the invoice." - + When is the due date? Assuming you are printing the invoices today, your answer is: - + dDueDate := DATE() + ft_addWkDay( Date(), 10 ) - + A work day is defined as Monday through Friday. Unfortunately this routine does _not_ account for holidays. - + This documentation was written by Glenn Scott so if it's wrong, blame him. - + $EXAMPLES$ // Postdate 5 working days from the first of January dPost := SToD( "19910101" ) dPost += FT_ADDWKDY( dPost, 5 ) // returns 7 true days ? dPost // 01/08/91 - + $SEEALSO$ FT_WORKDAYS() $END$ diff --git a/harbour/contrib/hbnf/doc/en/week.txt b/harbour/contrib/hbnf/doc/en/week.txt index 85b6dfe610..be4316a861 100644 --- a/harbour/contrib/hbnf/doc/en/week.txt +++ b/harbour/contrib/hbnf/doc/en/week.txt @@ -14,26 +14,26 @@ $ARGUMENTS$ <dGivenDate> is any valid date in any date format. Defaults to current system date if not supplied. - + <nWeekNum> is a number from 1 to 53 signifying a week. Defaults to current week if not supplied. $RETURNS$ A three element array containing the following data: - + aDateInfo[ 1 ] - The year and week as a character string "YYYYWW" aDateInfo[ 2 ] - The beginning date of the week aDateInfo[ 3 ] - The ending date of the week $DESCRIPTION$ FT_WEEK() returns an array containing data about the week containing the given date. - + Normally the return data will be based on a year beginning on January 1st with weeks beginning on Sunday. - + The beginning of year date and/or beginning of week day can be changed by using FT_DATECNFG(), which will affect all subsequent calls to FT_WEEK() until another call to FT_DATECNFG(). - + The beginning of year date and beginning of week day may be reset to January 1 and Sunday by calling FT_DATECNFG() with no parameters. @@ -43,13 +43,13 @@ ? aDateInfo[ 1 ] // 199037 (37th week) ? aDateInfo[ 2 ] // 09/09/90 beginning of week 37 ? aDateInfo[ 3 ] // 09/15/90 end of week 37 - + // get info about week 25 in year containing 9/15/90 aDateInfo := FT_WEEK( SToD( "19900915" ), 25 ) ? aDateInfo[ 1 ] // 199025 ? aDateInfo[ 2 ] // 06/17/90 beginning of week 25 ? aDateInfo[ 3 ] // 06/23/90 end of week 25 - + // get info about week 25 in current year( 1991 ) aDateInfo := FT_WEEK( , 25 ) ? aDateInfo[ 1 ] // 199025 diff --git a/harbour/contrib/hbnf/doc/en/workdays.txt b/harbour/contrib/hbnf/doc/en/workdays.txt index 8b6b39e4e0..1744f929e9 100644 --- a/harbour/contrib/hbnf/doc/en/workdays.txt +++ b/harbour/contrib/hbnf/doc/en/workdays.txt @@ -13,22 +13,22 @@ FT_WORKDAYS( [ <dStart> ], [ <dStop> ] ) -> nDays $ARGUMENTS$ <dStart> is the beginning value for the date range. - + <dStop> is the ending value for the date range. - + $RETURNS$ The number of work days (Monday through Friday) between two dates. - + $DESCRIPTION$ FT_WORKDAYS() returns a number indicating the number of work days between two dates. Work days are considered Monday through Friday. (The five day work week none of us Clipper programmers have.) - + $EXAMPLES$ ? FT_WorkDays( SToD( "19910516" ), SToD( "19910520" ) ) // 3 (Th - Mo) ? FT_WorkDays( SToD( "19910518" ), SToD( "19910519" ) ) // 0 (Sa - Su) ? FT_WorkDays( SToD( "19910517" ), SToD( "19910517" ) ) // 1 (Fr - Fr) $SEEALSO$ - + $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/woy.txt b/harbour/contrib/hbnf/doc/en/woy.txt index 5807f49b64..4674518046 100644 --- a/harbour/contrib/hbnf/doc/en/woy.txt +++ b/harbour/contrib/hbnf/doc/en/woy.txt @@ -25,20 +25,20 @@ Date validation must be external to this function. $EXAMPLES$ These code fragments find the week number, given a date. - + // literal character date dDate := SToD( "19910101" ) nWkNum := FT_WOY( dDate ) // result: 1 - + // presume DOS date to be 01/06/91 nWkNum := FT_WOY( Date() ) // result: 2 - + // date input dDate := SToD( "" ) @ 4, 10 GET cDate // input 1991/07/04 READ nWkNum := FT_WOY( dDate ) // result: 27 - + // last day of year nWkNum := FT_WOY( SToD( "19911231" ) ) // result: 53 $END$ @@ -64,23 +64,23 @@ Date validation must be external to this function. $EXAMPLES$ These code fragments find the day number, given a date. - + // literal character date dDate := SToD( "19910101" ) nDayNum := FT_DOY( dDate ) // result: 1 - + // presume DOS date to be 01/06/91 nDayNum := FT_DOY( Date() ) // result: 6 - + // date input dDate := SToD( "" ) @ 4, 10 GET cDate // input 1991/07/04 READ nDayNum := FT_DOY( dDate ) // result: 185 - + // last day of year nDayNum := FT_DOY( SToD( "19911231" ) ) // result: 365 - + For a demonstration of this function, compile and link the program woy.prg in the Nanforum Toolkit source code. $END$ diff --git a/harbour/contrib/hbnf/doc/en/xbox.txt b/harbour/contrib/hbnf/doc/en/xbox.txt index f604452ade..4046eebb78 100644 --- a/harbour/contrib/hbnf/doc/en/xbox.txt +++ b/harbour/contrib/hbnf/doc/en/xbox.txt @@ -18,30 +18,30 @@ <cJustType> is a character indicating the type of text justification. "L" or "l" will cause the text to be left-justified in the box. Centered text is the default. - + <cRetWait> is a character which determines if the function will wait for a keypress after displaying the box. "W" or "w" will cause the function to wait for a keypress before returning control to the calling routine. Not waiting is the default - + <cBorType> is a character which determines whether a single or double border will be displayed. "D" or "d" will cause a double border to be displayed. A single border is the default. - + <cBorColor> is a character string denoting the border color. 'N/W' is the default if this parameter is not a string. - + <cBoxColor> is a character string denoting the text color. 'W/N' is the default if this parameter is not a string. - + <nStartRow> is a number denoting the starting row. If '99' is passed, the box is centered vertically. If necessary, nStartRow is decreased so the entire box can be displayed. - + <nStartCol> is a number denoting the starting column. If '99' is passed, the box is centered horizontally. If necessary, nStartCol is decreased so the entire box can be displayed. - + <cLine1> thru <cLine8> are 1 to 8 character strings to be displayed. They are truncated to fit on the screen if necessary. $RETURNS$ @@ -51,10 +51,10 @@ without needing to calculate the dimensions of the box. Only the upper left corner needs to be defined. The function will calculate the lower right corner based on the number and length of strings passed. - + A maximum of eight strings can be displayed. If a string is too long to fit on the screen it is truncated. - + The first seven parameters are optional. The default settings are: Lines of text are centered. Control is returned to the calling routine immediately. @@ -64,14 +64,14 @@ The box is centered both vertically and horizontally. $EXAMPLES$ The following displays a two-line box with default settings: - + FT_XBOX( ,,,,,,, "This is a test", "of the XBOX() function" ) - + The following uses all optional parameters and displays a three-line box. The box is left-justified with a double border. It has a yellow on red border and white on blue text. The function will wait for a keypress before returning control to the calling routine. - + FT_XBOX( "L", "W", "D", "GR+/R", "W/B", 5, 10, "It is so nice",; "to not have to do the messy chore",; "of calculating the box size!" ) diff --git a/harbour/contrib/hbnf/doc/en/year.txt b/harbour/contrib/hbnf/doc/en/year.txt index 9914f7953b..a376109ae8 100644 --- a/harbour/contrib/hbnf/doc/en/year.txt +++ b/harbour/contrib/hbnf/doc/en/year.txt @@ -16,21 +16,21 @@ to current system date if not supplied. $RETURNS$ A three element array containing the following data: - + aDateInfo[ 1 ] - The year as a character string "YYYY" aDateInfo[ 2 ] - The beginning date of the year aDateInfo[ 3 ] - The ending date of the year $DESCRIPTION$ FT_YEAR() returns an array containing data about the year containing the given date. - + Normally the return data will be based on a year beginning on January 1st. - + The beginning of year date can be changed by using FT_DATECNFG(), which will affect all subsequent calls to FT_YEAR() until another call to FT_DATECNFG(). - + The beginning of year date may be reset to January 1 by calling FT_DATECNFG() with no parameters. $EXAMPLES$ @@ -40,7 +40,7 @@ ? aDateInfo[ 1 ] // 1990 ? aDateInfo[ 2 ] // 01/01/90 beginning of year ? aDateInfo[ 3 ] // 12/31/90 end of year - + // get info about current year (1991). aDateInfo := FT_YEAR() ? aDateInfo[ 1 ] // 1991 diff --git a/harbour/contrib/hbnf/dosver.c b/harbour/contrib/hbnf/dosver.c index 170a6c8c64..fadee11702 100644 --- a/harbour/contrib/hbnf/dosver.c +++ b/harbour/contrib/hbnf/dosver.c @@ -60,7 +60,7 @@ HB_FUNC( FT_DOSVER ) { #if defined( HB_OS_DOS ) { - char * pszPlatform = ( char * ) hb_xgrab( 256 ); + char * pszPlatform = ( char * ) hb_xgrab( 256 ); union REGS regs; regs.h.ah = 0x30; diff --git a/harbour/contrib/hbnf/easter.prg b/harbour/contrib/hbnf/easter.prg index 3715a3f3d6..a0800c1084 100644 --- a/harbour/contrib/hbnf/easter.prg +++ b/harbour/contrib/hbnf/easter.prg @@ -93,4 +93,4 @@ FUNCTION FT_EASTER( nYear ) nYear := 0 ENDIF - RETURN SToD( Str( nYear,4 ) + PadL( nMonth, 2, "0" ) + PadL( Int( nDay ), 2, "0" ) ) + RETURN hb_SToD( Str( nYear, 4 ) + PadL( nMonth, 2, "0" ) + PadL( Int( nDay ), 2, "0" ) ) diff --git a/harbour/contrib/hbnf/elapmil.prg b/harbour/contrib/hbnf/elapmil.prg index 20deb70b8d..d547b76b1c 100644 --- a/harbour/contrib/hbnf/elapmil.prg +++ b/harbour/contrib/hbnf/elapmil.prg @@ -25,5 +25,6 @@ FUNCTION FT_ELAPMIN( cTime1, cTime2 ) - RETURN ( ( Val( Left( cTime2, 2 ) ) * 60 ) + ( Val( Right( cTime2, 2 ) ) ) ) - ; - ( ( Val( Left( cTime1, 2 ) ) * 60 ) + ( Val( Right( cTime1, 2 ) ) ) ) + RETURN ; + ( ( Val( Left( cTime2, 2 ) ) * 60 ) + ( Val( Right( cTime2, 2 ) ) ) ) - ; + ( ( Val( Left( cTime1, 2 ) ) * 60 ) + ( Val( Right( cTime1, 2 ) ) ) ) diff --git a/harbour/contrib/hbnf/eltime.prg b/harbour/contrib/hbnf/eltime.prg index 7257675987..30c430bef4 100644 --- a/harbour/contrib/hbnf/eltime.prg +++ b/harbour/contrib/hbnf/eltime.prg @@ -36,8 +36,9 @@ FUNCTION FT_ELTIME( cTIME1, cTIME2 ) nMINS := Int( ( nDELSECS - nHRS * 3600 ) / 60 ) nSECS := nDELSECS - ( nHRS * 3600 ) - ( nMINS * 60 ) - RETURN Right( "00" + hb_ntos( nHRS ), 2 ) + ; - ":" + ; - Right( "00" + hb_ntos( nMINS ), 2 ) + ; - ":" + ; - Right( "00" + hb_ntos( nSECS ), 2 ) + RETURN ; + Right( "00" + hb_ntos( nHRS ), 2 ) + ; + ":" + ; + Right( "00" + hb_ntos( nMINS ), 2 ) + ; + ":" + ; + Right( "00" + hb_ntos( nSECS ), 2 ) diff --git a/harbour/contrib/hbnf/findith.prg b/harbour/contrib/hbnf/findith.prg index 919543a418..0696bb6158 100644 --- a/harbour/contrib/hbnf/findith.prg +++ b/harbour/contrib/hbnf/findith.prg @@ -28,6 +28,7 @@ FUNCTION FT_FINDITH( cCheckFor, cCheckIn, nWhichOccurrence, lIgnoreCase ) LOCAL nIthOccurrence // Is Case Important?? + IF ! HB_ISLOGICAL( lIgnoreCase ) .OR. lIgnoreCase cCheckFor := Upper( cCheckFor ) cCheckIn := Upper( cCheckIn ) diff --git a/harbour/contrib/hbnf/floptst.prg b/harbour/contrib/hbnf/floptst.prg index dcd6e1e772..a47969cec9 100644 --- a/harbour/contrib/hbnf/floptst.prg +++ b/harbour/contrib/hbnf/floptst.prg @@ -61,7 +61,9 @@ /* NOTE: Harbour port accepts a path as a string for checking for writability. It also won't detected unformatted state and "not ready" state. [vszakats] */ + FUNCTION FT_FLOPTST( nDriveNum ) + LOCAL cFileName LOCAL fhnd diff --git a/harbour/contrib/hbnf/ftattr.c b/harbour/contrib/hbnf/ftattr.c index bb749ed8a7..942145f586 100644 --- a/harbour/contrib/hbnf/ftattr.c +++ b/harbour/contrib/hbnf/ftattr.c @@ -28,16 +28,16 @@ HB_FUNC( FT_SAVEATT ) { - int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */ - int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */ - int iMaxRow = hb_gtMaxRow(); - int iMaxCol = hb_gtMaxCol(); - int iBottom = hb_parnidef( 3, iMaxRow ); - int iRight = hb_parnidef( 4, iMaxRow ); + int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */ + int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */ + int iMaxRow = hb_gtMaxRow(); + int iMaxCol = hb_gtMaxCol(); + int iBottom = hb_parnidef( 3, iMaxRow ); + int iRight = hb_parnidef( 4, iMaxRow ); - HB_SIZE nSize; - char * pBuffer; - char * pAttrib; + HB_SIZE nSize; + char * pBuffer; + char * pAttrib; if( iTop < 0 ) iTop = 0; @@ -50,8 +50,8 @@ HB_FUNC( FT_SAVEATT ) if( iTop <= iBottom && iLeft <= iRight ) { - nSize = ( iBottom - iTop + 1 ) * ( iRight - iLeft + 1 ); - pBuffer = pAttrib = ( char * ) hb_xgrab( nSize + 1 ); + nSize = ( iBottom - iTop + 1 ) * ( iRight - iLeft + 1 ); + pBuffer = pAttrib = ( char * ) hb_xgrab( nSize + 1 ); while( iTop <= iBottom ) { int iCol = iLeft; @@ -100,13 +100,13 @@ HB_FUNC( FT_RESTATT ) if( nLen ) { - int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */ - int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */ - int iMaxRow = hb_gtMaxRow(); - int iMaxCol = hb_gtMaxCol(); - int iBottom = hb_parnidef( 3, iMaxRow ); - int iRight = hb_parnidef( 4, iMaxCol ); - const char * pAttrib = hb_parc( 5 ); + int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */ + int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */ + int iMaxRow = hb_gtMaxRow(); + int iMaxCol = hb_gtMaxCol(); + int iBottom = hb_parnidef( 3, iMaxRow ); + int iRight = hb_parnidef( 4, iMaxCol ); + const char * pAttrib = hb_parc( 5 ); if( iTop < 0 ) iTop = 0; diff --git a/harbour/contrib/hbnf/fttext.c b/harbour/contrib/hbnf/fttext.c index abe32de154..cd8377a49a 100644 --- a/harbour/contrib/hbnf/fttext.c +++ b/harbour/contrib/hbnf/fttext.c @@ -163,7 +163,7 @@ typedef struct { - int area; + int area; /* arrays used by the text workareas */ long recno[ TEXT_WORKAREAS ]; HB_FOFFSET offset[ TEXT_WORKAREAS ]; @@ -201,26 +201,26 @@ HB_FUNC( FT_FOFFSET ) hb_retnint( ft_text->offset[ ft_text->area ] ); } -#define FT_CHR_CR 13 -#define FT_CHR_LF 10 -#define FT_CHR_EOF 26 +#define FT_CHR_CR 13 +#define FT_CHR_LF 10 +#define FT_CHR_EOF 26 HB_FUNC( FT_FUSE ) { - PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); + PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); - int attr = hb_parnidef( 2, FO_READWRITE | FO_DENYNONE ); + int attr = hb_parnidef( 2, FO_READWRITE | FO_DENYNONE ); ft_text->error[ ft_text->area ] = 0; if( HB_ISCHAR( 1 ) ) { - ft_text->handles[ ft_text->area ] = hb_fsOpen( hb_parc( 1 ), ( HB_USHORT ) attr ); + ft_text->handles[ ft_text->area ] = hb_fsOpen( hb_parc( 1 ), ( HB_USHORT ) attr ); if( ft_text->handles[ ft_text->area ] <= 0 ) ft_text->error[ ft_text->area ] = hb_fsError(); - ft_text->offset[ ft_text->area ] = 0; - ft_text->recno[ ft_text->area ] = 1; - ft_text->lastbyte[ ft_text->area ] = hb_fsSeekLarge( ft_text->handles[ ft_text->area ], 0, FS_END ); + ft_text->offset[ ft_text->area ] = 0; + ft_text->recno[ ft_text->area ] = 1; + ft_text->lastbyte[ ft_text->area ] = hb_fsSeekLarge( ft_text->handles[ ft_text->area ], 0, FS_END ); hb_retnint( ft_text->handles[ ft_text->area ] ); } else @@ -229,24 +229,24 @@ HB_FUNC( FT_FUSE ) { hb_fsClose( ft_text->handles[ ft_text->area ] ); hb_retnint( 0 ); - ft_text->recno[ ft_text->area ] = 0L; - ft_text->offset[ ft_text->area ] = 0L; - ft_text->handles[ ft_text->area ] = 0; - ft_text->last_rec[ ft_text->area ] = 0L; - ft_text->last_off[ ft_text->area ] = 0L; - ft_text->lastbyte[ ft_text->area ] = 0L; - ft_text->isBof[ ft_text->area ] = HB_FALSE; - ft_text->isEof[ ft_text->area ] = HB_FALSE; + ft_text->recno[ ft_text->area ] = 0L; + ft_text->offset[ ft_text->area ] = 0L; + ft_text->handles[ ft_text->area ] = 0; + ft_text->last_rec[ ft_text->area ] = 0L; + ft_text->last_off[ ft_text->area ] = 0L; + ft_text->lastbyte[ ft_text->area ] = 0L; + ft_text->isBof[ ft_text->area ] = HB_FALSE; + ft_text->isEof[ ft_text->area ] = HB_FALSE; } } } HB_FUNC( FT_FSELECT ) { - PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); + PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); - int oldarea = ft_text->area + 1; - int newArea; + int oldarea = ft_text->area + 1; + int newArea; if( HB_ISNUM( 1 ) ) { @@ -332,25 +332,25 @@ HB_FUNC( FT_FSKIP ) Returns a long indicating the number of records skipped */ static long _ft_skip( long iRecs ) { - PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); + PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); - HB_ISIZ iByteCount; - HB_ISIZ iBytesRead, iBytesRemaining; - char * cPtr; - long iSkipped = 0; + HB_ISIZ iByteCount; + HB_ISIZ iBytesRead, iBytesRemaining; + char * cPtr; + long iSkipped = 0; - char * cBuff = ( char * ) hb_xgrab( BUFFSIZE ); - HB_FOFFSET fpOffset = ft_text->offset[ ft_text->area ]; + char * cBuff = ( char * ) hb_xgrab( BUFFSIZE ); + HB_FOFFSET fpOffset = ft_text->offset[ ft_text->area ]; - ft_text->isBof[ ft_text->area ] = HB_FALSE; - ft_text->isEof[ ft_text->area ] = HB_FALSE; - ft_text->error[ ft_text->area ] = 0; + ft_text->isBof[ ft_text->area ] = HB_FALSE; + ft_text->isEof[ ft_text->area ] = HB_FALSE; + ft_text->error[ ft_text->area ] = 0; /* iRecs is zero if they want to find the EOF, start a top of file */ if( iRecs == 0 ) { - fpOffset = 0L; - ft_text->recno[ ft_text->area ] = 1; + fpOffset = 0L; + ft_text->recno[ ft_text->area ] = 1; } if( iRecs >= 0 ) @@ -368,10 +368,10 @@ static long _ft_skip( long iRecs ) if( ! iBytesRead ) { /* buffer is empty thus EOF, set vars and quit */ - ft_text->isEof[ ft_text->area ] = HB_TRUE; - ft_text->last_rec[ ft_text->area ] = ft_text->recno[ ft_text->area ]; - ft_text->last_off[ ft_text->area ] = ft_text->offset[ ft_text->area ]; - ft_text->error[ ft_text->area ] = hb_fsError(); + ft_text->isEof[ ft_text->area ] = HB_TRUE; + ft_text->last_rec[ ft_text->area ] = ft_text->recno[ ft_text->area ]; + ft_text->last_off[ ft_text->area ] = ft_text->offset[ ft_text->area ]; + ft_text->error[ ft_text->area ] = hb_fsError(); break; } @@ -386,9 +386,9 @@ static long _ft_skip( long iRecs ) { /* found a CRLF, iByteCount points to first char of next record */ - iBytesRemaining -= iByteCount; - fpOffset += iByteCount; - cPtr += iByteCount; + iBytesRemaining -= iByteCount; + fpOffset += iByteCount; + cPtr += iByteCount; ft_text->offset[ ft_text->area ] = fpOffset; ft_text->recno[ ft_text->area ]++; iSkipped++; @@ -405,9 +405,9 @@ static long _ft_skip( long iRecs ) if( iBytesRead != BUFFSIZE ) { /* buffer was not full, thus EOF, set vars and quit */ - iBytesRemaining = 0; - ft_text->last_rec[ ft_text->area ] = ft_text->recno[ ft_text->area ]; - ft_text->last_off[ ft_text->area ] = ft_text->offset[ ft_text->area ]; + iBytesRemaining = 0; + ft_text->last_rec[ ft_text->area ] = ft_text->recno[ ft_text->area ]; + ft_text->last_off[ ft_text->area ] = ft_text->offset[ ft_text->area ]; if( iRecs ) ft_text->isEof[ ft_text->area ] = HB_TRUE; } @@ -416,8 +416,8 @@ static long _ft_skip( long iRecs ) /* buffer was full, so probably not EOF, but maybe CRLF straddled end of buffer, so back up pointer a bit before doing the next read */ - fpOffset = hb_fsSeekLarge( ft_text->handles[ ft_text->area ], 0, FS_RELATIVE ) - 1; - iBytesRemaining = 0; + fpOffset = hb_fsSeekLarge( ft_text->handles[ ft_text->area ], 0, FS_RELATIVE ) - 1; + iBytesRemaining = 0; } } } @@ -447,20 +447,20 @@ static long _ft_skip( long iRecs ) if( ! iBytesRead ) { /* buffer is empty thus file is zero len, set vars and quit */ - ft_text->isBof[ ft_text->area ] = HB_TRUE; - ft_text->isEof[ ft_text->area ] = HB_TRUE; - ft_text->recno[ ft_text->area ] = 0; - ft_text->offset[ ft_text->area ] = 0; - ft_text->last_rec[ ft_text->area ] = 0; - ft_text->error[ ft_text->area ] = hb_fsError(); + ft_text->isBof[ ft_text->area ] = HB_TRUE; + ft_text->isEof[ ft_text->area ] = HB_TRUE; + ft_text->recno[ ft_text->area ] = 0; + ft_text->offset[ ft_text->area ] = 0; + ft_text->last_rec[ ft_text->area ] = 0; + ft_text->error[ ft_text->area ] = hb_fsError(); break; } /* set pointer within buffer */ - iBytesRemaining = ( int ) ( ft_text->offset[ ft_text->area ] - fpOffset ); + iBytesRemaining = ( int ) ( ft_text->offset[ ft_text->area ] - fpOffset ); - cPtr = cBuff + iBytesRemaining; + cPtr = cBuff + iBytesRemaining; /* parse the buffer while there's still stuff in it */ do @@ -472,10 +472,10 @@ static long _ft_skip( long iRecs ) { /* found a CRLF, iByteCount points to first char of next record */ - iBytesRemaining -= iByteCount; + iBytesRemaining -= iByteCount; ft_text->offset[ ft_text->area ] -= iByteCount; - cPtr -= iByteCount; - fpOffset = ft_text->offset[ ft_text->area ]; + cPtr -= iByteCount; + fpOffset = ft_text->offset[ ft_text->area ]; ft_text->recno[ ft_text->area ]--; iSkipped++; if( iSkipped == iRecs ) @@ -489,7 +489,7 @@ static long _ft_skip( long iRecs ) if( iBytesRead != BUFFSIZE ) { /* buffer was not full, thus BOF, set vars and quit */ - iBytesRemaining = 0; + iBytesRemaining = 0; ft_text->offset[ ft_text->area ] = 0; ft_text->recno[ ft_text->area ] = 1; ft_text->isBof[ ft_text->area ] = HB_TRUE; @@ -521,14 +521,14 @@ HB_FUNC( FT_FREADLN ) { PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); - HB_ISIZ iByteCount; - HB_ISIZ iBytesRead; - char * cPtr = ( char * ) hb_xgrab( BUFFSIZE ); + HB_ISIZ iByteCount; + HB_ISIZ iBytesRead; + char * cPtr = ( char * ) hb_xgrab( BUFFSIZE ); hb_fsSeekLarge( ft_text->handles[ ft_text->area ], ft_text->offset[ ft_text->area ], FS_SET ); - iBytesRead = hb_fsReadLarge( ft_text->handles[ ft_text->area ], cPtr, BUFFSIZE ); + iBytesRead = hb_fsReadLarge( ft_text->handles[ ft_text->area ], cPtr, BUFFSIZE ); - ft_text->error[ ft_text->area ] = 0; + ft_text->error[ ft_text->area ] = 0; if( ! iBytesRead ) ft_text->error[ ft_text->area ] = hb_fsError(); @@ -545,14 +545,14 @@ HB_FUNC( FT_FREADLN ) HB_FUNC( FT_FDELETE ) { - PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); + PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); - int iBytesRead; - HB_FOFFSET srcPtr; - HB_FOFFSET destPtr; - long cur_rec = ft_text->recno[ ft_text->area ]; - HB_FOFFSET cur_off = ft_text->offset[ ft_text->area ]; - char * Buff = ( char * ) hb_xgrab( BUFFSIZE ); + int iBytesRead; + HB_FOFFSET srcPtr; + HB_FOFFSET destPtr; + long cur_rec = ft_text->recno[ ft_text->area ]; + HB_FOFFSET cur_off = ft_text->offset[ ft_text->area ]; + char * Buff = ( char * ) hb_xgrab( BUFFSIZE ); /* save address to current record ( first record to be deleted ) */ destPtr = ft_text->offset[ ft_text->area ]; @@ -565,10 +565,10 @@ HB_FUNC( FT_FDELETE ) do { hb_fsSeekLarge( ft_text->handles[ ft_text->area ], srcPtr, FS_SET ); - iBytesRead = hb_fsRead( ft_text->handles[ ft_text->area ], Buff, BUFFSIZE ); /* now read in a big glob */ - srcPtr += iBytesRead; + iBytesRead = hb_fsRead( ft_text->handles[ ft_text->area ], Buff, BUFFSIZE ); /* now read in a big glob */ + srcPtr += iBytesRead; hb_fsSeekLarge( ft_text->handles[ ft_text->area ], destPtr, FS_SET ); - destPtr += hb_fsWriteLarge( ft_text->handles[ ft_text->area ], Buff, iBytesRead ); + destPtr += hb_fsWriteLarge( ft_text->handles[ ft_text->area ], Buff, iBytesRead ); } while( iBytesRead > 0 ); @@ -576,14 +576,14 @@ HB_FUNC( FT_FDELETE ) hb_fsSeekLarge( ft_text->handles[ ft_text->area ], srcPtr, FS_SET ); hb_fsWrite( ft_text->handles[ ft_text->area ], Buff, 0 ); - ft_text->error[ ft_text->area ] = hb_fsError(); + ft_text->error[ ft_text->area ] = hb_fsError(); /* restore pointers */ - ft_text->recno[ ft_text->area ] = cur_rec; - ft_text->offset[ ft_text->area ] = cur_off; + ft_text->recno[ ft_text->area ] = cur_rec; + ft_text->offset[ ft_text->area ] = cur_off; /* re_calc EOF */ - ft_text->lastbyte[ ft_text->area ] = hb_fsSeekLarge( ft_text->handles[ ft_text->area ], 0L, FS_END ); + ft_text->lastbyte[ ft_text->area ] = hb_fsSeekLarge( ft_text->handles[ ft_text->area ], 0L, FS_END ); _ft_skip( 0 ); /* restore pointers again */ @@ -601,11 +601,11 @@ HB_FUNC( FT_FDELETE ) HB_FUNC( FT_FINSERT ) { - PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); + PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); - int no_lines = hb_parnidef( 1, 1 ); - HB_ISIZ no_bytes = no_lines * 2; - int err = 1; + int no_lines = hb_parnidef( 1, 1 ); + HB_ISIZ no_bytes = no_lines * 2; + int err = 1; if( _ins_buff( ft_text, no_bytes ) ) err = 0; @@ -614,8 +614,8 @@ HB_FUNC( FT_FINSERT ) while( no_lines-- ) if( ! _writeeol( ft_text->handles[ ft_text->area ] ) ) { - ft_text->error[ ft_text->area ] = hb_fsError(); - err = 0; + ft_text->error[ ft_text->area ] = hb_fsError(); + err = 0; break; } } @@ -625,13 +625,13 @@ HB_FUNC( FT_FINSERT ) HB_FUNC( FT_FAPPEND ) { - PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); + PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); - int no_lines = hb_parnidef( 1, 1 ); - HB_ISIZ iRead; - HB_ISIZ iByteCount; + int no_lines = hb_parnidef( 1, 1 ); + HB_ISIZ iRead; + HB_ISIZ iByteCount; - char * buff = ( char * ) hb_xgrab( BUFFSIZE ); + char * buff = ( char * ) hb_xgrab( BUFFSIZE ); ft_text->error[ ft_text->area ] = 0; @@ -687,16 +687,16 @@ HB_FUNC( FT_FAPPEND ) HB_FUNC( FT_FWRITELN ) { - PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); + PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); - const char * theData = hb_parc( 1 ); - HB_ISIZ iDataLen = hb_parclen( 1 ); - HB_BOOL bInsert = hb_parl( 2 ); - int err; - HB_ISIZ iLineLen = 0; - HB_ISIZ iRead, iEOL; + const char * theData = hb_parc( 1 ); + HB_ISIZ iDataLen = hb_parclen( 1 ); + HB_BOOL bInsert = hb_parl( 2 ); + int err; + HB_ISIZ iLineLen = 0; + HB_ISIZ iRead, iEOL; - char * buffer; + char * buffer; /* position file pointer to insertion point */ hb_fsSeekLarge( ft_text->handles[ ft_text->area ], ft_text->offset[ ft_text->area ], FS_SET ); @@ -752,8 +752,8 @@ HB_FUNC( FT_FWRITELN ) /* write the new record's contents */ hb_fsWriteLarge( ft_text->handles[ ft_text->area ], theData, iDataLen ); } - ft_text->error[ ft_text->area ] = hb_fsError(); - err = ( ft_text->error[ ft_text->area ] ) ? 0 : 1; + ft_text->error[ ft_text->area ] = hb_fsError(); + err = ( ft_text->error[ ft_text->area ] ) ? 0 : 1; } hb_retl( err ); } @@ -762,13 +762,13 @@ HB_FUNC_TRANSLATE( FT_FWRITEL, FT_FWRITELN ) HB_FUNC( FT_FLASTRE ) { - PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); + PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); - long cur_rec; - HB_FOFFSET cur_offset; + long cur_rec; + HB_FOFFSET cur_offset; - cur_rec = ft_text->recno[ ft_text->area ]; - cur_offset = ft_text->offset[ ft_text->area ]; + cur_rec = ft_text->recno[ ft_text->area ]; + cur_offset = ft_text->offset[ ft_text->area ]; HB_FUNC_EXEC( FT_FGOBOT ); hb_retnl( ft_text->last_rec[ ft_text->area ] ); @@ -793,9 +793,9 @@ HB_FUNC( FT_FBOF ) HB_FUNC( FT_FGOTO ) { - PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); + PFT_TEXT ft_text = ( PFT_TEXT ) hb_stackGetTSD( &s_fttext ); - long target = hb_parnl( 1 ); + long target = hb_parnl( 1 ); /* if a recno was passed, do a relative skip */ if( target ) @@ -809,7 +809,7 @@ HB_FUNC( FT_FGOTO ) else { /* goto 0 passed, go top then skip back */ - target = ft_text->recno[ ft_text->area ]; + target = ft_text->recno[ ft_text->area ]; ft_text->offset[ ft_text->area ] = 0L; ft_text->recno[ ft_text->area ] = 1L; @@ -865,8 +865,8 @@ static HB_ISIZ _findbol( char * buf, HB_ISIZ buf_len ) if( tmp != 0 ) { - char * p = buf - 1; - char b = *p; + char * p = buf - 1; + char b = *p; if( b == FT_CHR_EOF ) { @@ -913,32 +913,32 @@ static HB_ISIZ _findbol( char * buf, HB_ISIZ buf_len ) write to them before they mean anything */ static int _ins_buff( PFT_TEXT ft_text, HB_ISIZ iLen ) { - char * ReadBuff = ( char * ) hb_xgrab( BUFFSIZE ); - char * WriteBuff = ( char * ) hb_xgrab( BUFFSIZE ); - char * SaveBuff; - HB_FOFFSET fpRead, fpWrite; - HB_ISIZ WriteLen, ReadLen; - HB_ISIZ SaveLen; - HB_ISIZ iLenRemaining = iLen; + char * ReadBuff = ( char * ) hb_xgrab( BUFFSIZE ); + char * WriteBuff = ( char * ) hb_xgrab( BUFFSIZE ); + char * SaveBuff; + HB_FOFFSET fpRead, fpWrite; + HB_ISIZ WriteLen, ReadLen; + HB_ISIZ SaveLen; + HB_ISIZ iLenRemaining = iLen; /* set target move distance, this allows iLen to be greater than BUFFSIZE */ - iLen = HB_MIN( iLenRemaining, BUFFSIZE ); - iLenRemaining -= iLen; + iLen = HB_MIN( iLenRemaining, BUFFSIZE ); + iLenRemaining -= iLen; /* initialize file pointers */ - fpRead = ft_text->offset[ ft_text->area ]; - fpWrite = ft_text->offset[ ft_text->area ] + iLen; + fpRead = ft_text->offset[ ft_text->area ]; + fpWrite = ft_text->offset[ ft_text->area ] + iLen; /* do initial load of both buffers */ hb_fsSeekLarge( ft_text->handles[ ft_text->area ], fpRead, FS_SET ); WriteLen = hb_fsRead( ft_text->handles[ ft_text->area ], WriteBuff, BUFFSIZE ); - fpRead += WriteLen; + fpRead += WriteLen; - ReadLen = hb_fsRead( ft_text->handles[ ft_text->area ], ReadBuff, BUFFSIZE ); - fpRead += ReadLen; + ReadLen = hb_fsRead( ft_text->handles[ ft_text->area ], ReadBuff, BUFFSIZE ); + fpRead += ReadLen; - ft_text->error[ ft_text->area ] = 0; + ft_text->error[ ft_text->area ] = 0; while( ! ft_text->error[ ft_text->area ] && iLen > 0 ) { @@ -971,19 +971,19 @@ static int _ins_buff( PFT_TEXT ft_text, HB_ISIZ iLen ) /* WriteLen = SaveLen; */ /* swap buffers */ - SaveBuff = WriteBuff; - WriteBuff = ReadBuff; - ReadBuff = SaveBuff; - WriteLen = ReadLen; + SaveBuff = WriteBuff; + WriteBuff = ReadBuff; + ReadBuff = SaveBuff; + WriteLen = ReadLen; /* return to read area and read another buffer */ hb_fsSeekLarge( ft_text->handles[ ft_text->area ], fpRead, FS_SET ); - ReadLen = hb_fsRead( ft_text->handles[ ft_text->area ], ReadBuff, BUFFSIZE ); - fpRead += ReadLen; + ReadLen = hb_fsRead( ft_text->handles[ ft_text->area ], ReadBuff, BUFFSIZE ); + fpRead += ReadLen; } - iLen = HB_MIN( iLenRemaining, BUFFSIZE ); - iLenRemaining -= iLen; + iLen = HB_MIN( iLenRemaining, BUFFSIZE ); + iLenRemaining -= iLen; } /* store length in bytes, set legacy EOF marker */ @@ -1004,30 +1004,30 @@ static int _ins_buff( PFT_TEXT ft_text, HB_ISIZ iLen ) /* deletes xxx bytes from the current file, beginning at the current record */ static int _del_buff( PFT_TEXT ft_text, HB_ISIZ iLen ) { - char * WriteBuff = ( char * ) hb_xgrab( BUFFSIZE ); - HB_FOFFSET fpRead, fpWrite; - HB_ISIZ WriteLen; - HB_ISIZ SaveLen; + char * WriteBuff = ( char * ) hb_xgrab( BUFFSIZE ); + HB_FOFFSET fpRead, fpWrite; + HB_ISIZ WriteLen; + HB_ISIZ SaveLen; /* initialize file pointers */ - fpWrite = ft_text->offset[ ft_text->area ]; - fpRead = ft_text->offset[ ft_text->area ] + iLen; + fpWrite = ft_text->offset[ ft_text->area ]; + fpRead = ft_text->offset[ ft_text->area ] + iLen; /* do initial load of buffer */ hb_fsSeekLarge( ft_text->handles[ ft_text->area ], fpRead, FS_SET ); WriteLen = hb_fsRead( ft_text->handles[ ft_text->area ], WriteBuff, BUFFSIZE ); - fpRead += WriteLen; + fpRead += WriteLen; - ft_text->error[ ft_text->area ] = 0; + ft_text->error[ ft_text->area ] = 0; while( WriteLen > 0 ) { /* position to beginning of write area */ hb_fsSeekLarge( ft_text->handles[ ft_text->area ], fpWrite, FS_SET ); - SaveLen = hb_fsWriteLarge( ft_text->handles[ ft_text->area ], WriteBuff, WriteLen ); + SaveLen = hb_fsWriteLarge( ft_text->handles[ ft_text->area ], WriteBuff, WriteLen ); /* move write pointer */ - fpWrite += SaveLen; + fpWrite += SaveLen; if( SaveLen != WriteLen ) { @@ -1039,7 +1039,7 @@ static int _del_buff( PFT_TEXT ft_text, HB_ISIZ iLen ) /* return to read area and read another buffer */ hb_fsSeekLarge( ft_text->handles[ ft_text->area ], fpRead, FS_SET ); WriteLen = hb_fsRead( ft_text->handles[ ft_text->area ], WriteBuff, BUFFSIZE ); - fpRead += WriteLen; + fpRead += WriteLen; } /* store length in bytes, set legacy EOF marker */ @@ -1061,24 +1061,24 @@ static int _writeLine( PFT_TEXT ft_text, const char * theData, HB_SIZE iDataLen { int err = 0; - if( !( hb_fsWriteLarge( ft_text->handles[ ft_text->area ], theData, iDataLen ) == iDataLen ) ) + if( ! ( hb_fsWriteLarge( ft_text->handles[ ft_text->area ], theData, iDataLen ) == iDataLen ) ) { - err = 1; - ft_text->error[ ft_text->area ] = hb_fsError(); + err = 1; + ft_text->error[ ft_text->area ] = hb_fsError(); } else if( ! _writeeol( ft_text->handles[ ft_text->area ] ) ) { - err = 1; - ft_text->error[ ft_text->area ] = hb_fsError(); + err = 1; + ft_text->error[ ft_text->area ] = hb_fsError(); } return err; } static HB_BOOL _writeeol( HB_FHANDLE fhnd ) { - const char * crlf = hb_conNewLine(); - HB_SIZE len = strlen( crlf ); + const char * crlf = hb_conNewLine(); + HB_SIZE len = strlen( crlf ); return hb_fsWriteLarge( fhnd, crlf, len ) == len; } diff --git a/harbour/contrib/hbnf/gcd.prg b/harbour/contrib/hbnf/gcd.prg index e8ee3c2de5..cfaca23fb4 100644 --- a/harbour/contrib/hbnf/gcd.prg +++ b/harbour/contrib/hbnf/gcd.prg @@ -30,6 +30,7 @@ FUNCTION FT_GCD( nNumber1, nNumber2 ) LOCAL nResult // GCD // Either Number Zero?? + IF nNumber1 == 0 .OR. nNumber2 == 0 nResult := 0 // Yes, Can't Have a GCD ELSE // No, Calculate the GCD diff --git a/harbour/contrib/hbnf/getenvrn.c b/harbour/contrib/hbnf/getenvrn.c index 58af3687c5..36f88865b8 100644 --- a/harbour/contrib/hbnf/getenvrn.c +++ b/harbour/contrib/hbnf/getenvrn.c @@ -33,32 +33,32 @@ # include <unistd.h> # if defined( HB_OS_DARWIN ) # include <crt_externs.h> -# define environ ( *_NSGetEnviron() ) +# define environ ( *_NSGetEnviron() ) # elif ! defined( __WATCOMC__ ) extern char ** environ; # endif #elif defined( HB_OS_DOS ) -# define environ _environ +# define environ _environ extern char ** _environ; #elif defined( HB_OS_WIN ) && ! defined( HB_OS_WIN_CE ) # include "hbwinuni.h" # include <windows.h> #endif -#define NORETURN 0 -#define CHARTYPE 1 -#define ARRAYTYPE 2 -#define CRLF "\x0D\x0A" +#define NORETURN 0 +#define CHARTYPE 1 +#define ARRAYTYPE 2 +#define CRLF "\x0D\x0A" HB_FUNC( FT_GETE ) { #if defined( HB_OS_DOS ) || defined( HB_OS_UNIX ) { - char * buffer = NULL; - int x; - int buffsize = 0; - int rettype = HB_ISARRAY( 1 ) ? ARRAYTYPE : - ( HB_ISCHAR( 1 ) && HB_ISBYREF( 1 ) ? CHARTYPE : NORETURN ); + char * buffer = NULL; + int x; + int buffsize = 0; + int rettype = HB_ISARRAY( 1 ) ? ARRAYTYPE : + ( HB_ISCHAR( 1 ) && HB_ISBYREF( 1 ) ? CHARTYPE : NORETURN ); /* scan strings first and add up total size */ if( rettype == CHARTYPE ) @@ -105,12 +105,12 @@ HB_FUNC( FT_GETE ) } #elif defined( HB_OS_WIN ) && ! defined( HB_OS_WIN_CE ) { - LPTCH lpEnviron = GetEnvironmentStrings(), lpEnv; - LPTSTR lpResult = NULL, lpDst; - HB_SIZE nSize = 0, nCount = 0; - PHB_ITEM pArray = NULL; - int rettype = HB_ISARRAY( 1 ) ? ARRAYTYPE : - ( HB_ISCHAR( 1 ) && HB_ISBYREF( 1 ) ? CHARTYPE : NORETURN ); + LPTCH lpEnviron = GetEnvironmentStrings(), lpEnv; + LPTSTR lpResult = NULL, lpDst; + HB_SIZE nSize = 0, nCount = 0; + PHB_ITEM pArray = NULL; + int rettype = HB_ISARRAY( 1 ) ? ARRAYTYPE : + ( HB_ISCHAR( 1 ) && HB_ISBYREF( 1 ) ? CHARTYPE : NORETURN ); if( lpEnviron ) { diff --git a/harbour/contrib/hbnf/hex2dec.prg b/harbour/contrib/hbnf/hex2dec.prg index 1b8a8f9722..dd075d26e2 100644 --- a/harbour/contrib/hbnf/hex2dec.prg +++ b/harbour/contrib/hbnf/hex2dec.prg @@ -27,4 +27,5 @@ */ FUNCTION FT_HEX2DEC( cHexNum ) + RETURN hb_HexToNum( cHexNum ) diff --git a/harbour/contrib/hbnf/invclr.prg b/harbour/contrib/hbnf/invclr.prg index eb104e8a3e..2f7eb8cead 100644 --- a/harbour/contrib/hbnf/invclr.prg +++ b/harbour/contrib/hbnf/invclr.prg @@ -36,7 +36,7 @@ FUNCTION FT_INVCLR( cDsrdColor ) // Get Any Modifiers cModifiers := ; - iif( "*" $ cDsrdColor, "*", "" ) +; + iif( "*" $ cDsrdColor, "*", "" ) + ; iif( "+" $ cDsrdColor, "+", "" ) // Separate the Fore/Background Colors diff --git a/harbour/contrib/hbnf/isprint.c b/harbour/contrib/hbnf/isprint.c index efaeae88bb..ddac73552a 100644 --- a/harbour/contrib/hbnf/isprint.c +++ b/harbour/contrib/hbnf/isprint.c @@ -83,9 +83,9 @@ HB_FUNC( FT_ISPRINT ) const char * pszPort; #if defined( HB_OS_UNIX ) - pszPort = hb_parc( 1 ); + pszPort = hb_parc( 1 ); #else - pszPort = HB_ISCHAR( 1 ) ? hb_parc( 1 ) : "PRN"; + pszPort = HB_ISCHAR( 1 ) ? hb_parc( 1 ) : "PRN"; #endif hb_retl( hb_printerIsReady( pszPort ) ); diff --git a/harbour/contrib/hbnf/kspeed.c b/harbour/contrib/hbnf/kspeed.c index a6744209b7..78dfe26490 100644 --- a/harbour/contrib/hbnf/kspeed.c +++ b/harbour/contrib/hbnf/kspeed.c @@ -34,8 +34,8 @@ HB_FUNC( FT_SETRATE ) #if defined( HB_OS_DOS ) { union REGS regs; - int iSpeed = 0; - int iRepeat = 0; + int iSpeed = 0; + int iRepeat = 0; switch( hb_pcount() ) { diff --git a/harbour/contrib/hbnf/linked.prg b/harbour/contrib/hbnf/linked.prg index e5df205a4c..09499d4fff 100644 --- a/harbour/contrib/hbnf/linked.prg +++ b/harbour/contrib/hbnf/linked.prg @@ -28,6 +28,7 @@ // Returns: .T. if all functions are available, // .F. if not + FUNCTION FT_Linked( cFuncs ) LOCAL aFuncArray := {}, nSpace, nComma, nFEnd, lRetVal := .F. diff --git a/harbour/contrib/hbnf/menu1.prg b/harbour/contrib/hbnf/menu1.prg index 48f9389cbe..47efea0bbd 100644 --- a/harbour/contrib/hbnf/menu1.prg +++ b/harbour/contrib/hbnf/menu1.prg @@ -62,31 +62,31 @@ FUNCTION FT_MENU1( aBar, aOptions, aColors, nTopRow, lShadow ) // inkey codes for A - Z LOCAL aKeyCodes := { ; - K_ALT_A ,; - K_ALT_B ,; - K_ALT_C ,; - K_ALT_D ,; - K_ALT_E ,; - K_ALT_F ,; - K_ALT_G ,; - K_ALT_H ,; - K_ALT_I ,; - K_ALT_J ,; - K_ALT_K ,; - K_ALT_L ,; - K_ALT_M ,; - K_ALT_N ,; - K_ALT_O ,; - K_ALT_P ,; - K_ALT_Q ,; - K_ALT_R ,; - K_ALT_S ,; - K_ALT_T ,; - K_ALT_U ,; - K_ALT_V ,; - K_ALT_W ,; - K_ALT_X ,; - K_ALT_Y ,; + K_ALT_A, ; + K_ALT_B, ; + K_ALT_C, ; + K_ALT_D, ; + K_ALT_E, ; + K_ALT_F, ; + K_ALT_G, ; + K_ALT_H, ; + K_ALT_I, ; + K_ALT_J, ; + K_ALT_K, ; + K_ALT_L, ; + K_ALT_M, ; + K_ALT_N, ; + K_ALT_O, ; + K_ALT_P, ; + K_ALT_Q, ; + K_ALT_R, ; + K_ALT_S, ; + K_ALT_T, ; + K_ALT_U, ; + K_ALT_V, ; + K_ALT_W, ; + K_ALT_X, ; + K_ALT_Y, ; K_ALT_Z } // Len() of widest array element for for each pulldown menu @@ -195,10 +195,12 @@ FUNCTION FT_MENU1( aBar, aOptions, aColors, nTopRow, lShadow ) RETURN NIL -// ACHOICE() user function +// AChoice() user function + STATIC FUNCTION __ftAcUdf( nMode ) LOCAL nRtnVal := AC_CONT + DO CASE CASE nMode == AC_HITTOP hb_keyPut( K_CTRL_END ) diff --git a/harbour/contrib/hbnf/menuto.prg b/harbour/contrib/hbnf/menuto.prg index 46cc50d448..4ef5832571 100644 --- a/harbour/contrib/hbnf/menuto.prg +++ b/harbour/contrib/hbnf/menuto.prg @@ -36,19 +36,8 @@ #include "setcurs.ch" #include "inkey.ch" -#xtranslate EnhColor( <colorspec> ) => ; - SubStr( <colorspec>, At( ",", <colorspec> ) + 1 ) - -#xtranslate isOkay( <exp> ) => ; - ( <exp> \ > 0 .AND. <exp> \ <= nCount ) - -#xtranslate isBetween( <val>, <lower>, <upper> ) => ; - ( <val> \ >= <lower> .AND. <val> \ <= <upper> ) - -#define nTriggerInkey hb_keyCode( Upper( SubStr( cPrompt, nTrigger, 1 ) ) ) -#define cTrigger SubStr( cPrompt, nTrigger, 1 ) -#define nCurrent nMenu,nActive -#define nLast nMenu,nPrev +#xtranslate isOkay( <exp> ) => ( <exp> \ > 0 .AND. <exp> \ <= nCount ) +#xtranslate isBetween( <val>, <lower>, <upper> ) => ( <val> \ >= <lower> .AND. <val> \ <= <upper> ) // These arrays hold information about each menu item @@ -78,6 +67,7 @@ FUNCTION FT_Prompt( nRow, nCol, cPrompt, cColor, ; nUp, nDown, nLeft, nRight, bExecute ) // If the prompt color setting is not specified, use default + __defaultNIL( @cColor, SetColor() ) // If no message is supplied, set message values to NIL @@ -118,7 +108,7 @@ FUNCTION FT_Prompt( nRow, nCol, cPrompt, cColor, ; AAdd( t_aMessage[ t_nLevel ], cMessage ) AAdd( t_aMsgColor[ t_nLevel ], cMsgColor ) AAdd( t_aTrigger[ t_nLevel ], nTrigger ) - AAdd( t_aTriggerInkey[ t_nLevel ], nTriggerInkey ) + AAdd( t_aTriggerInkey[ t_nLevel ], hb_keyCode( Upper( SubStr( cPrompt, nTrigger, 1 ) ) ) ) AAdd( t_aTriggerColor[ t_nLevel ], cTriggerColor ) AAdd( t_aHome[ t_nLevel ], nHome ) AAdd( t_aEnd[ t_nLevel ], nEnd ) @@ -131,7 +121,7 @@ FUNCTION FT_Prompt( nRow, nCol, cPrompt, cColor, ; // Now display the prompt for the sake of compatibility DispBegin() hb_DispOutAt( nRow, nCol, cPrompt, cColor ) - hb_DispOutAt( nRow, nCol - 1 + nTrigger, cTrigger, cTriggerColor ) + hb_DispOutAt( nRow, nCol - 1 + nTrigger, SubStr( cPrompt, nTrigger, 1 ), cTriggerColor ) DispEnd() RETURN NIL @@ -152,7 +142,9 @@ FUNCTION FT_MenuTo( bGetSet, cReadVar, lCold ) // Validate the incoming parameters and assign some reasonable defaults // to prevent a crash later. - cReadVar := iif( cReadVar == NIL, "", Upper( cReadVar ) ) + __defaultNIL( @cReadVar, "" ) + + cReadVar := Upper( cReadVar ) IF bGetSet == NIL bGetSet := {|| 1 } @@ -191,7 +183,7 @@ FUNCTION FT_MenuTo( bGetSet, cReadVar, lCold ) // Loop until Enter or Esc is pressed - WHILE ! lChoice + DO WHILE ! lChoice // Evaluate the getset block to update the target memory variable // in case it needs to be examined by a hotkey procedure. @@ -208,13 +200,13 @@ FUNCTION FT_MenuTo( bGetSet, cReadVar, lCold ) DispBegin() - IF t_aMessage[ nCurrent ] != NIL - cScreen := SaveScreen( t_aMsgRow[ nCurrent ], t_aMsgCol[ nCurrent ], ; - t_aMsgRow[ nCurrent ], t_aMsgCol[ nCurrent ] + ; - Len( t_aMessage[ nCurrent ] ) - 1 ) + IF t_aMessage[ nMenu, nActive ] != NIL + cScreen := SaveScreen( t_aMsgRow[ nMenu, nActive ], t_aMsgCol[ nMenu, nActive ], ; + t_aMsgRow[ nMenu, nActive ], t_aMsgCol[ nMenu, nActive ] + ; + Len( t_aMessage[ nMenu, nActive ] ) - 1 ) - hb_DispOutAt( t_aMsgRow[ nCurrent ], t_aMsgCol[ nCurrent ], ; - t_aMessage[ nCurrent ], t_aMsgColor[ nCurrent ] ) + hb_DispOutAt( t_aMsgRow[ nMenu, nActive ], t_aMsgCol[ nMenu, nActive ], ; + t_aMessage[ nMenu, nActive ], t_aMsgColor[ nMenu, nActive ] ) ELSE cScreen := NIL @@ -223,13 +215,13 @@ FUNCTION FT_MenuTo( bGetSet, cReadVar, lCold ) // Display the prompt using the designated colors for the prompt and // the trigger character. - hb_DispOutAt( t_aRow[ nCurrent ], t_aCol[ nCurrent ], ; - t_aPrompt[ nCurrent ], EnhColor( t_aColor[ nCurrent ] ) ) + hb_DispOutAt( t_aRow[ nMenu, nActive ], t_aCol[ nMenu, nActive ], ; + t_aPrompt[ nMenu, nActive ], hb_ColorIndex( t_aColor[ nMenu, nActive ], 1 ) ) - hb_DispOutAt( t_aRow[ nCurrent ], ; - t_aCol[ nCurrent ] - 1 + t_aTrigger[ nCurrent ], ; - SubStr( t_aPrompt[ nCurrent ], t_aTrigger[ nCurrent ], 1 ), ; - EnhColor( t_aTriggerColor[ nCurrent ] ) ) + hb_DispOutAt( t_aRow[ nMenu, nActive ], ; + t_aCol[ nMenu, nActive ] - 1 + t_aTrigger[ nMenu, nActive ], ; + SubStr( t_aPrompt[ nMenu, nActive ], t_aTrigger[ nMenu, nActive ], 1 ), ; + hb_ColorIndex( t_aTriggerColor[ nMenu, nActive ], 1 ) ) DispEnd() @@ -255,8 +247,8 @@ FUNCTION FT_MenuTo( bGetSet, cReadVar, lCold ) // associated code block. CASE nKey == K_ENTER - IF t_aExecute[ nCurrent ] != NIL - Eval( t_aExecute[ nCurrent ] ) + IF t_aExecute[ nMenu, nActive ] != NIL + Eval( t_aExecute[ nMenu, nActive ] ) ELSE lChoice := .T. ENDIF @@ -270,62 +262,62 @@ FUNCTION FT_MenuTo( bGetSet, cReadVar, lCold ) // If Home was pressed, go to the designated menu item. CASE nKey == K_HOME - nActive := iif( t_aHome[ nCurrent ] == NIL, 1, t_aHome[ nCurrent ] ) + nActive := iif( t_aHome[ nMenu, nActive ] == NIL, 1, t_aHome[ nMenu, nActive ] ) // If End was pressed, go to the designated menu item. CASE nKey == K_END - nActive := iif( t_aEnd[ nCurrent ] == NIL, nCount, t_aEnd[ nCurrent ] ) + nActive := iif( t_aEnd[ nMenu, nActive ] == NIL, nCount, t_aEnd[ nMenu, nActive ] ) // If Up Arrow was pressed, go to the designated menu item. CASE nKey == K_UP - IF t_aUp[ nCurrent ] == NIL - if --nActive < 1 + IF t_aUp[ nMenu, nActive ] == NIL + IF --nActive < 1 nActive := iif( lWrap, nCount, 1 ) ENDIF ELSE - IF isOkay( t_aUp[ nCurrent ] ) - nActive := t_aUp[ nCurrent ] + IF isOkay( t_aUp[ nMenu, nActive ] ) + nActive := t_aUp[ nMenu, nActive ] ENDIF ENDIF // If Down Arrow was pressed, go to the designated menu item. CASE nKey == K_DOWN - IF t_aDown[ nCurrent ] == NIL + IF t_aDown[ nMenu, nActive ] == NIL if ++nActive > nCount nActive := iif( lWrap, 1, nCount ) ENDIF ELSE - IF isOkay( t_aDown[ nCurrent ] ) - nActive := t_aDown[ nCurrent ] + IF isOkay( t_aDown[ nMenu, nActive ] ) + nActive := t_aDown[ nMenu, nActive ] ENDIF ENDIF // If Left Arrow was pressed, go to the designated menu item. CASE nKey == K_LEFT - IF t_aLeft[ nCurrent ] == NIL - if --nActive < 1 + IF t_aLeft[ nMenu, nActive ] == NIL + IF --nActive < 1 nActive := iif( lWrap, nCount, 1 ) ENDIF ELSE - IF isOkay( t_aLeft[ nCurrent ] ) - nActive := t_aLeft[ nCurrent ] + IF isOkay( t_aLeft[ nMenu, nActive ] ) + nActive := t_aLeft[ nMenu, nActive ] ENDIF ENDIF // If Right Arrow was pressed, go to the designated menu item. CASE nKey == K_RIGHT - IF t_aRight[ nCurrent ] == NIL + IF t_aRight[ nMenu, nActive ] == NIL if ++nActive > nCount nActive := iif( lWrap, 1, nCount ) ENDIF ELSE - IF isOkay( t_aRight[ nCurrent ] ) - nActive := t_aRight[ nCurrent ] + IF isOkay( t_aRight[ nMenu, nActive ] ) + nActive := t_aRight[ nMenu, nActive ] ENDIF ENDIF @@ -343,19 +335,19 @@ FUNCTION FT_MenuTo( bGetSet, cReadVar, lCold ) IF ! lChoice DispBegin() - hb_DispOutAt( t_aRow[ nLast ], t_aCol[ nLast ], ; - t_aPrompt[ nLast ], t_aColor[ nLast ] ) + hb_DispOutAt( t_aRow[ nMenu, nPrev ], t_aCol[ nMenu, nPrev ], ; + t_aPrompt[ nMenu, nPrev ], t_aColor[ nMenu, nPrev ] ) - hb_DispOutAt( t_aRow[ nLast ], t_aCol[ nLast ] - 1 + t_aTrigger[ nLast ], ; - SubStr( t_aPrompt[ nLast ], t_aTrigger[ nLast ], 1 ), ; - t_aTriggerColor[ nLast ] ) + hb_DispOutAt( t_aRow[ nMenu, nPrev ], t_aCol[ nMenu, nPrev ] - 1 + t_aTrigger[ nMenu, nPrev ], ; + SubStr( t_aPrompt[ nMenu, nPrev ], t_aTrigger[ nMenu, nPrev ], 1 ), ; + t_aTriggerColor[ nMenu, nPrev ] ) IF cScreen != NIL - RestScreen( t_aMsgRow[ nLast ], ; - t_aMsgCol[ nLast ], ; - t_aMsgRow[ nLast ], ; - t_aMsgCol[ nLast ] ; - + Len( t_aMessage[ nLast ] ) - 1, ; + RestScreen( t_aMsgRow[ nMenu, nPrev ], ; + t_aMsgCol[ nMenu, nPrev ], ; + t_aMsgRow[ nMenu, nPrev ], ; + t_aMsgCol[ nMenu, nPrev ] ; + + Len( t_aMessage[ nMenu, nPrev ] ) - 1, ; cScreen ) ENDIF DispEnd() diff --git a/harbour/contrib/hbnf/metaph.prg b/harbour/contrib/hbnf/metaph.prg index f71e004681..9f9457a264 100644 --- a/harbour/contrib/hbnf/metaph.prg +++ b/harbour/contrib/hbnf/metaph.prg @@ -98,130 +98,128 @@ FUNCTION FT_METAPH( cName, nSize ) // Calculates the metaphone of a character s __defaultNIL( @cName, "" ) // catch-all __defaultNIL( @nSize, 4 ) // default size: 4-bytes - // Remove non-alpha characters and make upper case. - // The string is padded with 1 space at the beginning & end. - // Spaces, if present inside the string, are not removed until all - // the prefix/suffix checking has been completed. + // Remove non-alpha characters and make upper case. + // The string is padded with 1 space at the beginning & end. + // Spaces, if present inside the string, are not removed until all + // the prefix/suffix checking has been completed. cMeta := " " + _ftMakeAlpha( Upper( AllTrim( cName ) ) ) + " " - // prefixes which need special consideration - IF " KN" $ cMeta ; cMeta := StrTran( cMeta, " KN" , " N" ) ; ENDIF - IF " GN" $ cMeta ; cMeta := StrTran( cMeta, " GN" , " N" ) ; ENDIF - IF " PN" $ cMeta ; cMeta := StrTran( cMeta, " PN" , " N" ) ; ENDIF - IF " AE" $ cMeta ; cMeta := StrTran( cMeta, " AE" , " E" ) ; ENDIF - IF " X" $ cMeta ; cMeta := StrTran( cMeta, " X" , " S" ) ; ENDIF - IF " WR" $ cMeta ; cMeta := StrTran( cMeta, " WR" , " R" ) ; ENDIF - IF " WHO" $ cMeta ; cMeta := StrTran( cMeta, " WHO", " H" ) ; ENDIF - IF " WH" $ cMeta ; cMeta := StrTran( cMeta, " WH" , " W" ) ; ENDIF - IF " MCG" $ cMeta ; cMeta := StrTran( cMeta, " MCG", " MK" ) ; ENDIF - IF " MC" $ cMeta ; cMeta := StrTran( cMeta, " MC" , " MK" ) ; ENDIF - IF " MACG" $ cMeta ; cMeta := StrTran( cMeta, " MACG", " MK" ) ; ENDIF - IF " MAC" $ cMeta ; cMeta := StrTran( cMeta, " MAC", " MK" ) ; ENDIF - IF " GI" $ cMeta ; cMeta := StrTran( cMeta, " GI", " K" ) ; ENDIF + // Prefixes which need special consideration + IF " KN" $ cMeta ; cMeta := StrTran( cMeta, " KN" , " N" ) ; ENDIF + IF " GN" $ cMeta ; cMeta := StrTran( cMeta, " GN" , " N" ) ; ENDIF + IF " PN" $ cMeta ; cMeta := StrTran( cMeta, " PN" , " N" ) ; ENDIF + IF " AE" $ cMeta ; cMeta := StrTran( cMeta, " AE" , " E" ) ; ENDIF + IF " X" $ cMeta ; cMeta := StrTran( cMeta, " X" , " S" ) ; ENDIF + IF " WR" $ cMeta ; cMeta := StrTran( cMeta, " WR" , " R" ) ; ENDIF + IF " WHO" $ cMeta ; cMeta := StrTran( cMeta, " WHO" , " H" ) ; ENDIF + IF " WH" $ cMeta ; cMeta := StrTran( cMeta, " WH" , " W" ) ; ENDIF + IF " MCG" $ cMeta ; cMeta := StrTran( cMeta, " MCG" , " MK" ) ; ENDIF + IF " MC" $ cMeta ; cMeta := StrTran( cMeta, " MC" , " MK" ) ; ENDIF + IF " MACG" $ cMeta ; cMeta := StrTran( cMeta, " MACG", " MK" ) ; ENDIF + IF " MAC" $ cMeta ; cMeta := StrTran( cMeta, " MAC" , " MK" ) ; ENDIF + IF " GI" $ cMeta ; cMeta := StrTran( cMeta, " GI" , " K" ) ; ENDIF - // Suffixes which need special consideration - IF "MB " $ cMeta ; cMeta := StrTran( cMeta, "MB " , "M " ) ; ENDIF - IF "NG " $ cMeta ; cMeta := StrTran( cMeta, "NG " , "N " ) ; ENDIF + // Suffixes which need special consideration + IF "MB " $ cMeta ; cMeta := StrTran( cMeta, "MB ", "M " ) ; ENDIF + IF "NG " $ cMeta ; cMeta := StrTran( cMeta, "NG ", "N " ) ; ENDIF - // Remove inner spaces (1st and last byte are spaces) + // Remove inner spaces (1st and last byte are spaces) IF " " $ SubStr( cMeta, 2, Len( cMeta ) - 2 ) cMeta := " " + StrTran( cMeta, " " ) + " " ENDIF - // Double consonants sound much the same as singles - IF "BB" $ cMeta ; cMeta := StrTran( cMeta, "BB" , "B" ) ; ENDIF - IF "CC" $ cMeta ; cMeta := StrTran( cMeta, "CC" , "CH" ) ; ENDIF - IF "DD" $ cMeta ; cMeta := StrTran( cMeta, "DD" , "T" ) ; ENDIF - IF "FF" $ cMeta ; cMeta := StrTran( cMeta, "FF" , "F" ) ; ENDIF - IF "GG" $ cMeta ; cMeta := StrTran( cMeta, "GG" , "K" ) ; ENDIF - IF "KK" $ cMeta ; cMeta := StrTran( cMeta, "KK" , "K" ) ; ENDIF - IF "LL" $ cMeta ; cMeta := StrTran( cMeta, "LL" , "L" ) ; ENDIF - IF "MM" $ cMeta ; cMeta := StrTran( cMeta, "MM" , "M" ) ; ENDIF - IF "NN" $ cMeta ; cMeta := StrTran( cMeta, "NN" , "N" ) ; ENDIF - IF "PP" $ cMeta ; cMeta := StrTran( cMeta, "PP" , "P" ) ; ENDIF - IF "RR" $ cMeta ; cMeta := StrTran( cMeta, "RR" , "R" ) ; ENDIF - IF "SS" $ cMeta ; cMeta := StrTran( cMeta, "SS" , "S" ) ; ENDIF - IF "TT" $ cMeta ; cMeta := StrTran( cMeta, "TT" , "T" ) ; ENDIF - IF "XX" $ cMeta ; cMeta := StrTran( cMeta, "XX" , "KS" ) ; ENDIF - IF "ZZ" $ cMeta ; cMeta := StrTran( cMeta, "ZZ" , "S" ) ; ENDIF + // Double consonants sound much the same as singles + IF "BB" $ cMeta ; cMeta := StrTran( cMeta, "BB", "B" ) ; ENDIF + IF "CC" $ cMeta ; cMeta := StrTran( cMeta, "CC", "CH" ) ; ENDIF + IF "DD" $ cMeta ; cMeta := StrTran( cMeta, "DD", "T" ) ; ENDIF + IF "FF" $ cMeta ; cMeta := StrTran( cMeta, "FF", "F" ) ; ENDIF + IF "GG" $ cMeta ; cMeta := StrTran( cMeta, "GG", "K" ) ; ENDIF + IF "KK" $ cMeta ; cMeta := StrTran( cMeta, "KK", "K" ) ; ENDIF + IF "LL" $ cMeta ; cMeta := StrTran( cMeta, "LL", "L" ) ; ENDIF + IF "MM" $ cMeta ; cMeta := StrTran( cMeta, "MM", "M" ) ; ENDIF + IF "NN" $ cMeta ; cMeta := StrTran( cMeta, "NN", "N" ) ; ENDIF + IF "PP" $ cMeta ; cMeta := StrTran( cMeta, "PP", "P" ) ; ENDIF + IF "RR" $ cMeta ; cMeta := StrTran( cMeta, "RR", "R" ) ; ENDIF + IF "SS" $ cMeta ; cMeta := StrTran( cMeta, "SS", "S" ) ; ENDIF + IF "TT" $ cMeta ; cMeta := StrTran( cMeta, "TT", "T" ) ; ENDIF + IF "XX" $ cMeta ; cMeta := StrTran( cMeta, "XX", "KS" ) ; ENDIF + IF "ZZ" $ cMeta ; cMeta := StrTran( cMeta, "ZZ", "S" ) ; ENDIF // J sounds - IF "DGE" $ cMeta ; cMeta := StrTran( cMeta, "DGE" , "J" ) ; ENDIF - IF "DGY" $ cMeta ; cMeta := StrTran( cMeta, "DGY" , "J" ) ; ENDIF - IF "DGI" $ cMeta ; cMeta := StrTran( cMeta, "DGI" , "J" ) ; ENDIF - IF "GI" $ cMeta ; cMeta := StrTran( cMeta, "GI" , "J" ) ; ENDIF - IF "GE" $ cMeta ; cMeta := StrTran( cMeta, "GE" , "J" ) ; ENDIF - IF "GY" $ cMeta ; cMeta := StrTran( cMeta, "GY" , "J" ) ; ENDIF + IF "DGE" $ cMeta ; cMeta := StrTran( cMeta, "DGE", "J" ) ; ENDIF + IF "DGY" $ cMeta ; cMeta := StrTran( cMeta, "DGY", "J" ) ; ENDIF + IF "DGI" $ cMeta ; cMeta := StrTran( cMeta, "DGI", "J" ) ; ENDIF + IF "GI" $ cMeta ; cMeta := StrTran( cMeta, "GI" , "J" ) ; ENDIF + IF "GE" $ cMeta ; cMeta := StrTran( cMeta, "GE" , "J" ) ; ENDIF + IF "GY" $ cMeta ; cMeta := StrTran( cMeta, "GY" , "J" ) ; ENDIF // X sounds (KS) - IF "X" $ cMeta ; cMeta := StrTran( cMeta, "X" , "KS" ) ; ENDIF + IF "X" $ cMeta ; cMeta := StrTran( cMeta, "X", "KS" ) ; ENDIF // special consideration for SCH - IF "ISCH" $ cMeta; cMeta := StrTran( cMeta, "ISCH", "IX" ) ; ENDIF - IF "SCH" $ cMeta ; cMeta := StrTran( cMeta, "SCH" , "SK" ) ; ENDIF + IF "ISCH" $ cMeta; cMeta := StrTran( cMeta, "ISCH", "IX" ) ; ENDIF + IF "SCH" $ cMeta; cMeta := StrTran( cMeta, "SCH" , "SK" ) ; ENDIF // sh sounds (X) - IF "CIA" $ cMeta ; cMeta := StrTran( cMeta, "CIA" , "X" ) ; ENDIF - IF "SIO" $ cMeta ; cMeta := StrTran( cMeta, "SIO" , "X" ) ; ENDIF - IF "C" $ cMeta ; cMeta := StrTran( cMeta, "SIA" , "X" ) ; ENDIF - IF "SH" $ cMeta ; cMeta := StrTran( cMeta, "SH" , "X" ) ; ENDIF - IF "TIA" $ cMeta ; cMeta := StrTran( cMeta, "TIA" , "X" ) ; ENDIF - IF "TIO" $ cMeta ; cMeta := StrTran( cMeta, "TIO" , "X" ) ; ENDIF - IF "TCH" $ cMeta ; cMeta := StrTran( cMeta, "TCH" , "X" ) ; ENDIF - IF "CH" $ cMeta ; cMeta := StrTran( cMeta, "CH" , "X" ) ; ENDIF + IF "CIA" $ cMeta ; cMeta := StrTran( cMeta, "CIA", "X" ) ; ENDIF + IF "SIO" $ cMeta ; cMeta := StrTran( cMeta, "SIO", "X" ) ; ENDIF + IF "C" $ cMeta ; cMeta := StrTran( cMeta, "SIA", "X" ) ; ENDIF + IF "SH" $ cMeta ; cMeta := StrTran( cMeta, "SH" , "X" ) ; ENDIF + IF "TIA" $ cMeta ; cMeta := StrTran( cMeta, "TIA", "X" ) ; ENDIF + IF "TIO" $ cMeta ; cMeta := StrTran( cMeta, "TIO", "X" ) ; ENDIF + IF "TCH" $ cMeta ; cMeta := StrTran( cMeta, "TCH", "X" ) ; ENDIF + IF "CH" $ cMeta ; cMeta := StrTran( cMeta, "CH" , "X" ) ; ENDIF // hissing sounds (S) - IF "SCI" $ cMeta ; cMeta := StrTran( cMeta, "SCI" , "S" ) ; ENDIF - IF "SCE" $ cMeta ; cMeta := StrTran( cMeta, "SCE" , "S" ) ; ENDIF - IF "SCY" $ cMeta ; cMeta := StrTran( cMeta, "SCY" , "S" ) ; ENDIF - IF "CI" $ cMeta ; cMeta := StrTran( cMeta, "CI" , "S" ) ; ENDIF - IF "CE" $ cMeta ; cMeta := StrTran( cMeta, "CE" , "S" ) ; ENDIF - IF "CY" $ cMeta ; cMeta := StrTran( cMeta, "CY" , "S" ) ; ENDIF - IF "Z" $ cMeta ; cMeta := StrTran( cMeta, "Z" , "S" ) ; ENDIF + IF "SCI" $ cMeta ; cMeta := StrTran( cMeta, "SCI", "S" ) ; ENDIF + IF "SCE" $ cMeta ; cMeta := StrTran( cMeta, "SCE", "S" ) ; ENDIF + IF "SCY" $ cMeta ; cMeta := StrTran( cMeta, "SCY", "S" ) ; ENDIF + IF "CI" $ cMeta ; cMeta := StrTran( cMeta, "CI" , "S" ) ; ENDIF + IF "CE" $ cMeta ; cMeta := StrTran( cMeta, "CE" , "S" ) ; ENDIF + IF "CY" $ cMeta ; cMeta := StrTran( cMeta, "CY" , "S" ) ; ENDIF + IF "Z" $ cMeta ; cMeta := StrTran( cMeta, "Z" , "S" ) ; ENDIF // th sound (0) - IF "TH" $ cMeta ; cMeta := StrTran( cMeta, "TH" , "0" ) ; ENDIF + IF "TH" $ cMeta ; cMeta := StrTran( cMeta, "TH" , "0" ) ; ENDIF // Convert all vowels to 'v' from 3rd byte on cMeta := Left( cMeta, 2 ) + _ftConvVowel( SubStr( cMeta, 3 ) ) // Make Y's silent if not followed by vowel - IF "Y" $ cMeta - cMeta := StrTran( cMeta, "Yv" , "#" ) // Y followed by vowel - cMeta := StrTran( cMeta, "Y" , "" ) // not followed by vowel - cMeta := StrTran( cMeta, "#" , "Yv" ) // restore Y and vowel + IF "Y" $ cMeta + cMeta := StrTran( cMeta, "Yv", "#" ) // Y followed by vowel + cMeta := StrTran( cMeta, "Y" , "" ) // not followed by vowel + cMeta := StrTran( cMeta, "#" , "Yv" ) // restore Y and vowel ENDIF // More G sounds, looking at surrounding vowels - IF "GHv" $ cMeta ; cMeta := StrTran( cMeta, "GHv" , "G" ) ; ENDIF - IF "vGHT" $ cMeta; cMeta := StrTran( cMeta, "vGHT", "T" ) ; ENDIF - IF "vGH" $ cMeta ; cMeta := StrTran( cMeta, "vGH" , "W" ) ; ENDIF - IF "GN" $ cMeta ; cMeta := StrTran( cMeta, "GN" , "N" ) ; ENDIF - IF "G" $ cMeta ; cMeta := StrTran( cMeta, "G" , "K" ) ; ENDIF + IF "GHv" $ cMeta ; cMeta := StrTran( cMeta, "GHv" , "G" ) ; ENDIF + IF "vGHT" $ cMeta ; cMeta := StrTran( cMeta, "vGHT", "T" ) ; ENDIF + IF "vGH" $ cMeta ; cMeta := StrTran( cMeta, "vGH" , "W" ) ; ENDIF + IF "GN" $ cMeta ; cMeta := StrTran( cMeta, "GN" , "N" ) ; ENDIF + IF "G" $ cMeta ; cMeta := StrTran( cMeta, "G" , "K" ) ; ENDIF // H sounds, looking at surrounding vowels - IF "vHv" $ cMeta ; cMeta := StrTran( cMeta, "vHv" , "H" ) ; ENDIF - IF "vH" $ cMeta ; cMeta := StrTran( cMeta, "vH" , "" ) ; ENDIF + IF "vHv" $ cMeta ; cMeta := StrTran( cMeta, "vHv" , "H" ) ; ENDIF + IF "vH" $ cMeta ; cMeta := StrTran( cMeta, "vH" , "" ) ; ENDIF // F sounds - IF "PH" $ cMeta ; cMeta := StrTran( cMeta, "PH" , "F" ) ; ENDIF - IF "V" $ cMeta ; cMeta := StrTran( cMeta, "V" , "F" ) ; ENDIF + IF "PH" $ cMeta ; cMeta := StrTran( cMeta, "PH" , "F" ) ; ENDIF + IF "V" $ cMeta ; cMeta := StrTran( cMeta, "V" , "F" ) ; ENDIF // D sounds a bit like T - IF "D" $ cMeta ; cMeta := StrTran( cMeta, "D" , "T" ) ; ENDIF + IF "D" $ cMeta ; cMeta := StrTran( cMeta, "D" , "T" ) ; ENDIF // K sounds - IF "CK" $ cMeta ; cMeta := StrTran( cMeta, "CK" , "K" ) ; ENDIF - IF "Q" $ cMeta ; cMeta := StrTran( cMeta, "Q" , "K" ) ; ENDIF - IF "C" $ cMeta ; cMeta := StrTran( cMeta, "C" , "K" ) ; ENDIF + IF "CK" $ cMeta ; cMeta := StrTran( cMeta, "CK" , "K" ) ; ENDIF + IF "Q" $ cMeta ; cMeta := StrTran( cMeta, "Q" , "K" ) ; ENDIF + IF "C" $ cMeta ; cMeta := StrTran( cMeta, "C" , "K" ) ; ENDIF - // Remove vowels + // Remove vowels cMeta := StrTran( cMeta, "v" ) RETURN PadR( AllTrim( cMeta ), nSize ) -// - STATIC FUNCTION _ftMakeAlpha( cStr ) // Strips non-alpha characters from a string, leaving spaces LOCAL x, cAlpha := "" @@ -234,8 +232,6 @@ STATIC FUNCTION _ftMakeAlpha( cStr ) // Strips non-alpha characters from a stri RETURN cAlpha -// - STATIC FUNCTION _ftConvVowel( cStr ) // Converts all vowels to letter 'v' LOCAL x, cConverted := "" diff --git a/harbour/contrib/hbnf/miltime.prg b/harbour/contrib/hbnf/miltime.prg index 4533f37f45..6c949e02db 100644 --- a/harbour/contrib/hbnf/miltime.prg +++ b/harbour/contrib/hbnf/miltime.prg @@ -27,12 +27,13 @@ FUNCTION FT_MIL2MIN( cMILTIME ) RETURN Int( Val( Left( cMILTIME, 2 ) ) * 60 + Val( Right( cMILTIME, 2 ) ) ) -FUNCTION FT_MIN2MIL( nMIN ) +FUNCTION FT_MIN2MIL( nMin ) - nMIN := nMIN % 1440 + nMin := nMin % 1440 - RETURN Right( "00" + hb_ntos( Int( nMIN / 60 ) ), 2 ) + ; - Right( "00" + hb_ntos( Int( nMIN % 60 ) ), 2 ) + RETURN ; + Right( "00" + hb_ntos( Int( nMin / 60 ) ), 2 ) + ; + Right( "00" + hb_ntos( Int( nMin % 60 ) ), 2 ) FUNCTION FT_MIL2CIV( cMILTIME ) @@ -69,15 +70,16 @@ FUNCTION FT_CIV2MIL( cTIME ) LOCAL cKEY, cMILTIME - //** Insure leading 0's + // ** Ensure leading 0's + cTIME := Replicate( "0", 3 - At( ":", LTrim( cTIME ) ) ) + LTrim( cTIME ) - //** Adjust for popular use of '12' for first hour after noon and midnight + // ** Adjust for popular use of '12' for first hour after noon and midnight IF Left( LTrim( cTIME ), 2 ) == "12" cTIME := Stuff( cTIME, 1, 2, "00" ) ENDIF - //** am, pm, noon or midnight + // ** am, pm, noon or midnight cKEY := SubStr( LTrim( cTIME ), 7, 1 ) DO CASE diff --git a/harbour/contrib/hbnf/min2dhm.prg b/harbour/contrib/hbnf/min2dhm.prg index 1d82e67593..d33edc9ef7 100644 --- a/harbour/contrib/hbnf/min2dhm.prg +++ b/harbour/contrib/hbnf/min2dhm.prg @@ -26,8 +26,8 @@ * */ -FUNCTION FT_MIN2DHM( nMINS ) - RETURN {; - hb_ntos( Int( nMINS / 1440 ) ) ,; - hb_ntos( Int( ( nMINS % 1440 ) / 60 ) ) ,; - hb_ntos( Int( ( nMINS % 1440 ) % 60 ) ) } \ No newline at end of file +FUNCTION FT_MIN2DHM( nMins ) + RETURN { ; + hb_ntos( Int( nMins / 1440 ) ), ; + hb_ntos( Int( ( nMins % 1440 ) / 60 ) ), ; + hb_ntos( Int( ( nMins % 1440 ) % 60 ) ) } diff --git a/harbour/contrib/hbnf/mouse1.prg b/harbour/contrib/hbnf/mouse1.prg index 3a91ff662e..dfbe800052 100644 --- a/harbour/contrib/hbnf/mouse1.prg +++ b/harbour/contrib/hbnf/mouse1.prg @@ -118,6 +118,7 @@ FUNCTION FT_MSETSENS( nHoriz, nVert, nDouble ) LOCAL nCurHoriz, nCurVert, nCurDouble // Get current values + FT_MGETSENS( @nCurHoriz, @nCurVert, @nCurDouble ) hb_default( @nHoriz, nCurHoriz ) @@ -139,7 +140,7 @@ FUNCTION FT_MVERSION( /* @ */ nMinor, /* @ */ nType, /* @ */ nIRQ ) FUNCTION FT_MINIT() - // If not previously initialized then try +// If not previously initialized then try IF ! t_lMInit t_lMInit := ( FT_MRESET() != 0 ) @@ -192,7 +193,7 @@ FUNCTION FT_MXLIMIT( nMin, nMax ) LOCAL nTop, nBottom - hb_MGetBounds( @nTop, , @nBottom ) + hb_MGetBounds( @nTop,, @nBottom ) MSetBounds( nTop, nMin, nBottom, nMax ) RETURN NIL @@ -201,7 +202,7 @@ FUNCTION FT_MYLIMIT( nMin, nMax ) LOCAL nLeft, nRight - hb_MGetBounds( , @nLeft, , @nRight ) + hb_MGetBounds(, @nLeft,, @nRight ) MSetBounds( nMin, nLeft, nMax, nRight ) RETURN NIL @@ -219,9 +220,11 @@ FUNCTION FT_MGETY() RETURN MCol() FUNCTION FT_MGETPAGE() + RETURN 0 -/* NOTE: Page is ignored in Harbour */ + /* NOTE: Page is ignored in Harbour */ + FUNCTION FT_MSETPAGE( nPage ) HB_SYMBOL_UNUSED( nPage ) diff --git a/harbour/contrib/hbnf/netpv.prg b/harbour/contrib/hbnf/netpv.prg index 56a1640e6a..42785aa8ff 100644 --- a/harbour/contrib/hbnf/netpv.prg +++ b/harbour/contrib/hbnf/netpv.prg @@ -36,4 +36,3 @@ FUNCTION FT_NETPV( nInitialInvestment, nInterestRate, aCashFlow, nNoOfCashFlows 1, nNoOfCashFlows ) RETURN nNetPresentValue -= nInitialInvestment - diff --git a/harbour/contrib/hbnf/nooccur.prg b/harbour/contrib/hbnf/nooccur.prg index d3c79b50a7..06ba01eadd 100644 --- a/harbour/contrib/hbnf/nooccur.prg +++ b/harbour/contrib/hbnf/nooccur.prg @@ -26,6 +26,7 @@ FUNCTION FT_NOOCCUR( cCheckFor, cCheckIn, lIgnoreCase ) // Is Case Important? + IF ! HB_ISLOGICAL( lIgnoreCase ) .OR. lIgnoreCase cCheckFor := Upper( cCheckFor ) cCheckIn := Upper( cCheckIn ) diff --git a/harbour/contrib/hbnf/ntow.prg b/harbour/contrib/hbnf/ntow.prg index e372a79de4..e347134098 100644 --- a/harbour/contrib/hbnf/ntow.prg +++ b/harbour/contrib/hbnf/ntow.prg @@ -66,12 +66,12 @@ STATIC FUNCTION grp_to_words( nGrp, sQual ) DO CASE CASE nTemp > 19 - sResult += sc_tens[ int( nTemp / 10 ) + 1 ] - sResult += sc_ones[ int( nTemp % 10 ) + 1 ] + sResult += sc_tens[ Int( nTemp / 10 ) + 1 ] + sResult += sc_ones[ Int( nTemp % 10 ) + 1 ] CASE nTemp < 20 .AND. nTemp > 9 - sResult += sc_teens[ int( nTemp % 10 ) + 1 ] + sResult += sc_teens[ Int( nTemp % 10 ) + 1 ] CASE nTemp < 10 .AND. nTemp > 0 - sResult += sc_ones[ int( nTemp) + 1 ] + sResult += sc_ones[ Int( nTemp ) + 1 ] ENDCASE RETURN sResult + sQual diff --git a/harbour/contrib/hbnf/numlock.c b/harbour/contrib/hbnf/numlock.c index 451e9b2699..03c6b0b969 100644 --- a/harbour/contrib/hbnf/numlock.c +++ b/harbour/contrib/hbnf/numlock.c @@ -33,7 +33,7 @@ HB_FUNC( FT_NUMLOCK ) { - int iState = 0; + int iState = 0; HB_GT_INFO gtInfo; memset( >Info, 0, sizeof( gtInfo ) ); @@ -48,8 +48,8 @@ HB_FUNC( FT_NUMLOCK ) if( HB_ISLOG( 1 ) ) { int iNewState = hb_parl( 1 ) ? - ( iState | HB_GTI_KBD_NUMLOCK ) : - ( iState & ~HB_GTI_KBD_NUMLOCK ); + ( iState | HB_GTI_KBD_NUMLOCK ) : + ( iState & ~HB_GTI_KBD_NUMLOCK ); gtInfo.pNewVal = hb_itemPutNI( gtInfo.pNewVal, iNewState ); hb_gtInfo( HB_GTI_KBDSHIFTS, >Info ); } diff --git a/harbour/contrib/hbnf/nwsem.prg b/harbour/contrib/hbnf/nwsem.prg index 9711ba71a9..9cca65bb2e 100644 --- a/harbour/contrib/hbnf/nwsem.prg +++ b/harbour/contrib/hbnf/nwsem.prg @@ -42,6 +42,7 @@ #define CLOSE_SEMAPHORE 4 /* TODO: rewrite in C */ + FUNCTION ft_nwSemOpen( cName, nInitVal, nHandle, nOpenCnt ) LOCAL aRegs[ INT86_MAX_REGS ], cRequest, nRet @@ -69,6 +70,7 @@ FUNCTION ft_nwSemOpen( cName, nInitVal, nHandle, nOpenCnt ) RETURN iif( nRet < 0, nRet + 256, nRet ) /* TODO: rewrite in C */ + FUNCTION ft_nwSemEx( nHandle, nValue, nOpenCnt ) LOCAL aRegs[ INT86_MAX_REGS ], nRet @@ -105,6 +107,7 @@ FUNCTION ft_nwSemClose( nHandle ) // _ftnwsem() - internal for the semaphore package /* TODO: rewrite in C */ + STATIC FUNCTION _ftnwsem( nOp, nHandle, nTimeout ) LOCAL aRegs[ INT86_MAX_REGS ], nRet diff --git a/harbour/contrib/hbnf/nwuid.prg b/harbour/contrib/hbnf/nwuid.prg index cba3a8c087..6f98b60778 100644 --- a/harbour/contrib/hbnf/nwuid.prg +++ b/harbour/contrib/hbnf/nwuid.prg @@ -34,6 +34,7 @@ #include "ftint86.ch" /* TODO: rewrite in C */ + FUNCTION FT_NWUID( nConn ) LOCAL aRegs[ INT86_MAX_REGS ] diff --git a/harbour/contrib/hbnf/ontick.prg b/harbour/contrib/hbnf/ontick.prg index f7fd23e51a..6f6b742eba 100644 --- a/harbour/contrib/hbnf/ontick.prg +++ b/harbour/contrib/hbnf/ontick.prg @@ -57,8 +57,8 @@ THREAD STATIC t_hIdle STATIC PROCEDURE __FT_ONTICK() - IF hb_milliSeconds() >= ( t_nLastCheck + t_nTickInterval ) - t_nLastCheck := hb_milliSeconds() + IF hb_MilliSeconds() >= ( t_nLastCheck + t_nTickInterval ) + t_nLastCheck := hb_MilliSeconds() Eval( t_bOnTick ) ENDIF @@ -71,7 +71,7 @@ PROCEDURE FT_ONTICK( bOnTick, nTickInterval ) IF HB_ISNUMERIC( nTickInterval ) t_nTickInterval := ( 1 / 18.20648 ) * nTickInterval * 1000 ENDIF - t_nLastCheck := hb_milliSeconds() + t_nLastCheck := hb_MilliSeconds() IF Empty( t_hIdle ) t_hIdle := hb_idleAdd( {|| __FT_ONTICK() } ) ENDIF diff --git a/harbour/contrib/hbnf/pchr.prg b/harbour/contrib/hbnf/pchr.prg index 134cbbbd03..daaaa1fec6 100644 --- a/harbour/contrib/hbnf/pchr.prg +++ b/harbour/contrib/hbnf/pchr.prg @@ -77,10 +77,11 @@ FUNCTION FT_PCHR( c_nums ) CASE LEFTEQUAL( c_upper, "/ITALIC" ) c_ret += hb_BChar( 27 ) + hb_BChar( 116 ) + hb_BChar( 0 ) CASE LEFTEQUAL( c_upper, "/PICTURE" ) - c_ret += hb_BChar( 27 ) + hb_BChar( 116 ) + hb_BChar( 1 ) + ; - hb_BChar( 27 ) + hb_BChar( 120 ) + hb_BChar( 1 ) + ; - hb_BChar( 27 ) + hb_BChar( 107 ) + hb_BChar( 1 ) + ; - hb_BChar( 27 ) + hb_BChar( 77 ) + hb_BChar( 27 ) + "U" + c_ret += ; + hb_BChar( 27 ) + hb_BChar( 116 ) + hb_BChar( 1 ) + ; + hb_BChar( 27 ) + hb_BChar( 120 ) + hb_BChar( 1 ) + ; + hb_BChar( 27 ) + hb_BChar( 107 ) + hb_BChar( 1 ) + ; + hb_BChar( 27 ) + hb_BChar( 77 ) + hb_BChar( 27 ) + "U" CASE LEFTEQUAL( c_upper, "/COND" ) .OR. LEFTEQUAL( c_upper, "/SI" ) c_ret += hb_BChar( 15 ) CASE LEFTEQUAL( c_upper, "/ROMAN" ) diff --git a/harbour/contrib/hbnf/peek.c b/harbour/contrib/hbnf/peek.c index f110886765..7a6e25e245 100644 --- a/harbour/contrib/hbnf/peek.c +++ b/harbour/contrib/hbnf/peek.c @@ -40,23 +40,23 @@ #if ! defined( MK_FP ) #define MK_FP( seg, off ) \ - ((void FAR *)(((unsigned long)(seg) << 4)|(unsigned)(off))) + ( ( void FAR * ) ( ( ( unsigned long ) ( seg ) << 4 ) | ( unsigned ) ( off ) ) ) #endif #if defined( __WATCOMC__ ) - #define outportb outp - #define inportb inp + #define outportb outp + #define inportb inp #endif #if defined( __WATCOMC__ ) && defined( __386__ ) - #define HB_PEEK_BYTE(s,o) ( *( ( HB_UCHAR * ) ( ( (s) << 4 ) | (o) ) ) ) - #define HB_POKE_BYTE(s,o,b) ( *( ( HB_UCHAR * ) ( ( (s) << 4 ) | (o) ) ) = ( HB_UCHAR ) (b) ) + #define HB_PEEK_BYTE( s, o ) ( *( ( HB_UCHAR * ) ( ( ( s ) << 4 ) | ( o ) ) ) ) + #define HB_POKE_BYTE( s, o, b ) ( *( ( HB_UCHAR * ) ( ( ( s ) << 4 ) | ( o ) ) ) = ( HB_UCHAR ) ( b ) ) #elif defined( __DJGPP__ ) - #define HB_PEEK_BYTE(s,o) _farpeekb( (s), (o) ) - #define HB_POKE_BYTE(s,o,b) _farpokeb( (s), (o), (b) ) + #define HB_PEEK_BYTE( s, o ) _farpeekb( ( s ), ( o ) ) + #define HB_POKE_BYTE( s, o, b ) _farpokeb( ( s ), ( o ), ( b ) ) #else - #define HB_PEEK_BYTE(s,o) ( *( ( HB_UCHAR FAR * ) MK_FP( (s), (o) ) ) ) - #define HB_POKE_BYTE(s,o,b) ( *( ( HB_UCHAR FAR * ) MK_FP( (s), (o) ) ) = ( HB_UCHAR ) (b) ) + #define HB_PEEK_BYTE( s, o ) ( *( ( HB_UCHAR FAR * ) MK_FP( ( s ), ( o ) ) ) ) + #define HB_POKE_BYTE( s, o, b ) ( *( ( HB_UCHAR FAR * ) MK_FP( ( s ), ( o ) ) ) = ( HB_UCHAR ) ( b ) ) #endif #endif diff --git a/harbour/contrib/hbnf/pegs.prg b/harbour/contrib/hbnf/pegs.prg index 7a0b2366a9..1bf7ea7142 100644 --- a/harbour/contrib/hbnf/pegs.prg +++ b/harbour/contrib/hbnf/pegs.prg @@ -31,8 +31,7 @@ #include "inkey.ch" #include "setcurs.ch" -#translate DOUBLEBOX( <top>, <left>, <bottom>, <right> ) => ; - hb_DispBox( <top>, <left>, <bottom>, <right>, hb_UTF8ToStrBox( "â•”â•╗║╝â•╚║ " ) ) +#translate DOUBLEBOX( <top>, <left>, <bottom>, <right> ) => hb_DispBox( <top>, <left>, <bottom>, <right>, hb_UTF8ToStrBox( "â•”â•╗║╝â•╚║ " ) ) /* here's the board array -- structure of which is: @@ -49,9 +48,9 @@ FUNCTION FT_PEGS() LOCAL oldscrn := SaveScreen( 0, 0, MaxRow(), MaxCol() ) LOCAL GetList - LOCAL board_ := {; + LOCAL board_ := { ; { { 0, 29, 2, 34 }, { 2, 4 }, { 3, 9 }, .T. }, ; - { { 0, 37, 2, 42 }, { 5 }, { 10 }, .T. } , ; + { { 0, 37, 2, 42 }, { 5 }, { 10 }, .T. }, ; { { 0, 45, 2, 50 }, { 2, 6 }, { 1, 11 }, .T. }, ; { { 3, 29, 5, 34 }, { 5, 9 }, { 6, 16 }, .T. }, ; { { 3, 37, 5, 42 }, { 10 }, { 17 }, .T. }, ; @@ -100,7 +99,7 @@ FUNCTION FT_PEGS() SetColor( "w/n" ) GetList := { Get():New( 23, 44, {| v | iif( PCount() == 0, move, move := v ) }, "move", "##" ) } - ATail( GetList ):postBlock := {| oGet | RangeCheck( oGet, , 1, 33 ) } + ATail( GetList ):postBlock := {| oGet | RangeCheck( oGet,, 1, 33 ) } ATail( GetList ):display() READ @@ -112,7 +111,7 @@ FUNCTION FT_PEGS() possible_ := {} FOR xx := 1 TO Len( board_[ move ][ 2 ] ) IF board_[ board_[ move ][ 2, xx ] ][ 4 ] .AND. ; - ! board_[ board_[ move ][ 3, xx ] ][ 4 ] + ! board_[ board_[ move ][ 3, xx ] ][ 4 ] AAdd( possible_, { board_[ move ][ 2, xx ], board_[ move ][ 3, xx ] } ) ENDIF NEXT @@ -163,24 +162,22 @@ FUNCTION FT_PEGS() RETURN NIL -// - STATIC FUNCTION DrawBox( board_, nelement ) SetColor( iif( board_[ nelement ][ 4 ], "+w/rb", "w/n" ) ) - hb_DispBox( board_[ nelement ][ 1, 1 ], ; - board_[ nelement ][ 1, 2 ], ; - board_[ nelement ][ 1, 3 ], ; - board_[ nelement ][ 1, 4 ], hb_UTF8ToStrBox( "┌─â”│â”─└│ " ) ) + hb_DispBox( ; + board_[ nelement ][ 1, 1 ], ; + board_[ nelement ][ 1, 2 ], ; + board_[ nelement ][ 1, 3 ], ; + board_[ nelement ][ 1, 4 ], hb_UTF8ToStrBox( "┌─â”│â”─└│ " ) ) - hb_DispOutAt( board_[ nelement ][ 1, 1 ] + 1, ; - board_[ nelement ][ 1, 2 ] + 2, hb_ntos( nelement ) ) + hb_DispOutAt( ; + board_[ nelement ][ 1, 1 ] + 1, ; + board_[ nelement ][ 1, 2 ] + 2, hb_ntos( nelement ) ) RETURN NIL -// - STATIC FUNCTION err_msg( msg ) LOCAL buffer := SaveScreen( 23, 33, 23, 47 ) @@ -194,8 +191,6 @@ STATIC FUNCTION err_msg( msg ) RETURN NIL -// - STATIC FUNCTION moremoves( board_ ) LOCAL xx, yy, canmove := .F., piecesleft := 0, buffer @@ -204,7 +199,7 @@ STATIC FUNCTION moremoves( board_ ) FOR yy := 1 TO Len( board_[ xx ][ 2 ] ) IF board_[ xx ][ 4 ] .AND. ; // if current location is filled board_[ board_[ xx ][ 2, yy ] ][ 4 ] .AND. ; // adjacent must be filled - ! board_[ board_[ xx ][ 3, yy ] ][ 4 ] // target must be empty + ! board_[ board_[ xx ][ 3, yy ] ][ 4 ] // target must be empty canmove := .T. EXIT ENDIF diff --git a/harbour/contrib/hbnf/popadder.prg b/harbour/contrib/hbnf/popadder.prg index 1084355ab9..20b88ed4ee 100644 --- a/harbour/contrib/hbnf/popadder.prg +++ b/harbour/contrib/hbnf/popadder.prg @@ -57,25 +57,6 @@ #define FT_B_DOUBLE HB_B_DOUBLE_UNI + " " #define FT_B_SINGLE HB_B_SINGLE_UNI + " " -#define nTotTran Len( aTrans ) - -#command DISPMESSAGE <mess>,<t>,<l>,<b>,<r> => ; - _ftPushKeys(); hb_keyPut( { K_CTRL_PGDN, K_CTRL_W } ) ;; - MemoEdit( <mess>, <t>, <l>, <b>, <r>, .F., NIL, ( <r> ) - ( <l> ) + 1 ) ;; - _ftPopKeys() - -/* This INKEY UDC was posted by Don Caton on NanForum... Thanks Don <g> */ -#command FT_INKEY [ <secs> ] TO <var> ; - => ; - WHILE .T. ;; - <var> := Inkey( [ <secs> ] ) ;; - IF SetKey( <var> ) != NIL ;; - Eval( SetKey( <var> ), ProcName(), ProcLine(), #<var> ) ;; - ELSE ;; - EXIT ;; - END ;; - END - // Instead of using STATIC variables for these I'm using a LOCAL array // and passing aAdder[] all over the place.... Don't let this confuse // you. I wrote the Adder using the variable names & now let the @@ -112,7 +93,7 @@ THREAD STATIC t_nWinColor THREAD STATIC t_aWinColor THREAD STATIC t_aStdColor -//---------------------------------------------------------- +// ---------------------------------------------------------- // Pop Up Adder / Calculator with Tape Display // NOTE: To make FT_Adder() pop up from any wait state in your // application just insert the line: @@ -135,6 +116,7 @@ FUNCTION FT_Adder() LOCAL lAC_exit_ok // Must prevent recursive calls + IF t_lAdderOpen RETURN NIL ELSE @@ -147,7 +129,6 @@ FUNCTION FT_Adder() cTapeScr := "" nTotal := nNumTotal := nSavTotal := nDecDigit := 0 lDone := .F. // Loop flag - nKey := 0 nMaxDeci := 2 // Initial # of decimals nSavSubTot := 0 lNewNum := .F. @@ -174,7 +155,7 @@ FUNCTION FT_Adder() hb_DispOutAt( 4 + nTopOS, 7 + nAddSpace, Transform( nTotal, cTotPict ) ) DO WHILE ! lDone // Input key & test loop - FT_INKEY 0 TO nKey + nKey := _ftInkey( 0, "nKey" ) DO CASE CASE hb_keyChar( nKey ) $ "1234567890." _ftProcessNumb( aAdder, nKey ) @@ -240,28 +221,28 @@ FUNCTION FT_Adder() _ftSetWinColor( W_CURR, W_PROMPT ) ENDIF CASE ( nKey == hb_keyCode( "S" ) .OR. nKey == hb_keyCode( "s" ) ) .AND. lTape // <S> Scroll tape display - IF nTotTran > 16 // We need to scroll + IF Len( aTrans ) > 16 // We need to scroll SetColor( "GR+/W" ) hb_DispOutAt( 21 + nTopOS, 8 + nTapeSpace, " " + /* LOW-ASCII "↑↓" */ Chr( 24 ) + Chr( 25 ) + "-SCROLL <ESC>-QUIT " ) SetColor( "N/W,W+/N" ) lAC_exit_ok := .F. AChoice( 5 + nTopOS, 7 + nTapeSpace, 20 + nTopOS, 32 + nTapeSpace, aTrans, .T., ; - {| nMode, cur_elem, rel_pos | _ftAdderTapeUDF( nMode, cur_elem, rel_pos, @lAC_exit_ok ) }, nTotTran, 20 ) + {| nMode, cur_elem, rel_pos | _ftAdderTapeUDF( nMode, cur_elem, rel_pos, @lAC_exit_ok ) }, Len( aTrans ), 20 ) SetColor( "R+/W" ) hb_DispBox( 21 + nTopOS, 8 + nTapeSpace, 21 + nTopOS, 30 + nTapeSpace, HB_B_SINGLE_UNI ) _ftSetWinColor( W_CURR, W_PROMPT ) CLEAR TYPEAHEAD ELSE - _ftError( "there are " + iif( nTotTran > 0, "only " + ; - hb_ntos( nTotTran ), "no" ) + ; + _ftError( "there are " + iif( Len( aTrans ) > 0, "only " + ; + hb_ntos( Len( aTrans ) ), "no" ) + ; " transactions entered so far." + ; " No need to scroll!" ) ENDIF - CASE nKey == K_DEL // Delete - Clear adder + CASE nKey == K_DEL // Delete - Clear adder _ftClearAdder( aAdder ) - CASE nKey == K_F1 // <F1> Help + CASE nKey == K_F1 // <F1> Help _ftAddHelp() - CASE nKey == K_F10 // <F10> Quit - Return total + CASE nKey == K_F10 // <F10> Quit - Return total IF lTotalOk // Did they finish the calculation IF oGet != NIL .AND. oGet:type == "N" Set( _SET_DECIMALS, nOldDecim ) @@ -293,7 +274,7 @@ FUNCTION FT_Adder() RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Display the Adder STATIC FUNCTION _ftAddScreen( aAdder ) @@ -301,7 +282,7 @@ STATIC FUNCTION _ftAddScreen( aAdder ) LOCAL nCol _ftPushWin( 2 + nTopOS, 2 + nAddSpace, 22 + nTopOS, 30 + nAddSpace, " Adder ", ; - "<F-1> for Help", , FT_B_DOUBLE ) + "<F-1> for Help",, FT_B_DOUBLE ) nCol := 5 + nAddSpace hb_DispOutAt( 7 + nTopOS, nCol, hb_UTF8ToStr( " ┌───┠┌───┠┌───â”" ) ) hb_DispOutAt( 8 + nTopOS, nCol, hb_UTF8ToStr( " │ │ │ │ │ │" ) ) @@ -345,7 +326,7 @@ STATIC FUNCTION _ftAddScreen( aAdder ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Change the decimal position in the display STATIC FUNCTION _ftChangeDec( aAdder, nNumDec ) @@ -375,7 +356,7 @@ STATIC FUNCTION _ftChangeDec( aAdder, nNumDec ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Display total number to Adder Window STATIC FUNCTION _ftDispTotal( aAdder ) @@ -399,7 +380,7 @@ STATIC FUNCTION _ftDispTotal( aAdder ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Display subtotal number STATIC FUNCTION _ftDispSubTot( aAdder ) @@ -423,7 +404,7 @@ STATIC FUNCTION _ftDispSubTot( aAdder ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Act on NUMBER key pressed STATIC FUNCTION _ftProcessNumb( aAdder, nKey ) @@ -458,7 +439,7 @@ STATIC FUNCTION _ftProcessNumb( aAdder, nKey ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Enter key - SUBTOTAL\TOTAL STATIC FUNCTION _ftAddTotal( aAdder ) @@ -533,7 +514,7 @@ STATIC FUNCTION _ftAddTotal( aAdder ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Process + or - keypress STATIC FUNCTION _ftAddSub( aAdder, nKey ) @@ -576,7 +557,7 @@ STATIC FUNCTION _ftAddSub( aAdder, nKey ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Process * or / keypress STATIC FUNCTION _ftMultDiv( aAdder, nKey ) @@ -624,7 +605,7 @@ STATIC FUNCTION _ftMultDiv( aAdder, nKey ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Help window STATIC FUNCTION _ftAddHelp @@ -652,7 +633,7 @@ STATIC FUNCTION _ftAddHelp RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Clear entry / Clear Adder STATIC FUNCTION _ftClearAdder( aAdder ) @@ -674,7 +655,7 @@ STATIC FUNCTION _ftClearAdder( aAdder ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Update transactions array STATIC FUNCTION _ftUpdateTrans( aAdder, lTypeTotal, nAmount ) @@ -693,13 +674,13 @@ STATIC FUNCTION _ftUpdateTrans( aAdder, lTypeTotal, nAmount ) IF lTypeTotal // If lTypeTotal == .T. Update from total AAdd( aTrans, Str( iif( lUseTotal, nTotal, nAmount ), 22, nMaxDeci ) ) - aTrans[ nTotTran ] := _ftStuffComma( aTrans[ nTotTran ], .T. ) + " *" + ; + aTrans[ Len( aTrans ) ] := _ftStuffComma( aTrans[ Len( aTrans ) ], .T. ) + " *" + ; iif( lAddError, "ER", "" ) ELSE // If lTypeTotal=.F. Update from nNumTotal AAdd( aTrans, Str( iif( lUseTotal, nTotal, nAmount ), 22, nMaxDeci ) ) - aTrans[ nTotTran ] := _ftStuffComma( aTrans[ nTotTran ], .T. ) + ; + aTrans[ Len( aTrans ) ] := _ftStuffComma( aTrans[ Len( aTrans ) ], .T. ) + ; iif( lSubRtn, " S", iif( nAddMode == 1, " +", iif( nAddMode == 2, " -", ; iif( lTotalOk, " =", iif( nAddMode == 3, " X", " /" ) ) ) ) ) + iif( lAddError, "ER", "" ) @@ -711,7 +692,7 @@ STATIC FUNCTION _ftUpdateTrans( aAdder, lTypeTotal, nAmount ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Clear the <TOTAL> & <SUBTOTAL> from Adder STATIC FUNCTION _ftEraseTotSubTot( aAdder ) @@ -722,7 +703,7 @@ STATIC FUNCTION _ftEraseTotSubTot( aAdder ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Adder Rounding function STATIC FUNCTION _ftRoundIt( nNumber, nPlaces ) @@ -732,7 +713,7 @@ STATIC FUNCTION _ftRoundIt( nNumber, nPlaces ) RETURN iif( nNumber < 0.0, -1.0, 1.0 ) * ; Int( Abs( nNumber ) * 10 ^ nPlaces + 0.50 + 10 ^ -12 ) / 10 ^ nPlaces -//---------------------------------------------------------- +// ---------------------------------------------------------- // Check divide by zero not allowed STATIC FUNCTION _ftDivide( aAdder, nNumerator, nDenominator ) @@ -746,7 +727,7 @@ STATIC FUNCTION _ftDivide( aAdder, nNumerator, nDenominator ) RETURN nNumerator / nDenominator -//---------------------------------------------------------- +// ---------------------------------------------------------- // Validate the number of decimals STATIC FUNCTION _ftValDeci( oGet ) @@ -760,7 +741,7 @@ STATIC FUNCTION _ftValDeci( oGet ) RETURN lRtnValue -//---------------------------------------------------------- +// ---------------------------------------------------------- // Display the Tape STATIC FUNCTION _ftDisplayTape( aAdder, nKey ) @@ -775,8 +756,8 @@ STATIC FUNCTION _ftDisplayTape( aAdder, nKey ) IF lTape // Are we in the display mode SetColor( "N/W" ) hb_Scroll( 5 + nTopOS, 7 + nTapeSpace, 20 + nTopOS, 32 + nTapeSpace, 1 ) - IF nTotTran > 0 // Any transactions been entered yet? - hb_DispOutAt( 20 + nTopOS, 7 + nTapeSpace, aTrans[ nTotTran ] ) + IF Len( aTrans ) > 0 // Any transactions been entered yet? + hb_DispOutAt( 20 + nTopOS, 7 + nTapeSpace, aTrans[ Len( aTrans ) ] ) ENDIF _ftSetWinColor( W_CURR, W_PROMPT ) ELSE // Start displaying tape @@ -788,18 +769,18 @@ STATIC FUNCTION _ftDisplayTape( aAdder, nKey ) SetColor( "GR+/W" ) hb_DispOutAt( 4 + nTopOS, 17 + nTapeSpace, " TAPE " ) SetColor( "N/W" ) - IF nTotTran > 15 - nTopTape := nTotTran - 15 + IF Len( aTrans ) > 15 + nTopTape := Len( aTrans ) - 15 ENDIF - FOR nDispTape := nTotTran TO nTopTape STEP -1 - hb_DispOutAt( 20 + nDispTape - nTotTran + nTopOS, 7 + nTapeSpace, aTrans[ nDispTape ] ) + FOR nDispTape := Len( aTrans ) TO nTopTape STEP -1 + hb_DispOutAt( 20 + nDispTape - Len( aTrans ) + nTopOS, 7 + nTapeSpace, aTrans[ nDispTape ] ) NEXT ENDIF _ftSetWinColor( W_CURR, W_PROMPT ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Sets the LASTKEY() value to value of nLastKey // NOTE: I use this in most of my Pop-Up routines to reset the // original value of LASTKEY() when quitting. @@ -813,7 +794,7 @@ STATIC FUNCTION _ftSetLastKey( nLastKey ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Push any keys in the Keyboard buffer on the array t_aKeys[] // NOTE: Save any keys in the buffer... for FAST typists <g>. @@ -825,7 +806,7 @@ STATIC FUNCTION _ftPushKeys() RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Restore the keyboard with any keystrokes that were saved with _ftPushKeys STATIC FUNCTION _ftPopKeys @@ -837,13 +818,13 @@ STATIC FUNCTION _ftPopKeys RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Display a message on the screen in a window // See Also: _ftPopMessage STATIC FUNCTION _ftPushMessage( cMessage, lWait, cTitle, cBotTitle, xQuiet, nTop ) - LOCAL nMessLen, nNumRows, nWide, nLeft, nBottom, nRight, nKey, cOldDevic + LOCAL nMessLen, nNumRows, nWide, nLeft, nBottom, nRight, cOldDevic LOCAL lOldPrint LOCAL cOldColor := SetColor() LOCAL nOldLastkey := LastKey() @@ -868,13 +849,13 @@ STATIC FUNCTION _ftPushMessage( cMessage, lWait, cTitle, cBotTitle, xQuiet, nTop __defaultNIL( @lWait, .F. ) _ftPushWin( nTop, nLeft, nBottom, nRight, cTitle, cBotTitle, nWinColor ) - DISPMESSAGE cMessage, nTop + 1, nLeft + 2, nBottom - 1, nRight - 2 + _ftDispMessage( cMessage, nTop + 1, nLeft + 2, nBottom - 1, nRight - 2 ) IF xQuiet == NIL Tone( 800, 1 ) ENDIF IF lWait - FT_INKEY 0 TO nKey + _ftInkey( 0, "nKey" ) _ftPopMessage() ENDIF @@ -887,7 +868,7 @@ STATIC FUNCTION _ftPushMessage( cMessage, lWait, cTitle, cBotTitle, xQuiet, nTop RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Pop off the Message Box // See Also: _ftPushMessage() @@ -897,7 +878,7 @@ STATIC FUNCTION _ftPopMessage RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Push a Question Box on the Screen // NOTE: This function will work for all Data Types @@ -907,7 +888,7 @@ STATIC FUNCTION _ftQuest( cMessage, xVarVal, cPict, bValid, lNoESC, nWinColor, n LOCAL nRight, oNewGet, nNumMessRow, nLenLastRow, lGetOnNextLine, nOldCurs LOCAL cVarType := ValType( xVarVal ) LOCAL nVarLen := ; - iif( cVarType == "C", Len( xVarVal ),; + iif( cVarType == "C", Len( xVarVal ), ; iif( cVarType == "D", 8, ; iif( cVarType == "L", 1, ; iif( cVarType == "N", iif( cPict == NIL, 9, Len( cPict ) ), 0 ) ) ) ) @@ -938,7 +919,7 @@ STATIC FUNCTION _ftQuest( cMessage, xVarVal, cPict, bValid, lNoESC, nWinColor, n _ftPushWin( nTop, nLeft, nBottom, nRight, "QUESTION ?", iif( HB_ISSTRING( xVarVal ) ; .AND. nVarLen > nWide, /* LOW-ASCII "â†" */ Chr( 27 ) + " scroll " + Chr( 26 ) /* LOW-ASCII "→" */, NIL ), nWinColor ) - DISPMESSAGE cMessage, nTop + 1, nLeft + 2, nBottom - 1, nRight - 2 + _ftDispMessage( cMessage, nTop + 1, nLeft + 2, nBottom - 1, nRight - 2 ) oNewGet := GetNew( ; iif( lGetOnNextLine, Row() + 1, Row() ), ; @@ -984,13 +965,13 @@ STATIC FUNCTION _ftQuest( cMessage, xVarVal, cPict, bValid, lNoESC, nWinColor, n SetCursor( nOldCurs ) SetColor( cOldColor ) SetPos( nOldRow, nOldCol ) - Set( _SET_DEVICE, cOldDevice ) + Set( _SET_DEVICE, cOldDevice ) Set( _SET_PRINTER, lOldPrint ) _ftSetLastKey( nOldLastKey ) RETURN xVarVal -//---------------------------------------------------------- +// ---------------------------------------------------------- // User function for ACHOICE() when scrolling tape STATIC FUNCTION _ftAdderTapeUDF( mode, cur_elem, rel_pos, /* @ */ lAC_exit_ok ) @@ -1022,13 +1003,13 @@ STATIC FUNCTION _ftAdderTapeUDF( mode, cur_elem, rel_pos, /* @ */ lAC_exit_ok ) RETURN nRtnVal -//---------------------------------------------------------- +// ---------------------------------------------------------- // Display an ERROR message in a window STATIC FUNCTION _ftError( cMessage, xDontReset ) LOCAL nOldRow, nOldCol, nOldCurs, nTop, nLeft, nBot, nRight, cOldColor - LOCAL nOldLastKey, cErrorScr, nMessLen, nWide, nNumRows, nKey + LOCAL nOldLastKey, cErrorScr, nMessLen, nWide, nNumRows LOCAL cOldDevic, lOldPrint LOCAL lResetLKey := ( xDontReset == NIL ) @@ -1053,9 +1034,9 @@ STATIC FUNCTION _ftError( cMessage, xDontReset ) hb_DispBox( nTop, nLeft, nBot, nRight, FT_B_SINGLE ) hb_DispOutAt( nTop, nLeft + Int( nWide / 2 ) - 1, " ERROR " ) hb_DispOutAt( nBot - 1, nLeft + Int( nWide - 28 ) / 2 + 3, "Press any key to continue..." ) - DISPMESSAGE cMessage, nTop + 1, nLeft + 3, nBot - 2, nRight - 3 + _ftDispMessage( cMessage, nTop + 1, nLeft + 3, nBot - 2, nRight - 3 ) Tone( 70, 5 ) - FT_INKEY 0 TO nKey + _ftInkey( 0, "nKey" ) RestScreen( nTop, nLeft, nBot + 1, nRight + 2, cErrorScr ) SetCursor( nOldCurs ) SetColor( cOldColor ) @@ -1070,7 +1051,7 @@ STATIC FUNCTION _ftError( cMessage, xDontReset ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Stuff a Comma in a string STATIC FUNCTION _ftStuffComma( cStrToStuff, lTrimStuffedStr ) @@ -1093,11 +1074,11 @@ STATIC FUNCTION _ftStuffComma( cStrToStuff, lTrimStuffedStr ) ENDIF nDecPosit := At( ".", cStrToStuff ) - IF Len( Left( LTrim(_ftCharRem("-",cStrToStuff ) ), ; - At( ".", LTrim( _ftCharRem("-",cStrToStuff ) ) ) - 1 ) ) > 3 + IF Len( Left( LTrim( _ftCharRem( "-", cStrToStuff ) ), ; + At( ".", LTrim( _ftCharRem( "-", cStrToStuff ) ) ) - 1 ) ) > 3 IF lTrimStuffedStr // Do we trim the number each time we insert a comma FOR x := nDecPosit - 3 TO 2 + _ftCountLeft( cStrToStuff, " " ) STEP -4 - cStrToStuff := SubStr( _ftPosIns( cStrToStuff,",",x ), 2 ) + cStrToStuff := SubStr( _ftPosIns( cStrToStuff, ",", x ), 2 ) NEXT ELSE FOR x := nDecPosit - 3 TO 2 + _ftCountLeft( cStrToStuff, " " ) STEP -3 @@ -1108,7 +1089,7 @@ STATIC FUNCTION _ftStuffComma( cStrToStuff, lTrimStuffedStr ) RETURN cStrToStuff -//---------------------------------------------------------- +// ---------------------------------------------------------- // Set the standard screen colors to the color requested. // See Also: _ftSetWinColor() @@ -1118,10 +1099,10 @@ STATIC FUNCTION _ftSetSCRColor( nStd, nEnh, nBord, nBack, nUnsel ) _ftInitColors() ENDIF - __defaultNIL( @nStd , 8 ) - __defaultNIL( @nEnh , 8 ) - __defaultNIL( @nBord , 8 ) - __defaultNIL( @nBack , 8 ) + __defaultNIL( @nStd, 8 ) + __defaultNIL( @nEnh, 8 ) + __defaultNIL( @nBord, 8 ) + __defaultNIL( @nBack, 8 ) __defaultNIL( @nUnsel, nEnh ) RETURN SetColor( ; @@ -1131,7 +1112,7 @@ STATIC FUNCTION _ftSetSCRColor( nStd, nEnh, nBord, nBack, nUnsel ) t_aStdColor[ nBack ] + "," + ; t_aStdColor[ nUnsel ] ) -//---------------------------------------------------------- +// ---------------------------------------------------------- // NOTE: Push a new window on the screen in the position t,l,b,r // and if cTitle is not NIL print the title for the window // in centered in the top line of the box. Similarly do @@ -1171,7 +1152,7 @@ STATIC FUNCTION _ftPushWin( t, l, b, r, cTitle, cBotTitle, nWinColor ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Pop a Window off the screen // NOTE: Pop the currently active window off the screen by restoring // it from the t_aWindow Array and if they pushed a new window @@ -1201,7 +1182,7 @@ STATIC FUNCTION _ftPopWin() RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Set the Color to the Window Colors requested // See Also: _ftSetSCRColor() // NOTE: If the window number is not passed use the currently @@ -1209,11 +1190,11 @@ STATIC FUNCTION _ftPopWin() STATIC FUNCTION _ftSetWinColor( nWin, nStd, nEnh, nBord, nBack, nUnsel ) - __defaultNIL( @nWin , t_nWinColor ) - __defaultNIL( @nStd , 7 ) - __defaultNIL( @nEnh , 7 ) - __defaultNIL( @nBord , 7 ) - __defaultNIL( @nBack , 7 ) + __defaultNIL( @nWin, t_nWinColor ) + __defaultNIL( @nStd, 7 ) + __defaultNIL( @nEnh, 7 ) + __defaultNIL( @nBord, 7 ) + __defaultNIL( @nBack, 7 ) __defaultNIL( @nUnsel, nEnh ) RETURN SetColor( ; @@ -1223,7 +1204,7 @@ STATIC FUNCTION _ftSetWinColor( nWin, nStd, nEnh, nBord, nBack, nUnsel ) t_aWinColor[ nBack, nWin ] + "," + ; t_aWinColor[ nUnsel, nWin ] ) -//---------------------------------------------------------- +// ---------------------------------------------------------- // Decrement the active window color number and return the current value // NOTE: If we are already on window #1 restart count by using # 4. @@ -1231,7 +1212,7 @@ STATIC FUNCTION _ftLastWinColor() RETURN t_nWinColor := iif( t_nWinColor == 1, 4, t_nWinColor - 1 ) -//---------------------------------------------------------- +// ---------------------------------------------------------- // Increment the active window color number and return the current value // NOTE: If we are already on window #4 restart count by using # 1. @@ -1243,7 +1224,7 @@ STATIC FUNCTION _ftNextWinColor() RETURN t_nWinColor := ( iif( t_nWinColor < 4, t_nWinColor + 1, 1 ) ) -//---------------------------------------------------------- +// ---------------------------------------------------------- // Print the top or bottom titles on the border of the currently // active window. @@ -1257,57 +1238,82 @@ STATIC FUNCTION _ftWinTitle( cTheTitle, cTopOrBot ) RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Initilize the colors for the Adder STATIC FUNCTION _ftInitColors() t_aWinColor := { ; - { "GR+/BG","GR+/G", "B+/RB", "G+/R" } ,; - { "R+/N", "W+/RB", "W+/BG", "GR+/B" } ,; - { "GR+/N", "GR+/N", "GR+/N", "GR+/N" } ,; - { "B/BG", "BG+/G", "W+/RB", "BG+/R" } ,; - { "W+/BG", "W+/G", "GR+/RB", "W+/R" } ,; - { "GR+/B", "GR+/R", "R+/B", "W+/BG" } ,; - { "N/N", "N/N", "N/N", "N/N" } } + { "GR+/BG", "GR+/G", "B+/RB", "G+/R" },; + { "R+/N", "W+/RB", "W+/BG", "GR+/B" },; + { "GR+/N", "GR+/N", "GR+/N", "GR+/N" },; + { "B/BG", "BG+/G", "W+/RB", "BG+/R" },; + { "W+/BG", "W+/G", "GR+/RB", "W+/R" },; + { "GR+/B", "GR+/R", "R+/B", "W+/BG" },; + { "N/N", "N/N", "N/N", "N/N" } } t_aStdColor := { ; - "BG+*/RB" ,; - "GR+/R" ,; - "GR+/N" ,; - "W/B" ,; - "GR+/N" ,; - "GR+/GR" ,; - { "W+/B", "W/B", "G+/B", "R+/B" ,; - "GR+/B", "BG+/B", "B+/B", "G+/B" } ,; + "BG+*/RB",; + "GR+/R",; + "GR+/N",; + "W/B",; + "GR+/N",; + "GR+/GR",; + { ; + "W+/B", "W/B", "G+/B", "R+/B",; + "GR+/B", "BG+/B", "B+/B", "G+/B" },; "N/N" } RETURN NIL -//---------------------------------------------------------- +// ---------------------------------------------------------- // Replace the Character at nPosit in cString with cChar STATIC FUNCTION _ftPosRepl( cString, cChar, nPosit ) RETURN StrTran( cString, "9", cChar, nPosit, 1 ) + "" -//---------------------------------------------------------- +// ---------------------------------------------------------- // Removes all occurances of cChar from cString. STATIC FUNCTION _ftCharRem( cChar, cString ) RETURN StrTran( cString, cChar ) -//---------------------------------------------------------- +// ---------------------------------------------------------- // Returns the number of spaces on the Left side of the String STATIC FUNCTION _ftCountLeft( cString ) RETURN Len( cString ) - Len( LTrim( cString ) ) -//---------------------------------------------------------- +// ---------------------------------------------------------- // Insert the Character cChar in cString at position nPosit STATIC FUNCTION _ftPosIns( cString, cChar, nPosit ) RETURN Left( cString, nPosit - 1 ) + cChar + SubStr( cString, nPosit ) + +STATIC FUNCTION _ftInkey( nSecs, cVar ) + + LOCAL nVar + + DO WHILE .T. + nVar := Inkey( nSecs ) + IF SetKey( nVar ) != NIL + Eval( SetKey( nVar ), ProcName(), ProcLine(), cVar ) + ELSE + EXIT + ENDIF + ENDDO + + RETURN nVar + +STATIC PROCEDURE _ftDispMessage( cMessage, nT, nL, nB, nR ) + + _ftPushKeys() + hb_keyPut( { K_CTRL_PGDN, K_CTRL_W } ) + MemoEdit( cMessage, nT, nL, nB, nR, .F., NIL, nR - nL + 1 ) + _ftPopKeys() + + RETURN diff --git a/harbour/contrib/hbnf/proper.c b/harbour/contrib/hbnf/proper.c index f52597ecc0..f8e81090db 100644 --- a/harbour/contrib/hbnf/proper.c +++ b/harbour/contrib/hbnf/proper.c @@ -60,11 +60,11 @@ static HB_BOOL _ftIsAlpha( char c ) HB_FUNC( FT_PROPER ) { - HB_ISIZ iLen = hb_parclen( 1 ); - const char * cStr = hb_parc( 1 ); - char * cDst = NULL; - HB_ISIZ i; - HB_BOOL fCap = HB_TRUE; + HB_ISIZ iLen = hb_parclen( 1 ); + const char * cStr = hb_parc( 1 ); + char * cDst = NULL; + HB_ISIZ i; + HB_BOOL fCap = HB_TRUE; hb_storc( NULL, 1 ); diff --git a/harbour/contrib/hbnf/prtscr.c b/harbour/contrib/hbnf/prtscr.c index 6170743937..654bcd4cd0 100644 --- a/harbour/contrib/hbnf/prtscr.c +++ b/harbour/contrib/hbnf/prtscr.c @@ -32,7 +32,7 @@ HB_FUNC( FT_PRTSCR ) { #if defined( HB_OS_DOS ) - #define pbyte *( ( char * ) 0x00400100 ) + #define pbyte *( ( char * ) 0x00400100 ) if( HB_ISLOG( 1 ) ) pbyte = hb_parl( 1 ) ? 0 : 1; diff --git a/harbour/contrib/hbnf/round.prg b/harbour/contrib/hbnf/round.prg index 6577255f87..b44d64dcb9 100644 --- a/harbour/contrib/hbnf/round.prg +++ b/harbour/contrib/hbnf/round.prg @@ -35,9 +35,9 @@ FUNCTION FT_ROUND( nNumber, nRoundToAmount, cRoundType, cRoundDirection, ; LOCAL nResult := Abs( nNumber ) // The Result of the Rounding - __defaultNIL( @nRoundToAmount , 2 ) - __defaultNIL( @cRoundType , NEAREST_DECIMAL ) - __defaultNIL( @cRoundDirection , ROUND_NORMAL ) + __defaultNIL( @nRoundToAmount, 2 ) + __defaultNIL( @cRoundType, NEAREST_DECIMAL ) + __defaultNIL( @cRoundDirection, ROUND_NORMAL ) __defaultNIL( @nAcceptableError, 1 / ( nRoundToAmount ** 2 ) ) // Are We Rounding to the Nearest Whole @@ -67,14 +67,15 @@ FUNCTION FT_ROUND( nNumber, nRoundToAmount, cRoundType, cRoundDirection, ; -1 / nRoundToAmount / 2, ; ; // No, Rounding Normal, No Adjustment 0 ) ) - //Do the Actual Rounding + // Do the Actual Rounding nResult := Int( ( nRoundToAmount * nResult ) + .5 + nAcceptableError ) / ; nRoundToAmount ENDIF - ELSE // Yes, Round to Nearest Whole Number - // or to Zero Places + ELSE + // Yes, Round to Nearest Whole Number + // or to Zero Places nRoundToAmount := Max( nRoundToAmount, 1 ) diff --git a/harbour/contrib/hbnf/scancode.prg b/harbour/contrib/hbnf/scancode.prg index 9c3c12643e..c77974442d 100644 --- a/harbour/contrib/hbnf/scancode.prg +++ b/harbour/contrib/hbnf/scancode.prg @@ -29,6 +29,7 @@ #include "ftint86.ch" /* TODO: rewrite in C */ + FUNCTION FT_SCANCODE() LOCAL aRegs[ INT86_MAX_REGS ] diff --git a/harbour/contrib/hbnf/scregion.prg b/harbour/contrib/hbnf/scregion.prg index 2746c5cd0e..f37e0bcbfa 100644 --- a/harbour/contrib/hbnf/scregion.prg +++ b/harbour/contrib/hbnf/scregion.prg @@ -33,16 +33,17 @@ FUNCTION FT_SAVRGN( nTop, nLeft, nBottom, nRight ) FUNCTION FT_RSTRGN( cScreen, nTop, nLeft ) IF PCount() == 3 - RestScreen( nTop, nLeft,; + RestScreen( nTop, nLeft, ; ( nTop - hb_BCode( hb_BSubStr( cScreen, 1, 1 ) ) ) + hb_BCode( hb_BSubStr( cScreen, 3, 1 ) ), ; ( nLeft - hb_BCode( hb_BSubStr( cScreen, 2, 1 ) ) ) + hb_BCode( hb_BSubStr( cScreen, 4, 1 ) ), ; hb_BSubStr( cScreen, 5 ) ) ELSE - RestScreen( hb_BCode( hb_BSubStr( cScreen, 1, 1 ) ),; - hb_BCode( hb_BSubStr( cScreen, 2, 1 ) ),; - hb_BCode( hb_BSubStr( cScreen, 3, 1 ) ),; - hb_BCode( hb_BSubStr( cScreen, 4, 1 ) ),; - hb_BSubStr( cScreen, 5 ) ) + RestScreen( ; + hb_BCode( hb_BSubStr( cScreen, 1, 1 ) ), ; + hb_BCode( hb_BSubStr( cScreen, 2, 1 ) ), ; + hb_BCode( hb_BSubStr( cScreen, 3, 1 ) ), ; + hb_BCode( hb_BSubStr( cScreen, 4, 1 ) ), ; + hb_BSubStr( cScreen, 5 ) ) ENDIF RETURN NIL diff --git a/harbour/contrib/hbnf/setdate.c b/harbour/contrib/hbnf/setdate.c index bb502e7bd2..3451d745d5 100644 --- a/harbour/contrib/hbnf/setdate.c +++ b/harbour/contrib/hbnf/setdate.c @@ -85,7 +85,7 @@ HB_FUNC( FT_SETDATE ) { #if defined( HB_OS_DOS ) - int iYear, iMonth, iDay; + int iYear, iMonth, iDay; union REGS regs; if( HB_ISDATE( 1 ) ) @@ -93,10 +93,10 @@ HB_FUNC( FT_SETDATE ) else hb_dateToday( &iYear, &iMonth, &iDay ); - regs.h.ah = 43; + regs.h.ah = 43; regs.HB_XREGS.cx = iYear; - regs.h.dh = iMonth; - regs.h.dl = iDay; + regs.h.dh = iMonth; + regs.h.dl = iDay; HB_DOS_INT86( 0x21, ®s, ®s ); hb_retl( HB_TRUE ); diff --git a/harbour/contrib/hbnf/settime.c b/harbour/contrib/hbnf/settime.c index f9b868d9ea..a4e04ab373 100644 --- a/harbour/contrib/hbnf/settime.c +++ b/harbour/contrib/hbnf/settime.c @@ -85,13 +85,13 @@ HB_FUNC( FT_SETTIME ) { #if defined( HB_OS_DOS ) - int iHour, iMinute, iSeconds; + int iHour, iMinute, iSeconds; union REGS regs; if( HB_ISCHAR( 1 ) ) { const char * pszTime = hb_parc( 1 ); - HB_SIZE nLen = strlen( pszTime ); + HB_SIZE nLen = strlen( pszTime ); if( nLen >= 1 ) iHour = ( int ) hb_strVal( pszTime, nLen ); @@ -104,7 +104,7 @@ HB_FUNC( FT_SETTIME ) { int iYear, iMonth, iDay, iMillisec; hb_timeStampGetLocal( &iYear, &iMonth, &iDay, - &iHour, &iMinute, &iSeconds, &iMillisec ); + &iHour, &iMinute, &iSeconds, &iMillisec ); } regs.h.ah = 45; diff --git a/harbour/contrib/hbnf/sinkey.prg b/harbour/contrib/hbnf/sinkey.prg index 9268ade238..905c8202c1 100644 --- a/harbour/contrib/hbnf/sinkey.prg +++ b/harbour/contrib/hbnf/sinkey.prg @@ -25,28 +25,28 @@ FUNCTION FT_SINKEY( waittime ) - LOCAL key, cBlock + LOCAL nKey, cBlock DO CASE CASE PCount() == 0 /* if no WAITTIME passed, go straight through */ - key := Inkey() + nKey := Inkey() /* dig this... if you pass Inkey( NIL ), it is identical to Inkey( 0 )! therefore, I allow you to pass FT_SINKEY( NIL ) -- hence this mild bit of convolution */ CASE waittime == NIL .AND. PCount() == 1 - key := Inkey( 0 ) + nKey := Inkey( 0 ) OTHERWISE - key := Inkey( waittime ) + nKey := Inkey( waittime ) ENDCASE - IF ( cBlock := SetKey( key ) ) != NIL + IF ( cBlock := SetKey( nKey ) ) != NIL // run the code block associated with this key and pass it the // name of the previous procedure and the previous line number Eval( cBlock, ProcName( 1 ), ProcLine( 1 ), NIL ) ENDIF - RETURN key + RETURN nKey diff --git a/harbour/contrib/hbnf/support.c b/harbour/contrib/hbnf/support.c index 7273b17b5a..f52cf11496 100644 --- a/harbour/contrib/hbnf/support.c +++ b/harbour/contrib/hbnf/support.c @@ -79,30 +79,30 @@ HB_FUNC( _FT_NWKSTAT ) HB_FUNC( _FT_TEMPFIL ) { - int nax; - int iflags; - const char * cPath; + int nax; + int iflags; + const char * cPath; #if defined( HB_OS_DOS ) && ! defined( HB_OS_DOS_32 ) { - int iMode = hb_parni( 2 ); - union REGS regs; - struct SREGS sregs; + int iMode = hb_parni( 2 ); + union REGS regs; + struct SREGS sregs; segread( &sregs ); - cPath = hb_parcx( 1 ); - regs.h.ah = 0x5A; - regs.HB_XREGS.cx = iMode; - sregs.ds = FP_SEG( cPath ); - regs.HB_XREGS.dx = FP_OFF( cPath ); + cPath = hb_parcx( 1 ); + regs.h.ah = 0x5A; + regs.HB_XREGS.cx = iMode; + sregs.ds = FP_SEG( cPath ); + regs.HB_XREGS.dx = FP_OFF( cPath ); HB_DOS_INT86X( 0x21, ®s, ®s, &sregs ); - nax = regs.HB_XREGS.ax; - iflags = regs.HB_XREGS.flags; + nax = regs.HB_XREGS.ax; + iflags = regs.HB_XREGS.flags; } #else { - nax = 0; - iflags = 0; - cPath = hb_parcx( 1 ); + nax = 0; + iflags = 0; + cPath = hb_parcx( 1 ); } #endif { @@ -120,7 +120,7 @@ HB_FUNC( FT_REBOOT ) { #if defined( HB_OS_DOS ) { - int iTODO; + int iTODO; } #endif hb_ret(); diff --git a/harbour/contrib/hbnf/tbwhile.prg b/harbour/contrib/hbnf/tbwhile.prg index c1faa6753d..59706a82f0 100644 --- a/harbour/contrib/hbnf/tbwhile.prg +++ b/harbour/contrib/hbnf/tbwhile.prg @@ -57,8 +57,6 @@ #include "inkey.ch" #include "setcurs.ch" -// - FUNCTION FT_BRWSWHL( aFields, bWhileCond, cKey, nFreeze, lSaveScrn, ; cColorList, cColorShad, nTop, nLeft, nBottom, nRight ) @@ -262,20 +260,18 @@ FUNCTION FT_BRWSWHL( aFields, bWhileCond, cKey, nFreeze, lSaveScrn, ; RETURN nPassRec -// - STATIC FUNCTION TbSkipWhil( n, bWhileCond ) LOCAL i := 0 IF n == 0 .OR. LastRec() == 0 - SKIP 0 // significant on a network + dbSkip( 0 ) // significant on a network ELSEIF n > 0 .AND. RecNo() != LastRec() + 1 WHILE i < n - SKIP 1 - IF EOF() .OR. ! Eval( bWhileCond ) - SKIP -1 + dbSkip() + IF Eof() .OR. ! Eval( bWhileCond ) + dbSkip( -1 ) EXIT ENDIF i++ @@ -283,11 +279,11 @@ STATIC FUNCTION TbSkipWhil( n, bWhileCond ) ELSEIF n < 0 DO WHILE i > n - SKIP -1 - IF BOF() + dbSkip( -1 ) + IF Bof() EXIT ELSEIF ! Eval( bWhileCond ) - SKIP + dbSkip() EXIT ENDIF i-- @@ -296,25 +292,21 @@ STATIC FUNCTION TbSkipWhil( n, bWhileCond ) RETURN i -// - STATIC FUNCTION TbWhileTop( cKey ) dbSeek( cKey ) RETURN NIL -// +// SeekLast: Finds Last Record For Matching Key +// Developed By Jon Cole +// With softseek set on, seek the first record after condition. +// This is accomplished by incrementing the right most character of the +// string cKey by one ascii character. After SEEKing the new string, +// back up one record to get to the last record which matches cKey. STATIC FUNCTION TbWhileBot( cKey ) - // SeekLast: Finds Last Record For Matching Key - // Developed By Jon Cole - // With softseek set on, seek the first record after condition. - // This is accomplished by incrementing the right most character of the - // string cKey by one ascii character. After SEEKing the new string, - // back up one record to get to the last record which matches cKey. - dbSeek( Left( cKey, Len( cKey ) - 1 ) + Chr( Asc( Right( cKey, 1 ) ) + 1 ), .T. ) dbSkip( -1 ) diff --git a/harbour/contrib/hbnf/tests/clrsel.prg b/harbour/contrib/hbnf/tests/clrsel.prg index 23a8315e71..786cc18fc3 100644 --- a/harbour/contrib/hbnf/tests/clrsel.prg +++ b/harbour/contrib/hbnf/tests/clrsel.prg @@ -30,7 +30,7 @@ PROCEDURE Main( cVidMode ) SetCursor( SC_NONE ) SetBlink( .F. ) - //.... a typical application might have the following different settings + // .... a typical application might have the following different settings // normally these would be stored in a .dbf/.dbv aClrs := { ; { "Desktop", "N/BG", "D", hb_UTF8ToStr( "â–’" ) }, ; @@ -48,7 +48,7 @@ PROCEDURE Main( cVidMode ) HB_SYMBOL_UNUSED( aClrs ) - //.... restore the original environment + // .... restore the original environment FT_RestSets( aEnvOri ) RestScreen( 0, 0, MaxRow(), MaxCol(), cScrOri ) SetPos( nRowOri, nColOri ) diff --git a/harbour/contrib/hbnf/tests/datecnfg.prg b/harbour/contrib/hbnf/tests/datecnfg.prg index 9efd4febdb..cd3505f2cb 100644 --- a/harbour/contrib/hbnf/tests/datecnfg.prg +++ b/harbour/contrib/hbnf/tests/datecnfg.prg @@ -2,7 +2,7 @@ * $Id$ */ -//******************************************************************* +// ******************************************************************* // // NOTES: 1) The date functions are 'international'; i.e., the // system date format is maintained, although ANSI is @@ -44,7 +44,7 @@ // // See function: FT_DATECNFG() // -//******************************************************************* +// ******************************************************************* #require "hbnf" @@ -186,7 +186,7 @@ STATIC FUNCTION FT_CAL( dGivenDate, nType ) dTemp := aTemp[ 2 ] FOR nTemp := 0 TO 6 - ?? PadC( CDOW( dTemp + nTemp ), 10 ) + ?? PadC( CDoW( dTemp + nTemp ), 10 ) NEXT ? diff --git a/harbour/contrib/hbnf/tests/menuto.prg b/harbour/contrib/hbnf/tests/menuto.prg new file mode 100644 index 0000000000..0394dec612 --- /dev/null +++ b/harbour/contrib/hbnf/tests/menuto.prg @@ -0,0 +1,41 @@ +/* + * $Id$ + */ + +#require "hbnf" + +#include "ftmenuto.ch" + +PROCEDURE Main() + + LOCAL nChoice := 1 + + CLS + + // Simple prompt + @ 1, 1 PROMPT "Menu choice #1" + + // Prompt with color + @ 3, 1 PROMPT "Menu choice #2" COLOR "W+/R,W+/B" + + // Prompt with a message + @ 5, 1 PROMPT "Menu choice #3" MESSAGE "Go to lunch" + + // Prompt with pinpoint message control + @ 7, 1 PROMPT "Menu choice #4" MESSAGE "Drop Dead" ; + MSGROW 22 MSGCOL 4 MSGCOLOR "GR+/N" + + // Prompt with a trigger character ("#" character) + @ 11, 1 PROMPT "Menu choice #6" TRIGGER 13 + + // Prompt with trigger character color control + @ 13, 1 PROMPT "Menu Choice #7" TRIGGER 13 TRIGGERCOLOR "R+/BG,G+/N" + + // Prompt with right and left arrow keys disabled + @ 15, 1 PROMPT "Menu Choice #8" RIGHT 8 LEFT 8 + + MENU TO nChoice + + ? nChoice + + RETURN diff --git a/harbour/contrib/hbnf/tests/metaph.prg b/harbour/contrib/hbnf/tests/metaph.prg index b334c78bfa..83c62ea3d1 100644 --- a/harbour/contrib/hbnf/tests/metaph.prg +++ b/harbour/contrib/hbnf/tests/metaph.prg @@ -9,7 +9,7 @@ PROCEDURE Main() LOCAL aNames := {} Set( _SET_SCOREBOARD, .F. ) - Set( _SET_COLOR, "W/B" ) + SetColor( "W/B" ) CLS // Demo will create an array of names and display in 3 columns diff --git a/harbour/contrib/hbnf/tests/ontick.prg b/harbour/contrib/hbnf/tests/ontick.prg index 21acf641f0..453d512dc3 100644 --- a/harbour/contrib/hbnf/tests/ontick.prg +++ b/harbour/contrib/hbnf/tests/ontick.prg @@ -16,11 +16,11 @@ PROCEDURE Main() CLS - FT_ONTICK( {|| OutStd( hb_milliSeconds(), hb_eol() ) } ) + FT_ONTICK( {|| OutStd( hb_MilliSeconds(), hb_eol() ) } ) Inkey( 0 ) - FT_ONTICK( {|| OutStd( hb_milliSeconds(), hb_eol() ) }, 18 ) + FT_ONTICK( {|| OutStd( hb_MilliSeconds(), hb_eol() ) }, 18 ) Inkey( 0 ) diff --git a/harbour/contrib/hbnf/tests/savearr.prg b/harbour/contrib/hbnf/tests/savearr.prg index a211b4096c..be16f9d8c8 100644 --- a/harbour/contrib/hbnf/tests/savearr.prg +++ b/harbour/contrib/hbnf/tests/savearr.prg @@ -6,7 +6,7 @@ PROCEDURE Main() - LOCAL aArray := {; + LOCAL aArray := { ; { "Invoice 1", SToD( "19910415" ), 1234.32, .T. }, ; { "Invoice 2", Date(), 234.98, .F. }, ; { "Invoice 3", Date() + 1, 0, .T. } }, aSave diff --git a/harbour/contrib/hbnf/tests/tbwhile.prg b/harbour/contrib/hbnf/tests/tbwhile.prg index a5a77942f9..7140dc3a12 100644 --- a/harbour/contrib/hbnf/tests/tbwhile.prg +++ b/harbour/contrib/hbnf/tests/tbwhile.prg @@ -92,7 +92,7 @@ STATIC FUNCTION make_dbf() { "OLEANDAR", "JILL", "425 FLORAL PARK DRIVE", "FLORAL PARK", "NY", "10093" }, ; { "SUGARMAN", "CANDY", "1541 SWEETHEART ROAD", "HERSHEY", "PA", "10132" } } - dbCreate( "TBNAMES", {; + dbCreate( "TBNAMES", { ; { "LAST ", "C", 18, 0, }, ; { "FIRST", "C", 9, 0, }, ; { "ADDR ", "C", 28, 0, }, ; diff --git a/harbour/contrib/hbnf/vertmenu.prg b/harbour/contrib/hbnf/vertmenu.prg index 14280b6f02..0c90c2cb93 100644 --- a/harbour/contrib/hbnf/vertmenu.prg +++ b/harbour/contrib/hbnf/vertmenu.prg @@ -20,9 +20,7 @@ * */ -/* - FT_MENU2(): display vertical menu -*/ +/* display vertical menu */ FUNCTION ft_menu2( aMenuInfo, cColors ) @@ -36,11 +34,7 @@ FUNCTION ft_menu2( aMenuInfo, cColors ) LOCAL lOldwrap := Set( _SET_WRAP, .T. ) LOCAL lOldcenter := Set( _SET_MCENTER, .T. ) LOCAL lOldmessrow := Set( _SET_MESSAGE ) - LOCAL cOldcolor := Set( _SET_COLOR ) - - IF cColors != NIL - Set( _SET_COLOR, cColors ) - ENDIF + LOCAL cOldcolor := SetColor( cColors ) /* if no message row has been established, use bottom row */ IF lOldmessrow == 0 @@ -84,6 +78,6 @@ FUNCTION ft_menu2( aMenuInfo, cColors ) Set( _SET_MESSAGE, lOldmessrow ) Set( _SET_MCENTER, lOldcenter ) Set( _SET_WRAP, lOldwrap ) - Set( _SET_COLOR, cOldcolor ) + SetColor( cOldcolor ) RETURN NIL diff --git a/harbour/contrib/hbnf/vidcur.prg b/harbour/contrib/hbnf/vidcur.prg index 73e150747c..867cd2087d 100644 --- a/harbour/contrib/hbnf/vidcur.prg +++ b/harbour/contrib/hbnf/vidcur.prg @@ -78,6 +78,7 @@ #include "setcurs.ch" /* NOTE: In Harbour video pages are ignored. */ + PROCEDURE FT_SETVCUR( nPage, nRow, nCol ) HB_SYMBOL_UNUSED( nPage ) @@ -87,7 +88,9 @@ PROCEDURE FT_SETVCUR( nPage, nRow, nCol ) RETURN /* NOTE: In Harbour video pages are ignored. */ + FUNCTION FT_GETVCUR( nPage ) + LOCAL nTop, nBot HB_SYMBOL_UNUSED( nPage ) @@ -110,8 +113,7 @@ FUNCTION FT_GETVCUR( nPage ) nBot := 3 EXIT OTHERWISE - nTop := ; - nBot := 0 + nTop := nBot := 0 ENDSWITCH RETURN { nTop, nBot, Row(), Col() } diff --git a/harbour/contrib/hbnf/video1.c b/harbour/contrib/hbnf/video1.c index 4d01884e08..6bc36f32ab 100644 --- a/harbour/contrib/hbnf/video1.c +++ b/harbour/contrib/hbnf/video1.c @@ -65,12 +65,12 @@ HB_FUNC( FT_SETATTR ) HB_FUNC( FT_REVATTR ) { - int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */ - int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */ - int iMaxRow = hb_gtMaxRow(); - int iMaxCol = hb_gtMaxCol(); - int iBottom = hb_parnidef( 3, iMaxRow ); - int iRight = hb_parnidef( 4, iMaxCol ); + int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */ + int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */ + int iMaxRow = hb_gtMaxRow(); + int iMaxCol = hb_gtMaxCol(); + int iBottom = hb_parnidef( 3, iMaxRow ); + int iRight = hb_parnidef( 4, iMaxCol ); if( iTop < 0 ) iTop = 0; diff --git a/harbour/contrib/hbnf/video2.prg b/harbour/contrib/hbnf/video2.prg index bd0a4091fd..d4f1380994 100644 --- a/harbour/contrib/hbnf/video2.prg +++ b/harbour/contrib/hbnf/video2.prg @@ -56,7 +56,7 @@ FUNCTION FT_CLS( nTop, nLeft, nBottom, nRight, nColor ) nColor := 0 ENDIF - RETURN hb_Scroll( nTop, nLeft, nBottom, nRight, , , nColor ) + RETURN hb_Scroll( nTop, nLeft, nBottom, nRight,,, nColor ) FUNCTION FT_VIDSTR( nRow, nCol, cString, nColor ) diff --git a/harbour/contrib/hbnf/wda.prg b/harbour/contrib/hbnf/wda.prg index 27ffeaabc0..2d27addadd 100644 --- a/harbour/contrib/hbnf/wda.prg +++ b/harbour/contrib/hbnf/wda.prg @@ -22,9 +22,9 @@ FUNCTION ft_addWkDy( dStart, nDys ) - LOCAL nDc := DOW( dStart ) + LOCAL nDc := DoW( dStart ) - RETURN iif( nDc == 7,; - ( nDys - 1 ) % 5 + 7 * Int( ( nDys - 1 ) / 5 ) + 2,; + RETURN iif( nDc == 7, ; + ( nDys - 1 ) % 5 + 7 * Int( ( nDys - 1 ) / 5 ) + 2, ; ( nDys + nDc - 2 ) % 5 + 7 * Int( ( nDys + nDc - 2 ) / 5 ) + 2 - nDc ; ) diff --git a/harbour/contrib/hbnf/workdays.prg b/harbour/contrib/hbnf/workdays.prg index c8c8739600..0de7346447 100644 --- a/harbour/contrib/hbnf/workdays.prg +++ b/harbour/contrib/hbnf/workdays.prg @@ -38,13 +38,13 @@ FUNCTION FT_WorkDays( dStart, dStop ) dStart := nAdjust ENDIF - IF ( nDays := DOW( dStart ) ) == 1 // Sunday (change to next Monday) + IF ( nDays := DoW( dStart ) ) == 1 // Sunday (change to next Monday) dStart++ ELSEIF nDays == 7 // Saturday (change to next Monday) dStart += 2 ENDIF - IF ( nDays := DOW( dStop ) ) == 1 // Sunday (change to prev Friday) + IF ( nDays := DoW( dStop ) ) == 1 // Sunday (change to prev Friday) dStop -= 2 ELSEIF nDays == 7 // Saturday (change to prev Friday) dStop-- @@ -52,13 +52,13 @@ FUNCTION FT_WorkDays( dStart, dStop ) nAdjust := ( nDays := dStop - dStart + 1 ) % 7 - IF DOW( dStop ) + 1 < DOW( dStart ) // Weekend adjustment + IF DoW( dStop ) + 1 < DoW( dStart ) // Weekend adjustment nAdjust -= 2 ENDIF nWorkDays := Int( nDays / 7 ) * 5 + nAdjust - ELSEIF DOW( dStart ) != 1 .AND. DOW( dStart ) != 7 + ELSEIF DoW( dStart ) != 1 .AND. DoW( dStart ) != 7 nWorkDays := 1 diff --git a/harbour/contrib/hbnf/woy.prg b/harbour/contrib/hbnf/woy.prg index 4bbe95cfd9..ad8b4cd8b6 100644 --- a/harbour/contrib/hbnf/woy.prg +++ b/harbour/contrib/hbnf/woy.prg @@ -33,12 +33,12 @@ FUNCTION FT_WOY( dInDate ) cCentury := Left( DToS( dInDate ), 4 ) // find number of days in first week of year - nFirstDays := 8 - DOW( SToD( cCentury + "0101" ) ) + nFirstDays := 8 - DoW( hb_SToD( cCentury + "0101" ) ) nWkNumber := 1 // find how many days after first week till dInDate - nDayOffset := ( dInDate - SToD( cCentury + "0101" ) ) - nFirstDays + 1 + nDayOffset := ( dInDate - hb_SToD( cCentury + "0101" ) ) - nFirstDays + 1 // count weeks in offset period DO WHILE nDayOffset > 0 @@ -57,7 +57,7 @@ FUNCTION FT_DOY( dInDate ) LOCAL nDayNum IF HB_ISDATE( dInDate ) - nDayNum := ( dInDate - SToD( Left( DToS( dInDate ), 4 ) + "0101" ) ) + 1 + nDayNum := ( dInDate - hb_SToD( Left( DToS( dInDate ), 4 ) + "0101" ) ) + 1 ELSE nDayNum := NIL ENDIF diff --git a/harbour/contrib/hbnf/xbox.prg b/harbour/contrib/hbnf/xbox.prg index 3552b7621d..3c5712c2e3 100644 --- a/harbour/contrib/hbnf/xbox.prg +++ b/harbour/contrib/hbnf/xbox.prg @@ -43,7 +43,6 @@ FUNCTION FT_XBOX( cJustType, ; // "L" -> left, otherwise centered cLine1, cLine2, cLine3, cLine4, cLine5, cLine6, cLine7, cLine8 ) LOCAL nLLen := 0 -// LOCAL cOldColor LOCAL nLCol LOCAL nRCol LOCAL nTRow @@ -55,8 +54,8 @@ FUNCTION FT_XBOX( cJustType, ; // "L" -> left, otherwise centered LOCAL aLines_[ 8 ] hb_default( @cJustType, "" ) - hb_default( @cRetWait , "" ) - hb_default( @cBorType , "" ) + hb_default( @cRetWait, "" ) + hb_default( @cBorType, "" ) hb_default( @cBorColor, "N/W" ) hb_default( @cBoxColor, "W/N" ) hb_default( @nStartRow, 99 ) @@ -92,7 +91,6 @@ FUNCTION FT_XBOX( cJustType, ; // "L" -> left, otherwise centered // form box and border // save screen color and set new color -// cOldColor := SetColor( cBoxColor ) hb_Scroll( nTRow, nLCol, nBRow, nRCol ) // draw border @@ -109,7 +107,7 @@ FUNCTION FT_XBOX( cJustType, ; // "L" -> left, otherwise centered // print text in box SetColor( cBoxColor ) nLoop := 1 - AEval( aLines_, {| cSayStr |; + AEval( aLines_, {| cSayStr | ; nSayRow := nTRow + nLoop, ; nSayCol := iif( Left( cJustType, 1 ) == "L", ; nLCol + 2, ; diff --git a/harbour/contrib/hbnf/year.prg b/harbour/contrib/hbnf/year.prg index 642ca486eb..8f47c8976f 100644 --- a/harbour/contrib/hbnf/year.prg +++ b/harbour/contrib/hbnf/year.prg @@ -36,7 +36,7 @@ FUNCTION FT_YEAR( dGivenDate ) dGivenDate := Date() ENDIF - aRetVal[ 2 ] := SToD( ; + aRetVal[ 2 ] := hb_SToD( ; StrZero( Year( dGivenDate ) - iif( Month( dGivenDate ) < Month( hb_CToD( cFY_Start, "yyyy.mm.dd" ) ), 1, 0 ), 4 ) + ; SubStr( cFY_Start, 6, 2 ) + ; SubStr( cFY_Start, 9, 6 ) ) diff --git a/harbour/contrib/hbodbc/browodbc.prg b/harbour/contrib/hbodbc/browodbc.prg index 2199e0843e..a108de35ca 100644 --- a/harbour/contrib/hbodbc/browodbc.prg +++ b/harbour/contrib/hbodbc/browodbc.prg @@ -73,9 +73,9 @@ FUNCTION BrowseODBC( nTop, nLeft, nBottom, nRight, oDataSource ) LOCAL oColumn // TODO: Check if datasource is open -// IF ! Used() -// RETURN .F. -// ENDIF + // IF ! Used() + // RETURN .F. + // ENDIF IF PCount() < 4 nTop := 1 @@ -99,8 +99,8 @@ FUNCTION BrowseODBC( nTop, nLeft, nBottom, nRight, oDataSource ) oBrw:HeadSep := "-" // TODO: Find out number of columns in ODBC result set, up to then you have to add columns by hand - FOR n := 1 to Len( oDataSource:Fields ) - oColumn:= TBColumn():New( oDataSource:Fields[ n ]:FieldName, ODBCFget( oDataSource:Fields[ n ]:FieldName, oDataSource ) ) + FOR n := 1 TO Len( oDataSource:Fields ) + oColumn := TBColumn():New( oDataSource:Fields[ n ]:FieldName, ODBCFget( oDataSource:Fields[ n ]:FieldName, oDataSource ) ) oBrw:AddColumn( oColumn ) NEXT @@ -117,7 +117,7 @@ FUNCTION BrowseODBC( nTop, nLeft, nBottom, nRight, oDataSource ) IF NextKey() == 0 oBrw:forceStable() - Statline( oBrw, oDataSource) + Statline( oBrw, oDataSource ) nKey := Inkey( 0 ) @@ -196,10 +196,10 @@ STATIC PROCEDURE Statline( oBrw, oDataSource ) hb_DispOutAt( nTop, nRight - 40, " " ) hb_DispOutAt( nTop, nRight - 20, " <new>" ) ELSE - hb_DispOutAt( nTop, nRight - 20, PadR( hb_ntos( oDataSource:RecNo() ) + "/" +; - hb_ntos( oDataSource:LastRec() ), 16 ) +; - iif( oBrw:hitTop, "<bof>", " " ) +; - iif( oBrw:hitBottom, "<eof>", " " ) ) + hb_DispOutAt( nTop, nRight - 20, PadR( hb_ntos( oDataSource:RecNo() ) + "/" + ; + hb_ntos( oDataSource:LastRec() ), 16 ) + ; + iif( oBrw:hitTop, "<bof>", " " ) + ; + iif( oBrw:hitBottom, "<eof>", " " ) ) ENDIF RETURN @@ -213,24 +213,24 @@ STATIC FUNCTION Skipped( nRecs, oDataSource ) // ODBC doesn't have Skip( 0 ) ELSEIF nRecs > 0 DO WHILE nSkipped < nRecs - IF ! oDataSource:Eof() - oDataSource:next( ) - IF oDataSource:Eof() - oDataSource:prior( ) - EXIT - ENDIF - nSkipped++ - ENDIF + IF ! oDataSource:Eof() + oDataSource:next() + IF oDataSource:Eof() + oDataSource:prior() + EXIT + ENDIF + nSkipped++ + ENDIF ENDDO ELSEIF nRecs < 0 DO WHILE nSkipped > nRecs - IF ! oDataSource:Bof() - oDataSource:prior( ) - IF oDataSource:Bof() - EXIT - ENDIF - nSkipped-- - ENDIF + IF ! oDataSource:Bof() + oDataSource:prior() + IF oDataSource:Bof() + EXIT + ENDIF + nSkipped-- + ENDIF ENDDO ENDIF ENDIF diff --git a/harbour/contrib/hbodbc/tests/odbcdemo.prg b/harbour/contrib/hbodbc/tests/odbcdemo.prg index 70241d499e..cf310479f0 100644 --- a/harbour/contrib/hbodbc/tests/odbcdemo.prg +++ b/harbour/contrib/hbodbc/tests/odbcdemo.prg @@ -29,13 +29,13 @@ PROCEDURE Main() dsFunctions:SetSQL( "SELECT * FROM test" ) dsFunctions:Open() - @ 3, 24 TO len( dsFunctions:Fields ) + 4, 55 + @ 3, 24 TO Len( dsFunctions:Fields ) + 4, 55 aOrders := {} FOR i := 1 TO Len( dsFunctions:Fields ) AAdd( aOrders, dsFunctions:Fields[ i ] :FieldName ) - @ i + 3, 25 PROMPT padc( "ORDER BY " + aOrders[ i ], 30 ) + @ i + 3, 25 PROMPT PadC( "ORDER BY " + aOrders[ i ], 30 ) NEXT @@ -62,17 +62,19 @@ PROCEDURE Main() @ 11, 2 SAY "Statement:" COLOR "GR+/B" @ 11, Col() + 1 SAY dsFunctions:cSQL - @ 14, 5 SAY " " + PadR( dsFunctions:FieldByName( "First" ):FieldName, 3 ) + " " + ; - PadR( dsFunctions:FieldByName( "Last" ):FieldName, 15 ) + " " + ; - PadR( dsFunctions:FieldByName( "Street" ):FieldName, 2 ) + " " + ; - PadR( dsFunctions:FieldByName( "City" ):FieldName, 40 ) ; - COLOR "B/W" + @ 14, 5 SAY " " + ; + PadR( dsFunctions:FieldByName( "First" ):FieldName, 3 ) + " " + ; + PadR( dsFunctions:FieldByName( "Last" ):FieldName, 15 ) + " " + ; + PadR( dsFunctions:FieldByName( "Street" ):FieldName, 2 ) + " " + ; + PadR( dsFunctions:FieldByName( "City" ):FieldName, 40 ) ; + COLOR "B/W" DO WHILE !dsFunctions:Eof() - ? " " + PadR( dsFunctions:FieldByName( "First" ):Value, 3 ), "|", ; - PadR( dsFunctions:FieldByName( "Last" ):Value, 15 ), "|", ; - PadR( dsFunctions:FieldByName( "Street" ):Value, 2 ), "|", ; - PadR( dsFunctions:FieldByName( "City" ):Value, 40 ) + ? " " + ; + PadR( dsFunctions:FieldByName( "First" ):Value, 3 ), "|", ; + PadR( dsFunctions:FieldByName( "Last" ):Value, 15 ), "|", ; + PadR( dsFunctions:FieldByName( "Street" ):Value, 2 ), "|", ; + PadR( dsFunctions:FieldByName( "City" ):Value, 40 ) dsFunctions:Skip() ENDDO diff --git a/harbour/contrib/hbodbc/tests/testodbc.prg b/harbour/contrib/hbodbc/tests/testodbc.prg index 7f16132655..ad31603473 100644 --- a/harbour/contrib/hbodbc/tests/testodbc.prg +++ b/harbour/contrib/hbodbc/tests/testodbc.prg @@ -9,8 +9,8 @@ #include "sql.ch" #xcommand GET ROW <nRow> INTO <cVar> => ; - <cVar> := Space( 128 ) ;; - SQLGetData( hStmt, <nRow>, SQL_CHAR, Len( <cVar> ), @<cVar> ) + <cVar> := Space( 128 ) ;; + SQLGetData( hStmt, <nRow>, SQL_CHAR, Len( <cVar> ), @ <cVar> ) PROCEDURE Main() @@ -46,7 +46,7 @@ PROCEDURE Main() ? "SQL: SELECT FROM test" SQLExecDirect( hStmt, "SELECT FROM test" ) - ? SQLError( ,,hStmt, @cError1, @nError, @cError2 ) + ? SQLError( ,, hStmt, @cError1, @nError, @cError2 ) ? "SQLERROR", cError1, nError, cError2 ? SQLGetDiagRec( SQL_HANDLE_STMT, hStmt, 1, @cError1, @nError, @cError2 ) ? "SQLGETDIAGREC", cError1, nError, cError2 diff --git a/harbour/contrib/hbodbc/todbc.prg b/harbour/contrib/hbodbc/todbc.prg index 193eaab409..e5816946ab 100644 --- a/harbour/contrib/hbodbc/todbc.prg +++ b/harbour/contrib/hbodbc/todbc.prg @@ -62,17 +62,17 @@ * METHOD RollBack() * METHOD SetStmtOptions( nType, uBuffer ) * METHOD GetStmtOptions( nType ) - * METHOD SetAutocommit( lEnable ) + * METHOD SetAutoCommit( lEnable ) * */ #include "hbclass.ch" #include "sql.ch" -*+ -*+ Class TODBCField -*+ Fields information collection -*+----------------------------------------------------------------- +// + +// + Class TODBCField +// + Fields information collection +// +----------------------------------------------------------------- CREATE CLASS TODBCField @@ -91,10 +91,10 @@ ENDCLASS METHOD New() CLASS TODBCField RETURN Self -*+ -*+ Class TODBC -*+ Manages ODBC access -*+----------------------------------------------------------------- +// + +// + Class TODBC +// + Manages ODBC access +// +----------------------------------------------------------------- CREATE CLASS TODBC @@ -122,7 +122,7 @@ CREATE CLASS TODBC METHOD SetSQL( cSQL ) METHOD Open() METHOD ExecSQL() - METHOD CLOSE() + METHOD Close() METHOD LoadData( nPos ) METHOD ClearData() INLINE AEval( ::Fields, {| oField | oField:Value := NIL } ) @@ -140,7 +140,7 @@ CREATE CLASS TODBC METHOD Eof() METHOD Bof() METHOD RecCount() - METHOD Lastrec() + METHOD LastRec() METHOD RecNo() METHOD SQLErrorMessage() @@ -151,7 +151,7 @@ CREATE CLASS TODBC METHOD RollBack() METHOD SetStmtOptions( nType, uBuffer ) METHOD GetStmtOptions( nType ) - METHOD SetAutocommit( lEnable ) + METHOD SetAutoCommit( lEnable ) ENDCLASS @@ -206,7 +206,7 @@ METHOD New( cODBCStr, cUserName, cPassword, lCache ) CLASS TODBC RETURN Self // -METHOD SetAutocommit( lEnable ) CLASS TODBC +METHOD SetAutoCommit( lEnable ) CLASS TODBC LOCAL lOld := ::lAutoCommit @@ -342,7 +342,7 @@ METHOD Open() CLASS TODBC FOR i := 1 TO nCols SQLDescribeCol( ::hStmt, i, @cColName, 255, @nNameLen, @nDataType, ; - @nColSize, @nDecimals, @nNul ) + @nColSize, @nDecimals, @nNul ) AAdd( ::Fields, TODBCField():New() ) ::Fields[ Len( ::Fields ) ]:FieldID := i @@ -386,6 +386,7 @@ METHOD Open() CLASS TODBC // Only executes the SQL Statement METHOD ExecSQL() CLASS TODBC + LOCAL xBuf LOCAL nRet @@ -452,58 +453,58 @@ METHOD Fetch( nFetchType, nOffset ) CLASS TODBC // Do we have cached recordset? IF ::lCacheRS .AND. ::Active // looks like we do ... - // Change Recno according to nFetchType and nOffset - SWITCH nFetchType - CASE SQL_FETCH_NEXT + // Change Recno according to nFetchType and nOffset + SWITCH nFetchType + CASE SQL_FETCH_NEXT - IF ::nRecNo == ::nRecCount - nResult := SQL_NO_DATA_FOUND - ELSE - nResult := SQL_SUCCESS - nPos := ::nRecNo + 1 - ENDIF - EXIT + IF ::nRecNo == ::nRecCount + nResult := SQL_NO_DATA_FOUND + ELSE + nResult := SQL_SUCCESS + nPos := ::nRecNo + 1 + ENDIF + EXIT - CASE SQL_FETCH_PRIOR - IF ::nRecNo == 1 - nResult := SQL_NO_DATA_FOUND - ELSE - nResult := SQL_SUCCESS - nPos := ::nRecNo - 1 - ENDIF - EXIT + CASE SQL_FETCH_PRIOR + IF ::nRecNo == 1 + nResult := SQL_NO_DATA_FOUND + ELSE + nResult := SQL_SUCCESS + nPos := ::nRecNo - 1 + ENDIF + EXIT - CASE SQL_FETCH_FIRST - nResult := SQL_SUCCESS - nPos := 1 - EXIT + CASE SQL_FETCH_FIRST + nResult := SQL_SUCCESS + nPos := 1 + EXIT - CASE SQL_FETCH_LAST - nResult := SQL_SUCCESS - nPos := ::nRecCount - EXIT + CASE SQL_FETCH_LAST + nResult := SQL_SUCCESS + nPos := ::nRecCount + EXIT - CASE SQL_FETCH_RELATIVE - IF ( ::nRecNo + nOffset ) > ::nRecCount .OR. ( ::nRecNo + nOffset ) < 1 // TODO: Should we go to the first/last row if out of bounds? - nResult := SQL_ERROR - ELSE - nResult := SQL_SUCCESS - nPos := ::nRecNo + nOffset - ENDIF - EXIT + CASE SQL_FETCH_RELATIVE + IF ( ::nRecNo + nOffset ) > ::nRecCount .OR. ( ::nRecNo + nOffset ) < 1 // TODO: Should we go to the first/last row if out of bounds? + nResult := SQL_ERROR + ELSE + nResult := SQL_SUCCESS + nPos := ::nRecNo + nOffset + ENDIF + EXIT - CASE SQL_FETCH_ABSOLUTE - IF nOffset > ::nRecCount .OR. nOffset < 1 // TODO: Should we go to the first/last row if out of bounds? - nResult := SQL_ERROR - ELSE - nResult := SQL_SUCCESS - nPos := nOffset - ENDIF - EXIT + CASE SQL_FETCH_ABSOLUTE + IF nOffset > ::nRecCount .OR. nOffset < 1 // TODO: Should we go to the first/last row if out of bounds? + nResult := SQL_ERROR + ELSE + nResult := SQL_SUCCESS + nPos := nOffset + ENDIF + EXIT - OTHERWISE - nResult := SQL_ERROR - ENDSWITCH + OTHERWISE + nResult := SQL_ERROR + ENDSWITCH ELSE nResult := SQLFetchScroll( ::hStmt, nFetchType, nOffSet ) @@ -547,7 +548,7 @@ METHOD Prior() CLASS TODBC ::nRecno := ::nRecno - 1 ELSEIF nResult == SQL_NO_DATA_FOUND .AND. ::nRecNo == 1 // permit skip-1 on first row, so that BOF() can work properly ::nRecno := ::nRecno - 1 - ::next() + ::Next() ::lBof := .T. ELSE // TODO: Error handling @@ -596,7 +597,7 @@ METHOD MoveBy( nSteps ) CLASS TODBC RETURN nResult // Moves the DataSet to absolute record number -METHOD Goto( nRecNo ) CLASS TODBC +METHOD GoTo( nRecNo ) CLASS TODBC LOCAL nResult := ::Fetch( SQL_FETCH_ABSOLUTE, nRecNo ) @@ -640,7 +641,7 @@ METHOD RecNo() CLASS TODBC RETURN ::nRecNo // Returns number of rows ( if that function is supported by ODBC driver ) -METHOD Lastrec() CLASS TODBC +METHOD LastRec() CLASS TODBC RETURN ::nRecCount @@ -657,54 +658,54 @@ METHOD LoadData( nPos ) CLASS TODBC FOR i := 1 TO Len( ::Fields ) - uData := "" + uData := "" - IF ::lCacheRS .AND. ::Active - IF nPos > 0 .AND. nPos <= ::nRecCount - uData := ::aRecordSet[ nPos, i ] - ENDIF - ELSE + IF ::lCacheRS .AND. ::Active + IF nPos > 0 .AND. nPos <= ::nRecCount + uData := ::aRecordSet[ nPos, i ] + ENDIF + ELSE - SQLGetData( ::hStmt, ::Fields[ i ]:FieldID, SQL_CHAR, 256, @uData ) + SQLGetData( ::hStmt, ::Fields[ i ]:FieldID, SQL_CHAR, 256, @uData ) - SWITCH ::Fields[ i ]:DataType - CASE SQL_LONGVARCHAR - uData := AllTrim( uData ) - EXIT + SWITCH ::Fields[ i ]:DataType + CASE SQL_LONGVARCHAR + uData := AllTrim( uData ) + EXIT - CASE SQL_CHAR - CASE SQL_VARCHAR - CASE SQL_NVARCHAR - uData := PadR( uData, ::Fields[ i ]:DataSize ) - EXIT + CASE SQL_CHAR + CASE SQL_VARCHAR + CASE SQL_NVARCHAR + uData := PadR( uData, ::Fields[ i ]:DataSize ) + EXIT - CASE SQL_TIMESTAMP - CASE SQL_DATE - uData := hb_SToD( SubStr( uData, 1, 4 ) + SubStr( uData, 6, 2 ) + SubStr( uData, 9, 2 ) ) - EXIT + CASE SQL_TIMESTAMP + CASE SQL_DATE + uData := hb_SToD( SubStr( uData, 1, 4 ) + SubStr( uData, 6, 2 ) + SubStr( uData, 9, 2 ) ) + EXIT - CASE SQL_BIT - uData := Val( uData ) == 1 - EXIT + CASE SQL_BIT + uData := Val( uData ) == 1 + EXIT - CASE SQL_NUMERIC - CASE SQL_DECIMAL - CASE SQL_DOUBLE - CASE SQL_TINYINT - CASE SQL_SMALLINT - CASE SQL_BIGINT - CASE SQL_INTEGER - CASE SQL_FLOAT - CASE SQL_REAL - uData := Round( Val( StrTran( uData, ",", "." ) ), ::Fields[ i ]:DataDecs ) - uData := hb_odbcNumSetLen( uData, ::Fields[ i ]:DataSize, ::Fields[ i ]:DataDecs ) - EXIT + CASE SQL_NUMERIC + CASE SQL_DECIMAL + CASE SQL_DOUBLE + CASE SQL_TINYINT + CASE SQL_SMALLINT + CASE SQL_BIGINT + CASE SQL_INTEGER + CASE SQL_FLOAT + CASE SQL_REAL + uData := Round( Val( StrTran( uData, ",", "." ) ), ::Fields[ i ]:DataDecs ) + uData := hb_odbcNumSetLen( uData, ::Fields[ i ]:DataSize, ::Fields[ i ]:DataDecs ) + EXIT - ENDSWITCH + ENDSWITCH - ENDIF + ENDIF - ::Fields[ i ]:Value := uData + ::Fields[ i ]:Value := uData NEXT diff --git a/harbour/contrib/hboslib/core.prg b/harbour/contrib/hboslib/core.prg index cae23708c2..52fc8d9f09 100644 --- a/harbour/contrib/hboslib/core.prg +++ b/harbour/contrib/hboslib/core.prg @@ -69,9 +69,11 @@ FUNCTION OL_IsNT() RETURN hb_osIsWinNT() FUNCTION OL_IsOS2() + #if defined( __PLATFORM__OS2 ) RETURN .T. #else + RETURN .F. /* TODO: detect OS/2 in MS-DOS builds */ #endif @@ -88,14 +90,16 @@ FUNCTION OL_WinCBCopy() RETURN hb_gtInfo( HB_GTI_CLIPBOARDDATA ) FUNCTION OL_WinCBPaste( cText ) + IF HB_ISSTRING( cText ) hb_gtInfo( HB_GTI_CLIPBOARDDATA, cText ) RETURN .T. ENDIF + RETURN .F. FUNCTION OL_WinFullScreen() RETURN hb_gtInfo( HB_GTI_ISFULLSCREEN, .T. ) FUNCTION OL_Yield() - RETURN hb_releaseCPU() + RETURN hb_ReleaseCPU() diff --git a/harbour/contrib/hbpgsql/tests/async.prg b/harbour/contrib/hbpgsql/tests/async.prg index f20a46d237..fbd5dda089 100644 --- a/harbour/contrib/hbpgsql/tests/async.prg +++ b/harbour/contrib/hbpgsql/tests/async.prg @@ -11,13 +11,14 @@ #include "inkey.ch" PROCEDURE Main( cServer, cDatabase, cUser, cPass ) + LOCAL conn CLS ? "Connect", conn := PQconnectDB( "dbname = " + cDatabase + " host = " + cServer + " user = " + cUser + " password = " + cPass + " port = 5432" ) - ? "Conection status", PQerrorMessage(conn), PQstatus(conn) + ? "Conection status", PQerrorMessage( conn ), PQstatus( conn ) Query( conn, "SELECT codigo, descri FROM client limit 100", .F. ) Query( conn, "SELECT codigo, descri FROM fornec limit 100", .F. ) @@ -26,6 +27,7 @@ PROCEDURE Main( cServer, cDatabase, cUser, cPass ) RETURN PROCEDURE Query( conn, cQuery, lCancel ) + LOCAL pCancel, cErrMsg := Space( 30 ) LOCAL res, x, y, cTime @@ -36,7 +38,7 @@ PROCEDURE Query( conn, cQuery, lCancel ) DO WHILE Inkey() != K_ESC DevPos( Row(), 20 ) - DevOut( "Processing: " + Elaptime( cTime, Time() ) ) + DevOut( "Processing: " + ElapTime( cTime, Time() ) ) Inkey( 1 ) @@ -58,7 +60,7 @@ PROCEDURE Query( conn, cQuery, lCancel ) ENDDO IF Inkey() != K_ESC - ? "PQgetResult", hb_valtoexp( res := PQgetResult( conn ) ) + ? "PQgetResult", hb_ValToExp( res := PQgetResult( conn ) ) FOR x := 1 TO PQlastrec( res ) ? diff --git a/harbour/contrib/hbpgsql/tests/cache.prg b/harbour/contrib/hbpgsql/tests/cache.prg index beadf5f274..c52499997f 100644 --- a/harbour/contrib/hbpgsql/tests/cache.prg +++ b/harbour/contrib/hbpgsql/tests/cache.prg @@ -21,6 +21,7 @@ STATIC s_aTableTemp := {} STATIC s_aTempDBF := {} PROCEDURE Main( cServer, cDatabase, cUser, cPass ) + LOCAL i LOCAL cQuery @@ -72,6 +73,7 @@ PROCEDURE Main( cServer, cDatabase, cUser, cPass ) /* Put theses functions in a library */ FUNCTION SQLApplyUpdates() + LOCAL cAlias := Upper( Alias() ) LOCAL i, x LOCAL oQuery @@ -84,71 +86,71 @@ FUNCTION SQLApplyUpdates() IF i != 0 - oQuery := s_aTableTemp[ i ][ 3] + oQuery := s_aTableTemp[ i ][ 3 ] FOR i := 1 TO LastRec() - dbGoto( i ) + dbGoto( i ) - IF i > oQuery:Lastrec() + IF i > oQuery:LastRec() - /* Verifica se eh um registro novo */ - IF ! Deleted() + /* Verifica se eh um registro novo */ + IF ! Deleted() - oRow := oQuery:GetBlankRow() + oRow := oQuery:GetBlankRow() - FOR x := 1 TO FCount() - IF oRow:Fieldpos( FieldName( x ) ) != 0 - oRow:FieldPut( FieldName( x ), FieldGet( x ) ) - ENDIF - NEXT + FOR x := 1 TO FCount() + IF oRow:FieldPos( FieldName( x ) ) != 0 + oRow:FieldPut( FieldName( x ), FieldGet( x ) ) + ENDIF + NEXT - oQuery:Append( oRow ) + oQuery:Append( oRow ) - cError := oQuery:ErrorMsg() + cError := oQuery:ErrorMsg() - lError := oQuery:NetErr() + lError := oQuery:NetErr() - ENDIF - ELSE + ENDIF + ELSE - oRow := oQuery:GetRow( i ) + oRow := oQuery:GetRow( i ) - lUpdate := .F. + lUpdate := .F. - IF Deleted() + IF Deleted() - oQuery:Delete( oRow ) - cError := oQuery:ErrorMsg() - lError := oQuery:NetErr() - ELSE + oQuery:Delete( oRow ) + cError := oQuery:ErrorMsg() + lError := oQuery:NetErr() + ELSE - /* Faz update, mas compara quais campos sao diferentes */ + /* Faz update, mas compara quais campos sao diferentes */ - FOR x := 1 TO Fcount() + FOR x := 1 TO FCount() - IF oRow:Fieldpos( FieldName( x ) ) != 0 + IF oRow:FieldPos( FieldName( x ) ) != 0 - IF ! ( Fieldget( x ) == oRow:Fieldget( FieldName( x ) ) ) - oRow:Fieldput( FieldName( x ), FieldGet( x ) ) - lUpdate := .T. - ENDIF - ENDIF - NEXT + IF ! ( FieldGet( x ) == oRow:FieldGet( FieldName( x ) ) ) + oRow:FieldPut( FieldName( x ), FieldGet( x ) ) + lUpdate := .T. + ENDIF + ENDIF + NEXT - IF lUpdate + IF lUpdate - oQuery:Update( oRow ) - cError := oQuery:ErrorMsg() - lError := oQuery:NetErr() + oQuery:Update( oRow ) + cError := oQuery:ErrorMsg() + lError := oQuery:NetErr() - ENDIF - ENDIF - ENDIF + ENDIF + ENDIF + ENDIF - IF lError - EXIT - ENDIF + IF lError + EXIT + ENDIF NEXT ENDIF @@ -160,6 +162,7 @@ FUNCTION SQLApplyUpdates() PROCEDURE SQLCloseTemp( cAlias ) + LOCAL x IF ! Empty( Select( cAlias ) ) @@ -170,13 +173,14 @@ PROCEDURE SQLCloseTemp( cAlias ) IF ! Empty( x ) ADel( s_aTableTemp, x ) - //ASize( s_aTableTemp, Len( s_aTableTemp ) - 1 ) + // ASize( s_aTableTemp, Len( s_aTableTemp ) - 1 ) ENDIF RETURN PROCEDURE SQLGarbageCollector() + LOCAL i LOCAL oQuery @@ -201,7 +205,7 @@ PROCEDURE SQLGarbageCollector() FErase( StrTran( s_aTempDBF[ i ], ".tmp", ".dbf" ) ) ENDIF - IF hb_FileExists( StrTran(s_aTempDBF[ i ], ".tmp", ".dbt" ) ) + IF hb_FileExists( StrTran( s_aTempDBF[ i ], ".tmp", ".dbt" ) ) FErase( StrTran( s_aTempDBF[ i ], ".tmp", ".dbt" ) ) ENDIF NEXT @@ -213,6 +217,7 @@ PROCEDURE SQLGarbageCollector() FUNCTION SQLFetch( fetchall ) + LOCAL oQuery LOCAL oRow LOCAL cAlias := Upper( Alias() ) @@ -235,11 +240,11 @@ FUNCTION SQLFetch( fetchall ) s_aTableTemp[ i ][ DB_FETCH ] := .T. ENDIF - IF oQuery:Lastrec() >= nPos + IF oQuery:LastRec() >= nPos y := nPos - DO WHILE nPos <= iif( FetchAll, oQuery:Lastrec(), y ) + DO WHILE nPos <= iif( FetchAll, oQuery:LastRec(), y ) oRow := oQuery:GetRow( nPos ) dbAppend() @@ -256,18 +261,22 @@ FUNCTION SQLFetch( fetchall ) dbSkip() ENDIF - lEof := nPos > oQuery:Lastrec() + lEof := nPos > oQuery:LastRec() ENDIF + RETURN lEof PROCEDURE SQLFetchAll() + SQLFetch( .T. ) - dbGotop() + dbGoTop() + RETURN FUNCTION SQLOpen( cAlias, cQuery, xFetch, cOrder ) + LOCAL cFile LOCAL Result := .T. LOCAL x @@ -326,11 +335,12 @@ FUNCTION SQLOpen( cAlias, cQuery, xFetch, cOrder ) /* Se nao houver query na area temporaria entao adiciona, caso contrario, apenas atualiza */ IF Empty( x ) - AAdd( s_aTableTemp, { cAlias,; // Table Name - cFile,; // Temporary File Name - oQuery,; // Object Query - 0,; // Current Row - lFetch } ) // Fetch Status + AAdd( s_aTableTemp, { ; + cAlias, ; // Table Name + cFile, ; // Temporary File Name + oQuery, ; // Object Query + 0, ; // Current Row + lFetch } ) // Fetch Status ELSE s_aTableTemp[ x ][ DB_QUERY ] := oQuery @@ -343,13 +353,14 @@ FUNCTION SQLOpen( cAlias, cQuery, xFetch, cOrder ) SQLFetch( lFetch ) IF lFetch - dbGotop() + dbGoTop() ENDIF RETURN result FUNCTION SQLConnect( cServer, cDatabase, cUser, cPassword, cSchema ) + LOCAL lRetval := .T. s_oServer := TPQServer():New( cServer, cDatabase, cUser, cPassWord, 5432, cSchema ) @@ -358,13 +369,16 @@ FUNCTION SQLConnect( cServer, cDatabase, cUser, cPassword, cSchema ) lRetval := .F. ENDIF s_oServer:lAllCols := .F. + RETURN lRetval PROCEDURE SQLDestroy() + IF s_oServer != NIL s_oServer:Destroy() ENDIF + RETURN @@ -373,6 +387,7 @@ FUNCTION SQLCurrentServer FUNCTION SQLQuery( cQuery ) + LOCAL oQuery := s_oServer:Query( cQuery ) IF oQuery:NetErr() @@ -383,6 +398,7 @@ FUNCTION SQLQuery( cQuery ) FUNCTION SQLExecQuery( cQuery ) + LOCAL oQuery LOCAL result := .T. @@ -399,16 +415,17 @@ FUNCTION SQLExecQuery( cQuery ) FUNCTION SQLPrepare( cQuery, ... ) + LOCAL i, x - IF Pcount() >= 2 + IF PCount() >= 2 /* Limpa espacos desnecessarios */ DO WHILE At( Space( 2 ), cQuery ) != 0 cQuery := StrTran( cQuery, Space( 2 ), Space( 1 ) ) ENDDO /* Coloca {} nos parametros */ - FOR i := 1 TO Pcount() - 1 + FOR i := 1 TO PCount() - 1 IF ! Empty( x := At( ":" + hb_ntos( i ), cQuery ) ) cQuery := Stuff( cQuery, x, 0, "{" ) cQuery := Stuff( cQuery, x + Len( hb_ntos( i ) ) + 2, 0, "}" ) @@ -457,9 +474,11 @@ FUNCTION SQLSequence( Sequence_name ) PROCEDURE SQLStartTrans() + IF PQtransactionstatus( s_oServer:pDB ) != PQTRANS_INTRANS s_oServer:StartTransaction() ENDIF + RETURN @@ -468,17 +487,22 @@ FUNCTION SQLInTrans() PROCEDURE SQLCommitTrans() + s_oServer:Commit() + RETURN PROCEDURE SQLRollbackTrans() + s_oServer:rollback() + RETURN /* Faz querie que retorna apenas 1 valor de coluna */ FUNCTION QuickQuery( cQuery ) + LOCAL pQuery LOCAL result := "" LOCAL temp, aTemp @@ -488,7 +512,7 @@ FUNCTION QuickQuery( cQuery ) IF PQresultstatus( pQuery ) == PGRES_TUPLES_OK IF PQLastrec( pQuery ) != 0 - IF PQFcount( pQuery ) == 1 .and. PQLastrec( pQuery ) == 1 + IF PQFcount( pQuery ) == 1 .AND. PQLastrec( pQuery ) == 1 temp := PQGetValue( pQuery, 1, 1 ) result := iif( temp == NIL, "", temp ) ELSE @@ -504,10 +528,12 @@ FUNCTION QuickQuery( cQuery ) ENDIF ENDIF ENDIF + RETURN result PROCEDURE MakeDBF( cAlias, aStructure, aIndex ) + LOCAL cFile, i, cIndex, cKey hb_default( @aIndex, {} ) @@ -524,7 +550,7 @@ PROCEDURE MakeDBF( cAlias, aStructure, aIndex ) INDEX ON &cKey TO &cIndex - AAdd( s_aTempDBF, cIndex) + AAdd( s_aTempDBF, cIndex ) NEXT AAdd( s_aTempDBF, cFile ) @@ -533,15 +559,16 @@ PROCEDURE MakeDBF( cAlias, aStructure, aIndex ) FUNCTION TempFile( cPath, cExt ) + LOCAL cString hb_default( @cPath, hb_DirTemp() ) hb_default( @cExt, "tmp" ) - cString := cPath + StrZero( Int( hb_random( Val( StrTran( Time(), ":" ) ) ) ), 8 ) + "." + cExt + cString := cPath + StrZero( Int( hb_Random( Val( StrTran( Time(), ":" ) ) ) ), 8 ) + "." + cExt DO WHILE hb_FileExists( cString ) - cString := cPath + StrZero( Int( hb_random( Val( StrTran( Time(), ":" ) ) ) ), 8 ) + "." + cExt + cString := cPath + StrZero( Int( hb_Random( Val( StrTran( Time(), ":" ) ) ) ), 8 ) + "." + cExt ENDDO RETURN cString diff --git a/harbour/contrib/hbpgsql/tests/dbf2pg.prg b/harbour/contrib/hbpgsql/tests/dbf2pg.prg index 8f4a4883ec..82e4718c42 100644 --- a/harbour/contrib/hbpgsql/tests/dbf2pg.prg +++ b/harbour/contrib/hbpgsql/tests/dbf2pg.prg @@ -150,7 +150,7 @@ PROCEDURE Main( ... ) ENDIF USE ( cFile ) SHARED - aDbfStruct := DBStruct() + aDbfStruct := dbStruct() oServer := TPQServer():New( cHostName, cDatabase, cUser, cPassWord, NIL, cPath ) IF oServer:NetErr() @@ -217,46 +217,46 @@ PROCEDURE Main( ... ) FOR i := 1 TO oTable:FCount() cField := Lower( oTable:FieldName( i ) ) sType := FieldType( FieldPos( cField ) ) - dType := oRecord:Fieldtype( i ) + dType := oRecord:FieldType( i ) cValue := FieldGet( FieldPos( cField ) ) IF cValue != NIL IF dType != sType IF dType == "C" .AND. sType == "N" - cValue := Str( cValue ) + cValue := Str( cValue ) ELSEIF dType == "C" .AND. sType == "D" - cValue := DToC( cValue ) + cValue := DToC( cValue ) ELSEIF dType == "C" .AND. sType == "L" - cValue := iif( cValue, "S", "N" ) + cValue := iif( cValue, "S", "N" ) ELSEIF dType == "N" .AND. sType == "C" - cValue := Val( cValue ) + cValue := Val( cValue ) ELSEIF dType == "N" .AND. sType == "D" - cValue := Val( DToS( cValue ) ) + cValue := Val( DToS( cValue ) ) ELSEIF dType == "N" .AND. sType == "L" - cValue := iif( cValue, 1, 0 ) + cValue := iif( cValue, 1, 0 ) ELSEIF dType == "D" .AND. sType == "C" - cValue := CToD( cValue ) + cValue := CToD( cValue ) ELSEIF dType == "D" .AND. sType == "N" - cValue := SToD( Str( cValue ) ) + cValue := SToD( Str( cValue ) ) ELSEIF dType == "L" .AND. sType == "N" - cValue := ! Empty( cValue ) + cValue := ! Empty( cValue ) ELSEIF dType == "L" .AND. sType == "C" - cValue := iif( AllTrim( cValue ) $ "YySs1", .T., .F. ) + cValue := iif( AllTrim( cValue ) $ "YySs1", .T., .F. ) ENDIF ENDIF IF cValue != NIL - IF oRecord:Fieldtype( i ) == "C" .OR. oRecord:Fieldtype( i ) == "M" + IF oRecord:FieldType( i ) == "C" .OR. oRecord:FieldType( i ) == "M" oRecord:FieldPut( i, hb_StrToUTF8( cValue ) ) ELSE oRecord:FieldPut( i, cValue ) @@ -265,7 +265,7 @@ PROCEDURE Main( ... ) ENDIF NEXT - oTable:Append(oRecord) + oTable:Append( oRecord ) IF oTable:NetErr() ? diff --git a/harbour/contrib/hbpgsql/tests/simple.prg b/harbour/contrib/hbpgsql/tests/simple.prg index c18d43f0e3..eab6f2486a 100644 --- a/harbour/contrib/hbpgsql/tests/simple.prg +++ b/harbour/contrib/hbpgsql/tests/simple.prg @@ -5,6 +5,7 @@ #require "hbpgsql" PROCEDURE Main( cHost, cDatabase, cUser, cPass ) + LOCAL oServer, oQuery, oRow, i, x, aTables, aStruct LOCAL cQuery @@ -50,7 +51,7 @@ PROCEDURE Main( cHost, cDatabase, cUser, cPass ) oQuery := oServer:Query( cQuery ) - IF oQuery:neterr() + IF oQuery:NetErr() ? oQuery:ErrorMsg() ENDIF @@ -70,12 +71,12 @@ PROCEDURE Main( cHost, cDatabase, cUser, cPass ) oServer:StartTransaction() FOR i := 1 TO 10 - cQuery := "INSERT INTO test(code, dept, name, sales, tax, salary, budget, Discount, Creation, Description) " +; - "VALUES( " + Str( i ) + ", 2, 'TEST', 'y', 5, 3000, 1500.2, 7.5, '2003-12-17', 'Short Description about what ? ')" + cQuery := "INSERT INTO test(code, dept, name, sales, tax, salary, budget, Discount, Creation, Description) " + ; + "VALUES( " + Str( i ) + ", 2, 'TEST', 'y', 5, 3000, 1500.2, 7.5, '2003-12-17', 'Short Description about what ? ')" oQuery := oServer:Query( cQuery ) - IF oQuery:neterr() + IF oQuery:NetErr() ? oQuery:errorMsg() ENDIF @@ -92,22 +93,23 @@ PROCEDURE Main( cHost, cDatabase, cUser, cPass ) ? aStruct[ i ][ 1 ], aStruct[ i ][ 2 ], aStruct[ i ][ 3 ], aStruct[ i ][ 4 ] NEXT - ? "Fields: ", oQuery:Fcount() + ? "Fields: ", oQuery:FCount() oRow := oQuery:Blank() - ? oRow:FCount(), ; - oRow:Fieldpos( "sales" ), ; - oRow:Fieldget( 1 ), ; - oRow:Fieldname( 2 ), ; - oRow:Fieldtype( 1 ), ; - oRow:Fielddec( 1 ), ; - oRow:Fieldlen( 1 ) + ? ; + oRow:FCount(), ; + oRow:FieldPos( "sales" ), ; + oRow:FieldGet( 1 ), ; + oRow:FieldName( 2 ), ; + oRow:FieldType( 1 ), ; + oRow:FieldDec( 1 ), ; + oRow:FieldLen( 1 ) - oRow:Fieldput( 1, 150 ) - oRow:Fieldput( 2, "MY TEST" ) + oRow:FieldPut( 1, 150 ) + oRow:FieldPut( 2, "MY TEST" ) - ? oRow:Fieldget( 1 ), oRow:Fieldget( 2 ) + ? oRow:FieldGet( 1 ), oRow:FieldGet( 2 ) ? oRow:aRow[ 1 ], oRow:aRow[ 2 ], oRow:aOld[ 1 ], oRow:aOld[ 2 ] @@ -116,25 +118,26 @@ PROCEDURE Main( cHost, cDatabase, cUser, cPass ) ? oQuery:ErrorMsg() DO WHILE ! oQuery:Eof() - ? oQuery:Recno(),; - oQuery:Fieldpos( "code" ),; - oQuery:Fieldget( oQuery:Fieldpos( "code" ) ), ; - oQuery:Fieldget( 4 ), ; - oQuery:Fieldget( 2 ), ; - oQuery:Fieldname( 1 ),; - oQuery:Fieldtype( 1 ), ; - oQuery:Fielddec( 1 ), ; - oQuery:Fieldlen( 1 ),; - oQuery:Fieldget( 3 ) + ? ; + oQuery:RecNo(), ; + oQuery:FieldPos( "code" ), ; + oQuery:FieldGet( oQuery:FieldPos( "code" ) ), ; + oQuery:FieldGet( 4 ), ; + oQuery:FieldGet( 2 ), ; + oQuery:FieldName( 1 ), ; + oQuery:FieldType( 1 ), ; + oQuery:FieldDec( 1 ), ; + oQuery:FieldLen( 1 ), ; + oQuery:FieldGet( 3 ) - IF oQuery:Recno() == 50 + IF oQuery:RecNo() == 50 oRow := oQuery:getrow() - oRow:Fieldput( 2, "My Second test" ) + oRow:FieldPut( 2, "My Second test" ) ? "Update: ", oQuery:Update( oRow ) ENDIF - IF oQuery:Recno() == 60 + IF oQuery:RecNo() == 60 oRow := oQuery:getrow() ? "Delete: ", oQuery:Delete( oRow ) ENDIF @@ -145,17 +148,18 @@ PROCEDURE Main( cHost, cDatabase, cUser, cPass ) oQuery:Refresh() - FOR i := 1 TO oQuery:Lastrec() + FOR i := 1 TO oQuery:LastRec() oRow := oQuery:getrow( i ) - ? i, oRow:Fieldget( oRow:Fieldpos( "code" ) ),; - oRow:Fieldget( 4 ),; - oRow:Fieldget( 2 ),; - oRow:Fieldname( 1 ),; - oRow:Fieldtype( 1 ),; - oRow:Fielddec( 1 ),; - oRow:Fieldlen( 1 ),; - oRow:Fieldget( i, 3 ) + ? i, ; + oRow:FieldGet( oRow:FieldPos( "code" ) ), ; + oRow:FieldGet( 4 ), ; + oRow:FieldGet( 2 ), ; + oRow:FieldName( 1 ), ; + oRow:FieldType( 1 ), ; + oRow:FieldDec( 1 ), ; + oRow:FieldLen( 1 ), ; + oRow:FieldGet( i, 3 ) NEXT diff --git a/harbour/contrib/hbpgsql/tests/stress.prg b/harbour/contrib/hbpgsql/tests/stress.prg index cafb702359..e53edc870f 100644 --- a/harbour/contrib/hbpgsql/tests/stress.prg +++ b/harbour/contrib/hbpgsql/tests/stress.prg @@ -11,6 +11,7 @@ #include "postgres.ch" PROCEDURE Main( cServer, cDatabase, cUser, cPass ) + LOCAL conn, res, i, x LOCAL cQuery @@ -50,8 +51,8 @@ PROCEDURE Main( cServer, cDatabase, cUser, cPass ) FOR i := 1 TO 10000 @ 15, 0 SAY "Inserting values...." + Str( i ) - cQuery := "INSERT INTO test(code, dept, name, sales, salary, creation) " +; - "VALUES( " + Str( i ) + "," + Str( i + 1 ) + ", 'DEPARTMENT NAME " + StrZero( i ) + "', 'y', " + Str( 300.49 + i ) + ", '2003-12-28' )" + cQuery := "INSERT INTO test(code, dept, name, sales, salary, creation) " + ; + "VALUES( " + Str( i ) + "," + Str( i + 1 ) + ", 'DEPARTMENT NAME " + StrZero( i ) + "', 'y', " + Str( 300.49 + i ) + ", '2003-12-28' )" PQexec( conn, cQuery ) @@ -76,7 +77,7 @@ PROCEDURE Main( cServer, cDatabase, cUser, cPass ) FOR i := 2000 TO 3000 @ 17, 0 SAY "Updating values...." + Str( i ) - cQuery := "UPDATE FROM test SET salary = 400 WHERE code = " + str( i ) + cQuery := "UPDATE FROM test SET salary = 400 WHERE code = " + Str( i ) PQexec( conn, cQuery ) IF Mod( i, 100 ) == 0 diff --git a/harbour/contrib/hbpgsql/tests/test.prg b/harbour/contrib/hbpgsql/tests/test.prg index 1dbbbfc32a..81cc2d0473 100644 --- a/harbour/contrib/hbpgsql/tests/test.prg +++ b/harbour/contrib/hbpgsql/tests/test.prg @@ -6,7 +6,8 @@ #include "postgres.ch" -PROCEDURE main() +PROCEDURE Main() + LOCAL conn, res, aTemp, x, y, pFile LOCAL cDb := "test" LOCAL cUser := "user" @@ -32,10 +33,11 @@ PROCEDURE main() ? "Verbose: ", PQsetErrorVerbosity( conn, 2 ) - ? "Protocol: ", PQprotocolVersion( conn ),; - " Server Version: ", PQserverVersion( conn ),; - " Client Encoding: ", PQsetClientEncoding( conn, "ASCII" ),; - "New encode: ", PQclientEncoding( conn ) + ? ; + "Protocol: ", PQprotocolVersion( conn ), ; + " Server Version: ", PQserverVersion( conn ), ; + " Client Encoding: ", PQsetClientEncoding( conn, "ASCII" ), ; + "New encode: ", PQclientEncoding( conn ) ? PQdb( conn ), PQuser( conn ), PQpass( conn ), PQhost( conn ), PQport( conn ), PQtty( conn ), PQoptions( conn ) @@ -68,7 +70,7 @@ PROCEDURE main() FOR x := 1 TO Len( aTemp ) ? "Linha 1: " FOR y := 1 TO 6 - ?? aTemp[ x ][ y ], ", " + ?? aTemp[ x ][ y ], ", " NEXT NEXT diff --git a/harbour/contrib/hbpgsql/tpostgre.prg b/harbour/contrib/hbpgsql/tpostgre.prg index 939199ec15..f8353289c5 100644 --- a/harbour/contrib/hbpgsql/tpostgre.prg +++ b/harbour/contrib/hbpgsql/tpostgre.prg @@ -63,6 +63,7 @@ #define _STRU_TABLECOL 6 CREATE CLASS TPQServer + VAR pDb VAR lTrans VAR lallCols INIT .T. @@ -101,6 +102,7 @@ ENDCLASS METHOD New( cHost, cDatabase, cUser, cPass, nPort, Schema ) CLASS TPQserver + LOCAL res IF ! HB_ISNUMERIC( nPort ) @@ -110,8 +112,8 @@ METHOD New( cHost, cDatabase, cUser, cPass, nPort, Schema ) CLASS TPQserver ::pDB := PQconnectDB( "dbname = " + cDatabase + " host = " + cHost + " user = " + cUser + " password = " + cPass + " port = " + hb_ntos( nPort ) ) IF PQstatus( ::pDb ) != CONNECTION_OK - ::lError := .T. - ::cError := PQerrormessage( ::pDb ) + ::lError := .T. + ::cError := PQerrormessage( ::pDb ) ELSE IF ! Empty( Schema ) ::SetSchema( Schema ) @@ -127,24 +129,28 @@ METHOD New( cHost, cDatabase, cUser, cPass, nPort, Schema ) CLASS TPQserver RETURN self METHOD Destroy() CLASS TPQserver + ::TraceOff() ::pDb := NIL + RETURN NIL METHOD SetSchema( cSchema ) CLASS TPQserver + LOCAL res LOCAL result := .F. IF PQstatus( ::pDb ) == CONNECTION_OK - ::Schema := cSchema - res := PQexec( ::pDB, "SET search_path TO " + cSchema ) - result := ( PQresultStatus( res ) == PGRES_COMMAND_OK ) - res := NIL + ::Schema := cSchema + res := PQexec( ::pDB, "SET search_path TO " + cSchema ) + result := ( PQresultStatus( res ) == PGRES_COMMAND_OK ) + res := NIL ENDIF RETURN result METHOD StartTransaction() CLASS TPQserver + LOCAL res LOCAL lError @@ -162,6 +168,7 @@ METHOD StartTransaction() CLASS TPQserver RETURN lError METHOD Commit() CLASS TPQserver + LOCAL res LOCAL lError @@ -179,6 +186,7 @@ METHOD Commit() CLASS TPQserver RETURN lError METHOD Rollback() CLASS TPQserver + LOCAL res LOCAL lError @@ -199,6 +207,7 @@ METHOD Query( cQuery ) CLASS TPQserver RETURN TPQquery():New( ::pDB, cQuery, ::lallCols, ::Schema ) METHOD TableExists( cTable ) CLASS TPQserver + LOCAL result := .F. LOCAL cQuery LOCAL res @@ -221,6 +230,7 @@ METHOD TableExists( cTable ) CLASS TPQserver RETURN result METHOD ListTables() CLASS TPQserver + LOCAL result := {} LOCAL cQuery LOCAL res @@ -246,6 +256,7 @@ METHOD ListTables() CLASS TPQserver RETURN result METHOD TableStruct( cTable ) CLASS TPQserver + LOCAL result := {} LOCAL cQuery LOCAL res @@ -370,6 +381,7 @@ METHOD TableStruct( cTable ) CLASS TPQserver RETURN result METHOD CreateTable( cTable, aStruct ) CLASS TPQserver + LOCAL result := .T. LOCAL cQuery LOCAL res @@ -420,6 +432,7 @@ METHOD CreateTable( cTable, aStruct ) CLASS TPQserver RETURN result METHOD DeleteTable( cTable ) CLASS TPQserver + LOCAL result := .T. LOCAL res @@ -437,25 +450,30 @@ METHOD DeleteTable( cTable ) CLASS TPQserver RETURN result METHOD TraceOn( cFile ) CLASS TPQserver + ::pTrace := PQcreatetrace( cFile ) IF ::pTrace != NIL PQtrace( ::pDb, ::pTrace ) ::lTrace := .T. ENDIF + RETURN NIL METHOD TraceOff() CLASS TPQserver + IF ::pTrace != NIL PQuntrace( ::pDb ) ::pTrace := NIL ENDIF ::lTrace := .F. + RETURN NIL CREATE CLASS TPQQuery + VAR pQuery VAR pDB @@ -547,6 +565,7 @@ METHOD Destroy() CLASS TPQquery RETURN .T. METHOD Refresh( lQuery, lMeta ) CLASS TPQquery + LOCAL res LOCAL aStruct := {} LOCAL aTemp @@ -665,12 +684,13 @@ METHOD Refresh( lQuery, lMeta ) CLASS TPQquery cType := "K" ENDIF - AAdd( aStruct, { aTemp[ i ][ HBPG_META_FIELDNAME ],; - cType,; - nSize,; - nDec,; - aTemp[ i ][ HBPG_META_TABLE ],; - aTemp[ i ][ HBPG_META_TABLECOL ] } ) + AAdd( aStruct, { ; + aTemp[ i ][ HBPG_META_FIELDNAME ], ; + cType, ; + nSize, ; + nDec, ; + aTemp[ i ][ HBPG_META_TABLE ], ; + aTemp[ i ][ HBPG_META_TABLECOL ] } ) NEXT ::nFields := PQfcount( res ) @@ -704,6 +724,7 @@ METHOD Refresh( lQuery, lMeta ) CLASS TPQquery RETURN ! ::lError METHOD Struct() CLASS TPQquery + LOCAL result := Array( Len( ::aStruct ) ) LOCAL i @@ -765,10 +786,11 @@ METHOD FieldPos( cField ) CLASS TPQquery RETURN AScan( ::aStruct, {| x | x[ _STRU_FIELDNAME ] == cField } ) METHOD FieldName( nField ) CLASS TPQquery + LOCAL result IF HB_ISSTRING( nField ) - nField := ::Fieldpos( nField ) + nField := ::FieldPos( nField ) ELSEIF nField < 1 .OR. nField > Len( ::aStruct ) nField := 0 ENDIF @@ -780,10 +802,11 @@ METHOD FieldName( nField ) CLASS TPQquery RETURN result METHOD FieldType( nField ) CLASS TPQquery + LOCAL result IF HB_ISSTRING( nField ) - nField := ::Fieldpos( nField ) + nField := ::FieldPos( nField ) ELSEIF nField < 1 .OR. nField > Len( ::aStruct ) nField := 0 ENDIF @@ -795,10 +818,11 @@ METHOD FieldType( nField ) CLASS TPQquery RETURN result METHOD FieldLen( nField ) CLASS TPQquery + LOCAL result IF HB_ISSTRING( nField ) - nField := ::Fieldpos( nField ) + nField := ::FieldPos( nField ) ELSEIF nField < 1 .OR. nField > Len( ::aStruct ) nField := 0 ENDIF @@ -810,10 +834,11 @@ METHOD FieldLen( nField ) CLASS TPQquery RETURN result METHOD FieldDec( nField ) CLASS TPQquery + LOCAL result IF HB_ISSTRING( nField ) - nField := ::Fieldpos( nField ) + nField := ::FieldPos( nField ) ELSEIF nField < 1 .OR. nField > Len( ::aStruct ) nField := 0 ENDIF @@ -825,6 +850,7 @@ METHOD FieldDec( nField ) CLASS TPQquery RETURN result METHOD Delete( oRow ) CLASS TPQquery + LOCAL res LOCAL i LOCAL nField @@ -837,7 +863,7 @@ METHOD Delete( oRow ) CLASS TPQquery IF ! Empty( ::Tablename ) .AND. ! Empty( ::aKeys ) FOR i := 1 TO Len( ::aKeys ) - nField := oRow:Fieldpos( ::aKeys[ i ] ) + nField := oRow:FieldPos( ::aKeys[ i ] ) xField := oRow:FieldGetOld( nField ) cWhere += ::aKeys[ i ] + " = $" + hb_ntos( i ) @@ -872,6 +898,7 @@ METHOD Delete( oRow ) CLASS TPQquery RETURN ! ::lError METHOD Append( oRow ) CLASS TPQquery + LOCAL cQuery LOCAL i LOCAL res @@ -886,7 +913,7 @@ METHOD Append( oRow ) CLASS TPQquery FOR i := 1 TO oRow:FCount() IF ::lallCols .OR. oRow:changed( i ) lChanged := .T. - cQuery += oRow:Fieldname( i ) + "," + cQuery += oRow:FieldName( i ) + "," ENDIF NEXT @@ -925,6 +952,7 @@ METHOD Append( oRow ) CLASS TPQquery RETURN ! ::lError METHOD Update( oRow ) CLASS TPQquery + LOCAL cQuery LOCAL i LOCAL nField @@ -941,7 +969,7 @@ METHOD Update( oRow ) CLASS TPQquery cWhere := "" FOR i := 1 TO Len( ::aKeys ) - nField := oRow:Fieldpos( ::aKeys[ i ] ) + nField := oRow:FieldPos( ::aKeys[ i ] ) xField := oRow:FieldGetOld( nField ) cWhere += ::aKeys[ i ] + "=" + DataToSql( xField ) @@ -956,7 +984,7 @@ METHOD Update( oRow ) CLASS TPQquery IF ::lallcols .OR. oRow:Changed( i ) lChanged := .T. nParams++ - cQuery += oRow:Fieldname( i ) + " = $" + hb_ntos( nParams ) + "," + cQuery += oRow:FieldName( i ) + " = $" + hb_ntos( nParams ) + "," AAdd( aParams, ValueToString( oRow:FieldGet( i ) ) ) ENDIF NEXT @@ -987,10 +1015,11 @@ METHOD Update( oRow ) CLASS TPQquery RETURN ! ::lError METHOD FieldGet( nField, nRow ) CLASS TPQquery + LOCAL result IF HB_ISSTRING( nField ) - nField := ::Fieldpos( nField ) + nField := ::FieldPos( nField ) ELSEIF nField < 1 .OR. nField > ::nFields nField := 0 ENDIF @@ -1042,6 +1071,7 @@ METHOD FieldGet( nField, nRow ) CLASS TPQquery RETURN result METHOD Getrow( nRow ) CLASS TPQquery + LOCAL result LOCAL aRow LOCAL aOld @@ -1059,8 +1089,8 @@ METHOD Getrow( nRow ) CLASS TPQquery aOld := Array( ::nFields ) FOR nCol := 1 TO ::nFields - aRow[ nCol ] := ::Fieldget( nCol, nRow ) - aOld[ nCol ] := ::Fieldget( nCol, nRow ) + aRow[ nCol ] := ::FieldGet( nCol, nRow ) + aOld[ nCol ] := ::FieldGet( nCol, nRow ) NEXT result := TPQRow():New( aRow, aOld, ::aStruct ) @@ -1073,6 +1103,7 @@ METHOD Getrow( nRow ) CLASS TPQquery RETURN result METHOD GetBlankRow() CLASS TPQquery + LOCAL aRow := Array( ::nFields ) LOCAL aOld := Array( ::nFields ) LOCAL i @@ -1102,6 +1133,7 @@ METHOD GetBlankRow() CLASS TPQquery RETURN TPQRow():New( aRow, aOld, ::aStruct ) METHOD SetKey() CLASS TPQquery + LOCAL cQuery LOCAL i, x LOCAL nTableId, xTableId := -1 @@ -1182,6 +1214,7 @@ METHOD SetKey() CLASS TPQquery RETURN NIL CREATE CLASS TPQRow + VAR aRow VAR aOld VAR aStruct @@ -1198,20 +1231,24 @@ CREATE CLASS TPQRow METHOD FieldType( nField ) METHOD Changed( nField ) INLINE !( ::aRow[ nField ] == ::aOld[ nField ] ) METHOD FieldGetOld( nField ) INLINE ::aOld[ nField ] + ENDCLASS -METHOD new( row, old, struct) CLASS TPQrow +METHOD new( row, old, struct ) CLASS TPQrow + ::aRow := row ::aOld := old ::aStruct := struct + RETURN self METHOD FieldGet( nField ) CLASS TPQrow + LOCAL result IF HB_ISSTRING( nField ) - nField := ::Fieldpos( nField ) + nField := ::FieldPos( nField ) ENDIF IF nField >= 1 .AND. nField <= Len( ::aRow ) @@ -1221,10 +1258,11 @@ METHOD FieldGet( nField ) CLASS TPQrow RETURN result METHOD FieldPut( nField, Value ) CLASS TPQrow + LOCAL result IF HB_ISSTRING( nField ) - nField := ::Fieldpos( nField ) + nField := ::FieldPos( nField ) ENDIF IF nField >= 1 .AND. nField <= Len( ::aRow ) @@ -1234,10 +1272,11 @@ METHOD FieldPut( nField, Value ) CLASS TPQrow RETURN result METHOD FieldName( nField ) CLASS TPQrow + LOCAL result IF HB_ISSTRING( nField ) - nField := ::Fieldpos( nField ) + nField := ::FieldPos( nField ) ENDIF IF nField >= 1 .AND. nField <= Len( ::aStruct ) @@ -1253,10 +1292,11 @@ METHOD FieldPos( cField ) CLASS TPQrow RETURN AScan( ::aStruct, {| x | x[ _STRU_FIELDNAME ] == cField } ) METHOD FieldType( nField ) CLASS TPQrow + LOCAL result IF HB_ISSTRING( nField ) - nField := ::Fieldpos( nField ) + nField := ::FieldPos( nField ) ENDIF IF nField >= 1 .AND. nField <= Len( ::aStruct ) @@ -1266,10 +1306,11 @@ METHOD FieldType( nField ) CLASS TPQrow RETURN result METHOD FieldLen( nField ) CLASS TPQrow + LOCAL result IF HB_ISSTRING( nField ) - nField := ::Fieldpos( nField ) + nField := ::FieldPos( nField ) ENDIF IF nField >= 1 .AND. nField <= Len( ::aStruct ) @@ -1279,10 +1320,11 @@ METHOD FieldLen( nField ) CLASS TPQrow RETURN result METHOD FieldDec( nField ) CLASS TPQrow + LOCAL result IF HB_ISSTRING( nField ) - nField := ::Fieldpos( nField ) + nField := ::FieldPos( nField ) ENDIF IF nField >= 1 .AND. nField <= Len( ::aStruct ) @@ -1296,7 +1338,7 @@ STATIC FUNCTION DataToSql( xField ) SWITCH ValType( xField ) CASE "C" CASE "M" - RETURN "'"+ StrTran( xField, "'", " " ) + "'" + RETURN "'" + StrTran( xField, "'", " " ) + "'" CASE "D" RETURN DToS( xField ) CASE "N" diff --git a/harbour/contrib/hbrun/hbrun.hbp b/harbour/contrib/hbrun/hbrun.hbp index 1482eb35fa..cf0836eb87 100644 --- a/harbour/contrib/hbrun/hbrun.hbp +++ b/harbour/contrib/hbrun/hbrun.hbp @@ -14,6 +14,9 @@ -DHBMK_WITH_ALL_EMBEDDED_HEADERS +-DHBMK_WITH_GTXWC{HBMK_WITH_GTXWC='yes'} +-gtxwc{HBMK_WITH_GTXWC='yes'} + hbct.hbc -request=__HBEXTERN__HBCT__ hbexpat.hbc -request=__HBEXTERN__HBEXPAT__ hbmemio.hbc -request=__HBEXTERN__HBMEMIO__ diff --git a/harbour/contrib/hbsms/sms.prg b/harbour/contrib/hbsms/sms.prg index 77a50669ab..2870792120 100644 --- a/harbour/contrib/hbsms/sms.prg +++ b/harbour/contrib/hbsms/sms.prg @@ -65,6 +65,7 @@ STATIC FUNCTION port_send( h, s ) RETURN hb_comSend( h, s ) STATIC FUNCTION port_rece( h, n, t ) + LOCAL cString IF ! HB_ISNUMERIC( n ) @@ -82,6 +83,7 @@ STATIC FUNCTION port_rece( h, n, t ) RETURN cString FUNCTION sms_Send( cPort, cPhoneNo, cText, lNotification, cPIN ) + LOCAL smsctx LOCAL nRetVal @@ -96,6 +98,7 @@ FUNCTION sms_Send( cPort, cPhoneNo, cText, lNotification, cPIN ) RETURN nRetVal FUNCTION sms_ReceiveAll( cPort, cPIN ) + LOCAL smsctx LOCAL aRetVal @@ -117,6 +120,7 @@ FUNCTION sms_ReceiveAll( cPort, cPIN ) #define _SMSCTX_MAX_ 3 FUNCTION smsctx_New( xPort ) + LOCAL smsctx[ _SMSCTX_MAX_ ] IF HB_ISNUMERIC( xPort ) @@ -160,6 +164,7 @@ FUNCTION smsctx_Close( smsctx ) RETURN .T. FUNCTION smsctx_Send( smsctx, cPhoneNo, cText, lNotification ) + LOCAL tmp IF ! HB_ISARRAY( smsctx ) .OR. Len( smsctx ) != _SMSCTX_MAX_ @@ -243,6 +248,7 @@ FUNCTION smsctx_Receive( smsctx ) RETURN {} FUNCTION smsctx_PIN( smsctx, cPIN ) + LOCAL cOldValue IF ! HB_ISARRAY( smsctx ) .OR. Len( smsctx ) != _SMSCTX_MAX_ @@ -265,11 +271,13 @@ STATIC FUNCTION StripCRLF( cString ) RETURN StrTran( cString, Chr( 13 ) + Chr( 10 ) ) STATIC FUNCTION IsOK( cString ) + LOCAL tmp := GetLines( cString ) RETURN ! Empty( tmp ) .AND. ATail( tmp ) == "OK" STATIC FUNCTION GetLines( cString ) + LOCAL aLine := {} LOCAL tmp @@ -287,6 +295,7 @@ STATIC FUNCTION GetLines( cString ) RETURN aLine STATIC FUNCTION GetList( cString ) + LOCAL aList := {} LOCAL tmp @@ -297,6 +306,7 @@ STATIC FUNCTION GetList( cString ) RETURN aList STATIC FUNCTION MakeList( aList ) + LOCAL cString := "" LOCAL tmp diff --git a/harbour/contrib/hbsqlit3/hdbcsqlt.prg b/harbour/contrib/hbsqlit3/hdbcsqlt.prg index a346c86ac0..133265361c 100644 --- a/harbour/contrib/hbsqlit3/hdbcsqlt.prg +++ b/harbour/contrib/hbsqlit3/hdbcsqlt.prg @@ -423,7 +423,7 @@ METHOD absolute( nMove ) CLASS hdbcSQLTResultSet RETURN .T. ENDIF ELSEIF nMove < 0 - if - nMove <= ::nRows + IF -nMove <= ::nRows ::nRow := ::nRows + nMove ::lBeforeFirst := .F. ::lAfterLast := .F. diff --git a/harbour/contrib/hbsqlit3/tests/blob.prg b/harbour/contrib/hbsqlit3/tests/blob.prg index 019865ccd0..bab4504b5b 100644 --- a/harbour/contrib/hbsqlit3/tests/blob.prg +++ b/harbour/contrib/hbsqlit3/tests/blob.prg @@ -57,6 +57,7 @@ #define TABLE_SQL "CREATE TABLE image( id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT(50), image BLOB )" PROCEDURE Main() + LOCAL lCreateIfNotExist := .T. LOCAL db := sqlite3_open( "test.s3db", lCreateIfNotExist ) LOCAL stmt @@ -71,7 +72,7 @@ PROCEDURE Main() sqlite3_exec( db, TABLE_SQL ) - stmt := sqlite3_prepare( db, "INSERT INTO image( title, image ) VALUES( :title, :image )") + stmt := sqlite3_prepare( db, "INSERT INTO image( title, image ) VALUES( :title, :image )" ) IF ! Empty( stmt ) buff := sqlite3_file_to_buff( "pngtest.png" ) @@ -116,7 +117,7 @@ PROCEDURE Main() ? "" ? "Save BLOB using sqlite3_column_blob()" - stmt := sqlite3_prepare( db, "SELECT image FROM image WHERE id == ?5 ") + stmt := sqlite3_prepare( db, "SELECT image FROM image WHERE id == ?5 " ) IF ! Empty( stmt ) IF sqlite3_bind_int64( stmt, 5, sqlite3_last_insert_rowid( db ) ) == SQLITE_OK IF sqlite3_step( stmt ) == SQLITE_ROW diff --git a/harbour/contrib/hbsqlit3/tests/hdbctest.prg b/harbour/contrib/hbsqlit3/tests/hdbctest.prg index 14de685626..d29deb08bc 100644 --- a/harbour/contrib/hbsqlit3/tests/hdbctest.prg +++ b/harbour/contrib/hbsqlit3/tests/hdbctest.prg @@ -4,6 +4,8 @@ #require "hbsqlit3" +#define _NUMROWS_ 10 + PROCEDURE Main() LOCAL oConn, oMeta, oStmt, cSql, n, oRs @@ -45,8 +47,6 @@ PROCEDURE Main() ? "Inserting using direct statement..." - #define _NUMROWS_ 10 - ? Time() FOR n := 1 TO _NUMROWS_ cSql := "INSERT INTO test(code, dept, name, sales, tax, salary, budget, Discount, Creation, Description) " @@ -63,7 +63,7 @@ PROCEDURE Main() ? "Creating prepared statement" ? Time() - oStmt := oConn:prepareStatement( "INSERT INTO test(code, dept, name, sales, tax, salary, budget, Discount, Creation, Description) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10 )") + oStmt := oConn:prepareStatement( "INSERT INTO test(code, dept, name, sales, tax, salary, budget, Discount, Creation, Description) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10 )" ) FOR n := _NUMROWS_ + 1 TO _NUMROWS_ * 2 oStmt:SetNumber( 1, n ) @@ -152,7 +152,7 @@ PROCEDURE Main() oRs:first() oRs:updateNumber( 8, 99.99 ) - oRs:updateDate( 9, date() ) + oRs:updateDate( 9, Date() ) oRs:updateString( "description", "Updated" ) oRs:updateRow() diff --git a/harbour/contrib/hbsqlit3/tests/metadata.prg b/harbour/contrib/hbsqlit3/tests/metadata.prg index 7d41abc1f6..4a29a04ae1 100644 --- a/harbour/contrib/hbsqlit3/tests/metadata.prg +++ b/harbour/contrib/hbsqlit3/tests/metadata.prg @@ -54,7 +54,7 @@ #include "hbsqlit3.ch" -//#define SQLITE_ENABLE_COLUMN_METADATA +// #define SQLITE_ENABLE_COLUMN_METADATA PROCEDURE Main() diff --git a/harbour/contrib/hbsqlit3/tests/sl3_test.prg b/harbour/contrib/hbsqlit3/tests/sl3_test.prg index 47f514507b..d591019612 100644 --- a/harbour/contrib/hbsqlit3/tests/sl3_test.prg +++ b/harbour/contrib/hbsqlit3/tests/sl3_test.prg @@ -74,6 +74,7 @@ PROCEDURE Main() /* */ PROCEDURE t1() + LOCAL lCreateIfNotExist := .F. LOCAL db := sqlite3_open( "new.s3db", lCreateIfNotExist ) @@ -86,6 +87,7 @@ PROCEDURE t1() /* */ PROCEDURE t2() + LOCAL lCreateIfNotExist := .T. LOCAL db := sqlite3_open( "new.s3db", lCreateIfNotExist ) LOCAL stmt @@ -126,7 +128,7 @@ PROCEDURE t2() sqlite3_sleep( 3000 ) - stmt := sqlite3_prepare( db, "INSERT INTO t1( name, age ) VALUES( :name, :age )") + stmt := sqlite3_prepare( db, "INSERT INTO t1( name, age ) VALUES( :name, :age )" ) IF ! Empty( stmt ) IF sqlite3_bind_text( stmt, 1, "Andy" ) == SQLITE_OK .AND. ; sqlite3_bind_int( stmt, 2, 17 ) == SQLITE_OK @@ -151,7 +153,7 @@ PROCEDURE t2() ? "Last _ROWID_: " + Str( sqlite3_last_insert_rowid( db ) ) ? "" - stmt := sqlite3_prepare( db, "SELECT * FROM t1 WHERE name == :name ") + stmt := sqlite3_prepare( db, "SELECT * FROM t1 WHERE name == :name " ) sqlite3_bind_text( stmt, 1, "Andy" ) ? @@ -172,7 +174,7 @@ PROCEDURE t2() SWITCH nCType CASE SQLITE_BLOB - ?? "BLOB" //sqlite3_column_blob( stmt, nI ) + ?? "BLOB" // sqlite3_column_blob( stmt, nI ) EXIT CASE SQLITE_INTEGER @@ -198,7 +200,7 @@ PROCEDURE t2() sqlite3_sleep( 3000 ) - stmt := sqlite3_prepare( db, "SELECT * FROM t1 WHERE age >= ?5") + stmt := sqlite3_prepare( db, "SELECT * FROM t1 WHERE age >= ?5" ) sqlite3_bind_int( stmt, 5, 40 ) ? @@ -218,7 +220,7 @@ PROCEDURE t2() SWITCH nCType CASE SQLITE_BLOB - ?? "BLOB" //sqlite3_column_blob( stmt, nI ) + ?? "BLOB" // sqlite3_column_blob( stmt, nI ) EXIT CASE SQLITE_INTEGER @@ -245,7 +247,7 @@ PROCEDURE t2() ? ? "SELECT id, name, age + 5 FROM t1" - stmt := sqlite3_prepare( db, "SELECT id, name, age + 5 FROM t1") + stmt := sqlite3_prepare( db, "SELECT id, name, age + 5 FROM t1" ) ? sqlite3_column_name( stmt, 1 ) ? sqlite3_column_name( stmt, 2 ) diff --git a/harbour/contrib/hbssl/tests/pem.prg b/harbour/contrib/hbssl/tests/pem.prg index 0d7fc14472..cd788e9bf5 100644 --- a/harbour/contrib/hbssl/tests/pem.prg +++ b/harbour/contrib/hbssl/tests/pem.prg @@ -14,6 +14,7 @@ #include "hbssl.ch" PROCEDURE Main() + LOCAL cString LOCAL bio LOCAL bioe @@ -55,7 +56,7 @@ VGue9TIkMgy7RW1VFWLcLsCArTEAl83bv+BQ+YaPp9aLNq8bL5vfU2od0R7LXIOe jH09fWcojNNLfmZU0Jzy7viUiScTtNqpqoH0qPI1hkisvELqXKhW1Lpkr56Ij8IL B0NDIZKbaPJHHPb9Ne7nQECzv0/kzmAley9UMTZ1M7fq6KYemR0LsA== -----END RSA PRIVATE KEY----- -ENDTEXT +#pragma __endtext ? PEM_READ_BIO_RSAPRIVATEKEY( bio := BIO_new_mem_buf( cString ), {| lWrite | QOut( "Callback", lWrite, hb_eol() ), "test" } ) ? ; ERR_print_errors( bioe ) @@ -72,9 +73,13 @@ ENDTEXT RETURN STATIC FUNCTION cb_function( lWrite ) + ? "Callback (func)", lWrite + RETURN "test" STATIC FUNCTION Output( ... ) + ? ... + RETURN NIL diff --git a/harbour/contrib/hbssl/tests/test.prg b/harbour/contrib/hbssl/tests/test.prg index fa8a343d5b..1832682684 100644 --- a/harbour/contrib/hbssl/tests/test.prg +++ b/harbour/contrib/hbssl/tests/test.prg @@ -16,6 +16,7 @@ #define CRLF Chr( 13 ) + Chr( 10 ) PROCEDURE Main() + LOCAL ssl_ctx LOCAL ssl LOCAL cipher diff --git a/harbour/contrib/hbtinymt/tests/test32.prg b/harbour/contrib/hbtinymt/tests/test32.prg index c8a0651201..8e17a0622f 100644 --- a/harbour/contrib/hbtinymt/tests/test32.prg +++ b/harbour/contrib/hbtinymt/tests/test32.prg @@ -26,13 +26,14 @@ PROCEDURE Main() TestMatrix( "Float numbers r, where 0.0 <= r < 1.0", {|| PadL( tinymt32_generate_float01(), 15 ) } ) TestMatrix( "Float numbers r, where 1.0 <= r < 2.0", {|| PadL( tinymt32_generate_float12(), 15 ) } ) TestMatrix( "Float numbers r, where 0.0 < r <= 1.0", {|| PadL( tinymt32_generate_floatOC(), 15 ) } ) - TestMatrix( "Float numbers r, where 0.0 < r < 1.0" , {|| PadL( tinymt32_generate_floatOO(), 15 ) } ) + TestMatrix( "Float numbers r, where 0.0 < r < 1.0", {|| PadL( tinymt32_generate_floatOO(), 15 ) } ) TestMatrix( "32-bit precision double numbers r, where 0.0 <= r < 1.0", {|| PadL( tinymt32_generate_32double(), 15 ) } ) ENDIF RETURN STATIC PROCEDURE TestMatrix( cDescription, bBlock ) + LOCAL i, j ? cDescription diff --git a/harbour/contrib/hbtinymt/tests/test64.prg b/harbour/contrib/hbtinymt/tests/test64.prg index 4270cd60a1..3419078038 100644 --- a/harbour/contrib/hbtinymt/tests/test64.prg +++ b/harbour/contrib/hbtinymt/tests/test64.prg @@ -21,12 +21,13 @@ PROCEDURE Main() TestMatrix( "Double numbers r, where 0.0 <= r < 1.0", {|| PadL( tinymt64_generate_double01(), 30 ) } ) TestMatrix( "Double numbers r, where 1.0 <= r < 2.0", {|| PadL( tinymt64_generate_double12(), 30 ) } ) TestMatrix( "Double numbers r, where 0.0 < r <= 1.0", {|| PadL( tinymt64_generate_doubleOC(), 30 ) } ) - TestMatrix( "Double numbers r, where 0.0 < r < 1.0" , {|| PadL( tinymt64_generate_doubleOO(), 30 ) } ) + TestMatrix( "Double numbers r, where 0.0 < r < 1.0", {|| PadL( tinymt64_generate_doubleOO(), 30 ) } ) ENDIF RETURN STATIC PROCEDURE TestMatrix( cDescription, bBlock ) + LOCAL i, j ? cDescription diff --git a/harbour/contrib/hbtip/cgi.prg b/harbour/contrib/hbtip/cgi.prg index dc083cfecf..74afa0725b 100644 --- a/harbour/contrib/hbtip/cgi.prg +++ b/harbour/contrib/hbtip/cgi.prg @@ -361,7 +361,7 @@ METHOD ErrHandler( xError ) CLASS TIpCgi cErrMsg += '<tr><td>CRITICAL ERROR:</td><td>' + xError:Description + '</td></tr>' cErrMsg += '<tr><td>OPERATION:</td><td>' + xError:Operation + '</td></tr>' cErrMsg += '<tr><td>OS ERROR:</td><td>' + hb_ntos( xError:OsCode ) + ' IN ' + xError:SubSystem + '/' + hb_ntos( xError:SubCode ) + '</td></tr>' - cErrMsg += '<tr><td>FILENAME:</td><td>' + right( xError:FileName, 40 ) + '</td></tr>' + cErrMsg += '<tr><td>FILENAME:</td><td>' + Right( xError:FileName, 40 ) + '</td></tr>' ELSEIF HB_ISSTRING( xError ) cErrMsg += '<tr><td>ERROR MESSAGE:</td><td>' + TIP_HTMLSPECIALCHARS( xError ) + '</td></tr>' ENDIF @@ -392,19 +392,20 @@ METHOD Write( cString ) CLASS TIpCgi METHOD StartHtml( hOptions ) CLASS TIpCgi - ::cHtmlPage += '<?xml version="1.0"' + HtmlOption( hOptions, 'encoding', ' ' ) + '?>' + _CRLF + ; - '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"' + _CRLF + ; - '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' + _CRLF + ; - '<html xmlns="http://www.w3.org/1999/xhtml">' + ; - '<head>' + ; - HtmlTag( hOptions, 'title', 'title' ) + ; - HtmlScript( hOptions ) + ; - HtmlStyle( hOptions ) + ; - HtmlLinkRel( hOptions ) + ; - '</head>' + ; - '<body ' + ; - HtmlAllOption( hOptions ) + ; - '>' + ::cHtmlPage += ; + '<?xml version="1.0"' + HtmlOption( hOptions, 'encoding', ' ' ) + '?>' + _CRLF + ; + '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"' + _CRLF + ; + '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' + _CRLF + ; + '<html xmlns="http://www.w3.org/1999/xhtml">' + ; + '<head>' + ; + HtmlTag( hOptions, 'title', 'title' ) + ; + HtmlScript( hOptions ) + ; + HtmlStyle( hOptions ) + ; + HtmlLinkRel( hOptions ) + ; + '</head>' + ; + '<body ' + ; + HtmlAllOption( hOptions ) + ; + '>' RETURN Self diff --git a/harbour/contrib/hbtip/client.prg b/harbour/contrib/hbtip/client.prg index d75fbd7464..47bc0fd23f 100644 --- a/harbour/contrib/hbtip/client.prg +++ b/harbour/contrib/hbtip/client.prg @@ -167,7 +167,7 @@ CREATE CLASS tIPClient METHOD ReadHTTPProxyResponse( sResponse ) /* Methods to log data if needed */ - METHOD InetRecv( SocketCon, cStr1, len) + METHOD InetRecv( SocketCon, cStr1, len ) METHOD InetRecvLine( SocketCon, nRet, size ) METHOD InetRecvAll( SocketCon, cRet, size ) METHOD InetCount( SocketCon ) @@ -181,6 +181,7 @@ CREATE CLASS tIPClient ENDCLASS METHOD New( oUrl, xTrace, oCredentials ) CLASS tIPClient + LOCAL oErr LOCAL oLog @@ -224,7 +225,7 @@ METHOD New( oUrl, xTrace, oCredentials ) CLASS tIPClient hb_inetInit() #if defined( HB_HAS_OPENSSL ) SSL_init() - RAND_seed( Time() + hb_username() + DToS( Date() ) + hb_DirBase() + NetName() ) + RAND_seed( Time() + hb_UserName() + DToS( Date() ) + hb_DirBase() + NetName() ) #endif ::bInitSocks := .T. ENDIF @@ -244,6 +245,7 @@ METHOD New( oUrl, xTrace, oCredentials ) CLASS tIPClient RETURN self METHOD Open( cUrl ) CLASS tIPClient + LOCAL nPort LOCAL cResp @@ -274,9 +276,11 @@ METHOD Open( cUrl ) CLASS tIPClient ENDIF ENDIF ::isOpen := .T. + RETURN .T. METHOD EnableTLS( lEnable ) CLASS tIPClient + LOCAL lSuccess IF ::lTLS == lEnable @@ -304,6 +308,7 @@ METHOD EnableTLS( lEnable ) CLASS tIPClient RETURN lSuccess METHOD OpenProxy( cServer, nPort, cProxy, nProxyPort, cResp, cUserName, cPassWord, cUserAgent ) CLASS tIPClient + LOCAL cRequest LOCAL lRet := .F. LOCAL tmp @@ -338,6 +343,7 @@ METHOD OpenProxy( cServer, nPort, cProxy, nProxyPort, cResp, cUserName, cPassWor RETURN lRet METHOD ReadHTTPProxyResponse( /* @ */ sResponse ) CLASS tIPClient + LOCAL bMoreDataToRead := .T. LOCAL nLength, nData LOCAL szResponse @@ -354,13 +360,14 @@ METHOD ReadHTTPProxyResponse( /* @ */ sResponse ) CLASS tIPClient nLength := Len( sResponse ) IF nLength >= 4 bMoreDataToRead := !( SubStr( sResponse, nLength - 3, 1 ) == Chr( 13 ) .AND. SubStr( sResponse, nLength - 2, 1 ) == Chr( 10 ) .AND. ; - SubStr( sResponse, nLength - 1, 1 ) == Chr( 13 ) .AND. SubStr( sResponse, nLength , 1 ) == Chr( 10 ) ) + SubStr( sResponse, nLength - 1, 1 ) == Chr( 13 ) .AND. SubStr( sResponse, nLength, 1 ) == Chr( 10 ) ) ENDIF ENDDO RETURN .T. METHOD Close() CLASS tIPClient + LOCAL nRet := -1 IF ! Empty( ::SocketCon ) @@ -387,14 +394,17 @@ METHOD Close() CLASS tIPClient RETURN nRet METHOD Reset() CLASS tIPClient + ::bInitialized := .F. ::bEof := .F. + RETURN .T. METHOD Commit() CLASS tIPClient RETURN .T. METHOD Read( nLen ) CLASS tIPClient + LOCAL cStr0 LOCAL cStr1 @@ -449,6 +459,7 @@ METHOD Read( nLen ) CLASS tIPClient RETURN cStr0 METHOD ReadToFile( cFile, nMode, nSize ) CLASS tIPClient + LOCAL nFout LOCAL cData LOCAL nSent @@ -507,6 +518,7 @@ METHOD ReadToFile( cFile, nMode, nSize ) CLASS tIPClient RETURN .T. METHOD WriteFromFile( cFile ) CLASS tIPClient + LOCAL nFin LOCAL cData LOCAL nLen @@ -551,6 +563,7 @@ METHOD WriteFromFile( cFile ) CLASS tIPClient ::nStatus := 2 FClose( nFin ) + RETURN .T. /* @@ -582,6 +595,7 @@ METHOD Write( cData, nLen, bCommit ) CLASS tIPClient RETURN ::nLastWrite METHOD InetSendAll( SocketCon, cData, nLen ) CLASS tIPClient + LOCAL nRet IF Empty( nLen ) @@ -609,6 +623,7 @@ METHOD InetSendAll( SocketCon, cData, nLen ) CLASS tIPClient RETURN nRet METHOD InetCount( SocketCon ) CLASS tIPClient + LOCAL nRet := hb_inetCount( SocketCon ) IF HB_ISBLOCK( ::bTrace ) @@ -618,6 +633,7 @@ METHOD InetCount( SocketCon ) CLASS tIPClient RETURN nRet METHOD InetRecv( SocketCon, cStr1, len ) CLASS tIPClient + LOCAL nRet IF ::lTLS @@ -641,6 +657,7 @@ METHOD InetRecv( SocketCon, cStr1, len ) CLASS tIPClient RETURN nRet METHOD InetRecvLine( SocketCon, nRet, size ) CLASS tIPClient + LOCAL cRet IF ::lTLS @@ -665,9 +682,10 @@ METHOD InetRecvLine( SocketCon, nRet, size ) CLASS tIPClient ::Log( SocketCon, "", size, cRet ) ENDIF - RETURN cRet + RETURN cRet METHOD InetRecvAll( SocketCon, cRet, size ) CLASS tIPClient + LOCAL nRet IF ::lTLS @@ -695,6 +713,7 @@ METHOD InetRecvAll( SocketCon, cRet, size ) CLASS tIPClient RETURN nRet METHOD InetErrorCode( SocketCon ) CLASS tIPClient + LOCAL nRet IF ::lTLS @@ -716,6 +735,7 @@ METHOD InetErrorCode( SocketCon ) CLASS tIPClient RETURN nRet METHOD InetErrorDesc( SocketCon ) CLASS tIPClient + LOCAL cMsg := "" hb_default( @SocketCon, ::SocketCon ) @@ -764,24 +784,30 @@ METHOD InetConnect( cServer, nPort, SocketCon ) CLASS tIPClient /* Methods to manage buffers */ METHOD InetRcvBufSize( SocketCon, nSizeBuff ) CLASS tIPClient + IF ! Empty( nSizeBuff ) hb_inetSetRcvBufSize( SocketCon, nSizeBuff ) ENDIF + RETURN hb_inetGetRcvBufSize( SocketCon ) METHOD InetSndBufSize( SocketCon, nSizeBuff ) CLASS tIPClient + IF ! Empty( nSizeBuff ) hb_inetSetSndBufSize( SocketCon, nSizeBuff ) ENDIF + RETURN hb_inetGetSndBufSize( SocketCon ) METHOD InetTimeOut( SocketCon, nConnTimeout ) CLASS tIPClient + IF HB_ISNUMERIC( nConnTimeout ) ::nConnTimeout := nConnTimeout ENDIF IF HB_ISNUMERIC( ::nConnTimeout ) RETURN hb_inetTimeout( SocketCon, ::nConnTimeout ) ENDIF + RETURN NIL /* Called from another method with list of parameters and, as last parameter, return code @@ -797,8 +823,8 @@ METHOD Log( ... ) CLASS tIPClient IF HB_ISBLOCK( ::bTrace ) cMsg := DToS( Date() ) + "-" + Time() + Space( 2 ) + ; - SubStr( ProcName( 1 ), RAt( ":", ProcName( 1 ) ) ) +; - "( " + SubStr( ProcName( 1 ), RAt( ":", ProcName( 1 ) ) ) + ; + "( " FOR EACH xVar IN hb_AParams() @@ -833,6 +859,7 @@ METHOD SetProxy( cProxyHost, nProxyPort, cProxyUser, cProxyPassword ) CLASS tIPC RETURN Self FUNCTION tip_SSL() + #if defined( HB_HAS_OPENSSL ) RETURN .T. #else diff --git a/harbour/contrib/hbtip/credent.prg b/harbour/contrib/hbtip/credent.prg index 2b94aafd41..0db4b91bde 100644 --- a/harbour/contrib/hbtip/credent.prg +++ b/harbour/contrib/hbtip/credent.prg @@ -58,7 +58,9 @@ */ CREATE CLASS tIPCredentials + VAR cMethod VAR cUserid VAR cPassword + ENDCLASS diff --git a/harbour/contrib/hbtip/encb64.prg b/harbour/contrib/hbtip/encb64.prg index a0b5732a87..24d19fc878 100644 --- a/harbour/contrib/hbtip/encb64.prg +++ b/harbour/contrib/hbtip/encb64.prg @@ -53,6 +53,7 @@ #include "hbclass.ch" CREATE CLASS TIPEncoderBase64 FROM TIPEncoder + // Set this to .T. to enable RFC 2068 (HTTP/1.1) exception to // RFC 2045 (MIME) base64 format. This exception consists in // not applying CRLF after each 76 output bytes. @@ -61,27 +62,31 @@ CREATE CLASS TIPEncoderBase64 FROM TIPEncoder METHOD New() Constructor METHOD Encode( cData ) METHOD Decode( cData ) + ENDCLASS METHOD New() CLASS TIPEncoderBase64 + ::cName := "Base64" ::bHttpExcept := .F. + RETURN Self METHOD Encode( cData ) CLASS TIPEncoderBase64 RETURN TIP_BASE64ENCODE( cData, iif( ::bHttpExcept, NIL, 72 ), Chr( 13 ) + Chr( 10 ) ) METHOD Decode( cData ) CLASS TIPEncoderBase64 - RETURN hb_base64decode( cData ) + RETURN hb_base64Decode( cData ) FUNCTION TIP_BASE64ENCODE( cBinary, nLineLength, cCRLF ) - LOCAL cTextIn := HB_BASE64ENCODE( cBinary ) + + LOCAL cTextIn := hb_base64Encode( cBinary ) LOCAL cText LOCAL tmp IF ! HB_ISNUMERIC( nLineLength ) - RETURN cTextIn + RETURN cTextIn ENDIF IF ! HB_ISSTRING( cCRLF ) cCRLF := hb_eol() diff --git a/harbour/contrib/hbtip/encoder.prg b/harbour/contrib/hbtip/encoder.prg index 21157b1900..5b305d1d89 100644 --- a/harbour/contrib/hbtip/encoder.prg +++ b/harbour/contrib/hbtip/encoder.prg @@ -63,6 +63,7 @@ #include "fileio.ch" FUNCTION TIp_GetEncoder( cModel ) + LOCAL oEncoder hb_default( @cModel, "as-is" ) @@ -91,16 +92,20 @@ FUNCTION TIp_GetEncoder( cModel ) RETURN oEncoder CREATE CLASS TIPEncoder + VAR cName METHOD New( cModel ) METHOD Encode( cData ) METHOD Decode( cData ) + ENDCLASS METHOD New( cModel ) CLASS TIPEncoder + hb_default( @cModel, "as-is" ) ::cName := cModel + RETURN Self METHOD Encode( cData ) CLASS TIPEncoder diff --git a/harbour/contrib/hbtip/encqp.prg b/harbour/contrib/hbtip/encqp.prg index 2bc13e9d56..89ac58f45b 100644 --- a/harbour/contrib/hbtip/encqp.prg +++ b/harbour/contrib/hbtip/encqp.prg @@ -58,15 +58,19 @@ This should be reverted once derived classes work fine from dynamically loaded libs. */ CREATE CLASS TIPEncoderQP + VAR cName METHOD New() CONSTRUCTOR METHOD Encode( cData ) METHOD Decode( cData ) + ENDCLASS METHOD New() CLASS TIPEncoderQP + ::cName := "quoted-printable" + RETURN Self METHOD Encode( cData ) CLASS TIPEncoderQP @@ -76,6 +80,7 @@ METHOD Decode( cData ) CLASS TIPEncoderQP RETURN TIP_QPDecode( cData ) FUNCTION TIP_QPEncode( cData ) + LOCAL nPos LOCAL c LOCAL nLen @@ -107,6 +112,7 @@ FUNCTION TIP_QPEncode( cData ) RETURN cString FUNCTION TIP_QPDecode( cData ) + LOCAL nPos LOCAL c LOCAL nLen diff --git a/harbour/contrib/hbtip/encurl.prg b/harbour/contrib/hbtip/encurl.prg index d1fb058dbb..8b5ba3e896 100644 --- a/harbour/contrib/hbtip/encurl.prg +++ b/harbour/contrib/hbtip/encurl.prg @@ -53,13 +53,17 @@ #include "hbclass.ch" CREATE CLASS TIPEncoderUrl FROM TIPEncoder + METHOD New() CONSTRUCTOR METHOD Encode( cData ) METHOD Decode( cData ) + ENDCLASS METHOD New() CLASS TIPEncoderURL + ::cName := "urlencoded" + RETURN Self METHOD Encode( cData ) CLASS TIPEncoderURL diff --git a/harbour/contrib/hbtip/ftpcli.prg b/harbour/contrib/hbtip/ftpcli.prg index d268a5cb58..22ea9b24b3 100644 --- a/harbour/contrib/hbtip/ftpcli.prg +++ b/harbour/contrib/hbtip/ftpcli.prg @@ -101,6 +101,7 @@ STATIC s_nPort := 16000 CREATE CLASS tIPClientFTP FROM tIPClient + VAR nDataPort VAR cDataServer VAR bUsePasv @@ -150,6 +151,7 @@ CREATE CLASS tIPClientFTP FROM tIPClient METHOD listFiles( cFileSpec ) METHOD MPut METHOD fileSize( cFileSpec ) + ENDCLASS @@ -194,9 +196,11 @@ METHOD Open( cUrl ) CLASS tIPClientFTP ENDIF ENDIF ENDIF + RETURN .F. METHOD GetReply() CLASS tIPClientFTP + LOCAL nLen LOCAL cRep @@ -222,6 +226,7 @@ METHOD GetReply() CLASS tIPClientFTP RETURN .T. METHOD Pasv() CLASS tIPClientFTP + LOCAL aRep ::InetSendall( ::SocketCon, "PASV" + ::cCRLF ) @@ -250,27 +255,39 @@ METHOD Close() CLASS tIPClientFTP RETURN ::super:Close() METHOD Quit() CLASS tIPClientFTP + ::InetSendall( ::SocketCon, "QUIT" + ::cCRLF ) + RETURN ::GetReply() METHOD TypeI() CLASS tIPClientFTP + ::InetSendall( ::SocketCon, "TYPE I" + ::cCRLF ) + RETURN ::GetReply() METHOD TypeA() CLASS tIPClientFTP + ::InetSendall( ::SocketCon, "TYPE A" + ::cCRLF ) + RETURN ::GetReply() METHOD NoOp() CLASS tIPClientFTP + ::InetSendall( ::SocketCon, "NOOP" + ::cCRLF ) + RETURN ::GetReply() METHOD Rest( nPos ) CLASS tIPClientFTP + ::InetSendall( ::SocketCon, "REST " + hb_ntos( iif( Empty( nPos ), 0, nPos ) ) + ::cCRLF ) + RETURN ::GetReply() METHOD CWD( cPath ) CLASS tIPClientFTP + ::InetSendall( ::SocketCon, "CWD " + cPath + ::cCRLF ) + RETURN ::GetReply() METHOD PWD() CLASS tIPClientFTP @@ -280,16 +297,20 @@ METHOD PWD() CLASS tIPClientFTP RETURN .F. ENDIF ::cReply := SubStr( ::cReply, At( '"', ::cReply ) + 1, ; - RAt( '"', ::cReply ) - At( '"', ::cReply ) - 1 ) + RAt( '"', ::cReply ) - At( '"', ::cReply ) - 1 ) + RETURN .T. METHOD DELE( cPath ) CLASS tIPClientFTP + ::InetSendall( ::SocketCon, "DELE " + cPath + ::cCRLF ) + RETURN ::GetReply() // scan last reply for an hint of length METHOD ScanLength() CLASS tIPClientFTP + LOCAL aBytes := hb_regex( ::RegBytes, ::cReply ) IF ! Empty( aBytes ) @@ -299,6 +320,7 @@ METHOD ScanLength() CLASS tIPClientFTP RETURN .T. METHOD TransferStart() CLASS tIPClientFTP + LOCAL skt ::SocketControl := ::SocketCon @@ -360,6 +382,7 @@ METHOD Commit() CLASS tIPClientFTP RETURN .T. METHOD List( cSpec ) CLASS tIPClientFTP + LOCAL cStr IF cSpec == NIL @@ -369,7 +392,7 @@ METHOD List( cSpec ) CLASS tIPClientFTP ENDIF IF ::bUsePasv IF ! ::Pasv() - //::bUsePasv := .F. + // ::bUsePasv := .F. RETURN NIL ENDIF ENDIF @@ -388,8 +411,8 @@ METHOD List( cSpec ) CLASS tIPClientFTP METHOD UserCommand( cCommand, lPasv, lReadPort, lGetReply ) CLASS tIPClientFTP - hb_default( @cCommand , "" ) - hb_default( @lPasv , .T. ) + hb_default( @cCommand, "" ) + hb_default( @lPasv, .T. ) hb_default( @lReadPort, .T. ) hb_default( @lGetReply, .F. ) @@ -410,6 +433,7 @@ METHOD UserCommand( cCommand, lPasv, lReadPort, lGetReply ) CLASS tIPClientFTP RETURN .T. METHOD ReadAuxPort( cLocalFile ) CLASS tIPClientFTP + LOCAL cRet LOCAL cList := "" LOCAL nFile := 0 @@ -439,13 +463,14 @@ METHOD ReadAuxPort( cLocalFile ) CLASS tIPClientFTP ENDIF RETURN cList ENDIF + RETURN NIL METHOD Stor( cFile ) CLASS tIPClientFTP IF ::bUsePasv IF ! ::Pasv() - //::bUsePasv := .F. + // ::bUsePasv := .F. RETURN .F. ENDIF ENDIF @@ -475,6 +500,7 @@ METHOD Port() CLASS tIPClientFTP RETURN .F. METHOD SendPort() CLASS tIPClientFTP + LOCAL cAddr LOCAL cPort, nPort @@ -487,6 +513,7 @@ METHOD SendPort() CLASS tIPClientFTP RETURN ::GetReply() METHOD Read( nLen ) CLASS tIPClientFTP + LOCAL cRet IF ! ::bInitialized @@ -549,7 +576,7 @@ METHOD Retr( cFile ) CLASS tIPClientFTP IF ::bUsePasv IF ! ::Pasv() - //::bUsePasv := .F. + // ::bUsePasv := .F. RETURN .F. ENDIF ENDIF @@ -572,7 +599,7 @@ METHOD MGET( cSpec, cLocalPath ) CLASS tIPClientFTP IF ::bUsePasv IF ! ::Pasv() - //::bUsePasv := .F. + // ::bUsePasv := .F. RETURN .F. ENDIF ENDIF @@ -616,7 +643,7 @@ METHOD UpLoadFile( cLocalFile, cRemoteFile ) CLASS tIPClientFTP LOCAL cFile LOCAL cExt - hb_FNameSplit( cLocalFile, @cPath, @cFile,@cExt ) + hb_FNameSplit( cLocalFile, @cPath, @cFile, @cExt ) hb_default( @cRemoteFile, cFile + cExt ) @@ -658,7 +685,7 @@ METHOD LS( cSpec ) CLASS tIPClientFTP hb_default( @cSpec, "" ) IF ::bUsePasv .AND. ! ::Pasv() - //::bUsePasv := .F. + // ::bUsePasv := .F. RETURN .F. ENDIF @@ -677,6 +704,7 @@ METHOD LS( cSpec ) CLASS tIPClientFTP /* Rename a traves del ftp */ METHOD Rename( cFrom, cTo ) CLASS tIPClientFTP + LOCAL lResult := .F. ::InetSendAll( ::SocketCon, "RNFR " + cFrom + ::cCRLF ) @@ -726,28 +754,36 @@ METHOD DownLoadFile( cLocalFile, cRemoteFile ) CLASS tIPClientFTP // Create a new folder METHOD MKD( cPath ) CLASS tIPClientFTP + ::InetSendall( ::SocketCon, "MKD " + cPath + ::cCRLF ) + RETURN ::GetReply() // Delete an existing folder METHOD RMD( cPath ) CLASS tIPClientFTP + ::InetSendall( ::SocketCon, "RMD " + cPath + ::cCRLF ) + RETURN ::GetReply() // Return total file size for <cFileSpec> METHOD fileSize( cFileSpec ) CLASS tIPClientFTP + LOCAL aFile LOCAL nSize := 0 + FOR EACH aFile IN ::ListFiles( cFileSpec ) nSize += aFile[ F_SIZE ] NEXT + RETURN nSize // Parse the :list() string into a Directory() compatible 2-dim array METHOD listFiles( cFileSpec ) CLASS tIPClientFTP + LOCAL aMonth := { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" } LOCAL cList, aList, aFile, cEntry, nStart, nEnd LOCAL cYear, cMonth, cDay, cTime diff --git a/harbour/contrib/hbtip/httpcli.prg b/harbour/contrib/hbtip/httpcli.prg index aef95de04c..a2c06f5c91 100644 --- a/harbour/contrib/hbtip/httpcli.prg +++ b/harbour/contrib/hbtip/httpcli.prg @@ -118,6 +118,7 @@ METHOD Get( cQuery ) CLASS tIPClientHTTP RETURN .F. METHOD Post( xPostData, cQuery ) CLASS tIPClientHTTP + LOCAL cData, nI, cTmp, y IF HB_ISHASH( xPostData ) @@ -162,7 +163,7 @@ METHOD Post( xPostData, cQuery ) CLASS tIPClientHTTP ENDIF ::InetSendall( ::SocketCon, "Content-Length: " + ; - hb_ntos( Len( cData ) ) + ::cCRLF ) + hb_ntos( Len( cData ) ) + ::cCRLF ) // End of header ::InetSendall( ::SocketCon, ::cCRLF ) @@ -176,37 +177,39 @@ METHOD Post( xPostData, cQuery ) CLASS tIPClientHTTP RETURN .F. METHOD StandardFields() CLASS tIPClientHTTP + LOCAL iCount - LOCAL oEncoder,cCookies + LOCAL oEncoder, cCookies ::InetSendall( ::SocketCon, "Host: " + ::oUrl:cServer + ::cCRLF ) ::InetSendall( ::SocketCon, "User-agent: " + ::cUserAgent + ::cCRLF ) ::InetSendall( ::SocketCon, "Connection: close" + ::cCRLF ) // Perform a basic authentication request - IF ::cAuthMode == "Basic" .AND. ! ("Authorization" $ ::hFields) + IF ::cAuthMode == "Basic" .AND. ! ( "Authorization" $ ::hFields ) oEncoder := TIPEncoderBase64():New() oEncoder:bHttpExcept := .T. - ::InetSendall( ::SocketCon, "Authorization: Basic " +; - oEncoder:Encode( ::oUrl:cUserID + ":" + ::oUrl:cPassword ) + ::cCRLF ) + ::InetSendall( ::SocketCon, "Authorization: Basic " + ; + oEncoder:Encode( ::oUrl:cUserID + ":" + ::oUrl:cPassword ) + ::cCRLF ) ENDIF // send cookies - cCookies:=::getCookies() + cCookies := ::getCookies() IF ! Empty( cCookies ) - ::InetSendall( ::SocketCon, "Cookie: " + cCookies+::cCRLF) + ::InetSendall( ::SocketCon, "Cookie: " + cCookies + ::cCRLF ) ENDIF - //Send optional Fields + // Send optional Fields FOR iCount := 1 TO Len( ::hFields ) - ::InetSendall( ::SocketCon, hb_HKeyAt( ::hFields, iCount ) +; + ::InetSendall( ::SocketCon, hb_HKeyAt( ::hFields, iCount ) + ; ": " + hb_HValueAt( ::hFields, iCount ) + ::cCRLF ) NEXT RETURN .T. METHOD ReadHeaders( lClear ) CLASS tIPClientHTTP + LOCAL cLine, nPos, aVersion LOCAL aHead @@ -269,9 +272,11 @@ METHOD ReadHeaders( lClear ) CLASS tIPClientHTTP IF ::InetErrorCode( ::SocketCon ) != 0 RETURN .F. ENDIF + RETURN .T. METHOD Read( nLen ) CLASS tIPClientHTTP + LOCAL cData, nPos, cLine, aHead IF ! ::bInitialized @@ -302,7 +307,7 @@ METHOD Read( nLen ) CLASS tIPClientHTTP // add Headers to footers aHead := hb_regexSplit( ":", cLine,,, 1 ) IF aHead != NIL - ::hHeaders[ aHead[1] ] := LTrim(aHead[2]) + ::hHeaders[ aHead[ 1 ] ] := LTrim( aHead[ 2 ] ) ENDIF cLine := ::InetRecvLine( ::SocketCon, @nPos, 1024 ) @@ -334,8 +339,8 @@ METHOD Read( nLen ) CLASS tIPClientHTTP IF ::bEof .AND. ::bChunked ::bEof := .F. ::nLength := -1 - //chunked data is followed by a blank line - /* cLine := */ ::InetRecvLine( ::SocketCon, @nPos, 1024 ) + // chunked data is followed by a blank line + /* cLine := */ ::InetRecvLine( ::SocketCon, @nPos, 1024 ) ENDIF @@ -344,6 +349,7 @@ METHOD Read( nLen ) CLASS tIPClientHTTP METHOD ReadAll() CLASS tIPClientHTTP LOCAL cOut := "", cChunk + IF ! ::bInitialized ::bInitialized := .T. IF ! ::Get() @@ -351,19 +357,21 @@ METHOD ReadAll() CLASS tIPClientHTTP ENDIF ENDIF IF ::bChunked - cChunk:=::read() + cChunk := ::read() DO WHILE cChunk != NIL cOut += cChunk - // ::nLength := -1 + // ::nLength := -1 cChunk := ::read() ENDDO ELSE RETURN ::read() ENDIF + RETURN cOut METHOD setCookie( cLine ) CLASS tIPClientHTTP - //docs from http://www.ietf.org/rfc/rfc2109.txt + + // docs from http://www.ietf.org/rfc/rfc2109.txt LOCAL aParam LOCAL cHost, cPath, cName, cValue, aElements, cElement LOCAL cDefaultHost := ::oUrl:cServer, cDefaultPath := ::oUrl:cPath @@ -371,14 +379,14 @@ METHOD setCookie( cLine ) CLASS tIPClientHTTP IF Empty( cDefaultPath ) cDefaultPath := "/" ENDIF - //this function currently ignores expires, secure and other tags that may be in the cookie for now... -// ?"Setting COOKIE:",cLine + // this function currently ignores expires, secure and other tags that may be in the cookie for now... + // ?"Setting COOKIE:",cLine aParam := hb_regexSplit( ";", cLine ) cName := cValue := "" cHost := cDefaultHost cPath := cDefaultPath y := Len( aParam ) - FOR x := 1 to y + FOR x := 1 TO y aElements := hb_regexSplit( "=", aParam[ x ], 1 ) IF Len( aElements ) == 2 IF x == 1 @@ -387,7 +395,7 @@ METHOD setCookie( cLine ) CLASS tIPClientHTTP ELSE cElement := Upper( AllTrim( aElements[ 1 ] ) ) DO CASE - //CASE cElement == "EXPIRES" + // CASE cElement == "EXPIRES" CASE cElement == "PATH" cPath := AllTrim( aElements[ 2 ] ) CASE cElement == "DOMAIN" @@ -397,8 +405,8 @@ METHOD setCookie( cLine ) CLASS tIPClientHTTP ENDIF NEXT IF ! Empty( cName ) - //cookies are stored in hashes as host.path.name - //check if we have a host hash yet + // cookies are stored in hashes as host.path.name + // check if we have a host hash yet IF ! hb_HHasKey( ::hCookies, cHost ) ::hCookies[ cHost ] := { => } ENDIF @@ -407,9 +415,11 @@ METHOD setCookie( cLine ) CLASS tIPClientHTTP ENDIF ::hCookies[ cHost ][ cPath ][ cName ] := cValue ENDIF + RETURN NIL METHOD getcookies( cHost, cPath ) CLASS tIPClientHTTP + LOCAL x, y, aDomKeys := {}, aKeys, z, cKey, aPathKeys, nPath LOCAL a, b, cOut := "", c, d @@ -425,24 +435,24 @@ METHOD getcookies( cHost, cPath ) CLASS tIPClientHTTP RETURN cOut ENDIF - //tail matching the domain - aKeys := hb_Hkeys( ::hCookies ) + // tail matching the domain + aKeys := hb_HKeys( ::hCookies ) y := Len( aKeys ) z := Len( cHost ) cHost := Upper( cHost ) FOR x := 1 TO y cKey := Upper( aKeys[ x ] ) - IF Upper( right( cKey, z ) ) == cHost .AND. ( Len( cKey ) == z .OR. SubStr( aKeys[ x ], 0 - z, 1 ) == "." ) + IF Upper( Right( cKey, z ) ) == cHost .AND. ( Len( cKey ) == z .OR. SubStr( aKeys[ x ], 0 - z, 1 ) == "." ) AAdd( aDomKeys, aKeys[ x ] ) ENDIF NEXT - //more specific paths should be sent before lesser generic paths. + // more specific paths should be sent before lesser generic paths. ASort( aDomKeys,,, {| cX, cY | Len( cX ) > Len( cY ) } ) y := Len( aDomKeys ) - //now that we have the domain matches we have to do path matchine + // now that we have the domain matches we have to do path matchine nPath := Len( cPath ) FOR x := 1 TO y - aKeys := hb_Hkeys( ::hCookies[ aDomKeys[ x ] ] ) + aKeys := hb_HKeys( ::hCookies[ aDomKeys[ x ] ] ) aPathKeys := {} b := Len( aKeys ) FOR a := 1 TO b @@ -455,7 +465,7 @@ METHOD getcookies( cHost, cPath ) CLASS tIPClientHTTP ASort( aPathKeys,,, {| cX, cY | Len( cX ) > Len( cY ) } ) b := Len( aPathKeys ) FOR a := 1 TO b - aKeys := hb_Hkeys( ::hCookies[ aDomKeys[ x ] ][ aPathKeys[ a ] ] ) + aKeys := hb_HKeys( ::hCookies[ aDomKeys[ x ] ][ aPathKeys[ a ] ] ) d := Len( aKeys ) FOR c := 1 TO d IF ! Empty( cOut ) @@ -465,6 +475,7 @@ METHOD getcookies( cHost, cPath ) CLASS tIPClientHTTP NEXT NEXT NEXT + RETURN cOut METHOD Boundary( nType ) CLASS tIPClientHTTP @@ -480,6 +491,7 @@ METHOD Boundary( nType ) CLASS tIPClientHTTP LOCAL cBound := ::cBoundary LOCAL i + hb_default( @nType, 0 ) IF Empty( cBound ) cBound := Replicate( "-", 27 ) + Space( 11 ) @@ -489,13 +501,17 @@ METHOD Boundary( nType ) CLASS tIPClientHTTP ::cBoundary := cBound ENDIF cBound := iif( nType < 2, "--", "" ) + cBound + iif( nType == 1, "--", "" ) + RETURN cBound METHOD Attach( cName, cFileName, cType ) CLASS tIPClientHTTP + AAdd( ::aAttachments, { cName, cFileName, cType } ) + RETURN NIL METHOD PostMultiPart( xPostData, cQuery ) CLASS tIPClientHTTP + LOCAL cData := "", nI, cTmp, y, cBound := ::boundary() LOCAL cCrlf := ::cCRlf, oSub LOCAL nPos @@ -530,23 +546,23 @@ METHOD PostMultiPart( xPostData, cQuery ) CLASS tIPClientHTTP cType := oSub[ 3 ] cTmp := StrTran( cFile, "/", "\" ) IF ( nPos := RAt( "\", cTmp ) ) != 0 - cFilePath := Left( cTmp, nPos ) + cFilePath := Left( cTmp, nPos ) ELSEIF ( nPos := RAt( ":", cTmp ) ) != 0 - cFilePath := Left( cTmp, nPos ) + cFilePath := Left( cTmp, nPos ) ELSE - cFilePath := "" + cFilePath := "" ENDIF cTmp := SubStr( cFile, Len( cFilePath ) + 1 ) IF Empty( cType ) cType := "text/html" ENDIF cData += cBound + cCrlf + 'Content-Disposition: form-data; name="' + cName + '"; filename="' + cTmp + '"' + cCrlf + 'Content-Type: ' + cType + cCrLf + cCrLf - //hope this is not a big file.... + // hope this is not a big file.... nFile := FOpen( cFile ) /* TOFIX: Error checking on nFile. [vszakats] */ nbuf := 8192 nRead := nBuf - //cBuf := Space( nBuf ) + // cBuf := Space( nBuf ) DO WHILE nRead == nBuf // nRead := FRead( nFile, @cBuf, nBuf ) cBuf := FReadStr( nFile, nBuf ) diff --git a/harbour/contrib/hbtip/log.prg b/harbour/contrib/hbtip/log.prg index c53e33fae4..fff5b072ee 100644 --- a/harbour/contrib/hbtip/log.prg +++ b/harbour/contrib/hbtip/log.prg @@ -108,6 +108,7 @@ METHOD Add( cMsg ) CLASS TIPLOG RETURN .F. METHOD Close() CLASS TIPLOG + LOCAL lRetVal IF ! Empty( ::fhnd ) .AND. ::fhnd != F_ERROR diff --git a/harbour/contrib/hbtip/mail.prg b/harbour/contrib/hbtip/mail.prg index 8626063eff..209e0a742d 100644 --- a/harbour/contrib/hbtip/mail.prg +++ b/harbour/contrib/hbtip/mail.prg @@ -62,6 +62,7 @@ #include "hbclass.ch" CREATE CLASS TipMail + VAR hHeaders // received fields may be more than once. VAR aReceived INIT {} @@ -123,7 +124,7 @@ METHOD New( cBody, oEncoder ) CLASS TipMail ::hHeaders := hb_HSetCaseMatch( { => }, .F. ) ::aAttachments := {} - IF Valtype( oEncoder ) $ "CO" + IF ValType( oEncoder ) $ "CO" ::setEncoder( oEncoder ) ENDIF @@ -136,35 +137,42 @@ METHOD New( cBody, oEncoder ) CLASS TipMail RETURN Self METHOD SetEncoder( cEncoder ) CLASS TipMail + IF HB_ISSTRING( cEncoder ) ::oEncoder := TIp_GetEncoder( cEncoder ) ELSE ::oEncoder := cEncoder ENDIF ::hHeaders[ "Content-Transfer-Encoding" ] := ::oEncoder:cName + RETURN .T. METHOD SetBody( cBody ) CLASS TipMail + IF ::oEncoder != NIL ::cBody := ::oEncoder:Encode( cBody ) ::hHeaders[ "Content-Transfer-Encoding" ] := ::oEncoder:cName - ::lBodyEncoded := .T. //GD needed to prevent an extra crlf from being appended + ::lBodyEncoded := .T. // GD needed to prevent an extra crlf from being appended ELSE ::cBody := cBody ENDIF // not needed // ::hHeaders[ "Content-Length" ] := hb_ntos( Len( cBody ) ) + RETURN .T. METHOD GetBody() CLASS TipMail + IF ::cBody == NIL RETURN NIL ELSEIF ::oEncoder != NIL RETURN ::oEncoder:Decode( ::cBody ) ENDIF + RETURN ::cBody METHOD GetFieldPart( cPart ) CLASS TipMail + LOCAL nPos, cEnc nPos := hb_HPos( ::hHeaders, cPart ) @@ -181,6 +189,7 @@ METHOD GetFieldPart( cPart ) CLASS TipMail RETURN cEnc METHOD GetFieldOption( cPart, cOption ) CLASS TipMail + LOCAL nPos, aMatch LOCAL cEnc @@ -201,6 +210,7 @@ METHOD GetFieldOption( cPart, cOption ) CLASS TipMail RETURN cEnc METHOD SetFieldPart( cPart, cValue ) CLASS TipMail + LOCAL nPos, cEnc nPos := hb_HPos( ::hHeaders, cPart ) @@ -219,20 +229,21 @@ METHOD SetFieldPart( cPart, cValue ) CLASS TipMail RETURN .T. METHOD SetFieldOption( cPart, cOption, cValue ) CLASS TipMail + LOCAL nPos, aMatch LOCAL cEnc nPos := hb_HPos( ::hHeaders, cPart ) IF nPos == 0 - Return .F. + RETURN .F. ELSE cEnc := hb_HValueAt( ::hHeaders, nPos ) aMatch := hb_regex( "(.*?;\s*)" + cOption + "\s*=[^;]*(.*)?", cEnc, .F. ) IF Empty( aMatch ) ::hHeaders[ cPart ] := cEnc += "; " + cOption + '="' + cValue + '"' ELSE - ::hHeaders[ cPart ] := aMatch[ 2 ] + cOption + '="' +; - cValue + '"' + aMatch[ 3 ] + ::hHeaders[ cPart ] := aMatch[ 2 ] + cOption + '="' + ; + cValue + '"' + aMatch[ 3 ] ENDIF ENDIF @@ -271,12 +282,13 @@ METHOD GetAttachment() CLASS TipMail RETURN ::aAttachments[ ::nAttachPos ] METHOD ToString() CLASS TipMail + LOCAL cBoundary, cElem, i LOCAL cRet := "" // this is a multipart message; we need a boundary IF Len( ::aAttachments ) > 0 - ::hHeaders[ "Mime-Version" ] := "1.0" + ::hHeaders[ "Mime-Version" ] := "1.0" ENDIF IF Len( ::aAttachments ) > 0 @@ -332,21 +344,22 @@ METHOD ToString() CLASS TipMail !( cElem == "to" ) .AND. ; !( cElem == "subject" ) .AND. ; !( cElem == "mime-version" ) - cRet += hb_HKeyAt( ::hHeaders, i ) + ": " + ; - hb_HValueAt( ::hHeaders, i ) + e"\r\n" + cRet += ; + hb_HKeyAt( ::hHeaders, i ) + ": " + ; + hb_HValueAt( ::hHeaders, i ) + e"\r\n" ENDIF NEXT // end of Header cRet += e"\r\n" - //Body + // Body IF ! Empty( ::cBody ) IF Empty( ::aAttachments ) - //cRet += ::cBody + iif( lAttachment, "", e"\r\n" ) + // cRet += ::cBody + iif( lAttachment, "", e"\r\n" ) cRet += ::cBody + iif( ::lBodyEncoded, "", e"\r\n" ) ELSE - //GD - if there are attachements the body of the message has to be treated as an attachment. + // GD - if there are attachements the body of the message has to be treated as an attachment. cRet += "--" + cBoundary + e"\r\n" cRet += "Content-Type: text/plain; charset=" + ::cCharset + "; format=flowed" + e"\r\n" cRet += "Content-Transfer-Encoding: 7bit" + e"\r\n" @@ -367,6 +380,7 @@ METHOD ToString() CLASS TipMail RETURN cRet METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail + LOCAL oSubSection, cSubBoundary LOCAL nLinePos, nSplitPos, nBodyPos LOCAL cValue, cLastField @@ -397,7 +411,7 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail IF Lower( cLastField ) == "received" ::aReceived[ Len( ::aReceived ) ] += " " + cValue ELSE - ::hHeaders[ cLastField ] += " " +cValue + ::hHeaders[ cLastField ] += " " + cValue ENDIF ELSE nSplitPos := hb_At( ":", cMail, nPos ) @@ -412,7 +426,7 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail nPos := nLinePos + 2 nLinePos := hb_At( e"\r\n", cMail, nPos ) - //Prevents malformed body to affect us + // Prevents malformed body to affect us IF cBoundary != NIL .AND. hb_At( "--" + cBoundary, cMail, nPos ) == 1 RETURN 0 ENDIF @@ -454,7 +468,7 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail ENDIF // Have we met a section? - IF cSubBoundary != NIL .AND.; + IF cSubBoundary != NIL .AND. ; hb_At( "--" + cSubBoundary, cMail, nPos ) == nPos // is it the last subsection? @@ -470,8 +484,8 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail // Add our subsection oSubSection := TipMail():New() - nPos := oSubSection:FromString( cMail, cSubBoundary,; - nLinePos + 2 ) + nPos := oSubSection:FromString( cMail, cSubBoundary, ; + nLinePos + 2 ) IF nPos > 0 AAdd( ::aAttachments, oSubSection ) @@ -487,7 +501,7 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail Instead of testing every single line of mail until we find next boundary, if there is a boundary we jump to it immediatly, this saves thousands of EOL test and makes splitting of a string fast */ - nPos := iif( ! Empty( cSubBoundary ), hb_At("--" + cSubBoundary, cMail, nPos ), iif( ! Empty( cBoundary ), hb_At( "--" + cBoundary, cMail, nPos ), nLinePos + 2 ) ) + nPos := iif( ! Empty( cSubBoundary ), hb_At( "--" + cSubBoundary, cMail, nPos ), iif( ! Empty( cBoundary ), hb_At( "--" + cBoundary, cMail, nPos ), nLinePos + 2 ) ) ENDIF nLinePos := hb_At( e"\r\n", cMail, nPos ) @@ -501,6 +515,7 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail RETURN nPos METHOD MakeBoundary() CLASS TipMail + LOCAL cBound := "=_0" + Space( 17 ) LOCAL i @@ -508,12 +523,13 @@ METHOD MakeBoundary() CLASS TipMail cBound := Stuff( cBound, i, 1, Chr( hb_Random( 0, 25 ) + Asc( "A" ) ) ) NEXT - cBound += "_TIP_" + DToS( Date() ) +; - "_" + StrTran( Time(), ":" ) + cBound += "_TIP_" + DToS( Date() ) + ; + "_" + StrTran( Time(), ":" ) RETURN cBound METHOD setHeader( cSubject, cFrom, xTo, xCC, xBCC ) CLASS TipMail + LOCAL aTo, aCC, aBCC, i, imax LOCAL cTo, cCC, cBCC @@ -605,6 +621,7 @@ METHOD setHeader( cSubject, cFrom, xTo, xCC, xBCC ) CLASS TipMail RETURN .T. METHOD attachFile( cFileName ) CLASS TipMail + LOCAL cContent := hb_MemoRead( cFileName ) LOCAL cMimeType := TIP_FileMimetype( cFileName ) LOCAL cDelim := hb_ps() @@ -627,6 +644,7 @@ METHOD attachFile( cFileName ) CLASS TipMail RETURN ::attach( oAttach ) METHOD detachFile( cPath ) CLASS TipMail + LOCAL cContent := ::getBody() LOCAL cFileName := ::getFileName() LOCAL cDelim := hb_ps() @@ -654,9 +672,10 @@ METHOD getFileName() CLASS TipMail RETURN StrTran( ::getFieldOption( "Content-Type", "name" ), '"' ) METHOD isMultiPart() CLASS TipMail - RETURN "multipart/" $ Lower( ::GetFieldPart("Content-Type") ) + RETURN "multipart/" $ Lower( ::GetFieldPart( "Content-Type" ) ) METHOD getMultiParts( aParts ) CLASS TipMail + LOCAL oSubPart, lReset := .F. ::resetAttachment() @@ -680,6 +699,7 @@ METHOD getMultiParts( aParts ) CLASS TipMail RETURN aParts STATIC FUNCTION WordEncodeQ( cData, cCharset ) + LOCAL nPos LOCAL c LOCAL cString @@ -711,6 +731,7 @@ STATIC FUNCTION WordEncodeQ( cData, cCharset ) RETURN iif( lToEncode, cString + "?=", cData ) FUNCTION tip_GetRawEMail( cAddress ) + LOCAL tmp, tmp1 IF ( tmp := At( "<", cAddress ) ) > 0 @@ -722,6 +743,7 @@ FUNCTION tip_GetRawEMail( cAddress ) RETURN cAddress FUNCTION tip_GetNameEMail( cAddress ) + LOCAL tmp IF ( tmp := At( "<", cAddress ) ) > 0 diff --git a/harbour/contrib/hbtip/popcli.prg b/harbour/contrib/hbtip/popcli.prg index 9de05a88c5..91196186cb 100644 --- a/harbour/contrib/hbtip/popcli.prg +++ b/harbour/contrib/hbtip/popcli.prg @@ -95,6 +95,7 @@ METHOD New( oUrl, xTrace, oCredentials ) CLASS tIPClientPOP /** */ METHOD Open( cUrl ) CLASS tIPClientPOP + IF ! ::super:Open( cUrl ) RETURN .F. ENDIF @@ -113,9 +114,11 @@ METHOD Open( cUrl ) CLASS tIPClientPOP ENDIF ENDIF ENDIF + RETURN .F. METHOD OpenDigest( cUrl ) CLASS tIPClientPOP + LOCAL nPos, nPos2, cDigest IF ! ::super:Open( cUrl ) @@ -131,9 +134,9 @@ METHOD OpenDigest( cUrl ) CLASS tIPClientPOP IF nPos > 0 nPos2 := hb_At( ">", ::cReply, nPos + 1 ) IF nPos2 > nPos - cDigest := hb_md5( SubStr( ::cReply, nPos, ( nPos2 - nPos ) + 1 ) + ::oUrl:cPassword ) + cDigest := hb_MD5( SubStr( ::cReply, nPos, ( nPos2 - nPos ) + 1 ) + ::oUrl:cPassword ) ::InetSendall( ::SocketCon, "APOP " + ::oUrl:cUserid + " " ; - + cDigest + ::cCRLF ) + + cDigest + ::cCRLF ) IF ::GetOK() ::isOpen := .T. RETURN .T. @@ -141,6 +144,7 @@ METHOD OpenDigest( cUrl ) CLASS tIPClientPOP ENDIF ENDIF ENDIF + RETURN .F. METHOD Close( lAutoQuit ) CLASS tIPClientPOP @@ -160,10 +164,13 @@ METHOD Close( lAutoQuit ) CLASS tIPClientPOP /** */ METHOD Delete( nId ) CLASS tIPClientPOP + ::InetSendall( ::SocketCon, "DELE " + hb_ntos( nId ) + ::cCRLF ) + RETURN ::GetOk() METHOD List() CLASS tIPClientPOP + LOCAL nPos LOCAL cStr, cRet @@ -190,10 +197,13 @@ METHOD List() CLASS tIPClientPOP RETURN cRet METHOD Noop() CLASS tIPClientPOP + ::InetSendall( ::SocketCon, "NOOP" + ::cCRLF ) + RETURN ::GetOk() METHOD Retrieve( nId, nLen ) CLASS tIPClientPOP + LOCAL nPos LOCAL cRet, nRetLen, cBuffer, nRead LOCAL cEOM := ::cCRLF + "." + ::cCRLF // End Of Mail @@ -243,18 +253,25 @@ METHOD Retrieve( nId, nLen ) CLASS tIPClientPOP ENDIF // Remove byte-stuffed termination octet(s) if any + RETURN StrTran( cRet, ::cCRLF + "..", ::cCRLF + "." ) METHOD Rset() CLASS tIPClientPOP + ::InetSendall( ::SocketCon, "RSET" + ::cCRLF ) + RETURN ::GetOk() METHOD Stat() CLASS tIPClientPOP + LOCAL nRead + ::InetSendall( ::SocketCon, "STAT" + ::cCRLF ) + RETURN ::InetRecvLine( ::SocketCon, @nRead, 128 ) METHOD Top( nMsgId ) CLASS tIPClientPOP + LOCAL nPos LOCAL cStr, cRet @@ -280,10 +297,13 @@ METHOD Top( nMsgId ) CLASS tIPClientPOP RETURN cRet METHOD Quit() CLASS tIPClientPOP + ::InetSendall( ::SocketCon, "QUIT" + ::cCRLF ) + RETURN ::GetOk() METHOD UIDL( nMsgId ) CLASS tIPClientPOP + LOCAL nPos LOCAL cStr, cRet @@ -321,6 +341,7 @@ METHOD UIDL( nMsgId ) CLASS tIPClientPOP /** */ METHOD countMail() CLASS TIpClientPop + LOCAL cStat IF ::isOpen @@ -334,15 +355,18 @@ METHOD countMail() CLASS TIpClientPop RETURN -1 METHOD GetOk() CLASS tIPClientPOP + LOCAL nLen ::cReply := ::InetRecvLine( ::SocketCon, @nLen, 128 ) IF ::InetErrorCode( ::SocketCon ) != 0 .OR. !( Left( ::cReply, 1 ) == "+" ) RETURN .F. ENDIF + RETURN .T. METHOD Read( nLen ) CLASS tIPClientPOP + /** Set what to read for */ IF Empty( ::oUrl:cFile ) RETURN ::List() @@ -359,6 +383,7 @@ METHOD Read( nLen ) CLASS tIPClientPOP RETURN ::Retrieve( Val( ::oUrl:cFile ), nLen ) METHOD retrieveAll( lDelete ) + LOCAL aMails, i, imax, cMail IF ! HB_ISLOGICAL( lDelete ) diff --git a/harbour/contrib/hbtip/sendmail.prg b/harbour/contrib/hbtip/sendmail.prg index 03b784303e..88060f844e 100644 --- a/harbour/contrib/hbtip/sendmail.prg +++ b/harbour/contrib/hbtip/sendmail.prg @@ -54,9 +54,9 @@ #translate ( <exp1> LIKE <exp2> ) => ( hb_regexLike( (<exp2>), (<exp1>) ) ) FUNCTION hb_SendMail( cServer, nPort, cFrom, xTo, xCC, xBCC, cBody, cSubject, ; - aFiles, cUser, cPass, cPopServer, nPriority, lRead, ; - xTrace, lPopAuth, lNoAuth, nTimeOut, cReplyTo, ; - lTLS, cSMTPPass, cCharset, cEncoding, cClientHost ) + aFiles, cUser, cPass, cPopServer, nPriority, lRead, ; + xTrace, lPopAuth, lNoAuth, nTimeOut, cReplyTo, ; + lTLS, cSMTPPass, cCharset, cEncoding, cClientHost ) /* cServer -> Required. IP or domain name of the mail server nPort -> Optional. Port used my email server @@ -328,9 +328,9 @@ FUNCTION hb_SendMail( cServer, nPort, cFrom, xTo, xCC, xBCC, cBody, cSubject, ; RETURN lReturn FUNCTION hb_MailAssemble( cFrom, xTo, xCC, cBody, cSubject, ; - aFiles, nPriority, lRead, ; - cReplyTo, ; - cCharset, cEncoding ) + aFiles, nPriority, lRead, ; + cReplyTo, ; + cCharset, cEncoding ) /* cFrom -> Required. Email address of the sender xTo -> Required. Character string or array of email addresses to send the email to diff --git a/harbour/contrib/hbtip/sessid.prg b/harbour/contrib/hbtip/sessid.prg index c0d10facc1..512ae4df07 100644 --- a/harbour/contrib/hbtip/sessid.prg +++ b/harbour/contrib/hbtip/sessid.prg @@ -109,7 +109,7 @@ FUNCTION TIP_CHECKSID( cSID, cCRCKey ) /* Calculate the key */ FOR n := 1 TO nLenSID - nRand := At( SubStr( cSID, n, 1), cBaseKeys ) + nRand := At( SubStr( cSID, n, 1 ), cBaseKeys ) nKey += nRand NEXT @@ -124,6 +124,7 @@ FUNCTION TIP_CHECKSID( cSID, cCRCKey ) RETURN Right( cSID, 5 ) == cSIDCRC FUNCTION TIP_DATETOGMT( dDate, cTime ) + LOCAL cStr LOCAL cOldDateFormat := Set( _SET_DATEFORMAT, "dd-mm-yy" ) LOCAL nDay, nMonth, nYear, nDoW @@ -135,11 +136,11 @@ FUNCTION TIP_DATETOGMT( dDate, cTime ) nDay := Day( dDate ) nMonth := Month( dDate ) - nYear := Year( dDate) - nDoW := Dow( dDate ) + nYear := Year( dDate ) + nDoW := DoW( dDate ) cStr := aDays[ nDow ] + ", " + StrZero( nDay, 2 ) + "-" + aMonths[ nMonth ] + "-" + ; - Right( StrZero( nYear, 4 ), 2 ) + " " + cTime + " GMT" + Right( StrZero( nYear, 4 ), 2 ) + " " + cTime + " GMT" Set( _SET_DATEFORMAT, cOldDateFormat ) diff --git a/harbour/contrib/hbtip/smtpcli.prg b/harbour/contrib/hbtip/smtpcli.prg index c25eec7871..d5ded8074d 100644 --- a/harbour/contrib/hbtip/smtpcli.prg +++ b/harbour/contrib/hbtip/smtpcli.prg @@ -157,33 +157,45 @@ METHOD GetOk() CLASS tIPClientSMTP RETURN .T. METHOD Close() CLASS tIPClientSMTP + ::InetTimeOut( ::SocketCon ) ::Quit() + RETURN ::super:Close() METHOD Commit() CLASS tIPClientSMTP + ::InetSendall( ::SocketCon, ::cCRLF + "." + ::cCRLF ) + RETURN ::GetOk() METHOD Quit() CLASS tIPClientSMTP + ::InetSendall( ::SocketCon, "QUIT" + ::cCRLF ) ::isAuth := .F. + RETURN ::GetOk() METHOD Mail( cFrom ) CLASS tIPClientSMTP + ::InetSendall( ::SocketCon, "MAIL FROM: <" + cFrom + ">" + ::cCRLF ) + RETURN ::GetOk() METHOD Rcpt( cTo ) CLASS tIPClientSMTP + ::InetSendall( ::SocketCon, "RCPT TO: <" + cTo + ">" + ::cCRLF ) + RETURN ::GetOk() METHOD Data( cData ) CLASS tIPClientSMTP + ::InetSendall( ::SocketCon, "DATA" + ::cCRLF ) IF ! ::GetOk() RETURN .F. ENDIF - ::InetSendall(::SocketCon, cData + ::cCRLF + "." + ::cCRLF ) + ::InetSendall( ::SocketCon, cData + ::cCRLF + "." + ::cCRLF ) + RETURN ::GetOk() METHOD Auth( cUser, cPass ) CLASS tIPClientSMTP @@ -208,6 +220,7 @@ METHOD AuthPlain( cUser, cPass ) CLASS tIPClientSMTP RETURN ::isAuth := ::GetOk() METHOD Write( cData, nLen, bCommit ) CLASS tIPClientSMTP + LOCAL cRcpt IF ! ::bInitialized @@ -259,6 +272,7 @@ METHOD ServerSuportSecure( /* @ */ lAuthPlain, /* @ */ lAuthLogin ) CLASS tIPCli RETURN lAuthLogin .OR. lAuthPlain METHOD SendMail( oTIpMail ) CLASS TIpClientSmtp + LOCAL cTo IF ! ::isOpen diff --git a/harbour/contrib/hbtip/tests/base64.prg b/harbour/contrib/hbtip/tests/base64.prg index 7e1be7496a..b9a7f83899 100644 --- a/harbour/contrib/hbtip/tests/base64.prg +++ b/harbour/contrib/hbtip/tests/base64.prg @@ -48,7 +48,7 @@ PROCEDURE Main( ... ) CASE cData == '-u' lUrl := .T. - OTHERWISE + OTHERWISE IF hb_FileExists( cData ) .AND. hInput == hSTDIN hInput := FOpen( cData ) ELSEIF hOutput == hSTDOUT diff --git a/harbour/contrib/hbtip/tests/dbtohtml.prg b/harbour/contrib/hbtip/tests/dbtohtml.prg index 766035e22e..3793193120 100644 --- a/harbour/contrib/hbtip/tests/dbtohtml.prg +++ b/harbour/contrib/hbtip/tests/dbtohtml.prg @@ -112,7 +112,6 @@ PROCEDURE Main WAIT ? HtmlToOem( oDoc:body:getText() ) - /* DllCall( "shell32.dll", NIL, "ShellExecute", 0, "open", "address.html", NIL, "", 1 ) */ hb_run( "address.html" ) RETURN diff --git a/harbour/contrib/hbtip/tests/dnldftp.prg b/harbour/contrib/hbtip/tests/dnldftp.prg index 1b486e3c80..860dc0c2b4 100644 --- a/harbour/contrib/hbtip/tests/dnldftp.prg +++ b/harbour/contrib/hbtip/tests/dnldftp.prg @@ -70,10 +70,10 @@ STATIC FUNCTION TRP20FTPEnv( cCarpeta ) cStr := "Could not connect to FTP server " + oURL:cServer IF oFTP:SocketCon == NIL cStr += hb_eol() + "Connection not initialized" - ELSEIF hb_InetErrorCode( oFTP:SocketCon ) == 0 + ELSEIF hb_inetErrorCode( oFTP:SocketCon ) == 0 cStr += hb_eol() + "Server response:" + " " + oFTP:cReply ELSE - cStr += hb_eol() + "Error in connection:" + " " + hb_InetErrorDesc( oFTP:SocketCon ) + cStr += hb_eol() + "Error in connection:" + " " + hb_inetErrorDesc( oFTP:SocketCon ) ENDIF ? cStr lRetVal := .F. diff --git a/harbour/contrib/hbtip/tests/ftpadv.prg b/harbour/contrib/hbtip/tests/ftpadv.prg index 236330f521..19b959dce3 100644 --- a/harbour/contrib/hbtip/tests/ftpadv.prg +++ b/harbour/contrib/hbtip/tests/ftpadv.prg @@ -49,10 +49,10 @@ PROCEDURE Main( cUrl ) ? "Can't connect with", oUrl:cServer IF oCon:SocketCon == NIL ? "Connection not initiated" - ELSEIF hb_InetErrorCode( oCon:SocketCon ) == 0 + ELSEIF hb_inetErrorCode( oCon:SocketCon ) == 0 ? "Server sayed:", oCon:cReply ELSE - ? "Error in connection:", hb_InetErrorDesc( oCon:SocketCon ) + ? "Error in connection:", hb_inetErrorDesc( oCon:SocketCon ) ENDIF ENDIF diff --git a/harbour/contrib/hbtip/tests/gmail.prg b/harbour/contrib/hbtip/tests/gmail.prg index c8d9f86807..0ad5ae47d4 100644 --- a/harbour/contrib/hbtip/tests/gmail.prg +++ b/harbour/contrib/hbtip/tests/gmail.prg @@ -17,25 +17,26 @@ PROCEDURE Main( cFrom, cPassword, cTo ) hb_default( @cPassword, "<mypassword>" ) hb_default( @cTo , "addressee@domain.com" ) - ? hb_SendMail( "smtp.gmail.com",; - 465,; - cFrom,; - cTo,; - NIL /* CC */,; - {} /* BCC */,; - "test: body",; - "test: subject",; - NIL /* attachment */,; - cFrom,; - cPassword,; - "",; - NIL /* nPriority */,; - NIL /* lRead */,; - .T. /* lTrace */,; - .F.,; - NIL /* lNoAuth */,; - NIL /* nTimeOut */,; - NIL /* cReplyTo */,; - .T. ) + ? hb_SendMail( ; + "smtp.gmail.com", ; + 465, ; + cFrom, ; + cTo, ; + NIL /* CC */, ; + {} /* BCC */, ; + "test: body", ; + "test: subject", ; + NIL /* attachment */, ; + cFrom, ; + cPassword, ; + "", ; + NIL /* nPriority */, ; + NIL /* lRead */, ; + .T. /* lTrace */, ; + .F., ; + NIL /* lNoAuth */, ; + NIL /* nTimeOut */, ; + NIL /* cReplyTo */, ; + .T. ) RETURN diff --git a/harbour/contrib/hbtip/tests/httpadv.prg b/harbour/contrib/hbtip/tests/httpadv.prg index 5f5bc8a30d..b0d0256004 100644 --- a/harbour/contrib/hbtip/tests/httpadv.prg +++ b/harbour/contrib/hbtip/tests/httpadv.prg @@ -48,10 +48,10 @@ PROCEDURE Main( cUrl ) ? "Can't connect with", oUrl:cServer IF oCon:SocketCon == NIL ? "Connection not initiated" - ELSEIF hb_InetErrorCode( oCon:SocketCon ) == 0 + ELSEIF hb_inetErrorCode( oCon:SocketCon ) == 0 ? "Server sayed:", oCon:cReply ELSE - ? "Error in connection:", hb_InetErrorDesc( oCon:SocketCon ) + ? "Error in connection:", hb_inetErrorDesc( oCon:SocketCon ) ENDIF ENDIF diff --git a/harbour/contrib/hbtip/tests/loadhtml.prg b/harbour/contrib/hbtip/tests/loadhtml.prg index 4c41c20191..2931ad4d98 100644 --- a/harbour/contrib/hbtip/tests/loadhtml.prg +++ b/harbour/contrib/hbtip/tests/loadhtml.prg @@ -12,15 +12,15 @@ PROCEDURE Main LOCAL oHttp, cHtml, hQuery, aLink, oNode, oDoc - oHttp := TIpClientHttp():new( "http://www.google.de/search" ) + oHttp := TIpClientHttp():new( "http://www.google.com/search" ) /* build the Google query */ hQUery := { => } - hb_hSetCaseMatch( hQuery, .F. ) + hb_HSetCaseMatch( hQuery, .F. ) - hQuery["q"] := "Harbour" - hQuery["hl"] := "en" - hQuery["btnG"] := "Google+Search" + hQuery[ "q" ] := "Harbour" + hQuery[ "hl" ] := "en" + hQuery[ "btnG" ] := "Google+Search" /* add query data to the TUrl object */ oHttp:oUrl:addGetForm( hQuery ) @@ -38,7 +38,7 @@ PROCEDURE Main oDoc := THtmlDocument():new( cHtml ) - oDoc:writeFile( "Google.html" ) + oDoc:writeFile( "google.html" ) /* ":a" retrieves the first <a href="url"> text </a> tag */ oNode := oDoc:body:a diff --git a/harbour/contrib/hbtip/tests/tipmmail.prg b/harbour/contrib/hbtip/tests/tipmmail.prg index a426fc6007..efcaeba68b 100644 --- a/harbour/contrib/hbtip/tests/tipmmail.prg +++ b/harbour/contrib/hbtip/tests/tipmmail.prg @@ -38,8 +38,8 @@ PROCEDURE Main( ... ) ENDIF oMail := TipMail( "This is the body of the mail" ) - oMail:hHeaders[ "Content-Type" ] := "text/plain; charset=iso8851" - oMail:hHeaders[ "Date" ] := Tip_Timestamp() + oMail:hHeaders[ "Content-Type" ] := "text/plain; charset=utf-8" + oMail:hHeaders[ "Date" ] := Tip_Timestamp() i := 1 DO WHILE i < PCount() @@ -51,31 +51,31 @@ PROCEDURE Main( ... ) ENDIF IF Lower( cData ) == "-f" - i ++ + i++ cData := hb_PValue( i ) IF cData != NIL - oMail:hHeaders[ "From" ] := cData + oMail:hHeaders[ "From" ] := hb_StrToUTF8( cData ) ENDIF ELSEIF Lower( cData ) == "-t" - i ++ + i++ cData := hb_PValue( i ) IF cData != NIL - oMail:hHeaders[ "To" ] := cData + oMail:hHeaders[ "To" ] := hb_StrToUTF8( cData ) ENDIF ELSEIF Lower( cData ) == "-s" - i ++ + i++ cData := hb_PValue( i ) IF cData != NIL - oMail:hHeaders[ "Subject" ] := cData + oMail:hHeaders[ "Subject" ] := hb_StrToUTF8( cData ) ENDIF ELSEIF Lower( cData ) == "-b" - i ++ + i++ cData := hb_PValue( i ) IF cData != NIL - oMail:SetBody( cData + e"\r\n" ) + oMail:SetBody( hb_StrToUTF8( cData ) + e"\r\n" ) ENDIF ELSEIF Lower( cData ) == "-m" - i ++ + i++ cData := hb_PValue( i ) IF cData != NIL cData := MemoRead( cData ) @@ -94,8 +94,8 @@ PROCEDURE Main( ... ) oAttach := TipMail():New() oAttach:SetEncoder( "base64" ) - //TODO: mime type magic auto-finder - HB_FNameSplit( hb_PValue( i ), , @cFname, @cFext ) + // TODO: mime type magic auto-finder + hb_FNameSplit( hb_PValue( i ), , @cFname, @cFext ) // Some EMAIL readers use Content-Type to check for filename oAttach:hHeaders[ "Content-Type" ] := ; "application/X-TIP-Attachment; filename="; @@ -108,7 +108,7 @@ PROCEDURE Main( ... ) oMail:Attach( oAttach ) ENDIF - i ++ + i++ ENDDO /* Writing stream */ diff --git a/harbour/contrib/hbtip/tests/tiptest.prg b/harbour/contrib/hbtip/tests/tiptest.prg index 2ebc584eec..27fa2221ac 100644 --- a/harbour/contrib/hbtip/tests/tiptest.prg +++ b/harbour/contrib/hbtip/tests/tiptest.prg @@ -57,7 +57,7 @@ PROCEDURE Main( cUrl, cFile ) LOCAL oUrl, oClient LOCAL cData - SET COLOR TO w+/b + SetColor( "w+/b" ) CLS @ 1, 6 SAY "X H A R B O U R - TIP (class based internet client protocol) test" diff --git a/harbour/contrib/hbtip/tests/upld_ftp.prg b/harbour/contrib/hbtip/tests/upld_ftp.prg index 3ed2173421..bb2e2589c2 100644 --- a/harbour/contrib/hbtip/tests/upld_ftp.prg +++ b/harbour/contrib/hbtip/tests/upld_ftp.prg @@ -73,10 +73,10 @@ STATIC FUNCTION TRP20FTPEnv( cCarpeta ) cStr := "Could not connect to FTP server " + oURL:cServer IF oFTP:SocketCon == NIL cStr += hb_eol() + "Connection not initialized" - ELSEIF hb_InetErrorCode( oFTP:SocketCon ) == 0 + ELSEIF hb_inetErrorCode( oFTP:SocketCon ) == 0 cStr += hb_eol() + "Server response:" + " " + oFTP:cReply ELSE - cStr += hb_eol() + "Error in connection:" + " " + hb_InetErrorDesc( oFTP:SocketCon ) + cStr += hb_eol() + "Error in connection:" + " " + hb_inetErrorDesc( oFTP:SocketCon ) ENDIF ? cStr lRetVal := .F. diff --git a/harbour/contrib/hbtip/thtml.prg b/harbour/contrib/hbtip/thtml.prg index d04e80a4a3..26d0e6f8af 100644 --- a/harbour/contrib/hbtip/thtml.prg +++ b/harbour/contrib/hbtip/thtml.prg @@ -250,18 +250,13 @@ METHOD readFile( cFileName ) CLASS THtmlDocument METHOD writeFile( cFileName ) CLASS THtmlDocument - LOCAL cHtml := ::toString() - LOCAL nFileHandle := FCreate( cFileName ) + LOCAL lSuccess := hb_MemoWrit( cFileName, ::toString() ) - IF FError() != 0 - RETURN .F. + IF lSuccess + ::changed := .F. ENDIF - FWrite( nFileHandle, cHtml ) - FClose( nFileHandle ) - ::changed := .F. - - RETURN FError() == 0 + RETURN lSuccess // builds a one dimensional array of all nodes contained in the HTML document @@ -579,7 +574,7 @@ CREATE CLASS THtmlNode MODULE FRIENDLY ACCESS isInline() ACCESS isOptional() ACCESS isNode() - ACCESS HB_ISBLOCK() + ACCESS isBlock() METHOD addNode( oTHtmlNode ) METHOD insertAfter( oTHtmlNode ) @@ -714,7 +709,7 @@ METHOD isNode() CLASS THtmlNode // checks if this is a block node that must be closed with an ending tag: eg: <table></table>, <ul></ul> -METHOD HB_ISBLOCK() CLASS THtmlNode +METHOD isBlock() CLASS THtmlNode RETURN hb_bitAnd( ::htmlTagType[ 2 ], CM_BLOCK ) > 0 @@ -764,7 +759,7 @@ METHOD parseHtml( parser ) CLASS THtmlNode ELSEIF Chr( 10 ) $ cText cText := RTrim( cText ) nPos := Len( cText ) + 1 - DO WHILE nPos > 0 .AND. SubStr( cText, -- nPos, 1 ) $ Chr( 9 ) + Chr( 10 ) + Chr( 13 ) + DO WHILE nPos > 0 .AND. SubStr( cText, --nPos, 1 ) $ Chr( 9 ) + Chr( 10 ) + Chr( 13 ) ENDDO oThisTag:addNode( THtmlNode():new( oThisTag, "_text_", , Left( cText, nPos ) ) ) ELSE @@ -812,7 +807,7 @@ METHOD parseHtml( parser ) CLASS THtmlNode lRewind := .T. EXIT - OTHERWISE + OTHERWISE IF oThisTag:isOptional() // this tag has no closing tag @@ -822,7 +817,7 @@ METHOD parseHtml( parser ) CLASS THtmlNode // the next tag is the same like this tag // ( e.g. <p>|<tr>|<td>|<li>) lRewind := .T. - CASE ( Lower( cTagName ) == Lower( oThisTag:parent:htmlTagName ) ) .AND. ! oThisTag:isType( CM_LIST ) + CASE Lower( cTagName ) == Lower( oThisTag:parent:htmlTagName ) .AND. ! oThisTag:isType( CM_LIST ) // the next tag is the same like the parent tag // ( e.g. this is <td> and the next tag is <tr> ) lRewind := .T. @@ -911,8 +906,8 @@ METHOD parseHtmlFixed( parser ) CLASS THtmlNode ENDIF // back to "<" - DO WHILE !( P_PREV( parser ) == "<" ) - ENDDO /* NOTE: != changed to !( == ) */ + DO WHILE !( P_PREV( parser ) == "<" ) /* NOTE: != changed to !( == ) */ + ENDDO nEnd := parser:p_pos ::addNode( THtmlNode():new( Self, "_text_", , SubStr( parser:p_Str, nStart, nEnd - nStart ) ) ) @@ -1513,7 +1508,7 @@ METHOD noAttribute( cName, aValue ) CLASS THtmlNode ELSEIF Right( cName, 1 ) == "s" .AND. hb_HHasKey( t_hTagTypes, Left( cName, Len( cName ) - 1 ) ) // message is the plural of a html tag -> oNode:forms -> Array of <FORM> tags - RETURN ::findNodesByTagName( Left( cName, Len( cName ) - 1 ), Atail( aValue ) ) + RETURN ::findNodesByTagName( Left( cName, Len( cName ) - 1 ), ATail( aValue ) ) ENDIF IF ! Empty( aValue ) @@ -1606,7 +1601,7 @@ METHOD pushNode( cTagName ) CLASS THtmlNode ENDIF IF ! hb_HHasKey( t_hTagTypes, cName ) - IF Left( cName, 1 ) == "/" .AND. hb_HHasKey( t_hTagTypes, SubStr( cName,2 ) ) + IF Left( cName, 1 ) == "/" .AND. hb_HHasKey( t_hTagTypes, SubStr( cName, 2 ) ) IF ! Lower( SubStr( cName, 2 ) ) == Lower( ::htmlTagName ) RETURN ::error( "Not a valid closing HTML tag for: <" + ::htmlTagName + ">", ::className(), "-", EG_ARG, { cName } ) ENDIF @@ -1650,7 +1645,7 @@ METHOD popNode( cName ) CLASS THtmlNode */ IF AScan( { "tr", "th", "td" }, cName ) > 0 endTag := "</" + cName + ">" - IF !Right( ::toString(), 3 + Len( cName ) ) == endTag + IF ! Right( ::toString(), 3 + Len( cName ) ) == endTag ::addNode( THtmlNode():new( Self, "/" + cName, , ) ) ENDIF ENDIF @@ -4544,7 +4539,7 @@ FUNCTION HtmlToAnsi( cHtmlText ) FUNCTION HtmlToOem( cHtmlText ) - RETURN hb_AnsiToOem( HtmlToAnsi( cHtmlText ) ) + RETURN hb_ANSIToOEM( HtmlToAnsi( cHtmlText ) ) // Inserts HTML character entities into an ANSI text string @@ -4615,7 +4610,7 @@ FUNCTION AnsiToHtml( cAnsiText ) FUNCTION OemToHtml( cOemText ) - RETURN AnsiToHtml( hb_OemToAnsi( cOemText ) ) + RETURN AnsiToHtml( hb_OEMToANSI( cOemText ) ) // This function returs the HTML character entities that are exchangeable between ANSI and OEM character sets diff --git a/harbour/contrib/hbtip/url.prg b/harbour/contrib/hbtip/url.prg index 2fbcdf7587..a216348aa5 100644 --- a/harbour/contrib/hbtip/url.prg +++ b/harbour/contrib/hbtip/url.prg @@ -64,6 +64,7 @@ */ CREATE CLASS tURL + VAR cAddress VAR cProto VAR cServer @@ -77,23 +78,26 @@ CREATE CLASS tURL METHOD New( cUrl ) METHOD SetAddress( cUrl ) METHOD BuildAddress() - METHOD BuildQuery( ) + METHOD BuildQuery() METHOD AddGetForm( xPostData ) HIDDEN: - CLASS VAR cREuri INIT hb_regexComp("(?:(.*)://)?([^?/]*)(/[^?]*)?\??(.*)") - CLASS VAR cREServ INIT hb_regexComp("(?:([^:@]*):?([^@:]*)@|)([^:]+):?(.*)") - CLASS VAR cREFile INIT hb_regexComp("^((?:/.*/)|/)*(.*)$") + CLASS VAR cREuri INIT hb_regexComp( "(?:(.*)://)?([^?/]*)(/[^?]*)?\??(.*)" ) + CLASS VAR cREServ INIT hb_regexComp( "(?:([^:@]*):?([^@:]*)@|)([^:]+):?(.*)" ) + CLASS VAR cREFile INIT hb_regexComp( "^((?:/.*/)|/)*(.*)$" ) ENDCLASS METHOD New( cUrl ) CLASS tURL + ::SetAddress( cUrl ) + RETURN Self METHOD SetAddress( cUrl ) CLASS tURL + LOCAL aMatch, cServer, cPath ::cAddress := cUrl @@ -142,6 +146,7 @@ METHOD SetAddress( cUrl ) CLASS tURL METHOD BuildAddress() CLASS tURL + LOCAL cRet := "" IF ::cProto != NIL @@ -185,6 +190,7 @@ METHOD BuildAddress() CLASS tURL RETURN cRet METHOD BuildQuery() CLASS tURL + LOCAL cLine IF Len( ::cPath ) == 0 .OR. !( Right( ::cPath, 1 ) == "/" ) @@ -199,6 +205,7 @@ METHOD BuildQuery() CLASS tURL RETURN cLine METHOD AddGetForm( xPostData ) + LOCAL cData := "" LOCAL nI LOCAL y diff --git a/harbour/contrib/hbtpathy/telepath.prg b/harbour/contrib/hbtpathy/telepath.prg index 7d47c0f72c..f9b7cc3c75 100644 --- a/harbour/contrib/hbtpathy/telepath.prg +++ b/harbour/contrib/hbtpathy/telepath.prg @@ -102,12 +102,14 @@ FUNCTION tp_baud( nPort, nNewBaud ) FUNCTION tp_inkey( ... ) - RETURN inkey( ... ) + RETURN Inkey( ... ) FUNCTION tp_idle( lNewval ) + IF lNewval != NIL .AND. lNewval RETURN .T. ENDIF + RETURN .F. PROCEDURE tp_delay( nTime ) @@ -233,8 +235,8 @@ FUNCTION tp_recv( nPort, nLength, nTimeout ) nDone := Seconds() + iif( nTimeout >= 0, nTimeout, 0 ) - DO WHILE Len( t_aPorts[ nPort, TPFP_INBUF ] ) < nLength .AND.; - ( nTimeout < 0 .OR. Seconds() < nDone ) + DO WHILE Len( t_aPorts[ nPort, TPFP_INBUF ] ) < nLength .AND. ; + ( nTimeout < 0 .OR. Seconds() < nDone ) IF ! tp_idle() FetchChars( nPort ) @@ -419,18 +421,17 @@ PROCEDURE tp_clrkbd() FUNCTION tp_crc16( cString ) - RETURN hb_byteSwapW( hb_crcct( cString ) ) /* swap lo and hi bytes */ + RETURN hb_ByteSwapW( hb_CRCCT( cString ) ) /* swap lo and hi bytes */ FUNCTION tp_crc32( cString ) - RETURN hb_crc32( cString ) + RETURN hb_CRC32( cString ) -/* nPort, nTimeout, acList|cString..., lIgnorecase */ -FUNCTION tp_waitfor( ... ) +FUNCTION tp_waitfor( ... ) /* nPort, nTimeout, acList|cString..., lIgnorecase */ LOCAL aParam := hb_AParams() - LOCAL nPort//, nTimeout, lIgnorecase + LOCAL nPort // , nTimeout, lIgnorecase nPort := aParam[ 1 ] // nTimeout := aParam[ 2 ] @@ -443,7 +444,7 @@ FUNCTION tp_waitfor( ... ) // hb_default( @nTimeout, -1 ) // hb_default( @lIgnorecase, .F. ) - /* +#if 0 IF ntimeout < 0 nDone := _clock() + 999999 @@ -484,16 +485,17 @@ FUNCTION tp_waitfor( ... ) ENDDO IF nFirst < 64000 - tp_recv( nPort, nAt + Len( acList[ nRet ] )) + tp_recv( nPort, nAt + Len( acList[ nRet ] ) ) RETURN nRet ENDIF - */ +#endif RETURN 0 /* We cannot set, well, _I_ think we cannot, CTS without setting RTS flowcontrol, so this function and tp_ctrlrts() do the same thing, that is set/reset CRTSCTS flowcontol */ FUNCTION tp_ctrlcts( nPort, nNewCtrl ) + LOCAL nCurValue LOCAL nFlag @@ -528,6 +530,7 @@ FUNCTION tp_ctrlrts( nPort, nNewCtrl ) // sets to 0 = dtr off, 1 dtr on, 2 = dtr flow control autotoggle // I don't support 2. who uses dtr for flow control anyway... FUNCTION tp_ctrldtr( nPort, nNewCtrl ) + LOCAL nCurValue LOCAL nFlag @@ -552,6 +555,7 @@ FUNCTION tp_ctrldtr( nPort, nNewCtrl ) RETURN nCurValue FUNCTION tp_isdcd( nPort ) + LOCAL nValue IF ! isopenport( nPort ) @@ -563,6 +567,7 @@ FUNCTION tp_isdcd( nPort ) RETURN hb_bitAnd( nValue, HB_COM_MSR_DCD ) != 0 FUNCTION tp_isri( nPort ) + LOCAL nValue IF ! isopenport( nPort ) @@ -574,6 +579,7 @@ FUNCTION tp_isri( nPort ) RETURN hb_bitAnd( nValue, HB_COM_MSR_RI ) != 0 FUNCTION tp_isdsr( nPort ) + LOCAL nValue IF ! isopenport( nPort ) @@ -585,6 +591,7 @@ FUNCTION tp_isdsr( nPort ) RETURN hb_bitAnd( nValue, HB_COM_MSR_DSR ) != 0 FUNCTION tp_iscts( nPort ) + LOCAL nValue IF ! isopenport( nPort ) @@ -613,26 +620,26 @@ FUNCTION tp_flush( nPort, nTimeout ) DO WHILE tp_OutFree( nPort ) > 0 .AND. ; ( nTimeout < 0 .OR. Seconds() < nDone ) - hb_IdleState() + hb_idleState() ENDDO RETURN iif( tp_OutFree( nPort ) > 0, TE_TMOUT, 0 ) -/* +#if 0 -/// sorry, but ctrldsr and ctrlcts will act like isdsr and iscts... if you want -/// flow control, talk to the system. +// / sorry, but ctrldsr and ctrlcts will act like isdsr and iscts... if you want +// / flow control, talk to the system. FUNCTION tp_ctrldsr( nPort ) RETURN tp_isdsr( nPort ) -/// you can't do these things. try rc.serial -FUNCTION tp_shared +// / you can't do these things. try rc.serial +FUNCTION tp_shared() RETURN 0 -FUNCTION tp_setport +FUNCTION tp_setport() RETURN 0 -*/ +#endif // internal (static) functions --------------------------------------------------- @@ -674,63 +681,67 @@ INIT PROCEDURE _tpinit() IF t_aPorts == NIL t_aPorts := Array( TP_MAXPORTS ) FOR x := 1 TO Len( t_aPorts ) - /// port name, file handle, baud, data bits, parity, stop bits, Open?, input buffer, input buff.size + // / port name, file handle, baud, data bits, parity, stop bits, Open?, input buffer, input buff.size t_aPorts[ x ] := { "", -1, 1200, 8, "N", 1, .F., "", 0 } NEXT ENDIF RETURN -/* -/// you can uncomment the following section for compatability with TP code... I figured -/// you'd probably want them commented so it won't compile so that you would see where -/// you have potential incomplete port problems -///FUNCTION tp_mstat -/// RETURN "" -/// -///FUNCTION tp_szmodem -/// RETURN 0 -/// -///FUNCTION tp_noteoff -/// RETURN 0 -/// -///FUNCTION tp_ontime -/// RETURN 0 -/// -///FUNCTION tp_rzmodem -/// RETURN 0 -/// -///FUNCTION tp_error -/// RETURN 0 -/// -///FUNCTION tp_errmsg -/// RETURN "" -/// -///FUNCTION tp_fifo -/// RETURN 0 -/// -/// -///FUNCTION tp_outchrs -/// RETURN 0 -/// -///FUNCTION tp_keybd -/// RETURN 0 -/// +#if 0 -/// tp_debug is not a real TP function. I included it so you can define your own debug -/// output function. -/// the point of the first parameter is a "debug level". I keep a system variable for how -/// much debuggning output is wanted and if the tp_debug parameter is a LOWER number than -/// the global debug level I print the message. Since I don't have your system globals, -/// I will ignore the first parameter and always print it. -/// I recommend you modify this function to suit your own debugging needs +// you can uncomment the following section for compatability with TP code... I figured +// you'd probably want them commented so it won't compile so that you would see where +// you have potential incomplete port problems +FUNCTION tp_mstat() + RETURN "" + +FUNCTION tp_szmodem() + RETURN 0 + +FUNCTION tp_noteoff() + RETURN 0 + +FUNCTION tp_ontime() + RETURN 0 + +FUNCTION tp_rzmodem() + RETURN 0 + +FUNCTION tp_error() + RETURN 0 + +FUNCTION tp_errmsg() + RETURN "" + +FUNCTION tp_fifo() + RETURN 0 + +FUNCTION tp_outchrs() + RETURN 0 + +FUNCTION tp_keybd() + RETURN 0 + +// / tp_debug is not a real TP function. I included it so you can define your own debug +// / output function. +// / the point of the first parameter is a "debug level". I keep a system variable for how +// / much debuggning output is wanted and if the tp_debug parameter is a LOWER number than +// / the global debug level I print the message. Since I don't have your system globals, +// / I will ignore the first parameter and always print it. +// / I recommend you modify this function to suit your own debugging needs FUNCTION tp_debug( nDebugLevel, cString ) + ? cString + RETURN NIL -*/ + +#endif PROCEDURE tp_uninstall() + /* NOTE: dummy function, solely for compatibility. */ + RETURN STATIC FUNCTION __TP_INFREE() @@ -740,13 +751,13 @@ STATIC FUNCTION __TP_OUTFREE() RETURN -1 FUNCTION BIN_AND( ... ) - RETURN HB_BITAND( ... ) + RETURN hb_bitAnd( ... ) FUNCTION BIN_OR( ... ) - RETURN HB_BITOR( ... ) + RETURN hb_bitOr( ... ) FUNCTION BIN_XOR( ... ) - RETURN HB_BITXOR( ... ) + RETURN hb_bitXor( ... ) FUNCTION BIN_NOT( ... ) - RETURN HB_BITNOT( ... ) + RETURN hb_bitNot( ... ) diff --git a/harbour/contrib/hbtpathy/tests/testtp.prg b/harbour/contrib/hbtpathy/tests/testtp.prg index c2296af103..3f5b978853 100644 --- a/harbour/contrib/hbtpathy/tests/testtp.prg +++ b/harbour/contrib/hbtpathy/tests/testtp.prg @@ -69,10 +69,12 @@ #require "hbtpathy" PROCEDURE Main() + ? tp_open( 1,,, 9600, 8, "N", 1 ) tp_send( 1, "Hi there Bob", 1 ) // One second timeout tp_inkey( .5 ) ? tp_recv( 1 ) ? tp_Close( 1 ) + RETURN diff --git a/harbour/contrib/hbunix/tests/testpid.prg b/harbour/contrib/hbunix/tests/testpid.prg index c46454e1e1..0ca0ce8d92 100644 --- a/harbour/contrib/hbunix/tests/testpid.prg +++ b/harbour/contrib/hbunix/tests/testpid.prg @@ -16,6 +16,6 @@ PROCEDURE Main() - ? posix_getpid() + ? posix_getpid() - RETURN + RETURN diff --git a/harbour/contrib/hbwin/axfunc.prg b/harbour/contrib/hbwin/axfunc.prg index 20c845332e..f51337ad18 100644 --- a/harbour/contrib/hbwin/axfunc.prg +++ b/harbour/contrib/hbwin/axfunc.prg @@ -51,6 +51,7 @@ */ FUNCTION WIN_AxGetControl( hWnd, bHandler, cID ) + LOCAL oAx := WIN_OleAuto() oAx:__hObj := __AxGetControl( hWnd ) diff --git a/harbour/contrib/hbwin/oleauto.prg b/harbour/contrib/hbwin/oleauto.prg index b19affb642..52d3b2f470 100644 --- a/harbour/contrib/hbwin/oleauto.prg +++ b/harbour/contrib/hbwin/oleauto.prg @@ -55,6 +55,7 @@ CREATE CLASS WIN_OLEAUTO + VAR __hObj VAR __hObjEnum VAR __hSink @@ -67,10 +68,12 @@ CREATE CLASS WIN_OLEAUTO METHOD __OpIndex( xIndex, xValue ) OPERATOR "[]" ERROR HANDLER __OnError() + ENDCLASS METHOD __enumStart( enum, lDescend ) CLASS WIN_OLEAUTO + LOCAL hObjEnum hObjEnum := __OleEnumCreate( ::__hObj, lDescend ) @@ -81,7 +84,7 @@ METHOD __enumStart( enum, lDescend ) CLASS WIN_OLEAUTO ENDIF ::__hObjEnum := hObjEnum /* set base value for enumerator */ - (@enum):__enumBase( self ) + ( @enum ):__enumBase( self ) RETURN ::__enumSkip( @enum, lDescend ) ENDIF @@ -89,25 +92,29 @@ METHOD __enumStart( enum, lDescend ) CLASS WIN_OLEAUTO METHOD __enumSkip( enum, lDescend ) CLASS WIN_OLEAUTO + LOCAL lContinue, xValue HB_SYMBOL_UNUSED( lDescend ) xValue := __OleEnumNext( ::__hObjEnum, @lContinue, ::classH ) /* set enumerator value */ - (@enum):__enumValue( xValue ) + ( @enum ):__enumValue( xValue ) RETURN lContinue METHOD PROCEDURE __enumStop() CLASS WIN_OLEAUTO + ::__hObjEnum := NIL /* activate autodestructor */ + RETURN /* OLE functions */ FUNCTION win_OleGetActiveObject( ... ) + LOCAL oOle, hOle hOle := __OleGetActiveObject( ... ) @@ -120,6 +127,7 @@ FUNCTION win_OleGetActiveObject( ... ) FUNCTION win_OleCreateObject( ... ) + LOCAL oOle, hOle hOle := __OleCreateObject( ... ) diff --git a/harbour/contrib/hbwin/tests/dlg.prg b/harbour/contrib/hbwin/tests/dlg.prg index 07e09ec955..cb4681de11 100644 --- a/harbour/contrib/hbwin/tests/dlg.prg +++ b/harbour/contrib/hbwin/tests/dlg.prg @@ -6,7 +6,7 @@ * This example demonstrates how to work with some features of the native Win32 * API. The following function displays a dialog created with an external * resource editor (Pelles C) - * 06/10/2010 - 00:16:41 - [vailtom] + * 2010/06/10 - 00:16:41 - [vailtom] */ // Some constants @@ -30,7 +30,7 @@ PROCEDURE Main() RETURN // Main function to control the user interaction -FUNCTION DialogFunc( hWnd, message, wParam, lParam, wPHigh, wPLow ) +FUNCTION DialogFunc( hWnd, nMessage, wParam, lParam, wPHigh, wPLow ) LOCAL cText @@ -38,11 +38,11 @@ FUNCTION DialogFunc( hWnd, message, wParam, lParam, wPHigh, wPLow ) HB_SYMBOL_UNUSED( lParam ) HB_SYMBOL_UNUSED( wPHigh ) - SWITCH message + SWITCH nMessage CASE WM_INITDIALOG wapi_SetDlgItemText( hWnd, IDC_STATIC1, "Hi! " + Time() ) - wapi_SetDlgItemText( hWnd, IDC_EDIT1 , "Harbour" ) + wapi_SetDlgItemText( hWnd, IDC_EDIT1, "Harbour" ) wapi_ComboBox_AddString( WAPI_GETDLGITEM( hWnd, IDC_COMBO1 ), "Architect" ) wapi_ComboBox_AddString( WAPI_GETDLGITEM( hWnd, IDC_COMBO1 ), "Engineer" ) diff --git a/harbour/contrib/hbwin/tests/dlg.rc b/harbour/contrib/hbwin/tests/dlg.rc index 3992f67e19..9b7283e7ff 100644 --- a/harbour/contrib/hbwin/tests/dlg.rc +++ b/harbour/contrib/hbwin/tests/dlg.rc @@ -10,7 +10,7 @@ LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US 101 DIALOGEX DISCARDABLE 6, 18, 210, 174 STYLE WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|DS_CENTER|WS_CAPTION|WS_SYSMENU|WS_VISIBLE -CAPTION "Sample Dialog (Win32 API Demo With Harbour)" +CAPTION "Sample Dialog (Windows API Demo With Harbour)" FONT 8, "Segoe UI", 0, 0, 1 { CONTROL "", 1003, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 8, 48, 192, 14 @@ -22,10 +22,8 @@ FONT 8, "Segoe UI", 0, 0, 1 CONTROL "&Occupation:", 1008, "Static", WS_GROUP, 8, 72, 40, 8 CONTROL "Own a &car?", 1007, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 96, 116, 58, 10 CONTROL "Click me!", 4001, "Button", BS_DEFPUSHBUTTON|WS_TABSTOP, 8, 156, 84, 14 - CONTROL "This example demonstrates how to work with some features of the native Win32 API. The following function displays a dialog created with an external resource editor.", 4002, "Static", SS_CENTER|WS_GROUP, 4, 4, 204, 28 + CONTROL "This example demonstrates how to work with some features of the native Windows API. The following function displays a dialog created with an external resource editor.", 4002, "Static", SS_CENTER|WS_GROUP, 4, 4, 204, 28 CONTROL "&Has children?", 4003, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 96, 132, 58, 10 } LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US - -1 MANIFEST "dlg.xml" diff --git a/harbour/contrib/hbwin/tests/olesrv1.prg b/harbour/contrib/hbwin/tests/olesrv1.prg index d901b889c4..682f5cdb56 100644 --- a/harbour/contrib/hbwin/tests/olesrv1.prg +++ b/harbour/contrib/hbwin/tests/olesrv1.prg @@ -112,20 +112,26 @@ PROCEDURE DllMain() WIN_OleServerInit( CLS_ID, CLS_Name, {|| OleNetioSrv():new() }, .T. ) -RETURN + RETURN CREATE CLASS OleNetioSrv -HIDDEN: + + HIDDEN: + VAR pConn -EXPORTED: + + EXPORTED: + METHOD Eval( cMethodName, ... ) + ENDCLASS METHOD Eval( cMethodName, ... ) CLASS OleNetioSrv + LOCAL xRetVal, oErr - BEGIN SEQUENCE WITH {| oErr | BREAK( oErr ) } + BEGIN SEQUENCE WITH {| oErr | Break( oErr ) } SWITCH cMethodName CASE "CONNECT" xRetVal := !Empty( ::pConn := NETIO_GETCONNECTION( ... ) ) @@ -154,7 +160,7 @@ METHOD Eval( cMethodName, ... ) CLASS OleNetioSrv xRetVal := oErr END SEQUENCE -RETURN xRetVal + RETURN xRetVal ANNOUNCE GT_SYS diff --git a/harbour/contrib/hbwin/tests/olesrv2.prg b/harbour/contrib/hbwin/tests/olesrv2.prg index d6d425928c..9247886be9 100644 --- a/harbour/contrib/hbwin/tests/olesrv2.prg +++ b/harbour/contrib/hbwin/tests/olesrv2.prg @@ -22,9 +22,9 @@ PROCEDURE DllMain() hAction := { => } hb_HKeepOrder( hAction, .T. ) hb_HSetCaseMatch( hAction, .F. ) - hAction[ "DATE" ] := @date() // DISPID=1 - hAction[ "TIME" ] := @time() // DISPID=2 - hAction[ "DATETIME" ] := @hb_datetime() // DISPID=3 + hAction[ "DATE" ] := @Date() // DISPID=1 + hAction[ "TIME" ] := @Time() // DISPID=2 + hAction[ "DATETIME" ] := @hb_DateTime() // DISPID=3 hAction[ "VALUE" ] := NIL // DISPID=4 hAction[ "GETDATA" ] := @get_data() // DISPID=5 @@ -33,17 +33,18 @@ PROCEDURE DllMain() */ WIN_OleServerInit( CLS_ID, CLS_Name, hAction, .T. ) -RETURN + RETURN STATIC FUNCTION get_data( ... ) + LOCAL hAction := QSelf() IF hAction[ "VALUE" ] == NIL RETURN "(:VALUE IS NOT SET)" ENDIF -RETURN ":VALUE='" + hAction[ "VALUE" ] + "'" + RETURN ":VALUE='" + hAction[ "VALUE" ] + "'" ANNOUNCE GT_SYS diff --git a/harbour/contrib/hbwin/tests/olesrv3.prg b/harbour/contrib/hbwin/tests/olesrv3.prg index 929d7c7b6b..13a4ee11c3 100644 --- a/harbour/contrib/hbwin/tests/olesrv3.prg +++ b/harbour/contrib/hbwin/tests/olesrv3.prg @@ -27,12 +27,12 @@ PROCEDURE DllMain() */ WIN_OleServerInit( CLS_ID, CLS_Name ) -RETURN + RETURN FUNCTION MyMethod( ... ) -RETURN "Hello from MyOleServer [" + hb_valToExp( { ... } ) + "]" + RETURN "Hello from MyOleServer [" + hb_ValToExp( { ... } ) + "]" ANNOUNCE GT_SYS diff --git a/harbour/contrib/hbwin/tests/olesrv4.prg b/harbour/contrib/hbwin/tests/olesrv4.prg index a0af7a3a95..00ed870ab5 100644 --- a/harbour/contrib/hbwin/tests/olesrv4.prg +++ b/harbour/contrib/hbwin/tests/olesrv4.prg @@ -23,43 +23,51 @@ PROCEDURE DllMain() WIN_OleServerInit( CLS_ID, CLS_Name, OleObjServer():new() ) -RETURN + RETURN CREATE CLASS OleObjServer + METHOD timer METHOD info METHOD ref + ENDCLASS METHOD timer() CLASS OleObjServer -RETURN timerCls():new() + RETURN timerCls():new() METHOD info() CLASS OleObjServer -RETURN infoCls():new() + RETURN infoCls():new() METHOD ref( p1, p2, p3, p4, p5, p6, p7 ) CLASS OleObjServer - p1 := date() - p2 := hb_datetime() + + p1 := Date() + p2 := hb_DateTime() p3 := .T. p4 := { "A", "B", "C" } p5 := timerCls():new() p6 := 123.456 p7 := "text" -RETURN "DONE" + + RETURN "DONE" CREATE CLASS timerCls + MESSAGE date EXTERN date MESSAGE time EXTERN time MESSAGE now EXTERN hb_datetime + ENDCLASS CREATE CLASS infoCls + MESSAGE os EXTERN os MESSAGE ver EXTERN version MESSAGE compiler EXTERN hb_compiler MESSAGE build EXTERN hb_builddate + ENDCLASS ANNOUNCE GT_SYS diff --git a/harbour/contrib/hbwin/tests/oletst1.prg b/harbour/contrib/hbwin/tests/oletst1.prg index aed0b5950d..0ab0dbebca 100644 --- a/harbour/contrib/hbwin/tests/oletst1.prg +++ b/harbour/contrib/hbwin/tests/oletst1.prg @@ -16,6 +16,7 @@ #define NETPASSWD "topsecret" PROCEDURE Main() + LOCAL oObject oObject := win_OleCreateObject( "MyOleRPCServer" ) @@ -26,10 +27,10 @@ PROCEDURE Main() /* execute some functions on the server side and display * the results. */ - ? oObject:upper( "hello world !!!" ) - ? "SERVER DATE:", oObject:DATE() - ? "SERVER TIME:", oObject:TIME() - ? "SERVER DATETIME:", oObject:HB_DATETIME() + ? oObject:Upper( "hello world !!!" ) + ? "SERVER DATE:", oObject:Date() + ? "SERVER TIME:", oObject:Time() + ? "SERVER DATETIME:", oObject:hb_DateTime() ELSE ? "Cannot connect to the server:", NETSERVER ENDIF @@ -38,4 +39,5 @@ PROCEDURE Main() ENDIF WAIT -RETURN + + RETURN diff --git a/harbour/contrib/hbwin/tests/oletst2.prg b/harbour/contrib/hbwin/tests/oletst2.prg index 772d5e62f4..5f10f94692 100644 --- a/harbour/contrib/hbwin/tests/oletst2.prg +++ b/harbour/contrib/hbwin/tests/oletst2.prg @@ -13,13 +13,14 @@ */ PROCEDURE Main() + LOCAL oObject oObject := win_OleCreateObject( "MyOleTimeServer" ) IF !Empty( oObject ) - ? "DATE:", oObject:date() - ? "TIME:", oObject:time() + ? "DATE:", oObject:Date() + ? "TIME:", oObject:Time() ? "DATTIME:", oObject:datetime() ? "VALUE:", oObject:value ? "GETDATA:", oObject:getdata() @@ -31,4 +32,5 @@ PROCEDURE Main() ENDIF WAIT -RETURN + + RETURN diff --git a/harbour/contrib/hbwin/tests/oletst3.prg b/harbour/contrib/hbwin/tests/oletst3.prg index f96adefd53..7e1da666ff 100644 --- a/harbour/contrib/hbwin/tests/oletst3.prg +++ b/harbour/contrib/hbwin/tests/oletst3.prg @@ -12,18 +12,20 @@ */ PROCEDURE Main() + LOCAL oObject - BEGIN SEQUENCE WITH {|| break() } + BEGIN SEQUENCE WITH {|| Break() } oObject := CreateObject( "MyOleServer" ) ? oObject:MyMethod( "Hello", 123, .T., ; - { hb_datetime(), 123.45, { date(), 2, 3 } } ) + { hb_DateTime(), 123.45, { Date(), 2, 3 } } ) ? oObject:Property1 - oObject:Property1 := "!!! >>>" + upper( oObject:Property1 ) + "<<< !!!" + oObject:Property1 := "!!! >>>" + Upper( oObject:Property1 ) + "<<< !!!" ? oObject:Property1 RECOVER ? "Can not access 'MyOleServer' OLE server." END SEQUENCE WAIT -RETURN + + RETURN diff --git a/harbour/contrib/hbwin/tests/oletst4.prg b/harbour/contrib/hbwin/tests/oletst4.prg index c427c8dfbe..39cbf1f90c 100644 --- a/harbour/contrib/hbwin/tests/oletst4.prg +++ b/harbour/contrib/hbwin/tests/oletst4.prg @@ -13,6 +13,7 @@ */ PROCEDURE Main() + LOCAL oObject, oTime, oInfo LOCAL p1, p2, p3, p4, p5, p6, p7 @@ -32,16 +33,17 @@ PROCEDURE Main() ? " build:", oInfo:build ? ? "REF:", oObject:ref( @p1, @p2, @p3, @p4, @p5, @p6, @p7 ) - ? " p1:", hb_valToExp( p1 ) - ? " p2:", hb_valToExp( p2 ) - ? " p3:", hb_valToExp( p3 ) - ? " p4:", hb_valToExp( p4 ) + ? " p1:", hb_ValToExp( p1 ) + ? " p2:", hb_ValToExp( p2 ) + ? " p3:", hb_ValToExp( p3 ) + ? " p4:", hb_ValToExp( p4 ) ? " p5:", p5:className() // hb_valToExp( p5 ) - ? " p6:", hb_valToExp( p6 ) - ? " p7:", hb_valToExp( p7 ) + ? " p6:", hb_ValToExp( p6 ) + ? " p7:", hb_ValToExp( p7 ) ELSE ? "Can not access 'MyOleObjServer' OLE server." ENDIF WAIT -RETURN + + RETURN diff --git a/harbour/contrib/hbwin/tests/pdfcreat.prg b/harbour/contrib/hbwin/tests/pdfcreat.prg index e305a6a858..e95988b6f1 100644 --- a/harbour/contrib/hbwin/tests/pdfcreat.prg +++ b/harbour/contrib/hbwin/tests/pdfcreat.prg @@ -64,8 +64,8 @@ PROCEDURE Main() oPC:cPrinterStop := .F. - nTime := hb_milliSeconds() - DO WHILE nEvent == 0 .AND. hb_milliSeconds() - nTime < 10000 + nTime := hb_MilliSeconds() + DO WHILE nEvent == 0 .AND. hb_MilliSeconds() - nTime < 10000 hb_idleSleep( 0.5 ) /* The following dummy line is required to allow COM server to send event [Mindaugas] */ oPC:cOption( "UseAutosave" ) diff --git a/harbour/contrib/hbwin/tests/testax.prg b/harbour/contrib/hbwin/tests/testax.prg index 026635518c..a2512cd421 100644 --- a/harbour/contrib/hbwin/tests/testax.prg +++ b/harbour/contrib/hbwin/tests/testax.prg @@ -13,6 +13,7 @@ REQUEST HB_GT_WVT_DEFAULT #endif PROCEDURE Main() + LOCAL oMSCAL #if defined( __PLATFORM__WINDOWS ) .AND. defined( __HBSCRIPT__HBSHELL ) @@ -28,36 +29,46 @@ PROCEDURE Main() RETURN CREATE CLASS HActiveX + VAR oOLE VAR hWnd METHOD Init METHOD Event ERROR HANDLER OnError DESTRUCTOR Close + ENDCLASS METHOD Init( hWnd, cProgId, nTop, nLeft, nWidth, nHeight, cID ) CLASS HActiveX + LOCAL nStyle := WIN_WS_CHILD + WIN_WS_VISIBLE + WIN_WS_CLIPCHILDREN + win_AxInit() ::hWnd := WAPI_CreateWindowEX( 0, "AtlAxWin", cProgId, nStyle, nLeft, nTop, nWidth, nHeight, hWnd, 0 ) /* WAPI_SetWindowPos( ::hWnd, WIN_HWND_TOPMOST, 0, 0, 1, 1, hb_bitOr( WIN_SWP_NOSIZE, WIN_SWP_DRAWFRAME ) ) */ ::oOLE := WIN_AxGetControl( ::hWnd, {| event, ... | ::Event( event, ... ) }, cID ) + RETURN self PROCEDURE Event( ... ) CLASS HActiveX + LOCAL cEvents := "" LOCAL aEvents := { ... } - aEval( aEvents, {| xEvent | cEvents += HB_ValToStr( xEvent ) + ", " } ) + + AEval( aEvents, {| xEvent | cEvents += hb_ValToStr( xEvent ) + ", " } ) wapi_OutputDebugString( cEvents ) + RETURN METHOD OnError() CLASS HActiveX - RETURN HB_ExecFromArray( ::oOLE, __GetMessage(), HB_AParams() ) + RETURN hb_ExecFromArray( ::oOLE, __GetMessage(), hb_AParams() ) METHOD Close() CLASS HActiveX + wapi_OutputDebugString( "Close" ) WAPI_DestroyWindow( ::hWnd ) ::hWnd := NIL ::oOLE := NIL wapi_OutputDebugString( "After Close" ) + RETURN NIL diff --git a/harbour/contrib/hbwin/tests/testcom1.prg b/harbour/contrib/hbwin/tests/testcom1.prg index f1ba28e2bc..965e1f1e64 100644 --- a/harbour/contrib/hbwin/tests/testcom1.prg +++ b/harbour/contrib/hbwin/tests/testcom1.prg @@ -66,14 +66,14 @@ PROCEDURE Main( cPortName ) ? "Open() succeeded" ? IF oWinPort:SetDTR( .T. ) - ? "SetDTR( .T. ) succeeded" + ? "SetDTR( .T. ) succeeded" ELSE - ? "SetDTR( .T. ) failed :", oWinPort:ErrorText() + ? "SetDTR( .T. ) failed :", oWinPort:ErrorText() ENDIF IF ( nResult := oWinPort:Write( cString ) ) == Len( cString ) - ? "Write() succeeded" + ? "Write() succeeded" ELSE - ? "Write() failed, returned ", nResult, " expected ", Len( cString ) + ? "Write() failed, returned ", nResult, " expected ", Len( cString ) ENDIF ? "Scan something... we'll not read it but purge it, press enter" Inkey( 0 ) diff --git a/harbour/contrib/hbwin/tests/testcom2.prg b/harbour/contrib/hbwin/tests/testcom2.prg index 7041c54141..c3f067b569 100644 --- a/harbour/contrib/hbwin/tests/testcom2.prg +++ b/harbour/contrib/hbwin/tests/testcom2.prg @@ -98,7 +98,7 @@ PROCEDURE Main( cPortName ) ? IF oWinPort:QueueStatus( @lCTSHold, @lDSRHold, @lDCDHold, @lXoffHold, @lXoffSent, @nInQueue, @nOutQueue ) ? "QueueStatus() : CTSHold", lCtsHold, ", DSRHold", lDsrHold, ", DCDHold", lDCDHold, ", XoffHold", lXoffHold, ; - ", Xoff Sent ", lXoffSent, ", InQueue ", nInQueue, ", nOutQueue ", nOutQueue + ", Xoff Sent ", lXoffSent, ", InQueue ", nInQueue, ", nOutQueue ", nOutQueue ELSE ? "QueueStatus() failed :", oWinPort:ErrorText() ENDIF @@ -107,7 +107,7 @@ PROCEDURE Main( cPortName ) ? IF oWinPort:QueueStatus( @lCTSHold, @lDSRHold, @lDCDHold, @lXoffHold, @lXoffSent, @nInQueue, @nOutQueue ) ? "QueueStatus() : CTSHold", lCtsHold, ", DSRHold", lDsrHold, ", DCDHold", lDCDHold, ", XoffHold", lXoffHold, ; - ", Xoff Sent ", lXoffSent, ", InQueue ", nInQueue, ", nOutQueue ", nOutQueue + ", Xoff Sent ", lXoffSent, ", InQueue ", nInQueue, ", nOutQueue ", nOutQueue ELSE ? "QueueStatus() failed :", oWinPort:ErrorText() ENDIF @@ -140,7 +140,7 @@ PROCEDURE Main( cPortName ) Inkey( 0 ) IF oWinPort:QueueStatus( @lCTSHold, @lDSRHold, @lDCDHold, @lXoffHold, @lXoffSent, @nInQueue, @nOutQueue ) ? "QueueStatus() : CTSHold", lCtsHold, ", DSRHold", lDsrHold, ", DCDHold", lDCDHold, ", XoffHold", lXoffHold, ; - ", Xoff Sent ", lXoffSent, ", InQueue ", nInQueue, ", nOutQueue ", nOutQueue + ", Xoff Sent ", lXoffSent, ", InQueue ", nInQueue, ", nOutQueue ", nOutQueue ELSE ? "QueueStatus() failed :", oWinPort:ErrorText() ENDIF @@ -152,7 +152,7 @@ PROCEDURE Main( cPortName ) ? "InQueue should be zero" IF oWinPort:QueueStatus( @lCTSHold, @lDSRHold, @lDCDHold, @lXoffHold, @lXoffSent, @nInQueue, @nOutQueue ) ? "QueueStatus() : CTSHold", lCtsHold, ", DSRHold", lDsrHold, ", DCDHold", lDCDHold, ", XoffHold", lXoffHold, ; - ", Xoff Sent ", lXoffSent, ", InQueue ", nInQueue, ", nOutQueue ", nOutQueue + ", Xoff Sent ", lXoffSent, ", InQueue ", nInQueue, ", nOutQueue ", nOutQueue ELSE ? "QueueStatus() failed :", oWinPort:ErrorText() ENDIF @@ -202,7 +202,7 @@ PROCEDURE Main( cPortName ) ENDIF IF oWinPort:QueueStatus( @lCTSHold, @lDSRHold, @lDCDHold, @lXoffHold, @lXoffSent, @nInQueue, @nOutQueue ) ? "QueueStatus() : CTSHold", lCtsHold, ", DSRHold", lDsrHold, ", DCDHold", lDCDHold, ", XoffHold", lXoffHold, ; - ", Xoff Sent ", lXoffSent, ", InQueue ", nInQueue, ", nOutQueue ", nOutQueue + ", Xoff Sent ", lXoffSent, ", InQueue ", nInQueue, ", nOutQueue ", nOutQueue ELSE ? "QueueStatus() failed :", oWinPort:ErrorText() ENDIF @@ -230,7 +230,7 @@ PROCEDURE Main( cPortName ) ? "If it's on then no Hold status should be on, IF off then probably CTS and DSR" IF oWinPort:QueueStatus( @lCTSHold, @lDSRHold, @lDCDHold, @lXoffHold, @lXoffSent, @nInQueue, @nOutQueue ) ? "QueueStatus() : CTSHold", lCtsHold, ", DSRHold", lDsrHold, ", DCDHold", lDCDHold, ", XoffHold", lXoffHold, ; - ", Xoff Sent ", lXoffSent, ", InQueue ", nInQueue, ", nOutQueue ", nOutQueue + ", Xoff Sent ", lXoffSent, ", InQueue ", nInQueue, ", nOutQueue ", nOutQueue ELSE ? "QueueStatus() failed :", oWinPort:ErrorText() ENDIF diff --git a/harbour/contrib/hbwin/tests/testcopy.prg b/harbour/contrib/hbwin/tests/testcopy.prg index cec0787528..0e72a3b0b2 100644 --- a/harbour/contrib/hbwin/tests/testcopy.prg +++ b/harbour/contrib/hbwin/tests/testcopy.prg @@ -17,22 +17,23 @@ #include "simpleio.ch" PROCEDURE Main() + LOCAL a LOCAL lAbort LOCAL tmp - ? "0x" + hb_numtohex( WIN_SHFileOperation( NIL, WIN_FO_COPY, { __FILE__, "olesrv1.prg" }, { "testcopy1" },; - NIL, @lAbort,; - NIL, "Harbour SHFile 1" ) ) + ? "0x" + hb_NumToHex( WIN_SHFileOperation( NIL, WIN_FO_COPY, { __FILE__, "olesrv1.prg" }, { "testcopy1" }, ; + NIL, @lAbort, ; + NIL, "Harbour SHFile 1" ) ) ? lAbort hb_MemoWrit( "rename.txt", "hello1" ) hb_MemoWrit( "rename1.txt", "hello2" ) a := {} - ? "0x" + hb_numtohex( WIN_SHFileOperation( NIL, WIN_FO_RENAME, { "rename.txt" }, { "rename1.txt" },; - WIN_FOF_WANTMAPPINGHANDLE, @lAbort,; - a, "Harbour SHFile 2" ) ) + ? "0x" + hb_NumToHex( WIN_SHFileOperation( NIL, WIN_FO_RENAME, { "rename.txt" }, { "rename1.txt" }, ; + WIN_FOF_WANTMAPPINGHANDLE, @lAbort, ; + a, "Harbour SHFile 2" ) ) ? lAbort FOR EACH tmp IN a ? tmp[ 1 ], tmp[ 2 ] @@ -42,9 +43,9 @@ PROCEDURE Main() FErase( "rename1.txt" ) - ? "0x" + hb_numtohex( WIN_SHFileOperation( NIL, WIN_FO_COPY, __FILE__ + Chr( 0 ) + "olesrv1.prg" + Chr( 0 ), "testcopy2",; - NIL, @lAbort,; - NIL, "Harbour SHFile 3" ) ) + ? "0x" + hb_NumToHex( WIN_SHFileOperation( NIL, WIN_FO_COPY, __FILE__ + Chr( 0 ) + "olesrv1.prg" + Chr( 0 ), "testcopy2", ; + NIL, @lAbort, ; + NIL, "Harbour SHFile 3" ) ) ? lAbort RETURN diff --git a/harbour/contrib/hbwin/tests/testdir.prg b/harbour/contrib/hbwin/tests/testdir.prg index 424031bfce..4d2977ede4 100644 --- a/harbour/contrib/hbwin/tests/testdir.prg +++ b/harbour/contrib/hbwin/tests/testdir.prg @@ -14,7 +14,7 @@ PROCEDURE Main() - ? ">" + wapi_GetWindowsDirectory() + "<" - ? ">" + wapi_GetSystemDirectory() + "<" + ? ">" + wapi_GetWindowsDirectory() + "<" + ? ">" + wapi_GetSystemDirectory() + "<" - RETURN + RETURN diff --git a/harbour/contrib/hbwin/tests/testgdi.prg b/harbour/contrib/hbwin/tests/testgdi.prg index 2fb4f1875f..beb5ea8193 100644 --- a/harbour/contrib/hbwin/tests/testgdi.prg +++ b/harbour/contrib/hbwin/tests/testgdi.prg @@ -18,6 +18,7 @@ #include "hbwin.ch" PROCEDURE Main() + LOCAL cPrinterName := "Microsoft XPS Document Writer" LOCAL hDC diff --git a/harbour/contrib/hbwin/tests/testmapi.prg b/harbour/contrib/hbwin/tests/testmapi.prg index 4bcdaec13a..39ea3bf682 100644 --- a/harbour/contrib/hbwin/tests/testmapi.prg +++ b/harbour/contrib/hbwin/tests/testmapi.prg @@ -18,30 +18,30 @@ PROCEDURE Main() LOCAL aDest := { { "test to", "to@test.com", WIN_MAPI_TO } } LOCAL aFiles := { { __FILE__, "testmapi" } } - ? win_MAPISendMail( cSubject, ; // subject - cBody, ; // menssage - NIL, ; // type of message - DToS( Date() ) + " " + Time(), ; // send date - "", ; // conversation ID - lMailConf, ; // acknowledgment - lFromUser, ; // user intervention - aSender, ; // sender - aDest, ; // destinators - aFiles ; // attach - ) + ? win_MAPISendMail( ; + cSubject, ; // subject + cBody, ; // menssage + NIL, ; // type of message + DToS( Date() ) + " " + Time(), ; // send date + "", ; // conversation ID + lMailConf, ; // acknowledgment + lFromUser, ; // user intervention + aSender, ; // sender + aDest, ; // destinators + aFiles ) // attach // simple format - ? win_MAPISendMail( cSubject, ; // subject - cBody, ; // menssage - NIL, ; // type of message - DToS( Date() ) + " " + Time(), ; // send date - "", ; // conversation ID - lMailConf, ; // acknowledgment - lFromUser, ; // user intervention - "from@test.com", ; // sender - { "to@test.com" }, ; // destinators - { __FILE__ } ; // attach - ) + ? win_MAPISendMail( ; + cSubject, ; // subject + cBody, ; // menssage + NIL, ; // type of message + DToS( Date() ) + " " + Time(), ; // send date + "", ; // conversation ID + lMailConf, ; // acknowledgment + lFromUser, ; // user intervention + "from@test.com", ; // sender + { "to@test.com" }, ; // destinators + { __FILE__ } ) // attach RETURN diff --git a/harbour/contrib/hbwin/tests/testprn.prg b/harbour/contrib/hbwin/tests/testprn.prg index 0a416705a6..47f20f1caa 100644 --- a/harbour/contrib/hbwin/tests/testprn.prg +++ b/harbour/contrib/hbwin/tests/testprn.prg @@ -7,6 +7,7 @@ #include "hbwin.ch" PROCEDURE Main( cPar1 ) + LOCAL nPrn := 1 LOCAL cBMPFile := Space( 40 ) LOCAL aPrn := WIN_PRINTERLIST() @@ -15,7 +16,7 @@ PROCEDURE Main( cPar1 ) CLS IF Empty( aPrn ) - Alert("No printers installed - Cannot continue") + Alert( "No printers installed - Cannot continue" ) QUIT ENDIF @@ -34,6 +35,7 @@ PROCEDURE Main( cPar1 ) RETURN STATIC PROCEDURE PrnTest( cPrinter, cBMPFile, lAsk ) + LOCAL oPrinter := Win_Prn():New( cPrinter ) LOCAL aFonts LOCAL x @@ -59,7 +61,7 @@ STATIC PROCEDURE PrnTest( cPrinter, cBMPFile, lAsk ) oPrinter:TextOut( oPrinter:PrinterName + ": MaxRow() = " + Str( oPrinter:MaxRow(), 4 ) + " MaxCol() = " + Str( oPrinter:MaxCol(), 4 ) ) oPrinter:Bold( WIN_FW_DONTCARE ) oPrinter:NewLine() - oPrinter:TextOut(" Partial list of available fonts that are available for OEM_") + oPrinter:TextOut( " Partial list of available fonts that are available for OEM_" ) oPrinter:NewLine() oPrinter:UnderLine( .T. ) oPrinter:Italic( .T. ) @@ -79,7 +81,7 @@ STATIC PROCEDURE PrnTest( cPrinter, cBMPFile, lAsk ) oPrinter:UnderLine( .F. ) aFonts := oPrinter:GetFonts() oPrinter:NewLine() - FOR x:= 1 TO Len( aFonts ) STEP 2 + FOR x := 1 TO Len( aFonts ) STEP 2 oPrinter:CharSet( aFonts[ x, 4 ] ) IF oPrinter:SetFont( aFonts[ x, 1 ] ) // Could use "IF oPrinter:SetFontOk" after call to oPrinter:SetFont() IF oPrinter:FontName == aFonts[ x, 1 ] // Make sure Windows didn't pick a different font @@ -102,10 +104,10 @@ STATIC PROCEDURE PrnTest( cPrinter, cBMPFile, lAsk ) oPrinter:CharSet( 0 ) // Reset default charset oPrinter:Bold( WIN_FW_EXTRABOLD ) oPrinter:NewLine() - oPrinter:TextOut( "This is on line" + Str( oPrinter:Prow(), 4 ) + ", Printed bold, " ) + oPrinter:TextOut( "This is on line" + Str( oPrinter:PRow(), 4 ) + ", Printed bold, " ) oPrinter:TextOut( " finishing at Column: " ) - oPrinter:TextOut( Str( oPrinter:Pcol(), 4 ) ) - oPrinter:SetPrc( oPrinter:Prow() + 3, 0 ) + oPrinter:TextOut( Str( oPrinter:PCol(), 4 ) ) + oPrinter:SetPRC( oPrinter:PRow() + 3, 0 ) oPrinter:Bold( WIN_FW_DONTCARE ) oPrinter:TextOut( "Notice: UNDERLINE only prints correctly if there is a blank line after", .T. ) oPrinter:TextOut( " it. This is because of :LineHeight and the next line", .T. ) @@ -121,10 +123,10 @@ STATIC PROCEDURE PrnTest( cPrinter, cBMPFile, lAsk ) oPrinter:Ellipse( 400, oPrinter:PosY + 100, 500, oPrinter:PosY + 200 ) oPrinter:FillRect( 600, oPrinter:PosY + 100, 700, oPrinter:PosY + 200, HB_WIN_RGB_RED ) -// To print a barcode; -// Replace 'BCod39HN' with your own bar code font or any other font -// oPrinter:TextAtFont( oPrinter:MM_TO_POSX( 30 ), oPrinter:MM_TO_POSY( 60 ), "1234567890", "BCod39HN", 24, 0 ) -// + // To print a barcode; + // Replace 'BCod39HN' with your own bar code font or any other font + // oPrinter:TextAtFont( oPrinter:MM_TO_POSX( 30 ), oPrinter:MM_TO_POSY( 60 ), "1234567890", "BCod39HN", 24, 0 ) + // PrintBitMap( oPrinter, cBMPFile ) oPrinter:EndDoc() @@ -135,10 +137,11 @@ STATIC PROCEDURE PrnTest( cPrinter, cBMPFile, lAsk ) RETURN STATIC PROCEDURE PrintBitMap( oPrn, cBitFile ) + LOCAL oBMP IF Empty( cBitFile ) - * + // ELSEIF ! hb_FileExists( cBitFile ) Alert( cBitFile + " not found " ) ELSE diff --git a/harbour/contrib/hbwin/tests/testprn2.prg b/harbour/contrib/hbwin/tests/testprn2.prg index d633e33644..0a9774d740 100644 --- a/harbour/contrib/hbwin/tests/testprn2.prg +++ b/harbour/contrib/hbwin/tests/testprn2.prg @@ -3,6 +3,7 @@ */ PROCEDURE Main() + LOCAL nPrn := 1 LOCAL cFileName := Space( 40 ) LOCAL aPrn := WIN_PRINTERLIST() @@ -11,7 +12,7 @@ PROCEDURE Main() CLS IF Empty( aPrn ) - Alert("No printers installed - Cannot continue") + Alert( "No printers installed - Cannot continue" ) QUIT ENDIF diff --git a/harbour/contrib/hbwin/tests/testprn3.prg b/harbour/contrib/hbwin/tests/testprn3.prg index 840fada026..b01c9ff24a 100644 --- a/harbour/contrib/hbwin/tests/testprn3.prg +++ b/harbour/contrib/hbwin/tests/testprn3.prg @@ -25,6 +25,7 @@ PROCEDURE Main() RETURN STATIC PROCEDURE Dump( a ) + LOCAL b, c ? "==================" diff --git a/harbour/contrib/hbwin/tests/testprn4.prg b/harbour/contrib/hbwin/tests/testprn4.prg index e3d0c7d977..a7516171db 100644 --- a/harbour/contrib/hbwin/tests/testprn4.prg +++ b/harbour/contrib/hbwin/tests/testprn4.prg @@ -13,6 +13,7 @@ #include "simpleio.ch" PROCEDURE Main() + LOCAL a := WIN_PRINTERGETDEFAULT() ? ">" + a + "<" diff --git a/harbour/contrib/hbwin/tests/testreg.prg b/harbour/contrib/hbwin/tests/testreg.prg index 53e775ee72..9c44b799e3 100644 --- a/harbour/contrib/hbwin/tests/testreg.prg +++ b/harbour/contrib/hbwin/tests/testreg.prg @@ -10,13 +10,14 @@ #define KEY_WOW64_32KEY 0x0200 PROCEDURE Main() + LOCAL tmp ? win_regWrite( "HKCU\_TEST\mydword", 0x11223344, WIN_REG_DWORD ) - ? hb_numtohex( win_regRead( "HKCU\_TEST\mydword" ) ) + ? hb_NumToHex( win_regRead( "HKCU\_TEST\mydword" ) ) ? win_regWrite( "HKCU\_TEST\myqword", 0x1122334455667788, WIN_REG_QWORD ) - ? hb_numtohex( win_regRead( "HKCU\_TEST\myqword" ) ) + ? hb_NumToHex( win_regRead( "HKCU\_TEST\myqword" ) ) Inkey( 0 ) @@ -42,7 +43,7 @@ PROCEDURE Main() ? win_regWrite( "HKCU\Control Panel\Desktop\Wallpaper", tmp ) ? win_regRead( "HKLM\SOFTWARE\7-Zip\Path" ) - IF hb_OSis64bit() + IF hb_osIs64bit() ? win_regRead( "HKLM\SOFTWARE\7-Zip\Path",, KEY_WOW64_32KEY ) ? win_regRead( "HKLM\SOFTWARE\7-Zip\Path",, KEY_WOW64_64KEY ) ENDIF diff --git a/harbour/contrib/hbwin/tests/testrpc.prg b/harbour/contrib/hbwin/tests/testrpc.prg index 85c542c631..2383d062c1 100644 --- a/harbour/contrib/hbwin/tests/testrpc.prg +++ b/harbour/contrib/hbwin/tests/testrpc.prg @@ -14,6 +14,6 @@ PROCEDURE Main() - ? win_UuidCreateString() + ? win_UuidCreateString() - RETURN + RETURN diff --git a/harbour/contrib/hbwin/tests/testsim.prg b/harbour/contrib/hbwin/tests/testsim.prg index ea96395e09..cd62453c58 100644 --- a/harbour/contrib/hbwin/tests/testsim.prg +++ b/harbour/contrib/hbwin/tests/testsim.prg @@ -47,14 +47,14 @@ PROCEDURE Main() 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_eol() + "Name: " + n[ 2 ] + hb_eol() + "Adr. Type: " + Str( n[ 3 ] ) + hb_eol() + "Plan Type: " + Str( n[ 4 ] ),"pos 1" ) } ) + Alert( "VALTYPE-> " + ValType( a ) + " LEN -> " + Str( Len( a ) ), a[ 1 ][ 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_eol() + "Name: " + n[ 2 ] + hb_eol() + "Adr. Type: " + Str( n[ 3 ] ) + hb_eol() + "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 a4a0921e6f..77fc133b69 100644 --- a/harbour/contrib/hbwin/tests/testsvc.prg +++ b/harbour/contrib/hbwin/tests/testsvc.prg @@ -57,6 +57,7 @@ #define _SERVICE_NAME "Harbour_Test_Service" PROCEDURE Main( cMode ) + LOCAL nError LOCAL cMsg @@ -72,7 +73,7 @@ PROCEDURE Main( cMode ) cMsg := Space( 128 ) wapi_FormatMessage( ,,,, @cMsg ) ? "Error installing service: " + hb_ntos( nError ) + " " + cMsg - ENDIf + ENDIF EXIT CASE "U" @@ -84,7 +85,7 @@ PROCEDURE Main( cMode ) cMsg := Space( 128 ) wapi_FormatMessage( ,,,, @cMsg ) ? "Error deleting service: " + hb_ntos( nError ) + " " + cMsg - ENDIf + ENDIF EXIT CASE "S" @@ -109,8 +110,9 @@ PROCEDURE Main( cMode ) #include "fileio.ch" PROCEDURE SrvMain() + LOCAL n := 0 - LOCAL fhnd := hb_FCreate( hb_dirBase() + "testsvc.out", FC_NORMAL, FO_DENYNONE + FO_WRITE ) + LOCAL fhnd := hb_FCreate( hb_DirBase() + "testsvc.out", FC_NORMAL, FO_DENYNONE + FO_WRITE ) LOCAL cParam FWrite( fhnd, "Startup" + hb_eol() ) diff --git a/harbour/contrib/hbwin/tests/testwmtx.prg b/harbour/contrib/hbwin/tests/testwmtx.prg index 4f52a43ff6..36a593893c 100644 --- a/harbour/contrib/hbwin/tests/testwmtx.prg +++ b/harbour/contrib/hbwin/tests/testwmtx.prg @@ -5,6 +5,7 @@ STATIC s_hMutex PROCEDURE Main() + LOCAL cAppName // It may be a random program name :) diff --git a/harbour/contrib/hbwin/win_os.prg b/harbour/contrib/hbwin/win_os.prg index 833667273e..988be29fdb 100644 --- a/harbour/contrib/hbwin/win_os.prg +++ b/harbour/contrib/hbwin/win_os.prg @@ -67,6 +67,7 @@ Administrator rights are required by default in Windows. [vszakats] */ FUNCTION WIN_OSNETREGOK( lSetIt, lDoVista ) + LOCAL bRetVal := .T. LOCAL cKeySrv LOCAL cKeyWks @@ -123,6 +124,7 @@ FUNCTION WIN_OSNETREGOK( lSetIt, lDoVista ) RETURN bRetVal FUNCTION WIN_OSNETVREDIROK( /* @ */ nResult ) + LOCAL aFiles nResult := 0 diff --git a/harbour/contrib/hbwin/win_reg.prg b/harbour/contrib/hbwin/win_reg.prg index 401f27a4e7..8535a46071 100644 --- a/harbour/contrib/hbwin/win_reg.prg +++ b/harbour/contrib/hbwin/win_reg.prg @@ -62,6 +62,7 @@ #define KEY_CREATE_LINK 32 PROCEDURE win_regPathSplit( cRegPath, /* @ */ nHKEY, /* @ */ cKey, /* @ */ cEntry ) + LOCAL cHKEY LOCAL tmp @@ -104,6 +105,7 @@ PROCEDURE win_regPathSplit( cRegPath, /* @ */ nHKEY, /* @ */ cKey, /* @ */ cEntr RETURN FUNCTION win_regRead( cRegPath, xDefault, nRegSam ) + LOCAL nHKEY, cKey, cEntry win_regPathSplit( cRegPath, @nHKEY, @cKey, @cEntry ) @@ -111,6 +113,7 @@ FUNCTION win_regRead( cRegPath, xDefault, nRegSam ) RETURN win_regGet( nHKEY, cKey, cEntry, xDefault, nRegSam ) FUNCTION win_regWrite( cRegPath, xValue, nType, nRegSam ) + LOCAL nHKEY, cKey, cEntry win_regPathSplit( cRegPath, @nHKEY, @cKey, @cEntry ) @@ -118,6 +121,7 @@ FUNCTION win_regWrite( cRegPath, xValue, nType, nRegSam ) RETURN win_regSet( nHKEY, cKey, cEntry, xValue, nType, nRegSam ) FUNCTION win_regDelete( cRegPath, nRegSam ) + LOCAL nHKEY, cKey, cEntry LOCAL lRetVal LOCAL pKeyHandle @@ -142,6 +146,7 @@ FUNCTION win_regDelete( cRegPath, nRegSam ) RETURN lRetVal FUNCTION win_regQuery( nHKEY, cKeyName, cEntryName, xValue, lSetIt, nRegSam ) + LOCAL xKey := win_regGet( nHKEY, cKeyName, cEntryName,, nRegSam ) LOCAL cValType := ValType( xValue ) @@ -167,10 +172,13 @@ FUNCTION win_regQuery( nHKEY, cKeyName, cEntryName, xValue, lSetIt, nRegSam ) RETURN lRetVal STATIC FUNCTION Bin2U( c ) + LOCAL l := Bin2L( c ) + RETURN iif( l < 0, l + 4294967296, l ) FUNCTION win_regGet( nHKEY, cKeyName, cEntryName, xDefault, nRegSam ) + LOCAL xRetVal LOCAL pKeyHandle LOCAL nValueType @@ -194,8 +202,8 @@ FUNCTION win_regGet( nHKEY, cKeyName, cEntryName, xDefault, nRegSam ) xRetVal := Bin2U( Right( xRetVal, 2 ) + Left( xRetVal, 2 ) ) CASE nValueType == WIN_REG_QWORD .OR. ; nValueType == WIN_REG_QWORD_LITTLE_ENDIAN - xRetVal := hb_bitShift( Bin2U( SubStr( xRetVal, 5, 2 ) + SubStr( xRetVal, 7, 2 ) ), 32 ) +; - Bin2U( SubStr( xRetVal, 1, 2 ) + SubStr( xRetVal, 3, 2 ) ) + xRetVal := hb_bitShift( Bin2U( SubStr( xRetVal, 5, 2 ) + SubStr( xRetVal, 7, 2 ) ), 32 ) +; + Bin2U( SubStr( xRetVal, 1, 2 ) + SubStr( xRetVal, 3, 2 ) ) OTHERWISE /* Strip ending zero byte */ IF hb_BRight( xRetVal, 1 ) == hb_BChar( 0 ) @@ -214,6 +222,7 @@ FUNCTION win_regGet( nHKEY, cKeyName, cEntryName, xDefault, nRegSam ) RETURN xRetVal FUNCTION win_regSet( nHKEY, cKeyName, cEntryName, xValue, nValueType, nRegSam ) + LOCAL cName LOCAL lRetVal := .F. LOCAL pKeyHandle diff --git a/harbour/contrib/hbwin/win_tbmp.prg b/harbour/contrib/hbwin/win_tbmp.prg index c972ddc15f..b21a5989b9 100644 --- a/harbour/contrib/hbwin/win_tbmp.prg +++ b/harbour/contrib/hbwin/win_tbmp.prg @@ -75,12 +75,14 @@ CREATE CLASS WIN_BMP // See WinApi StretchDIBits() VAR BitMap INIT "" VAR FileName INIT "" + ENDCLASS METHOD New() CLASS WIN_BMP RETURN Self METHOD LoadFile( cFileName, aDimXY ) CLASS WIN_BMP + ::FileName := cFileName ::Bitmap := win_LoadBitMapFile( ::FileName ) IF Empty( ::Bitmap ) @@ -89,11 +91,12 @@ METHOD LoadFile( cFileName, aDimXY ) CLASS WIN_BMP ELSE ::Type := win_bitmapType( ::Bitmap ) IF HB_ISARRAY( aDimXY ) - ::DimXY := aDimXY + ::DimXY := aDimXY ELSEIF ! win_BitMapDimensions( ::Bitmap, @::DimXY[ 1 ], @::DimXY[ 2 ] ) - ::DimXY := { 1, 1 } // Driver may use the original dimensions + ::DimXY := { 1, 1 } // Driver may use the original dimensions ENDIF ENDIF + RETURN ::Type != HB_WIN_BITMAP_UNKNOWN METHOD Create() CLASS WIN_BMP // Compatibility function for Alaska Xbase++ @@ -106,7 +109,9 @@ METHOD IsSupported( oPrn, /* @ */ nError ) CLASS WIN_BMP RETURN ( nError := win_BitmapIsSupported( oPrn:hPrinterDc, ::Bitmap ) ) == 0 METHOD Draw( oPrn, aRectangle, /* @ */ nError ) CLASS WIN_BMP // Pass a WIN_PRN object reference & Rectangle array + IF HB_ISARRAY( aRectangle ) ::Rect := aRectangle ENDIF + RETURN iif( ::IsSupported( oPrn, @nError ), oPrn:DrawBitMap( Self ), .F. ) diff --git a/harbour/contrib/hbwin/win_tcom.prg b/harbour/contrib/hbwin/win_tcom.prg index aaf176140e..9fcc86ef3d 100644 --- a/harbour/contrib/hbwin/win_tcom.prg +++ b/harbour/contrib/hbwin/win_tcom.prg @@ -131,6 +131,7 @@ METHOD Recv( nLength, nResult ) CLASS win_Com RETURN win_ComRecv( ::nPort, nLength, @nResult ) METHOD RecvTo( cDelim, nMaxlen ) CLASS win_Com + LOCAL nResult LOCAL cRecv := "" @@ -200,6 +201,7 @@ METHOD DebugDCB( nDebug ) CLASS win_Com you to see what call did the deed when things go wrong. */ METHOD ErrorText() CLASS win_Com + LOCAL nFcn := win_ComFuncLast( ::nPort ) LOCAL cString LOCAL nError diff --git a/harbour/contrib/hbwin/win_tprn.prg b/harbour/contrib/hbwin/win_tprn.prg index 6cc7adb989..ec799f6c30 100644 --- a/harbour/contrib/hbwin/win_tprn.prg +++ b/harbour/contrib/hbwin/win_tprn.prg @@ -127,7 +127,7 @@ CREATE CLASS WIN_PRN METHOD DrawBitMap( oBmp ) /* Clipper compatible functions. */ - METHOD SetPrc( nRow, nCol ) // Based on ::LineHeight and current ::CharWidth + METHOD SetPRC( nRow, nCol ) // Based on ::LineHeight and current ::CharWidth METHOD PRow() METHOD PCol() METHOD MaxRow() // Based on ::LineHeight & Form dimensions @@ -215,12 +215,15 @@ CREATE CLASS WIN_PRN ENDCLASS METHOD New( cPrinter ) CLASS WIN_PRN + ::PrinterName := iif( Empty( cPrinter ), win_PrinterGetDefault(), cPrinter ) /* Initialized with the current properties of the printer [jarabal] */ ::GetDocumentProperties() + RETURN Self METHOD Create() CLASS WIN_PRN + LOCAL lResult := .F. ::Destroy() // Finish current print job if any @@ -234,16 +237,16 @@ METHOD Create() CLASS WIN_PRN IF ::AskProperties lResult := win_SetDocumentProperties( ::hPrinterDC, ::PrinterName, ; - @::FormType, @::Landscape, ; - @::Copies, @::BinNumber, ; - @::fDuplexType, @::fPrintQuality, ; - @::PaperLength, @::PaperWidth ) + @::FormType, @::Landscape, ; + @::Copies, @::BinNumber, ; + @::fDuplexType, @::fPrintQuality, ; + @::PaperLength, @::PaperWidth ) ELSE lResult := win_SetDocumentProperties( ::hPrinterDC, ::PrinterName, ; - ::FormType, ::Landscape, ; - ::Copies, ::BinNumber, ; - ::fDuplexType, ::fPrintQuality, ; - ::PaperLength, ::PaperWidth ) + ::FormType, ::Landscape, ; + ::Copies, ::BinNumber, ; + ::fDuplexType, ::fPrintQuality, ; + ::PaperLength, ::PaperWidth ) ENDIF IF !lResult @@ -254,7 +257,7 @@ METHOD Create() CLASS WIN_PRN ENDIF // Set mapping mode to pixels, topleft down win_SetMapMode( ::hPrinterDC, WIN_MM_TEXT ) -// win_SetTextCharacterExtra( ::hPrinterDC, 0 ) // do not add extra char spacing even if bold +// win_SetTextCharacterExtra( ::hPrinterDC, 0 ) // do not add extra char spacing even if bold // Get Margins etc... here ::PageWidth := win_GetDeviceCaps( ::hPrinterDC, WIN_PHYSICALWIDTH ) ::PageHeight := win_GetDeviceCaps( ::hPrinterDC, WIN_PHYSICALHEIGHT ) @@ -285,26 +288,32 @@ METHOD Create() CLASS WIN_PRN ::fOldPaperWidth := ::PaperWidth ENDIF ENDIF + RETURN lResult METHOD Destroy() CLASS WIN_PRN + IF ! Empty( ::hPrinterDc ) IF ::Printing ::EndDoc() ENDIF ::hPrinterDC := NIL ENDIF + RETURN .T. METHOD PROCEDURE Destruct() CLASS WIN_PRN + ::Destroy() + RETURN METHOD StartDoc( cDocName ) CLASS WIN_PRN + LOCAL lResult IF ! HB_ISSTRING( cDocName ) - cDocName := hb_ArgV( 0 ) + " [" + DToC( Date() ) + " - " + Time() + "]" + cDocName := hb_argv( 0 ) + " [" + DToC( Date() ) + " - " + Time() + "]" ENDIF IF ( lResult := win_StartDoc( ::hPrinterDc, cDocName ) ) @@ -314,9 +323,11 @@ METHOD StartDoc( cDocName ) CLASS WIN_PRN ::Printing := .T. ENDIF ENDIF + RETURN lResult METHOD EndDoc( lAbortDoc ) CLASS WIN_PRN + IF ::HavePrinted IF ! HB_ISLOGICAL( lAbortDoc ) lAbortDoc := .F. @@ -332,9 +343,11 @@ METHOD EndDoc( lAbortDoc ) CLASS WIN_PRN ENDIF ::HavePrinted := ::Printing := ::PageInit := .F. ::PageNumber := 0 + RETURN .T. METHOD StartPage() CLASS WIN_PRN + LOCAL lLLandScape LOCAL nLBinNumber LOCAL nLFormType @@ -376,18 +389,20 @@ METHOD StartPage() CLASS WIN_PRN ENDIF IF lChangeDP win_SetDocumentProperties( ::hPrinterDC, ::PrinterName, ; - nLFormType, lLLandscape, , ; - nLBinNumber, nLDuplexType, nLPrintQuality, ; - nLPaperLength, nLPaperWidth ) + nLFormType, lLLandscape, , ; + nLBinNumber, nLDuplexType, nLPrintQuality, ; + nLPaperLength, nLPaperWidth ) ENDIF win_StartPage( ::hPrinterDC ) ::PageNumber++ ::PageInit := .F. ::PosX := ::LeftMargin ::PosY := ::TopMargin + RETURN .T. METHOD CheckPage() CLASS WIN_PRN + IF ::PageInit ::PageInit := .F. win_StartPage( ::hPrinterDC ) @@ -396,6 +411,7 @@ METHOD CheckPage() CLASS WIN_PRN ::SetFont() ENDIF ENDIF + RETURN ::Printing METHOD EndPage( lStartNewPage ) CLASS WIN_PRN @@ -420,8 +436,10 @@ METHOD EndPage( lStartNewPage ) CLASS WIN_PRN RETURN .T. METHOD NewLine() CLASS WIN_PRN + ::PosX := ::LeftMargin ::PosY += ::LineHeight + RETURN ::PosY METHOD NewPage( lDelay ) CLASS WIN_PRN @@ -440,17 +458,20 @@ METHOD NewPage( lDelay ) CLASS WIN_PRN RETURN .T. METHOD GetDocumentProperties() CLASS WIN_PRN - RETURN win_GetDocumentProperties( ::PrinterName, @::FormType, @::Landscape, ; - @::Copies, @::BinNumber, @::fDuplexType, ; - @::fPrintQuality, ; - @::PaperLength, @::PaperWidth ) + RETURN win_GetDocumentProperties( ::PrinterName, ; + @::FormType, @::Landscape, ; + @::Copies, @::BinNumber, ; + @::fDuplexType, @::fPrintQuality, ; + @::PaperLength, @::PaperWidth ) // If font width is specified it is in "characters per inch" to emulate DotMatrix // An array {nMul,nDiv} is used to get precise size such a the Dot Matric equivalent // of Compressed print == 16.67 char per inch == { 3,-50 } // If nDiv is < 0 then Fixed width printing is forced via ExtTextOut() METHOD SetFont( cFontName, nPointSize, xWidth, nBold, lUnderline, lItalic, nCharSet, lManualSize ) CLASS WIN_PRN + LOCAL cType + IF cFontName != NIL ::FontName := cFontName ENDIF @@ -471,7 +492,7 @@ METHOD SetFont( cFontName, nPointSize, xWidth, nBold, lUnderline, lItalic, nChar ::fBold := nBold ENDIF IF lUnderLine != NIL - ::fUnderline:= lUnderLine + ::fUnderline := lUnderLine ENDIF IF lItalic != NIL ::fItalic := lItalic @@ -485,15 +506,19 @@ METHOD SetFont( cFontName, nPointSize, xWidth, nBold, lUnderline, lItalic, nChar ::CharHeight := ::GetCharHeight() ENDIF ::FontName := win_GetPrinterFontName( ::hPrinterDC ) // Get the font name that Windows actually used + RETURN ::SetFontOk METHOD GetCharWidth() CLASS WIN_PRN + LOCAL nWidth + IF ::FontWidth[ 2 ] < 0 .AND. ! Empty( ::FontWidth[ 1 ] ) nWidth := wapi_MulDiv( ::FontWidth[ 1 ], ::PixelsPerInchX, ::FontWidth[ 2 ] ) ELSE nWidth := win_GetCharSize( ::hPrinterDC ) ENDIF + RETURN nWidth METHOD GetCharHeight() CLASS WIN_PRN @@ -503,69 +528,88 @@ METHOD SetDefaultFont() CLASS WIN_PRN RETURN ::SetFont( "Courier New", 12, { 1, 10 }, 0, .F., .F., 0 ) METHOD Bold( nWeight ) CLASS WIN_PRN + LOCAL nOldValue := ::fBold + IF nWeight != NIL ::fBold := nWeight IF ::Printing ::SetFont() ENDIF ENDIF + RETURN nOldValue METHOD Underline( lUnderLine ) CLASS WIN_PRN + LOCAL lOldValue := ::fUnderline + IF lUnderLine != NIL ::fUnderLine := lUnderLine IF ::Printing ::SetFont() ENDIF ENDIF + RETURN lOldValue METHOD Italic( lItalic ) CLASS WIN_PRN + LOCAL lOldValue := ::fItalic + IF lItalic != NIL ::fItalic := lItalic IF ::Printing ::SetFont() ENDIF ENDIF + RETURN lOldValue METHOD CharSet( nCharSet ) CLASS WIN_PRN + LOCAL nOldValue := ::fCharSet + IF nCharSet != NIL ::fCharSet := nCharSet IF ::Printing ::SetFont() ENDIF ENDIF + RETURN nOldValue METHOD SetDuplexType( nDuplexType ) CLASS WIN_PRN + LOCAL nOldValue := ::fDuplexType + IF nDuplexType != NIL ::fNewDuplexType := nDuplexType IF ! ::Printing ::fDuplexType := nDuplexType ENDIF ENDIF + RETURN nOldValue METHOD SetPrintQuality( nPrintQuality ) CLASS WIN_PRN + LOCAL nOldValue := ::fPrintQuality + IF nPrintQuality != NIL ::fNewPrintQuality := nPrintQuality IF ! ::Printing ::fPrintQuality := nPrintQuality ENDIF ENDIF + RETURN nOldValue METHOD GetFonts() CLASS WIN_PRN RETURN win_EnumFonts( ::hPrinterDC ) METHOD SetPos( nPosX, nPosY ) CLASS WIN_PRN + LOCAL aOldValue := { ::PosX, ::PosY } IF nPosX != NIL @@ -592,12 +636,15 @@ METHOD SetColor( nClrText, nClrPane, nAlign ) CLASS WIN_PRN RETURN win_SetColor( ::hPrinterDC, nClrText, nClrPane, nAlign ) METHOD SetBkMode( nMode ) CLASS WIN_PRN + IF HB_ISNUMERIC( nMode ) ::BkMode := nMode ENDIF + RETURN win_SetBkMode( ::hPrinterDc, nMode ) METHOD TextOut( cString, lNewLine, lUpdatePosX, nAlign ) CLASS WIN_PRN + LOCAL lResult := .F. LOCAL nPosX @@ -610,7 +657,7 @@ METHOD TextOut( cString, lNewLine, lUpdatePosX, nAlign ) CLASS WIN_PRN lUpdatePosX := .T. ENDIF IF ! HB_ISNUMERIC( nAlign ) - nAlign := HB_BITOR( WIN_TA_BOTTOM, WIN_TA_LEFT ) + nAlign := hb_bitOr( WIN_TA_BOTTOM, WIN_TA_LEFT ) ENDIF nPosX := win_TextOut( ::hPrinterDC, ::PosX, ::PosY, cString, Len( cString ), ::fCharWidth, nAlign ) @@ -629,10 +676,13 @@ METHOD TextOut( cString, lNewLine, lUpdatePosX, nAlign ) CLASS WIN_PRN RETURN lResult METHOD TextOutAt( nPosX, nPosY, cString, lNewLine, lUpdatePosX, nAlign ) CLASS WIN_PRN + ::SetPos( nPosX, nPosY ) + RETURN ::TextOut( cString, lNewLine, lUpdatePosX, nAlign ) METHOD TextAtFont( nPosX, nPosY, cString, cFont, nPointSize, nWidth, nBold, lUnderLine, lItalic, nCharSet, lNewLine, lUpdatePosX, nColor, nAlign ) CLASS WIN_PRN + LOCAL lResult LOCAL nDiv := 0 LOCAL cType @@ -669,15 +719,19 @@ METHOD TextAtFont( nPosX, nPosY, cString, cFont, nPointSize, nWidth, nBold, lUnd ENDIF ENDIF + RETURN lResult METHOD SetPen( nStyle, nWidth, nColor ) CLASS WIN_PRN + ::PenStyle := nStyle ::PenWidth := nWidth ::PenColor := nColor + RETURN ! Empty( ::hPen := win_SetPen( ::hPrinterDC, nStyle, nWidth, nColor ) ) METHOD Line( nX1, nY1, nX2, nY2 ) CLASS WIN_PRN + LOCAL lResult := .F. IF ::CheckPage() @@ -686,9 +740,11 @@ METHOD Line( nX1, nY1, nX2, nY2 ) CLASS WIN_PRN ::HavePrinted := .T. ENDIF ENDIF + RETURN lResult METHOD Box( nX1, nY1, nX2, nY2, nWidth, nHeight ) CLASS WIN_PRN + LOCAL lResult := .F. IF ::CheckPage() @@ -697,9 +753,11 @@ METHOD Box( nX1, nY1, nX2, nY2, nWidth, nHeight ) CLASS WIN_PRN ::HavePrinted := .T. ENDIF ENDIF + RETURN lResult METHOD Arc( nX1, nY1, nX2, nY2 ) CLASS WIN_PRN + LOCAL lResult := .F. IF ::CheckPage() @@ -708,9 +766,11 @@ METHOD Arc( nX1, nY1, nX2, nY2 ) CLASS WIN_PRN ::HavePrinted := .T. ENDIF ENDIF + RETURN lResult METHOD Ellipse( nX1, nY1, nX2, nY2 ) CLASS WIN_PRN + LOCAL lResult := .F. IF ::CheckPage() @@ -719,9 +779,11 @@ METHOD Ellipse( nX1, nY1, nX2, nY2 ) CLASS WIN_PRN ::HavePrinted := .T. ENDIF ENDIF + RETURN lResult METHOD FillRect( nX1, nY1, nX2, nY2, nColor ) CLASS WIN_PRN + LOCAL lResult := .F. IF ::CheckPage() @@ -730,35 +792,44 @@ METHOD FillRect( nX1, nY1, nX2, nY2, nColor ) CLASS WIN_PRN ::HavePrinted := .T. ENDIF ENDIF + RETURN lResult METHOD GetTextWidth( cString ) CLASS WIN_PRN + LOCAL nWidth + IF ::FontWidth[ 2 ] < 0 .AND. ! Empty( ::FontWidth[ 1 ] ) nWidth := Len( cString ) * ::CharWidth ELSE nWidth := win_GetTextSize( ::hPrinterDC, cString, Len( cString ) ) // Return Width in device units ENDIF + RETURN nWidth METHOD GetTextHeight( cString ) CLASS WIN_PRN RETURN win_GetTextSize( ::hPrinterDC, cString, Len( cString ), .F. ) // Return Height in device units METHOD DrawBitMap( oBmp ) CLASS WIN_PRN + LOCAL lResult := .F. + IF ::BitMapsOk .AND. ::CheckPage() .AND. ! Empty( oBmp:BitMap ) IF ( lResult := win_DrawBitMap( ::hPrinterDc, oBmp:BitMap, oBmp:Rect[ 1 ], oBmp:Rect[ 2 ], oBmp:Rect[ 3 ], oBmp:Rect[ 4 ], oBmp:DimXY[ 1 ], oBmp:DimXY[ 2 ] ) ) ::HavePrinted := .T. ENDIF ENDIF + RETURN lResult -METHOD SetPrc( nRow, nCol ) CLASS WIN_PRN +METHOD SetPRC( nRow, nCol ) CLASS WIN_PRN + ::SetPos( ( nCol * ::CharWidth ) + ::LeftMArgin, ( nRow * ::LineHeight ) + ::TopMargin ) + RETURN NIL METHOD PRow() CLASS WIN_PRN - RETURN Int( ( ::PosY- ::TopMargin ) / ::LineHeight ) // No test for Div by ZERO + RETURN Int( ( ::PosY - ::TopMargin ) / ::LineHeight ) // No test for Div by ZERO METHOD PCol() CLASS WIN_PRN RETURN Int( ( ::PosX - ::LeftMargin ) / ::CharWidth ) // Uses width of current character diff --git a/harbour/contrib/hbxdiff/tests/test.prg b/harbour/contrib/hbxdiff/tests/test.prg index 27e245957c..09c11547f4 100644 --- a/harbour/contrib/hbxdiff/tests/test.prg +++ b/harbour/contrib/hbxdiff/tests/test.prg @@ -10,7 +10,8 @@ #define _SIZE 62 -PROCEDURE main() +PROCEDURE Main() + LOCAL pMMF LOCAL cFileCtx LOCAL nSize @@ -19,7 +20,7 @@ PROCEDURE main() ? xdl_mmfile_size( pMMF ) ? xdl_mmfile_iscompact( pMMF ) - cFileCtx := hb_memoRead( __FILE__ ) + cFileCtx := hb_MemoRead( __FILE__ ) ? xdl_write_mmfile( pMMF, cFileCtx ), Len( cFileCtx ) ? xdl_mmfile_size( pMMF ) diff --git a/harbour/contrib/hbxdiff/tests/test2.prg b/harbour/contrib/hbxdiff/tests/test2.prg index 939725b520..f86ec51d99 100644 --- a/harbour/contrib/hbxdiff/tests/test2.prg +++ b/harbour/contrib/hbxdiff/tests/test2.prg @@ -9,7 +9,7 @@ #include "fileio.ch" #include "simpleio.ch" -PROCEDURE main() +PROCEDURE Main() LOCAL pMMFOld, pMMFNew, pDiff LOCAL cFileCtx @@ -38,7 +38,7 @@ PROCEDURE main() ENDIF pDiff := xdl_init_mmfile( XDLT_STD_BLKSIZE, XDL_MMF_ATOMIC ) - cFileCtx := hb_memoRead( cDiffName ) + cFileCtx := hb_MemoRead( cDiffName ) xdl_write_mmfile( pDiff, cFileCtx ) hNew := FCreate( hb_FNameMerge( NIL, cDiffName, ".new" ), FC_NORMAL ) diff --git a/harbour/contrib/hbxdiff/tests/test3.prg b/harbour/contrib/hbxdiff/tests/test3.prg index 4301b4ba7b..c91f8bfc4b 100644 --- a/harbour/contrib/hbxdiff/tests/test3.prg +++ b/harbour/contrib/hbxdiff/tests/test3.prg @@ -18,7 +18,7 @@ FUNCTION Diff( ... ) RETURN 0 -PROCEDURE main() +PROCEDURE Main() LOCAL pMMFOld, pMMFNew LOCAL cFileCtx @@ -26,7 +26,7 @@ PROCEDURE main() pMMFOld := xdl_init_mmfile( XDLT_STD_BLKSIZE ) pMMFNew := xdl_init_mmfile( XDLT_STD_BLKSIZE, XDL_MMF_ATOMIC ) - cFileCtx := hb_memoRead( __FILE__ ) + cFileCtx := hb_MemoRead( __FILE__ ) xdl_write_mmfile( pMMFOld, @cFileCtx ) xdl_write_mmfile( pMMFNew, cFileCtx + hb_eol() + Space( 3 ) + "RETURN NIL" + hb_eol() ) diff --git a/harbour/contrib/hbxpp/dbfuncsx.prg b/harbour/contrib/hbxpp/dbfuncsx.prg index 0622ea8fe1..90674f7522 100644 --- a/harbour/contrib/hbxpp/dbfuncsx.prg +++ b/harbour/contrib/hbxpp/dbfuncsx.prg @@ -66,6 +66,7 @@ FUNCTION _dbExport( cFile, aFields, bFor, bWhile, nNext, nRecord, lRest, cXPP_Dr RETURN __dbCopy( cFile, aFields, bFor, bWhile, nNext, nRecord, lRest, cXPP_Driver ) FUNCTION xpp_dbUseArea( lNewArea, cDriver, cName, xcAlias, lShared, lReadonly ) + LOCAL nOldArea LOCAL nArea @@ -81,7 +82,7 @@ FUNCTION xpp_dbUseArea( lNewArea, cDriver, cName, xcAlias, lShared, lReadonly ) IF HB_ISSTRING( xcAlias ) nOldArea := Select() IF ( nArea := Select( xcAlias ) ) > 0 - xcAlias += "_" + hb_ntos( nArea ) + xcAlias += "_" + hb_ntos( nArea ) ENDIF dbSelectArea( nOldArea ) ENDIF diff --git a/harbour/contrib/hbxpp/runshell.prg b/harbour/contrib/hbxpp/runshell.prg index d49d385a1a..1b14f27e46 100644 --- a/harbour/contrib/hbxpp/runshell.prg +++ b/harbour/contrib/hbxpp/runshell.prg @@ -56,36 +56,36 @@ FUNCTION RunShell( cCommand, cProgram, lAsync, lBackground ) HB_SYMBOL_UNUSED( lBackground ) IF ! HB_ISSTRING( cProgram ) - #if defined( __PLATFORM__UNIX ) - cProgram := hb_getenv( "SHELL" ) - #elif defined( __PLATFORM__OS2 ) - cProgram := hb_getenv( "OS2_SHELL" ) - #else - cProgram := hb_getenv( "COMSPEC" ) - #endif +#if defined( __PLATFORM__UNIX ) + cProgram := hb_GetEnv( "SHELL" ) +#elif defined( __PLATFORM__OS2 ) + cProgram := hb_GetEnv( "OS2_SHELL" ) +#else + cProgram := hb_GetEnv( "COMSPEC" ) +#endif IF Empty( cProgram ) - #if defined( __PLATFORM__WINDOWS ) - IF hb_osIsWinNT() - cProgram := "cmd.exe" - ELSE - cProgram := "command.com" - ENDIF - #elif defined( __PLATFORM__DOS ) - cProgram := "command.com" - #elif defined( __PLATFORM__OS2 ) +#if defined( __PLATFORM__WINDOWS ) + IF hb_osIsWinNT() cProgram := "cmd.exe" - #else - cProgram := "" - #endif + ELSE + cProgram := "command.com" + ENDIF +#elif defined( __PLATFORM__DOS ) + cProgram := "command.com" +#elif defined( __PLATFORM__OS2 ) + cProgram := "cmd.exe" +#else + cProgram := "" +#endif ENDIF ENDIF IF HB_ISSTRING( cCommand ) - #if defined( __PLATFORM__UNIX ) - cProgram += " " + cCommand - #else - cProgram += " /c " + cCommand - #endif +#if defined( __PLATFORM__UNIX ) + cProgram += " " + cCommand +#else + cProgram += " /c " + cCommand +#endif ENDIF RETURN hb_processRun( LTrim( cProgram ), NIL, NIL, NIL, lAsync ) diff --git a/harbour/contrib/hbxpp/tbrowsex.prg b/harbour/contrib/hbxpp/tbrowsex.prg index 757c3b2131..dd53037219 100644 --- a/harbour/contrib/hbxpp/tbrowsex.prg +++ b/harbour/contrib/hbxpp/tbrowsex.prg @@ -60,7 +60,7 @@ CREATE CLASS xpp_TBrowse INHERIT TBrowse -EXPORTED: + EXPORTED: METHOD viewArea() METHOD firstScrCol() @@ -85,11 +85,12 @@ METHOD viewArea() CLASS xpp_TBrowse /* _MAXFREEZE( ::nFrozen, ::aColData, @nWidth ) */ nFrozenWidth -= nWidth - RETURN { ::n_Top + ::nHeadHeight + iif( ::lHeadSep, 1, 0 ),; - ::n_Left,; - ::n_Bottom - ::nFootHeight - iif( ::lFootSep, 1, 0 ),; - ::n_Right,; - nFrozenWidth } + RETURN { ; + ::n_Top + ::nHeadHeight + iif( ::lHeadSep, 1, 0 ), ; + ::n_Left, ; + ::n_Bottom - ::nFootHeight - iif( ::lFootSep, 1, 0 ), ; + ::n_Right, ; + nFrozenWidth } /* NOTE: Returns the left margin relative column position of the first non-frozen column. Xbase++ compatible method. */ diff --git a/harbour/contrib/hbxpp/tests/opover.prg b/harbour/contrib/hbxpp/tests/opover.prg index 5f1ed4eee5..808cd96f1c 100644 --- a/harbour/contrib/hbxpp/tests/opover.prg +++ b/harbour/contrib/hbxpp/tests/opover.prg @@ -7,6 +7,9 @@ #include "hbxpp.ch" PROCEDURE Main() + LOCAL cString := "ABC" + ? cString[ 2 ] // ------> 'B' + RETURN diff --git a/harbour/contrib/hbxpp/tests/testdll.prg b/harbour/contrib/hbxpp/tests/testdll.prg index cb67b8dd38..13d5adfe0f 100644 --- a/harbour/contrib/hbxpp/tests/testdll.prg +++ b/harbour/contrib/hbxpp/tests/testdll.prg @@ -17,13 +17,44 @@ #include "dll.ch" -#define MAX_PATH 260 +#define MAX_PATH 260 + +#define MB_OK 0x00000000 +#define MB_OKCANCEL 0x00000001 +#define MB_ABORTRETRYIGNORE 0x00000002 +#define MB_YESNOCANCEL 0x00000003 +#define MB_YESNO 0x00000004 +#define MB_RETRYCANCEL 0x00000005 +#define MB_CANCELTRYCONTINUE 0x00000006 +#define MB_ICONHAND 0x00000010 +#define MB_ICONQUESTION 0x00000020 +#define MB_ICONEXCLAMATION 0x00000030 +#define MB_ICONASTERISK 0x00000040 +#define MB_USERICON 0x00000080 +#define MB_DEFBUTTON2 0x00000100 +#define MB_DEFBUTTON3 0x00000200 +#define MB_DEFBUTTON4 0x00000300 +#define MB_SYSTEMMODAL 0x00001000 +#define MB_TASKMODAL 0x00002000 +#define MB_HELP 0x00004000 +#define MB_NOFOCUS 0x00008000 +#define MB_SETFOREGROUND 0x00010000 +#define MB_DEFAULT_DESKTOP_ONLY 0x00020000 +#define MB_TOPMOST 0x00040000 +#define MB_RIGHT 0x00080000 +#define MB_RTLREADING 0x00100000 + +#define SPI_SETDRAGFULLWINDOWS 37 + +#define CSIDL_APPDATA 0x001a /* <username>\Application Data */ +#define CSIDL_ADMINTOOLS 0x0030 /* <username>\Start Menu\Programs\Administrative Tools */ PROCEDURE Main() + LOCAL hDLL LOCAL cData - #if defined( __PLATFORM__WINDOWS ) +#if defined( __PLATFORM__WINDOWS ) IF hb_FileExists( "pscript.dll" ) hDLL := DllLoad( "pscript.dll" ) @@ -47,37 +78,10 @@ PROCEDURE Main() ? cData DllUnload( hDLL ) - #define MB_OK 0x00000000 - #define MB_OKCANCEL 0x00000001 - #define MB_ABORTRETRYIGNORE 0x00000002 - #define MB_YESNOCANCEL 0x00000003 - #define MB_YESNO 0x00000004 - #define MB_RETRYCANCEL 0x00000005 - #define MB_CANCELTRYCONTINUE 0x00000006 - #define MB_ICONHAND 0x00000010 - #define MB_ICONQUESTION 0x00000020 - #define MB_ICONEXCLAMATION 0x00000030 - #define MB_ICONASTERISK 0x00000040 - #define MB_USERICON 0x00000080 - #define MB_DEFBUTTON2 0x00000100 - #define MB_DEFBUTTON3 0x00000200 - #define MB_DEFBUTTON4 0x00000300 - #define MB_SYSTEMMODAL 0x00001000 - #define MB_TASKMODAL 0x00002000 - #define MB_HELP 0x00004000 - #define MB_NOFOCUS 0x00008000 - #define MB_SETFOREGROUND 0x00010000 - #define MB_DEFAULT_DESKTOP_ONLY 0x00020000 - #define MB_TOPMOST 0x00040000 - #define MB_RIGHT 0x00080000 - #define MB_RTLREADING 0x00100000 - ? "MsgBox:", DllCall( "user32.dll", DLL_OSAPI, "MessageBoxA", 0, "Hello world!", "Harbour sez", hb_bitOr( MB_OKCANCEL, MB_ICONEXCLAMATION, MB_HELP ) ) /* Force Windows not to show dragged windows contents */ - #define SPI_SETDRAGFULLWINDOWS 37 - ? "Full content drag: OFF" ? DllCall( "user32.dll", DLL_OSAPI, "SystemParametersInfoA", SPI_SETDRAGFULLWINDOWS, 0, 0, 0 ) Inkey( 0 ) @@ -86,9 +90,6 @@ PROCEDURE Main() ? DllCall( "user32.dll", DLL_OSAPI, "SystemParametersInfoA", SPI_SETDRAGFULLWINDOWS, 1, 0, 0 ) Inkey( 0 ) - #define CSIDL_APPDATA 0x001a /* <username>\Application Data */ - #define CSIDL_ADMINTOOLS 0x0030 /* <username>\Start Menu\Programs\Administrative Tools */ - ? "DLLCALL" cData := Space( MAX_PATH ) ? DllCall( "shell32.dll", DLL_OSAPI, "SHGetFolderPathA", 0, CSIDL_ADMINTOOLS, 0, 0, @cData ) @@ -99,6 +100,6 @@ PROCEDURE Main() ? DllCall( "shell32.dll", DLL_OSAPI, "SHGetFolderPathW", 0, CSIDL_ADMINTOOLS, 0, 0, @cData ) ? "REF:", cData - #endif +#endif RETURN diff --git a/harbour/contrib/hbxpp/thfuncx.prg b/harbour/contrib/hbxpp/thfuncx.prg index 0507f643bf..050ffb3ecb 100644 --- a/harbour/contrib/hbxpp/thfuncx.prg +++ b/harbour/contrib/hbxpp/thfuncx.prg @@ -51,7 +51,7 @@ */ FUNCTION ThreadID() - RETURN hb_threadId() + RETURN hb_threadID() FUNCTION ThreadObject( oThread ) @@ -63,6 +63,7 @@ FUNCTION ThreadObject( oThread ) FUNCTION ThreadWait( aThreads, nTimeOut ) + LOCAL xResult, nPos, apThIDs, th apThIDs := {} @@ -75,7 +76,7 @@ FUNCTION ThreadWait( aThreads, nTimeOut ) NEXT nPos := hb_threadWait( apThIDs, iif( HB_ISNUMERIC( nTimeOut ) .AND. nTimeOut != 0, ; - nTimeOut / 100, ) ) + nTimeOut / 100, ) ) IF nPos != 0 xResult := aThreads[ nPos ] ENDIF @@ -84,6 +85,7 @@ FUNCTION ThreadWait( aThreads, nTimeOut ) FUNCTION ThreadWaitAll( aThreads, nTimeOut ) + LOCAL apThIDs, th apThIDs := {} @@ -96,6 +98,6 @@ FUNCTION ThreadWaitAll( aThreads, nTimeOut ) NEXT RETURN hb_threadWait( apThIDs, iif( HB_ISNUMERIC( nTimeOut ) .AND. nTimeOut != 0, ; - nTimeOut / 100, ), .T. ) == Len( apThIDs ) + nTimeOut / 100, ), .T. ) == Len( apThIDs ) /* TODO: ThreadInfo() */ diff --git a/harbour/contrib/hbxpp/xppop.prg b/harbour/contrib/hbxpp/xppop.prg index 0d6f2451e9..2f4667f3ed 100644 --- a/harbour/contrib/hbxpp/xppop.prg +++ b/harbour/contrib/hbxpp/xppop.prg @@ -63,16 +63,22 @@ ANNOUNCE XPP_OP_OVERLOAD ENDIF INIT PROCEDURE xpp_Init() + ASSOCIATE CLASS xpp_op_Character WITH TYPE Character ASSOCIATE CLASS xpp_op_Array WITH TYPE Array + RETURN CREATE CLASS Character FUNCTION xpp_op_Character + OPTIONAL INHERIT HBCharacter OPERATOR "[]" FUNCTION XPP_INDEX() + ENDCLASS CREATE CLASS Array FUNCTION xpp_op_Array + OPTIONAL INHERIT HBArray OPERATOR "$$" FUNCTION XPP_INCLUDE() + ENDCLASS diff --git a/harbour/contrib/hbzebra/tests/testcair.prg b/harbour/contrib/hbzebra/tests/testcair.prg index ac880c4e15..f2267eca7e 100644 --- a/harbour/contrib/hbzebra/tests/testcair.prg +++ b/harbour/contrib/hbzebra/tests/testcair.prg @@ -9,6 +9,7 @@ #include "hbcairo.ch" PROCEDURE Main() + LOCAL hCairo, hSurface hSurface := cairo_pdf_surface_create( "testcair.pdf", 567, 794 ) // A4 @@ -39,19 +40,21 @@ PROCEDURE Main() DrawBarcode( hCairo, 340, 1, "CODE93", "TEST93" ) DrawBarcode( hCairo, 360, 1, "CODE11", "12", HB_ZEBRA_FLAG_WIDE3 ) DrawBarcode( hCairo, 380, 1, "CODE11", "1234567890", HB_ZEBRA_FLAG_CHECKSUM + HB_ZEBRA_FLAG_WIDE3 ) - DrawBarcode( hCairo, 400, 1, "CODE128", "Code 128") - DrawBarcode( hCairo, 420, 1, "CODE128", "61300073570004616") - DrawBarcode( hCairo, 440, 1, "CODE128", "Wikipedia") + DrawBarcode( hCairo, 400, 1, "CODE128", "Code 128" ) + DrawBarcode( hCairo, 420, 1, "CODE128", "61300073570004616" ) + DrawBarcode( hCairo, 440, 1, "CODE128", "Wikipedia" ) DrawBarcode( hCairo, 460, 1, "PDF417", "Hello, World of Harbour!!! It's 2D barcode PDF417 :)" ) - DrawBarcode( hCairo, 540, 1, "DATAMATRIX", "Hello, World of Harbour!!! It's 2D barcode DataMatrix :)") + DrawBarcode( hCairo, 540, 1, "DATAMATRIX", "Hello, World of Harbour!!! It's 2D barcode DataMatrix :)" ) DrawBarcode( hCairo, 580, 1, "QRCODE", "http://harbour-project.org/" ) cairo_destroy( hCairo ) cairo_surface_write_to_png( hSurface, "testcair.png" ) cairo_surface_destroy( hSurface ) + RETURN PROCEDURE DrawBarcode( hCairo, nY, nLineWidth, cType, cCode, nFlags ) + LOCAL hZebra, nLineHeight, cTxt SWITCH cType @@ -89,6 +92,7 @@ PROCEDURE DrawBarcode( hCairo, nY, nLineWidth, cType, cCode, nFlags ) ELSE ? "Invalid barcode type", cType ENDIF + RETURN STATIC FUNCTION hb_zebra_draw_cairo( hZebra, hCairo, ... ) diff --git a/harbour/contrib/hbzebra/tests/testhpdf.prg b/harbour/contrib/hbzebra/tests/testhpdf.prg index 3f0d957db1..4a70e2f5c7 100644 --- a/harbour/contrib/hbzebra/tests/testhpdf.prg +++ b/harbour/contrib/hbzebra/tests/testhpdf.prg @@ -17,6 +17,7 @@ #include "harupdf.ch" PROCEDURE Main() + LOCAL pdf LOCAL page @@ -44,11 +45,11 @@ PROCEDURE Main() DrawBarcode( page, 340, 1, "CODE93", "TEST93" ) DrawBarcode( page, 360, 1, "CODE11", "12", HB_ZEBRA_FLAG_WIDE3 ) DrawBarcode( page, 380, 1, "CODE11", "1234567890", HB_ZEBRA_FLAG_CHECKSUM + HB_ZEBRA_FLAG_WIDE3 ) - DrawBarcode( page, 400, 1, "CODE128", "Code 128") - DrawBarcode( page, 420, 1, "CODE128", "1234567890") - DrawBarcode( page, 440, 1, "CODE128", "Wikipedia") + DrawBarcode( page, 400, 1, "CODE128", "Code 128" ) + DrawBarcode( page, 420, 1, "CODE128", "1234567890" ) + DrawBarcode( page, 440, 1, "CODE128", "Wikipedia" ) DrawBarcode( page, 460, 1, "PDF417", "Hello, World of Harbour!!! It's 2D barcode PDF417 :)" ) - DrawBarcode( page, 540, 1, "DATAMATRIX", "Hello, World of Harbour!!! It's 2D barcode DataMatrix :)") + DrawBarcode( page, 540, 1, "DATAMATRIX", "Hello, World of Harbour!!! It's 2D barcode DataMatrix :)" ) DrawBarcode( page, 580, 1, "QRCODE", "http://harbour-project.org/" ) FErase( "testhpdf.pdf" ) @@ -57,6 +58,7 @@ PROCEDURE Main() RETURN PROCEDURE DrawBarcode( page, nY, nLineWidth, cType, cCode, nFlags ) + LOCAL hZebra, nLineHeight, cTxt nY := HPDF_Page_GetHeight( page ) - nY diff --git a/harbour/contrib/hbzebra/tests/testwin.prg b/harbour/contrib/hbzebra/tests/testwin.prg index 68d86132f7..401ab3ad9c 100644 --- a/harbour/contrib/hbzebra/tests/testwin.prg +++ b/harbour/contrib/hbzebra/tests/testwin.prg @@ -17,12 +17,13 @@ #include "hbwin.ch" PROCEDURE Main() + LOCAL hDC LOCAL pDEVMODE := __wapi_DEVMODE_New( "Microsoft XPS Document Writer" ) LOCAL hOBJECT - __wapi_DEVMODE_Set( pDEVMODE, {; - "dmPaperSize" => WIN_DMPAPER_A4,; + __wapi_DEVMODE_Set( pDEVMODE, { ; + "dmPaperSize" => WIN_DMPAPER_A4, ; "dmOrientation" => WIN_DMORIENT_PORTRAIT } ) hDC := wapi_CreateDC( NIL, "Microsoft XPS Document Writer", NIL, pDEVMODE ) @@ -36,20 +37,21 @@ PROCEDURE Main() IF wapi_StartPage( hDC ) > 0 - hOBJECT := wapi_CreateFont( 96,; - 42,; - NIL,; - NIL,; - WIN_FW_NORMAL,; - .F.,; - .F.,; - NIL,; - WIN_ANSI_CHARSET,; - NIL,; - NIL,; - NIL,; - NIL,; - "Arial" ) + hOBJECT := wapi_CreateFont( ; + 96, ; + 42, ; + NIL, ; + NIL, ; + WIN_FW_NORMAL, ; + .F., ; + .F., ; + NIL, ; + WIN_ANSI_CHARSET, ; + NIL, ; + NIL, ; + NIL, ; + NIL, ; + "Arial" ) wapi_SelectObject( hDC, hOBJECT ) @@ -72,11 +74,11 @@ PROCEDURE Main() DrawBarcode( hDC, 340, 1, "CODE93", "TEST93" ) DrawBarcode( hDC, 360, 1, "CODE11", "12", HB_ZEBRA_FLAG_WIDE3 ) DrawBarcode( hDC, 380, 1, "CODE11", "1234567890", HB_ZEBRA_FLAG_CHECKSUM + HB_ZEBRA_FLAG_WIDE3 ) - DrawBarcode( hDC, 400, 1, "CODE128", "Code 128") - DrawBarcode( hDC, 420, 1, "CODE128", "1234567890") - DrawBarcode( hDC, 440, 1, "CODE128", "Wikipedia") + DrawBarcode( hDC, 400, 1, "CODE128", "Code 128" ) + DrawBarcode( hDC, 420, 1, "CODE128", "1234567890" ) + DrawBarcode( hDC, 440, 1, "CODE128", "Wikipedia" ) DrawBarcode( hDC, 460, 1, "PDF417", "Hello, World of Harbour!!! It's 2D barcode PDF417 :)" ) - DrawBarcode( hDC, 540, 1, "DATAMATRIX", "Hello, World of Harbour!!! It's 2D barcode DataMatrix :)") + DrawBarcode( hDC, 540, 1, "DATAMATRIX", "Hello, World of Harbour!!! It's 2D barcode DataMatrix :)" ) DrawBarcode( hDC, 580, 1, "QRCODE", "http://harbour-project.org/" ) wapi_EndPage( hDC ) @@ -90,6 +92,7 @@ PROCEDURE Main() #define _SCALE_ 7.2 PROCEDURE DrawBarcode( hDC, nY, nLineWidth, cType, cCode, nFlags ) + LOCAL hZebra, nLineHeight, cTxt SWITCH cType diff --git a/harbour/contrib/hbziparc/doc/en/hbziparc.txt b/harbour/contrib/hbziparc/doc/en/hbziparc.txt index 65d58bedfa..2d2801b6e7 100644 --- a/harbour/contrib/hbziparc/doc/en/hbziparc.txt +++ b/harbour/contrib/hbziparc/doc/en/hbziparc.txt @@ -79,13 +79,13 @@ This function tests if the disk inserted is the last disk of an backup set or not. It will return the follow return code when an error is found - + <table> Error code Meaning 114 Incorrect Disk 103 No Call back was set with hb_ZipTestPK() </table> - + Call this function to determine if the disk inserted is the correct one before any other function. $EXAMPLES$ @@ -121,7 +121,7 @@ This function will set an codeblock that will be evaluated every time that an changedisk event is necessary. <bBlock> receives nDisk as a code block param that corresponds to the diskette number to be processed. - + Set this function before opening archives that are in removable media. This block will be released, when the caller finish it job. $EXAMPLES$ @@ -141,25 +141,25 @@ $CATEGORY$ Zip Functions $ONELINER$ - + $SYNTAX$ hb_SetBuffer( [<nWriteBuffer>], [<nExtractBuffer>], [<nReadBuffer>] ) --> NIL $ARGUMENTS$ <nWriteBuffer> The size of the write buffer. - + <nExtractBuffer> The size of the extract buffer. - + <nReadBuffer> The size of the read buffer. $RETURNS$ <NIL> This function always returns NIL. $DESCRIPTION$ This function set the size of the internal buffers for write/extract/read operation. - + If the size of the buffer is smaller then the default, the function will automatically use the default values, which are 65535/16384/32768 respectively. - + This function be called before any of the compression/decompression functions. $EXAMPLES$ @@ -188,27 +188,27 @@ <pFileProgress>) --> lCompress $ARGUMENTS$ <cFile> Name of the zip file - + <cFileToCompress> Name of a file to Compress, Drive and/or path can be used _or_ <aFiles> An array containing files to compress, Drive and/or path can be used - + <nLevel> Compression level ranging from 0 to 9 - + <bBlock> Code block to execute while compressing - + <lOverWrite> Toggle to overwrite the file if exists - + <cPassword> Password to encrypt the files - + <iSize> Size of the archive, in bytes. Default is 1457664 bytes - + <lWithPath> Toggle to store the path or not - + <lWithDrive> Toggle to store the Drive letter and path or not - + <pFileProgress> Code block for File Progress $RETURNS$ <lCompress> .T. if file was create, otherwise .F. @@ -218,41 +218,41 @@ character string, this file will be added to the zip file. If the second parameter is an array, all file names contained in <aFiles> will be compressed. - + If <nLevel> is used, it determines the compression type where 0 means no compression and 9 means best compression. - + If <bBlock> is used, every time the file is opened to compress it will evaluate bBlock. Parameters of bBlock are cFile and nPos. - + If <lOverWrite> is used, it toggles to overwrite or not the existing file. Default is to overwrite the file, otherwise if <lOverWrite> is false the new files are added to the <cFile>. - + If <lWithPath> is used, it tells thats the path should also be stored with the file name. Default is false. - + If <lWithDrive> is used, it tells thats the Drive and path should also be stored with the file name. Default is false. - + If <pFileProgress> is used, an Code block is evaluated, showing the total of that file has being processed. The codeblock must be defined as follow {| nPos, nTotal | GaugeUpdate( aGauge1, nPos / nTotal ) } $EXAMPLES$ PROCEDURE Main() - + IF hb_ZipFileByTDSpan( "test.zip", "test.prg" ) ? "File was successfully created" ENDIF - + IF hb_ZipFileByTDSpan( "test1.zip", { "test.prg", "test.hbp" } ) ? "File was successfully created" ENDIF - + IF hb_ZipFileByTDSpan( "test2.zip", { "test.prg", "test.hbp" }, 9, {| nPos, cFile | QOut( cFile ) }, "hello",, 521421 ) ? "File was successfully created" ENDIF - + aFiles := { "test.prg", "test.hbp" } nLen := Len( aFiles ) aGauge := GaugeNew( 5, 5, 7, 40, "W/B", "W+/B", "." ) @@ -283,25 +283,25 @@ <pFileProgress> ) --> lCompress $ARGUMENTS$ <cFile> Name of the zip file - + <cFileToCompress> Name of a file to Compress, Drive and/or path can be used _or_ <aFiles> An array containing files to compress, Drive and/or path can be used - + <nLevel> Compression level ranging from 0 to 9 - + <bBlock> Code block to execute while compressing - + <lOverWrite> Toggle to overwrite the file if exists - + <cPassword> Password to encrypt the files - + <lWithPath> Toggle to store the path or not - + <lWithDrive> Toggle to store the Drive letter and path or not - + <pFileProgress> Code block for File Progress $RETURNS$ <lCompress> .T. if file was create, otherwise .F. @@ -312,49 +312,49 @@ second parameter is an array, all file names contained in <aFiles> will be compressed. Also, the use of this function is for creating backup in removable media like an floppy drive/zip drive. - + If <nLevel> is used, it determines the compression type where 0 means no compression and 9 means best compression. - + If <bBlock> is used, every time the file is opened to compress it will evaluate bBlock. Parameters of bBlock are cFile and nPos. - + If <lOverWrite> is used , it toggles to overwrite or not the existing file. Default is to overwrite the file, otherwise if <lOverWrite> is false the new files are added to the <cFile>. - + If <cPassword> is used, all files that are added to the archive are encrypted with the password. - + If <lWithPath> is used, it tells thats the path should also be stored with the file name. Default is false. - + If <lWithDrive> is used, it tells thats the Drive and path should also be stored with the file name. Default is false. - + If <pFileProgress> is used, an Code block is evaluated, showing the total of that file has being processed. The codeblock must be defined as follow {| nPos, nTotal | GaugeUpdate( aGauge1, nPos / nTotal ) } - + Before calling this function, Set an Changedisk codeblock by calling the hb_SetDiskZip(). $EXAMPLES$ PROCEDURE Main() - + hb_SetDiskZip( {| nDisk | Alert( "Please insert disk no " + Str( nDisk, 3 ) ) } ) - + IF hb_ZipFileByPKSpan( "test.zip", "test.prg" ) ? "File was successfully created" ENDIF - + IF hb_ZipFileByPKSpan( "test1.zip", { "test.prg", "test.hbp" } ) ? "File was successfully created" ENDIF - + IF hb_ZipFileByPKSpan( "test2.zip", { "test.prg", "test.hbp" }, 9, {| nPos, cFile | QOut( cFile ) } ) ? "File was successfully created" ENDIF - + aFiles := { "test.prg", "test.hbp" } nLen := Len( aFiles ) aGauge := GaugeNew( 5, 5, 7, 40, "W/B", "W+/B", "." ) @@ -385,25 +385,25 @@ <pFileProgress> ) --> lCompress $ARGUMENTS$ <cFile> Name of the zip file to create - + <cFileToCompress> Name of a file to Compress, Drive and/or path can be used _or_ <aFiles> An array containing files to compress, Drive and/or path can be used - + <nLevel> Compression level ranging from 0 to 9 - + <bBlock> Code block to execute while compressing - + <lOverWrite> Toggle to overwrite the file if exists - + <cPassword> Password to encrypt the files - + <lWithPath> Toggle to store the path or not - + <lWithDrive> Toggle to store the Drive letter and path or not - + <pFileProgress> Code block for File Progress $RETURNS$ <lCompress> .T. if file was create, otherwise .F. @@ -413,45 +413,45 @@ character string, this file will be added to the zip file. If the second parameter is an array, all file names contained in <aFiles> will be compressed. - + If <nLevel> is used, it determines the compression type where 0 means no compression and 9 means best compression. - + If <bBlock> is used, every time the file is opened to compress it will evaluate bBlock. Parameters of bBlock are cFile and nPos. - + If <lOverWrite> is used, it toggles to overwrite or not the existing file. Default is to overwrite the file,otherwise if <lOverWrite> is false the new files are added to the <cFile>. - + If <cPassword> is used, all files that are added to the archive are encrypted with the password. - + If <lWithPath> is used, it tells the path should also be stored with the file name. Default is false. - + If <lWithDrive> is used, it tells thats the Drive and path should also be stored with the file name. Default is false. - + If <pFileProgress> is used, an Code block is evaluated, showing the total of that file has being processed. The codeblock must be defined as follow {| nPos, nTotal | GaugeUpdate( aGauge1, nPos / nTotal ) } - + $EXAMPLES$ PROCEDURE Main() - + IF hb_ZipFile( "test.zip", "test.prg" ) ? "File was successfully created" ENDIF - + IF hb_ZipFile( "test1.zip", { "test.prg", "test.hbp" } ) ? "File was successfully created" ENDIF - + IF hb_ZipFile( "test2.zip", { "test.prg", "test.hbp" }, 9, {| cFile, nPos | QOut( cFile ) } ) ? "File was successfully created" ENDIF - + aFiles := { "test.prg", "test.hbp" } nLen := Len( aFiles ) aGauge := GaugeNew( 5, 5, 7, 40, "W/B", "W+/B" , "." ) @@ -481,17 +481,17 @@ <cFile> | <aFile>, <pFileProgress> ) --> lCompress $ARGUMENTS$ <cFile> Name of the zip file to extract - + <bBlock> Code block to execute while extracting - + <lWithPath> Toggle to create directory if needed - + <cPassWord> Password to use to extract files - + <cPath> Path to extract the files to - mandatory - + <cFile> | <aFiles> A File or Array of files to extract - mandatory - + <pFileProgress> Code block for File Progress $RETURNS$ <lCompress> .T. if all file was successfully restored, otherwise .F. @@ -499,28 +499,28 @@ This function restores all files contained inside the <cFile>. If the extension is omitted, .zip will be assumed. If a file already exists, it will be overwritten. - + If <bBlock> is used, every time the file is opened to compress it will evaluate bBlock. Parameters of bBlock are cFile and nPos. - + The <cPath> is a mandatory parameter. Set to ".\" to extract to the current directory - + If <cFile> or <aFiles> are not provided, no files will be extracted! Make sure you provide the file or files you want extracted - + If <pFileProgress> is used, an Code block is evaluated, showing the total of that file has being processed. The codeblock must be defined as follow {| nPos, nTotal | GaugeUpdate( aGauge1, nPos / nTotal ) } $EXAMPLES$ PROCEDURE Main() - + LOCAL aExtract := hb_GetFilesInZip( "test.zip" ) // extract all files in zip - + IF hb_UnzipFile( "test.zip",,,, "." + hb_ps(), aExtract ) ? "File was successfully extracted" ENDIF - + aExtract := hb_GetFilesInZip( "test2.zip" ) // extract all files in zip IF hb_UnzipFile( "test2.zip", {| cFile | QOut( cFile ) },,, "." + hb_ps(), aExtract ) ? "File was successfully extracted" @@ -548,7 +548,7 @@ hb_ZipDeleteFiles( <cFile>, <cFiletoDelete> | <aFiles> | <nFilePos> ) --> <lDeleted> $ARGUMENTS$ <cFile> The name of the zip files from where the files will be deleted - + <cFiletoDelete> An File to be removed _or_ <aFiles> An Array of Files to be removed diff --git a/harbour/contrib/hbziparc/tests/unzipa.prg b/harbour/contrib/hbziparc/tests/unzipa.prg index 5c2a959a15..744a05c7d5 100644 --- a/harbour/contrib/hbziparc/tests/unzipa.prg +++ b/harbour/contrib/hbziparc/tests/unzipa.prg @@ -8,6 +8,6 @@ PROCEDURE Main( cZip, ... ) - ? hb_UnzipFile( cZip, NIL, .F., NIL, NIL, hb_AParams(), {| x, y | QOut( Str( x / y * 100, 3 ) + "%" ) } ) + ? hb_UnzipFile( cZip, NIL, .F., NIL, NIL, hb_AParams(), {| x, y | QOut( Str( x / y * 100, 3 ) + "%" ) } ) - RETURN + RETURN diff --git a/harbour/contrib/hbziparc/tests/zipa.prg b/harbour/contrib/hbziparc/tests/zipa.prg index c18e4f96d2..9b8ce44da7 100644 --- a/harbour/contrib/hbziparc/tests/zipa.prg +++ b/harbour/contrib/hbziparc/tests/zipa.prg @@ -7,20 +7,21 @@ #include "simpleio.ch" PROCEDURE Main( cZip, ... ) - LOCAL a, b, c - SET DATE TO ANSI - SET CENTURY ON + LOCAL a, b, c - ? hb_ZipFile( cZip, hb_AParams() ) + SET DATE TO ANSI + SET CENTURY ON - a := hb_GetFilesInZip( cZip, .T. ) + ? hb_ZipFile( cZip, hb_AParams() ) - FOR EACH b IN a - ? - FOR EACH c IN b - ?? c, "" - NEXT - NEXT + a := hb_GetFilesInZip( cZip, .T. ) - RETURN + FOR EACH b IN a + ? + FOR EACH c IN b + ?? c, "" + NEXT + NEXT + + RETURN diff --git a/harbour/contrib/hbziparc/ziparc.prg b/harbour/contrib/hbziparc/ziparc.prg index 2989d6b680..7b4c6728d9 100644 --- a/harbour/contrib/hbziparc/ziparc.prg +++ b/harbour/contrib/hbziparc/ziparc.prg @@ -81,6 +81,7 @@ PROCEDURE hb_SetZipComment( cComment ) RETURN FUNCTION hb_GetZipComment( cFileName ) + LOCAL hUnzip LOCAL cComment @@ -98,6 +99,7 @@ FUNCTION hb_GetZipComment( cFileName ) RETURN cComment FUNCTION hb_GetFileCount( cFileName ) + LOCAL hUnzip LOCAL nEntries @@ -115,6 +117,7 @@ FUNCTION hb_GetFileCount( cFileName ) RETURN nEntries FUNCTION hb_ZipWithPassword( cFileName ) + LOCAL lCrypted := .F. LOCAL hUnzip @@ -177,7 +180,7 @@ FUNCTION hb_GetFilesInZip( cFileName, lVerbose ) /* TOFIX: Original hbziparch has nMethod as string: Unknown, Stored, DeflatN, DeflatX, DeflatF. */ /* TOFIX: Original hbziparch has attributes as string. */ - AAdd( aFiles, { cFileName, nSize, nMethod, nCompSize, nRatio, dDate, cTime, hb_numtohex( nCRC, 8 ), nInternalAttr /* cAttr */, lCrypted, cComment } ) + AAdd( aFiles, { cFileName, nSize, nMethod, nCompSize, nRatio, dDate, cTime, hb_NumToHex( nCRC, 8 ), nInternalAttr /* cAttr */, lCrypted, cComment } ) ELSE AAdd( aFiles, cFileName ) ENDIF @@ -241,17 +244,18 @@ FUNCTION hb_ZipFileByPKSpan( ... ) RETURN hb_ZipFile( ... ) -FUNCTION hb_ZipFile( cFileName,; - acFiles,; - nLevel,; - bUpdate,; - lOverwrite,; - cPassword,; - lWithPath,; - lWithDrive,; - bProgress,; - lFullPath,; - acExclude ) +FUNCTION hb_ZipFile( ; + cFileName, ; + acFiles, ; + nLevel, ; + bUpdate, ; + lOverwrite, ; + cPassword, ; + lWithPath, ; + lWithDrive, ; + bProgress, ; + lFullPath, ; + acExclude ) LOCAL lRetVal := .T. @@ -353,8 +357,8 @@ FUNCTION hb_ZipFile( cFileName,; hb_FGetDateTime( cFileToZip, @tTime ) hb_FNameSplit( cFileToZip, @cPath, @cName, @cExt, @cDrive ) - hb_ZipFileCreate( hZip, hb_FNameMerge( iif( lWithPath, cPath, NIL ), cName, cExt, iif( lWithDrive, cDrive, NIL ) ),; - tTime, NIL, NIL, NIL, NIL, nLevel, cPassword, iif( Empty( cPassword ), NIL, hb_ZipFileCRC32( cFileToZip ) ), NIL ) + hb_ZipFileCreate( hZip, hb_FNameMerge( iif( lWithPath, cPath, NIL ), cName, cExt, iif( lWithDrive, cDrive, NIL ) ), ; + tTime, NIL, NIL, NIL, NIL, nLevel, cPassword, iif( Empty( cPassword ), NIL, hb_ZipFileCRC32( cFileToZip ) ), NIL ) DO WHILE ( nLen := FRead( hHandle, @cBuffer, hb_BLen( cBuffer ) ) ) > 0 @@ -435,12 +439,12 @@ FUNCTION hb_UnzipFile( cFileName, bUpdate, lWithPath, cPassword, cPath, acFiles, IF hb_UnzipFileInfo( hUnzip, @cZipName, @dDate, @cTime, , , , @nSize ) == 0 /* NOTE: As opposed to original hbziparch we don't do a second match without path. */ - lExtract := Empty( acFiles ) .OR. ; + lExtract := Empty( acFiles ) .OR. ; AScan( acFiles, nPos ) > 0 .OR. ; AScan( acFiles, {| cMask | hb_FileMatch( cZipName, cMask ) } ) > 0 IF lExtract .AND. ; - ( hHandle := FCreate( cPath + cZipName ) ) != F_ERROR + ( hHandle := FCreate( cPath + cZipName ) ) != F_ERROR IF hb_UnzipFileOpen( hUnzip, cPassword ) != UNZ_OK lRetVal := .F. diff --git a/harbour/contrib/make.hb b/harbour/contrib/make.hb index d24f4094ec..982ff720ee 100755 --- a/harbour/contrib/make.hb +++ b/harbour/contrib/make.hb @@ -39,11 +39,11 @@ #define _ACT_INC_REBUILD 4 #define _ACT_INC_REBUILD_INST 5 -STATIC sc_hActions := {; - _ACT_INC_CLEAN => "clean" ,; - _ACT_INC => "build" ,; - _ACT_INC_INST => "build and install" ,; - _ACT_INC_REBUILD => "rebuild" ,; +STATIC sc_hActions := { ; + _ACT_INC_CLEAN => "clean", ; + _ACT_INC => "build", ; + _ACT_INC_INST => "build and install", ; + _ACT_INC_REBUILD => "rebuild", ; _ACT_INC_REBUILD_INST => "rebuild and install" } STATIC s_cBase @@ -53,6 +53,7 @@ STATIC s_cBinDir STATIC s_cReBase PROCEDURE Main( ... ) + LOCAL hProjectList LOCAL aParams @@ -68,11 +69,11 @@ PROCEDURE Main( ... ) s_cRoot := "../" ENDIF - #if defined( __HBSCRIPT__HBSHELL ) - s_cBinDir := hbshell_DirBase() - #else - s_cBinDir := hb_DirBase() - #endif +#if defined( __HBSCRIPT__HBSHELL ) + s_cBinDir := hbshell_DirBase() +#else + s_cBinDir := hb_DirBase() +#endif /* For *nixes */ s_cBinDir := hb_PathNormalize( s_cBinDir ) @@ -87,7 +88,7 @@ PROCEDURE Main( ... ) aParams := hb_AParams() IF AScanL( aParams, "verbose" ) > 0 - hb_setenv( "HB_BUILD_VERBOSE", "yes" ) + hb_SetEnv( "HB_BUILD_VERBOSE", "yes" ) ENDIF /* Build */ @@ -110,6 +111,7 @@ PROCEDURE Main( ... ) #5 clean install clean install _ACT_INC_REBUILD_INST -inc -rebuildall -instpath= */ PROCEDURE Standalone( aParams, hProjectList ) + LOCAL hProjectReqList LOCAL cOptionsUser @@ -210,6 +212,7 @@ PROCEDURE Standalone( aParams, hProjectList ) clean install clean _ACT_INC_CLEAN -inc -clean */ PROCEDURE GNUMake( aParams, hProjectList ) + LOCAL cProject LOCAL hProjectReqList @@ -324,20 +327,20 @@ PROCEDURE GNUMake( aParams, hProjectList ) /* Clearing envvars that may interact with hbmk2 */ /* Saving original install dirs to our own variables */ - hb_setenv( "_HB_INSTALL_BIN", GetEnv( "HB_INSTALL_BIN" ) ) - hb_setenv( "_HB_INSTALL_LIB", GetEnv( "HB_INSTALL_LIB" ) ) - hb_setenv( "_HB_INSTALL_DYN", GetEnv( "HB_INSTALL_DYN" ) ) - hb_setenv( "_HB_INSTALL_INC", GetEnv( "HB_INSTALL_INC" ) ) - hb_setenv( "_HB_INSTALL_MAN", GetEnv( "HB_INSTALL_MAN" ) ) - hb_setenv( "_HB_INSTALL_ETC", GetEnv( "HB_INSTALL_ETC" ) ) - hb_setenv( "_HB_INSTALL_CONTRIB", GetEnv( "HB_INSTALL_CONTRIB" ) ) + hb_SetEnv( "_HB_INSTALL_BIN", GetEnv( "HB_INSTALL_BIN" ) ) + hb_SetEnv( "_HB_INSTALL_LIB", GetEnv( "HB_INSTALL_LIB" ) ) + hb_SetEnv( "_HB_INSTALL_DYN", GetEnv( "HB_INSTALL_DYN" ) ) + hb_SetEnv( "_HB_INSTALL_INC", GetEnv( "HB_INSTALL_INC" ) ) + hb_SetEnv( "_HB_INSTALL_MAN", GetEnv( "HB_INSTALL_MAN" ) ) + hb_SetEnv( "_HB_INSTALL_ETC", GetEnv( "HB_INSTALL_ETC" ) ) + hb_SetEnv( "_HB_INSTALL_CONTRIB", GetEnv( "HB_INSTALL_CONTRIB" ) ) /* Override hbmk2 autodetection. WARNING: Must be in sync with global.mk logic */ - hb_setenv( "HB_INSTALL_PREFIX", s_cRoot ) - hb_setenv( "HB_INSTALL_BIN", s_cRoot + "bin/" + GetEnv( "HB_PLATFORM" ) + "/" + GetEnv( "HB_COMPILER" ) + GetEnv( "HB_BUILD_NAME" ) ) - hb_setenv( "HB_INSTALL_LIB", s_cRoot + "lib/" + GetEnv( "HB_PLATFORM" ) + "/" + GetEnv( "HB_COMPILER" ) + GetEnv( "HB_BUILD_NAME" ) ) - hb_setenv( "HB_INSTALL_DYN" ) - hb_setenv( "HB_INSTALL_INC", s_cRoot + "include" ) + hb_SetEnv( "HB_INSTALL_PREFIX", s_cRoot ) + hb_SetEnv( "HB_INSTALL_BIN", s_cRoot + "bin/" + GetEnv( "HB_PLATFORM" ) + "/" + GetEnv( "HB_COMPILER" ) + GetEnv( "HB_BUILD_NAME" ) ) + hb_SetEnv( "HB_INSTALL_LIB", s_cRoot + "lib/" + GetEnv( "HB_PLATFORM" ) + "/" + GetEnv( "HB_COMPILER" ) + GetEnv( "HB_BUILD_NAME" ) ) + hb_SetEnv( "HB_INSTALL_DYN" ) + hb_SetEnv( "HB_INSTALL_INC", s_cRoot + "include" ) /* Start building */ @@ -350,6 +353,7 @@ PROCEDURE GNUMake( aParams, hProjectList ) RETURN STATIC PROCEDURE build_projects( nAction, hProjectList, hProjectReqList, cOptionsUser, lStdAlone ) + LOCAL aPairList LOCAL aSortedList @@ -367,7 +371,7 @@ STATIC PROCEDURE build_projects( nAction, hProjectList, hProjectReqList, cOption LOCAL nErrorLevel /* Signal that we're doing a Harbour build */ - hb_setenv( "_HB_BUILD_", "yes" ) + hb_SetEnv( "_HB_BUILD_", "yes" ) /* Preprocessing */ @@ -428,7 +432,7 @@ STATIC PROCEDURE build_projects( nAction, hProjectList, hProjectReqList, cOption lInstall := nAction == _ACT_INC_INST .OR. ; nAction == _ACT_INC_REBUILD_INST - hb_setenv( iif( lStdAlone, "_HB_BUILD_INSTALL_STDALONE", "_HB_BUILD_INSTALL" ), iif( lInstall, "yes", NIL ) ) + hb_SetEnv( iif( lStdAlone, "_HB_BUILD_INSTALL_STDALONE", "_HB_BUILD_INSTALL" ), iif( lInstall, "yes", NIL ) ) /* Build the dependencies and primary targets in sorted order */ @@ -439,10 +443,10 @@ STATIC PROCEDURE build_projects( nAction, hProjectList, hProjectReqList, cOption lPrimary := cProject $ hProjectReqList lContainer := "lFromContainer" $ hProjectList[ cProject ] - IF ( nErrorLevel := call_hbmk2( cProjectPath, iif( lPrimary .OR. lContainer, iif( lContainer, cOptions, cOptions + cOptionsUser ), " -inc" ) +; - iif( ( lPrimary .OR. lContainer ) .AND. ; - hProjectList[ cProject ][ "cType" ] $ "hblib|hbdyn" .AND. ; - GetEnv( "HB_REBUILD_EXTERN" ) == "yes", " -hbx=" + hb_FNameExtSet( cProjectPath, ".hbx" ), "" ), NIL ) ) == 0 + IF ( nErrorLevel := call_hbmk2( cProjectPath, iif( lPrimary .OR. lContainer, iif( lContainer, cOptions, cOptions + cOptionsUser ), " -inc" ) + ; + iif( ( lPrimary .OR. lContainer ) .AND. ; + hProjectList[ cProject ][ "cType" ] $ "hblib|hbdyn" .AND. ; + GetEnv( "HB_REBUILD_EXTERN" ) == "yes", " -hbx=" + hb_FNameExtSet( cProjectPath, ".hbx" ), "" ), NIL ) ) == 0 /* Build dynamic lib */ IF GetEnv( "HB_BUILD_CONTRIB_DYN" ) == "yes" .AND. hProjectList[ cProject ][ "cType" ] == "hblib" @@ -481,6 +485,7 @@ STATIC PROCEDURE build_projects( nAction, hProjectList, hProjectReqList, cOption RETURN STATIC FUNCTION call_hbmk2_hbinfo( cProjectPath, hProject ) + LOCAL cStdOut LOCAL cDir LOCAL cName @@ -505,14 +510,14 @@ STATIC FUNCTION call_hbmk2_hbinfo( cProjectPath, hProject ) FOR EACH tmp IN hb_ATokens( hbmk2_hbinfo_getitem( hInfo, "hbctree" ), Chr( 10 ) ) IF ! Empty( tmp ) hb_FNameSplit( LTrim( tmp ), @cDir, @cName ) - #ifdef __PLATFORM__DOS - /* Ignore long filenames on MS-DOS hosts */ - IF Len( cName ) > 8 - LOOP - ENDIF - #endif - AAdd( hProject[ "aDept" ], { "nDepth" => Len( tmp ) - Len( LTrim( tmp ) ),; - "cFileName_HBP" => StrTran( hb_PathNormalize( hb_PathJoin( s_cRebase, hb_FNameExtSet( PathSepToSelf( LTrim( tmp ) ), ".hbp" ) ) ), "\", "/" ) } ) +#ifdef __PLATFORM__DOS + /* Ignore long filenames on MS-DOS hosts */ + IF Len( cName ) > 8 + LOOP + ENDIF +#endif + AAdd( hProject[ "aDept" ], { "nDepth" => Len( tmp ) - Len( LTrim( tmp ) ), ; + "cFileName_HBP" => StrTran( hb_PathNormalize( hb_PathJoin( s_cRebase, hb_FNameExtSet( PathSepToSelf( LTrim( tmp ) ), ".hbp" ) ) ), "\", "/" ) } ) ENDIF NEXT ENDIF @@ -523,38 +528,39 @@ STATIC FUNCTION hbmk2_hbinfo_getitem( hInfo, cItem ) RETURN iif( HB_ISHASH( hInfo ), hb_HGetDef( hInfo, cItem, "" ), "" ) STATIC FUNCTION call_hbmk2( cProjectPath, cOptionsPre, cDynSuffix, cStdErr, cStdOut ) + LOCAL nErrorLevel LOCAL cOptionsLibDyn := "" LOCAL cCommand /* Making sure that user settings do not interfere with the std build process. */ - hb_setenv( "HBMK_OPTIONS" ) - hb_setenv( "HARBOUR" ) - hb_setenv( "HARBOURCMD" ) - hb_setenv( "CLIPPER" ) - hb_setenv( "CLIPPERCMD" ) + hb_SetEnv( "HBMK_OPTIONS" ) + hb_SetEnv( "HARBOUR" ) + hb_SetEnv( "HARBOURCMD" ) + hb_SetEnv( "CLIPPER" ) + hb_SetEnv( "CLIPPERCMD" ) IF cDynSuffix != NIL - hb_setenv( "_HB_DYNSUFF", cDynSuffix ) /* Request dll version of Harbour contrib dependencies (the implibs) to be linked (experimental) */ - hb_setenv( "_HB_BUILD_LIBDYN", "yes" ) + hb_SetEnv( "_HB_DYNSUFF", cDynSuffix ) /* Request dll version of Harbour contrib dependencies (the implibs) to be linked (experimental) */ + hb_SetEnv( "_HB_BUILD_LIBDYN", "yes" ) IF hb_FileExists( hb_FNameExtSet( cProjectPath, ".hbc" ) ) cOptionsLibDyn += " " + hb_FNameExtSet( cProjectPath, ".hbc" ) ENDIF ELSE - hb_setenv( "_HB_DYNSUFF" ) - hb_setenv( "_HB_BUILD_LIBDYN" ) + hb_SetEnv( "_HB_DYNSUFF" ) + hb_SetEnv( "_HB_BUILD_LIBDYN" ) ENDIF - hb_setenv( "_HB_CONTRIB_SUBDIR", hb_FNameDir( PathSepToSelf( cProjectPath ) ) ) + hb_SetEnv( "_HB_CONTRIB_SUBDIR", hb_FNameDir( PathSepToSelf( cProjectPath ) ) ) - cCommand := s_cBinDir + "hbmk2" +; - " -quiet -width=0 -autohbm-" +; - " @" + StrTran( s_cHome + "hbpre", "\", "/" ) +; - cOptionsPre +; - " " + StrTran( cProjectPath, "\", "/" ) +; - " @" + StrTran( s_cHome, "\", "/" ) + "hbpost" +; - cOptionsLibDyn + cCommand := s_cBinDir + "hbmk2" + ; + " -quiet -width=0 -autohbm-" + ; + " @" + StrTran( s_cHome + "hbpre", "\", "/" ) + ; + cOptionsPre + ; + " " + StrTran( cProjectPath, "\", "/" ) + ; + " @" + StrTran( s_cHome, "\", "/" ) + "hbpost" + ; + cOptionsLibDyn IF PCount() >= 4 nErrorLevel := hb_processRun( cCommand,, @cStdOut, @cStdErr ) @@ -569,6 +575,7 @@ STATIC FUNCTION call_hbmk2( cProjectPath, cOptionsPre, cDynSuffix, cStdErr, cStd RETURN nErrorLevel STATIC FUNCTION hbmk2_errorstr( nErrorLevel ) + SWITCH nErrorLevel CASE 0 ; RETURN "no error" CASE 1 ; RETURN "unknown platform" @@ -585,6 +592,7 @@ STATIC FUNCTION hbmk2_errorstr( nErrorLevel ) CASE 30 ; RETURN "too deep nesting" CASE 50 ; RETURN "stop requested" ENDSWITCH + RETURN "unknown" STATIC FUNCTION mk_hb_processRun( cCommand, ... ) @@ -594,6 +602,7 @@ STATIC FUNCTION mk_hb_processRun( cCommand, ... ) RETURN hb_processRun( cCommand, ... ) STATIC FUNCTION mk_hbd( cDir ) + LOCAL cName LOCAL cDocDir LOCAL tmp @@ -632,6 +641,7 @@ STATIC FUNCTION AScanL( aArray, cString ) RETURN AScan( aArray, {| tmp | Lower( tmp ) == cString } ) STATIC FUNCTION DirGetName( cDir ) + LOCAL cName cDir := hb_DirSepDel( cDir ) @@ -649,6 +659,7 @@ STATIC FUNCTION PathSepToSelf( cFileName ) /* Convert indented list of line to tree / list of parent-child pairs */ STATIC PROCEDURE DeptLinesToDeptPairList( aPairList, cParent, aFlatTree ) + LOCAL hFlatTreeElement LOCAL hNode, hNewNode, tmp LOCAL nLevel, nDepth @@ -687,6 +698,7 @@ STATIC PROCEDURE AddDeptPair( aPairList, cParent, cChild ) /* Topological sort of the dependency graph */ STATIC FUNCTION TopoSort( aEdgeList ) + LOCAL aList := {} LOCAL hTopNodes := { => } @@ -729,6 +741,7 @@ STATIC FUNCTION TopoSort( aEdgeList ) RETURN aList PROCEDURE AddProject( hProjectList, cFileName ) + LOCAL cDir LOCAL cName LOCAL cExt @@ -757,6 +770,7 @@ PROCEDURE AddProject( hProjectList, cFileName ) RETURN PROCEDURE LoadProjectListFromFile( hProjectList, cFileName ) + LOCAL cItem FOR EACH cItem IN hb_ATokens( StrTran( MemoRead( cFileName ), Chr( 13 ) ), Chr( 10 ) ) @@ -769,6 +783,7 @@ PROCEDURE LoadProjectListFromFile( hProjectList, cFileName ) RETURN PROCEDURE LoadProjectListFromString( hProjectList, cString ) + LOCAL cItem FOR EACH cItem IN hb_ATokens( cString,, .T. ) diff --git a/harbour/contrib/rddads/doc/en/adsfuncs.txt b/harbour/contrib/rddads/doc/en/adsfuncs.txt index bc64ad91f0..5710ec745e 100644 --- a/harbour/contrib/rddads/doc/en/adsfuncs.txt +++ b/harbour/contrib/rddads/doc/en/adsfuncs.txt @@ -14,18 +14,18 @@ $ARGUMENTS$ <cFileName> File to create. If it already exists, it will be overwritten on success and destroyed on error. - + <cFieldName> Field in the current workarea that contains binary data. - + $RETURNS$ <lSuccess> True if the file is successfully written. $DESCRIPTION$ See ace.hlp for full details about the Advantage Database Server. ADSBlob2File() is a wrapper for AdsBinaryToFile. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -51,9 +51,9 @@ ADSFile2Blob(cFileName, cFieldName, <nBinaryType>) --> lSuccess $ARGUMENTS$ <cFileName> File to read. Can be in UNC format. A common example is an image file. - + <cFieldName> Field in the current workarea to contain the binary data. - + <nBinaryType> Either ADS_BINARY (the default) or ADS_IMAGE. This parameter is for fields in DBF files. ADT tables cannot store binary and image data in standard character @@ -65,9 +65,9 @@ ADSFile2Blob() is a wrapper for AdsFileToBinary. Use of this function is illegal in an ADS transaction. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -98,9 +98,9 @@ $DESCRIPTION$ See ace.hlp for full details about the Advantage Database Server. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -128,9 +128,9 @@ <nRecno | aRecNos> Can be either a single record number or an array of record numbers to add or delete from the AOF. If omitted, defaults to the current record. - + <nType> The type of operation: - + <table> ADS_AOF_ADD_RECORD Add the record to the AOF (set the bit). This is the default operation. ADS_AOF_REMOVE_RECORD Remove the record from the AOF (clear the bit). @@ -147,17 +147,17 @@ add or remove records at will from the visible set. This is useful for tagging records or for refining a result set after the data has been retrieved from the server. - + The maximum number of records that can be customized in a single call is 16,383, so <aRecNos> must not be longer than this. - + Calls to AdsCustomizeAOF must be made after an application has created a filter with a call to AdsSetAOF. To create a completely empty record set (to which records can be added with calls to AdsCustomizeAOF), use ".F." as the filter expression given to AdsSetAOF. To create a completely full record set (from which records can be removed), use ".T." as the filter expression. - + WARNING: Always start with a FULLY optimized AOF! If an application must use a filter expression that is not fully optimized as the starting point for customization, the ADS_RESOLVE_IMMEDIATE option @@ -166,12 +166,12 @@ have been added through the AdsCustomizeAOF calls. The filter expressions ".T." and ".F." both result in fully optimized AOFs regardless of available indexes. - + See ace.hlp for full details about the Advantage Database Server. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -206,9 +206,9 @@ $DESCRIPTION$ See ace.hlp for full details about the Advantage Database Server. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -241,9 +241,9 @@ $DESCRIPTION$ See ace.hlp for full details about the Advantage Database Server. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -274,9 +274,9 @@ $DESCRIPTION$ See ace.hlp for full details about the Advantage Database Server. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -308,9 +308,9 @@ $DESCRIPTION$ See ace.hlp for full details about the Advantage Database Server. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -344,9 +344,9 @@ or may not be valid records for the filter. ADSRefreshAOF() re-evaluates the data to include or exclude changed records. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -372,7 +372,7 @@ ADSSetAOF( <cFilter> [, <nResolveOption>] ) --> lSuccess $ARGUMENTS$ <cFilter> Filter expression to set. - + <nResolveOption> Option to indicate how the filter should be resolved in the event that the expression cannot be fully optimized. Options are defined in ads.ch: @@ -382,9 +382,9 @@ $DESCRIPTION$ See ace.hlp for full details about the Advantage Database Server. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -415,9 +415,9 @@ $DESCRIPTION$ See ace.hlp for full details about the Advantage Database Server. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -451,14 +451,14 @@ It also works with no active index to yield the relative position of the current record number. The value returned is between 0.0 and 1.0, inclusive. - + This is the recommended function for positioning a scrollbar or other "coarse" position interface. See ace.hlp for full details about the Advantage Database Server. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -491,14 +491,14 @@ within the current index order, respecting any scope setting. It also works with no active index to go to the relative position of the current record number. - + This is the recommended function for re-positioning in reaction to a dragged scrollbar thumb or other "coarse" navigation interface. See ace.hlp for full details about the Advantage Database Server. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -524,7 +524,7 @@ ADSKeyCount([<xTag>], <cIgnoredIndexFile>, [<nFilterOption>]) --> nKeyCount $ARGUMENTS$ <xTag> Numeric order number OR index tag name. Default is current index. - + <cIgnoredIndexFile> This parameter is not processed. In other Harbour RDDs, the second parameter to "ordKeyCount" takes a second argument to identify a particular Index File in cases where two files are open that contain @@ -532,11 +532,11 @@ will select the first order with the requested name. To stay consistent with other RDDs, therefore, the second parameter is reserved and the <nFilterOption> is passed as a third parameter. - + <nFilterOption> Indicates if filters and/or scopes are to be respected if set. - + Options are defined in ads.ch: - + <table> ADS_RESPECTFILTERS Respect filters and scopes ADS_IGNOREFILTERS Ignore filters and scopes @@ -547,9 +547,9 @@ $DESCRIPTION$ See ace.hlp for full details about the Advantage Database Server. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -575,7 +575,7 @@ ADSKeyNo([<xTag>], <cIgnoredIndexFile>, [<nFilterOption>]) --> nKeyNo $ARGUMENTS$ <xTag> Numeric order number OR index tag name. Default is current index. - + <cIgnoredIndexFile> This parameter is not processed. In other Harbour RDDs, the second parameter to "ordKeyNo" takes a second argument to identify a particular Index File in cases where two files are open that contain @@ -583,9 +583,9 @@ will select the first order with the requested name. To stay consistent with other RDDs, therefore, the second parameter is reserved and the <nFilterOption> is passed as a third parameter. - + <nFilterOption> Indicates if filters and/or scopes are to be respected if set. - + <table> Options are defined in ads.ch: ADS_RESPECTFILTERS Respect filters and scopes @@ -627,7 +627,7 @@ <lMode> .T. to use the Advantage proprietary locking mode (this is the default setting if a remote server is used) or pass .F. to use "compatibility" locking. - + $RETURNS$ <lPriorSetting> .T. if prior setting was for the proprietary mode. $DESCRIPTION$ @@ -635,12 +635,12 @@ The Advantage Database Server has a fast Proprietary locking mode that is more efficient than traditional network locking. It is only available when using the remote server (not the local server). - + If a file is opened in the proprietary mode, other applications cannot open it in a "write" mode. So if non-Advantage applications need concurrent access to the data files, use the Compatibility locking mode by calling ADSLocking( .F. ). - + ADSLocking() is a Get/Set function for the locking mode. It affects files at the time they are opened. So when a data file is opened, the current setting is used for that file until it is @@ -672,7 +672,7 @@ $ARGUMENTS$ <lMode> .T. to check rights upon opening data files (the default), or .F. to ignore rights - + $RETURNS$ <lPriorSetting> $DESCRIPTION$ @@ -682,15 +682,15 @@ Database Server will use the rights of the connected user when opening the file. If the user does not have rights to the directory or server, then the open call will fail. - + If the setting is .F., then the ADS will ignore the connected user's rights and open the file regardless. This lets you allow only Advantage-based applications to access specific data. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -719,7 +719,7 @@ indexing. A numeric value of the "percent completed" is passed to the codeblock by the ADS server. The codeblock should return a logical value: .T. to abort or .F. to not stop indexing. - + $RETURNS$ <nil> $DESCRIPTION$ @@ -740,7 +740,7 @@ INDEX ON First+LAST+LABEL1+LABEL2 TAG First AdsClrCallBack() RETURN - + FUNCTION outputstuff( nPercent ) /* The "callback" function */ ? "output stuff", nPercent RETURN Inkey() == K_ESC @@ -769,15 +769,15 @@ $SYNTAX$ AdsClrCallBack() --> nil $ARGUMENTS$ - + $RETURNS$ <nil> $DESCRIPTION$ See AdsRegCallBack(). $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -803,7 +803,7 @@ ADSSetDefault( [<cPath>] ) --> cPriorSetting $ARGUMENTS$ <cPath> Sets new value if passed. - + $RETURNS$ <cPriorSetting> $DESCRIPTION$ @@ -813,9 +813,9 @@ SET DEFAULT TO command, so normal programming will not use this. It exists primarily for testing purposes. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -826,7 +826,7 @@ Library is RddAds Header is ads.ch $SEEALSO$ - + $END$ */ @@ -844,7 +844,7 @@ to Harbour usage, so pass .F. to see deleted records or .T. to hide them. (This is inverted from ADS's AdsShowDeleted() syntax.) - + $RETURNS$ <lPriorSetting> $DESCRIPTION$ @@ -854,9 +854,9 @@ SET DELETED ON/OFF command, so normal programming will not use this. It exists primarily for testing purposes. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -867,7 +867,7 @@ Library is RddAds Header is ads.ch $SEEALSO$ - + $END$ */ @@ -882,7 +882,7 @@ AdsSetSearchPath( [<cPath>] ) --> cPriorSetting $ARGUMENTS$ <cPath> Sets new value if passed. - + $RETURNS$ <cPriorSetting> $DESCRIPTION$ @@ -892,9 +892,9 @@ SET PATH command, so normal programming will not use this. It exists primarily for testing purposes. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -905,7 +905,7 @@ Library is RddAds Header is ads.ch $SEEALSO$ - + $END$ */ @@ -920,7 +920,7 @@ AdsSetExact( [<lOnOff>] ) --> lPriorSetting $ARGUMENTS$ <lOnOff> Sets new value if passed. - + $RETURNS$ <lPriorSetting> $DESCRIPTION$ @@ -930,9 +930,9 @@ SET EXACT ON/OFF command, so normal programming will not use this. It exists primarily for testing purposes. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -943,7 +943,7 @@ Library is RddAds Header is ads.ch $SEEALSO$ - + $END$ */ @@ -967,16 +967,16 @@ <lOEM> This parameter used for console mode applications, when character data stored in OEM charset. If lOEM is passed as .T., rddads doesn't convert character data into ANSI charset. - + $RETURNS$ <nPriorSetting> $DESCRIPTION$ See ace.hlp for full details about the Advantage Database Server. This sets the usCharType parameter used when ADS opens a table. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -1001,15 +1001,15 @@ $SYNTAX$ AdsIsIndexed() --> lActiveIndex $ARGUMENTS$ - + $RETURNS$ <lActiveIndex> $DESCRIPTION$ Equivalent to <b>empty(ordSetFocus())<\b>, but faster. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -1019,7 +1019,7 @@ $FILES$ Library is RddAds $SEEALSO$ - + $END$ */ @@ -1045,7 +1045,7 @@ bugs later in program execution that are hard to find. In Harbour internal RDDs, a runtime error occurs if an attempt is made to write to a shared file without a proper lock. - + AdsTestRecLocks( .T. ) will turn on a debugging mode to mimic this behavior and throw an error instead of allowing an implicit lock. Each time a field is set, we see if the file is open exclusively or locked, and whether @@ -1055,12 +1055,12 @@ Although the call to AdsIsRecordLocked is documented as a client call, not a server request, and should be fast, it will be called for EACH FIELD as it is assigned a value. - + See ace.hlp for full details about the Advantage Database Server. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -1071,7 +1071,7 @@ Library is RddAds Header is ads.ch $SEEALSO$ - + $END$ */ @@ -1091,9 +1091,9 @@ $DESCRIPTION$ See ace.hlp for full details about the Advantage Database Server. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -1104,7 +1104,7 @@ Library is RddAds Header is ads.ch $SEEALSO$ - + $END$ */ @@ -1129,7 +1129,7 @@ (See ace.hlp under Advantage Expression Engine for a list of functions allowed by ADS.) Call AdsIsExprValid() to determine if the server can process the expression. - + For illustration, consider filter expressions. Since Harbour attempts to be as compatible with Clipper as possible, you CAN set a filter that ADS DOES NOT understand, but the filtering @@ -1140,9 +1140,9 @@ done by the server itself to reduce network traffic, it is better to only use filter expressions ADS can understand. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -1153,7 +1153,7 @@ Library is RddAds Header is ads.ch $SEEALSO$ - + $END$ */ @@ -1171,7 +1171,7 @@ or AdsConnect60(). If omitted, the RDD's current connection handle is used, but this only exists if AdsConnect() or AdsConnect60() were previously called. - + $RETURNS$ The type of Advantage Server that the connection uses, either ADS_REMOTE_SERVER, ADS_AIS_SERVER, or ADS_LOCAL_SERVER. @@ -1184,9 +1184,9 @@ that workarea can be retrieved with AdsGetTableConType(). See ace.hlp for full details. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -1212,7 +1212,7 @@ AdsGetTableConType() --> nConnectionType $ARGUMENTS$ None. - + $RETURNS$ The type of Advantage Server that the current workarea uses, either ADS_REMOTE_SERVER, ADS_AIS_SERVER, or ADS_LOCAL_SERVER. @@ -1223,9 +1223,9 @@ but others via the Local server or an Internect connection. This function identifies the type of server used in the current workarea. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -1266,7 +1266,7 @@ // Add the tables AdsDDaddTable("Table1", "table1.adt", "table1.adi") $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -1297,7 +1297,7 @@ $DESCRIPTION$ This function no longer exists. See the Data Dictionary topic $TESTS$ - + $STATUS$ R $COMPLIANCE$ @@ -1305,7 +1305,7 @@ $PLATFORMS$ Windows, Linux $FILES$ - + $SEEALSO$ ADSCONNECT60() $END$ @@ -1326,7 +1326,7 @@ <cUserName> Optional Name of the user connecting to the server <cUserPass> Optional password for the user Name <nOptions> The optional connection options - + $RETURNS$ <lSuccess> True if connected, otherwise False. $DESCRIPTION$ @@ -1362,7 +1362,7 @@ ADSCACHEOPENTABLES(<nOpen>) -> nRetVal $ARGUMENTS$ <nOpen> Number of tables to cache. - + $RETURNS$ <nRetVal> ??? $DESCRIPTION$ @@ -1400,7 +1400,7 @@ ADSCACHEOPENCURSORS(<nOpen>) -> nRetVal $ARGUMENTS$ <nOpen> Number of cursors to cache. - + $RETURNS$ <nRetVal> ??? $DESCRIPTION$ @@ -1477,16 +1477,16 @@ $ARGUMENTS$ <lMode> xxx xxx - + $RETURNS$ <lPriorSetting> $DESCRIPTION$ See ace.hlp for full details about the Advantage Database Server. ADSRightsCheck() is a Get/Set function for the "rights checking" mode. $EXAMPLES$ - + $TESTS$ - + $STATUS$ R $COMPLIANCE$ diff --git a/harbour/contrib/rddads/doc/en/readme.txt b/harbour/contrib/rddads/doc/en/readme.txt index 407c741a2b..7d980bfd67 100644 --- a/harbour/contrib/rddads/doc/en/readme.txt +++ b/harbour/contrib/rddads/doc/en/readme.txt @@ -15,40 +15,40 @@ The RDD was written by Alexander Kresin <alex@belacy.belgorod.su> Additional code and documentation was added by Brian Hays <bhays@abacuslaw.com>. - + Your Harbour application can access a remote database server for a true client/server architecture, or it can use the "local server" for stand-alone or even small network installations. - + For using this RDD you need to have all required dynamic libraries installed on your system. - + For building executables don't forget to include rddads.hbc in your hbmk2 project. - + You also need to include in your prg file following lines: - + REQUEST ADS rddRegister( "ADS", 1 ) rddsetdefault( "ADS" ) - + By default RDDADS is tuned for remote server and cdx indexes. To change this you may use these commands defined in ads.ch: - + SET SERVER LOCAL SET SERVER REMOTE - + SET FILETYPE TO NTX SET FILETYPE TO ADT SET FILETYPE TO CDX - + or functions AdsSetServerType(), AdsSetFileType(). See the header file ads.ch for details. - + Note that the default local server is useable for file sharing on a small network. The default DLL is limited to 5 users, but an unlimited version is available from Extended Systems. - + MAX OPEN TABLES: The server (even local) has its own setting for Max Tables allowed open. For the Local Server, it can be set in adslocal.cfg. The default is only 50! @@ -56,61 +56,61 @@ increase the setting for the TABLES configuration value in the Advantage Database Server configuration registry key using the Registry Editor. For NetWare, edit the configuration file ads.cfg. - + See ace.hlp under adslocal.cfg, or the Advantage Error Guide for error 7005. - + SPEED AND PERFORMANCE ISSUES - + If you have sluggish browsers, one issue could be the scrollbar. If it's fast with the scrollbar disabled, the browse/scrolling logic may not be as optimized as it could be. Scrollbars should always use ADSGetRelKeyPos() and ADSSetRelKeyPos() instead of key counting functions. - + If filtered data seems slower than expected, check these things: First, optimization is not on by default, so at the top of the app call - + Set( _SET_OPTIMIZE, .T. ) - + or its command equivalent. RDDADS will use an AOF whenever dbSetFilter is called *if it can*. - + Second, make sure the filter is one ADS can understand. UDFs are out, as are references to public or private variables. It's also best to remove field aliases from the string. ADS cannot reference aliases for other related tables, so they're superfluous. You can call - + ? AdsIsExprValid( cFilter ) - + to check. If this returns False, neither the Local Server nor the Remote Server can process it, so optimization will never occur (but the Harbour RDD will process the filtering locally by eval'ing the codeblock and testing each record). The only way to speed it up is to fix the filter so ADS understands it. - + You can also use dbOrderInfo(DBOI_OPTLEVEL) to see if the current filter is optimized or not. COMIX users can use: - + FUNCTION rlOptLevel() RETURN dbOrderInfo(DBOI_OPTLEVEL) - + This returns the Clipper/COMIX values (not ADS-defined values) because this is an RDD call, not just a wrapper to the ADS call, which uses different numbers). - + $COMPLIANCE$ Every attempt has been made to make the RDD compliant with the standard dbfcdx RDD at the .prg level. One important difference is the handling of structural indexes. ACE will <b>always</b> automatically open an index with the same name as the data file. There is no way to turn this feature off. - + You can use the Set() function call as well as the equivalent commands for SET DEFAULT TO, DATEFORMAT, DELETE, and EPOCH. Harbour automatically makes the call to ADS to change its internal setting to match Harbour's. - + INDEXING and Progress Displays: Remote server does not support the EVAL/EVERY clauses. Remember, there is an external process doing the indexing that knows nothing of @@ -120,7 +120,7 @@ It lets you set a codeblock that is eval'ed every 2 seconds. A numeric value of the "percent completed" is passed to the codeblock by the ADS server. - + <table> #include "inkey.ch" PROCEDURE Main() @@ -132,21 +132,21 @@ INDEX ON First+LAST+LABEL1+LABEL2 TAG First AdsClrCallBack() RETURN - + FUNCTION outputstuff( nPercent ) /* The "callback" function */ ? "output stuff", nPercent RETURN Inkey() == K_ESC /* If press ESC, returns .T. to abort. */ </table> - + For programmers who are already familiar with the ACE engine, Harbour's compatibility with dbfcdx means there are some differences between the RDDADS in Harbour and the parallel ACE documentation: - + 1) In ACE, skipping backwards to BOF goes to the phantom record and sets the record number to 0. In RDDADS, the record pointer stays at the Top record and only the BOF flag is set to True. - + 2) In RDDADS, a filter expression can be used that may not be valid on the server (because of references to public variables or User-Defined Functions). @@ -154,14 +154,14 @@ but will be filtered by the application running on the client. These situations lose the benefits of having a data server and should be avoided, but they will function as they would in a Clipper program. - + One problem with this scenario is that index key counting functions that are supposed to give an accurate count respecting the filter (e.g. dbOrderInfo(DBOI_KEYCOUNT) will return the values the Server knows about, so the counts may be inaccurate. - + 3) When setting a relation, the expression must be one that can be evaluated by the Advantage Expression Engine. UDFs will fail. - + $END$ */ diff --git a/harbour/contrib/rddads/tests/datad.prg b/harbour/contrib/rddads/tests/datad.prg index a8478b3ea9..2de756c51d 100644 --- a/harbour/contrib/rddads/tests/datad.prg +++ b/harbour/contrib/rddads/tests/datad.prg @@ -12,7 +12,7 @@ REQUEST ADS #if defined( __HBDYNLOAD__RDDADS__ ) -# include "rddads.hbx" +#include "rddads.hbx" #endif PROCEDURE Main() @@ -62,7 +62,7 @@ PROCEDURE Main() // now create two free tables with same structure dbCreate( "Table1", aStru ) dbCreate( "Table2", aStru ) - //now create an index + // now create an index USE table1 NEW INDEX ON FIELD->id TAG codigo USE diff --git a/harbour/contrib/rddads/tests/testmg.prg b/harbour/contrib/rddads/tests/testmg.prg index 8f9201280f..cd00bb76cc 100644 --- a/harbour/contrib/rddads/tests/testmg.prg +++ b/harbour/contrib/rddads/tests/testmg.prg @@ -59,7 +59,7 @@ REQUEST ADS #if defined( __HBDYNLOAD__RDDADS__ ) -# include "rddads.hbx" +#include "rddads.hbx" #endif PROCEDURE Main() @@ -211,7 +211,6 @@ PROCEDURE Main() ? aRay[ 23 ], " reserved " ? aRay[ 24 ], " NT Service IP send port # " ? aRay[ 25 ], " NT Service IP rcv port # " -// ? aRay[ 26 ], " reserved " ENDIF WAIT diff --git a/harbour/contrib/xhb/cstruct.prg b/harbour/contrib/xhb/cstruct.prg index 29d855be26..29b055b0ab 100644 --- a/harbour/contrib/xhb/cstruct.prg +++ b/harbour/contrib/xhb/cstruct.prg @@ -69,7 +69,7 @@ PROCEDURE __INIT_LONGLONGS() HB_CStructureCSyntax( "ULONGLONG", { "-4", "ulong[2]", }, , , 8 ) __ClsSetModule( __ActiveStructure() ) - HB_CStructureCSyntax( "LONGLONG", { "4", "long[2]", } , , , 8 ) + HB_CStructureCSyntax( "LONGLONG", { "4", "long[2]", }, , , 8 ) __ClsSetModule( __ActiveStructure() ) RETURN @@ -109,23 +109,23 @@ FUNCTION __ActiveStructure( cStructure, nAlign ) #endif // In most cases we can simply ignore the redefinition, by returning a FAKED Structure Array! - //TraceLog( "Redefinition of C Structure: " + cStructure ) + // TraceLog( "Redefinition of C Structure: " + cStructure ) RETURN t_aActiveStructure := { cStructure, NIL, {}, {}, iif( HB_ISNUMERIC( nAlign ), nAlign, 8 ) } ENDIF AAdd( s_aClasses, { cStructure, NIL, {}, {}, iif( HB_ISNUMERIC( nAlign ), nAlign, 8 ) } ) - //TraceLog( "Registered: " + cStructure, ATail( s_aClasses )[ 5 ] ) + // TraceLog( "Registered: " + cStructure, ATail( s_aClasses )[ 5 ] ) t_aActiveStructure := ATail( s_aClasses ) ELSE - //TraceLog( "Created: " + Str( nId ) ) + // TraceLog( "Created: " + Str( nId ) ) acMembers := t_aActiveStructure[ 3 ] aCTypes := t_aActiveStructure[ 4 ] nAlign := t_aActiveStructure[ 5 ] - hClass := __clsNew( "C Structure " + t_aActiveStructure[ 1 ] , Len( acMembers ) + CLASS_PROPERTIES ) - //__clsDelMsg( hClass, "C" ) + hClass := __clsNew( "C Structure " + t_aActiveStructure[ 1 ], Len( acMembers ) + CLASS_PROPERTIES ) + // __clsDelMsg( hClass, "C" ) t_aActiveStructure[ 2 ] := hClass @@ -153,7 +153,7 @@ FUNCTION __ActiveStructure( cStructure, nAlign ) // WARNING InternalBuffer *MUST* remain the *LAST* Property!!! __clsAddMsg( hClass, "InternalBuffer", ++Counter, HB_OO_MSG_PROPERTY, , HB_OO_CLSTP_READONLY ) - //TraceLog( Len( aCTypes ), aCTypes[ 1 ], aCTypes ) + // TraceLog( Len( aCTypes ), aCTypes[ 1 ], aCTypes ) RETURN hClass ENDIF @@ -167,7 +167,7 @@ PROCEDURE HB_Member( cMember, CType ) IF Right( cMember, 1 ) == "]" nAt := At( "[", cMember ) - //nLen := Val( SubStr( cMember, nAt + 1, Len( cMember ) ) ) + // nLen := Val( SubStr( cMember, nAt + 1, Len( cMember ) ) ) // Support expressions like x + y, x - y, x * y nLen := &( SubStr( cMember, nAt + 1, Len( cMember ) - nAt - 1 ) ) @@ -215,7 +215,7 @@ FUNCTION HB_CStructureID( cStructure, lInplace ) nID += iif( lInplace, CTYPE_STRUCTURE, CTYPE_STRUCTURE_PTR ) ENDIF -// TraceLog( cStructure, nID ) + // TraceLog( cStructure, nID ) RETURN nID @@ -261,7 +261,7 @@ PROCEDURE HB_CStructureCSyntax( cStructure, aDefinitions, cTag, cSynonList, nAli IF ! Empty( cTag ) AAdd( s_aSynonyms, { Upper( cTag ), nID + CTYPE_STRUCTURE } ) - //Tracelog( ATail( s_aSynonyms )[ 1 ], ATail( s_aSynonyms )[ 2 ] ) + // Tracelog( ATail( s_aSynonyms )[ 1 ], ATail( s_aSynonyms )[ 2 ] ) ENDIF IF ! Empty( cSynonList ) @@ -272,14 +272,14 @@ PROCEDURE HB_CStructureCSyntax( cStructure, aDefinitions, cTag, cSynonList, nAli AAdd( s_aSynonyms, { Upper( cSynon ), nID + CTYPE_STRUCTURE } ) ENDIF - //Tracelog( ATail( s_aSynonyms )[ 1 ], ATail( s_aSynonyms )[ 2 ] ) + // Tracelog( ATail( s_aSynonyms )[ 1 ], ATail( s_aSynonyms )[ 2 ] ) NEXT ENDIF nLen := Len( aDefinitions ) FOR Counter := 1 TO nLen STEP 2 - //TraceLog( "Member: " + aDefinitions[ Counter + 1 ], "Type: " + aDefinitions[ Counter ] ) + // TraceLog( "Member: " + aDefinitions[ Counter + 1 ], "Type: " + aDefinitions[ Counter ] ) CType := aDefinitions[ Counter ] IF Val( CType ) != 0 @@ -354,7 +354,7 @@ STATIC PROCEDURE AllocateMembers( oStructure ) aCTypes := oStructure:aCTypes -// TraceLog( "Scaning: " + oStructure:ClassName ) + // TraceLog( "Scaning: " + oStructure:ClassName ) FOR EACH CType IN aCTypes IF CType > CTYPE_STRUCTURE .AND. CType < CTYPE_STRUCTURE_PTR @@ -363,7 +363,7 @@ STATIC PROCEDURE AllocateMembers( oStructure ) ENDIF NEXT -// TraceLog( "Finished: " + oStructure:ClassName ) + // TraceLog( "Finished: " + oStructure:ClassName ) RETURN @@ -374,7 +374,7 @@ FUNCTION HB_CStructureFromID( nID, nAlign ) LOCAL hClass, oStructure LOCAL oErr -// TraceLog( nId, s_aClasses ) + // TraceLog( nId, s_aClasses ) IF nID > CTYPE_STRUCTURE_PTR nID -= CTYPE_STRUCTURE_PTR @@ -420,7 +420,7 @@ FUNCTION HB_CTypeArrayID( CType, nLen ) IF nID == 0 hClass := __clsNew( "C Structure " + cArrayClassName, nLen + CLASS_PROPERTIES ) - //__clsDelMsg( hClass, "C" ) + // __clsDelMsg( hClass, "C" ) __ClsSetModule( hClass ) AAdd( s_aClasses, { cArrayClassName, hClass, Array( nLen ), Array( nLen ), 1 } ) @@ -445,9 +445,9 @@ FUNCTION HB_CTypeArrayID( CType, nLen ) __clsAddMsg( hClass, "GetPointer", @GetPointer() , HB_OO_MSG_METHOD ) __clsAddMsg( hClass, "CopyTo" , @__CSTR_CopyTo() , HB_OO_MSG_METHOD ) - //IF Abs( CType ) == 1 + // IF Abs( CType ) == 1 __clsAddMsg( hClass, "AsString", @AsString() , HB_OO_MSG_METHOD ) - //ENDIF + // ENDIF FOR Counter := 1 TO nLen cMember := hb_ntos( Counter ) @@ -462,10 +462,10 @@ FUNCTION HB_CTypeArrayID( CType, nLen ) __clsAddMsg( hClass, "_nID", Counter++, HB_OO_MSG_PROPERTY, nID ) // WARNING InternalBuffer *MUST* remain the *LAST* Property!!! __clsAddMsg( hClass, "InternalBuffer", Counter, HB_OO_MSG_PROPERTY, , HB_OO_CLSTP_READONLY ) - //TraceLog( "Registered: " + cArrayClassName, nID, Len( s_aArrayClasses ), HB_SizeOfCStructure( aCTypes, 1 ), nLen ) + // TraceLog( "Registered: " + cArrayClassName, nID, Len( s_aArrayClasses ), HB_SizeOfCStructure( aCTypes, 1 ), nLen ) ELSE nID := s_aArrayClasses[ nID ][ 3 ] - //TraceLog( "Reused: " + s_aClasses[ nID ][ 1 ], nID ) + // TraceLog( "Reused: " + s_aClasses[ nID ][ 1 ], nID ) ENDIF RETURN nID + CTYPE_STRUCTURE @@ -506,7 +506,7 @@ STATIC FUNCTION SayMembers( cPad, lShowMembers, lReturnString ) xProperty:SayMembers( cPad + cPad, lShowMembers ) ENDIF ELSE - //QOut( cPad + iif( lShowMembers, acMembers[ xProperty:__enumIndex() ], "" ) + ":", xProperty ) + // QOut( cPad + iif( lShowMembers, acMembers[ xProperty:__enumIndex() ], "" ) + ":", xProperty ) cOut += hb_eol() + cPad + iif( lShowMembers, QSelf():acMembers[ xProperty:__enumIndex() ], "" ) + ":" + hb_CStr( xProperty ) ENDIF NEXT @@ -543,7 +543,7 @@ STATIC FUNCTION Buffer( Buffer, lAdopt ) IF HB_ISSTRING( Buffer ) IF Len( Buffer ) < QSelf():SizeOf - //TraceLog( Buffer ) + // TraceLog( Buffer ) Buffer := PadR( Buffer, QSelf():SizeOf, Chr( 0 ) ) ENDIF @@ -589,10 +589,10 @@ STATIC FUNCTION DeValue( lAdopt ) // AEval( QSelf(), {| xVal | aAdd( aValues, xVal ) }, 1, Len( QSelf() ) - CLASS_PROPERTIES ) IF ! HB_ISSTRING( Buffer ) .OR. Len( Buffer ) == 0 - //TraceLog( "EMPTY Buffer passed to " + ProcName() ) + // TraceLog( "EMPTY Buffer passed to " + ProcName() ) ELSEIF Len( Buffer ) < QSelf():SizeOf - //TraceLog( "Should have been caught at ::Buffer()!!!", Buffer ) - //Buffer := PadR( Buffer, QSelf():SizeOf, Chr( 0 ) ) + // TraceLog( "Should have been caught at ::Buffer()!!!", Buffer ) + // Buffer := PadR( Buffer, QSelf():SizeOf, Chr( 0 ) ) ELSE HB_StructureToArray( Buffer, QSelf():aCTypes, QSelf():nAlign, lAdopt, QSelf() ) ENDIF diff --git a/harbour/contrib/xhb/decode.prg b/harbour/contrib/xhb/decode.prg index 255983b590..5ea26d5756 100644 --- a/harbour/contrib/xhb/decode.prg +++ b/harbour/contrib/xhb/decode.prg @@ -102,8 +102,8 @@ FUNCTION HB_Decode( ... ) // couples of values IF HB_ISARRAY( xDefault[ 1 ] ) - //// If i have an array as default, this contains couples of key / value - //// so I have to convert in a linear array + // // If i have an array as default, this contains couples of key / value + // // so I have to convert in a linear array nLen := Len( xDefault ) diff --git a/harbour/contrib/xhb/dirrec.prg b/harbour/contrib/xhb/dirrec.prg index bf7465be44..e01b959b04 100644 --- a/harbour/contrib/xhb/dirrec.prg +++ b/harbour/contrib/xhb/dirrec.prg @@ -86,8 +86,8 @@ FUNCTION DirectoryRecurse( cPath, cAttr ) * compatibility though it should be reverted when it will * be fixed in xHarbour */ - aResult := HB_DirScan( cFilePath, cMask, ; - StrTran( Upper( cAttr ), "D" ) ) + aResult := hb_DirScan( cFilePath, cMask, ; + StrTran( Upper( cAttr ), "D" ) ) AEval( aResult, {| x | x[ F_NAME ] := cFilePath + x[ F_NAME ] } ) diff --git a/harbour/contrib/xhb/diskhb.prg b/harbour/contrib/xhb/diskhb.prg index 7bbe916794..139de63129 100644 --- a/harbour/contrib/xhb/diskhb.prg +++ b/harbour/contrib/xhb/diskhb.prg @@ -53,6 +53,7 @@ #include "directry.ch" FUNCTION GETVOLINFO( cDir ) - LOCAL aFiles := Directory( cDir, "V" ) - RETURN iif( Len( aFiles ) >= 1, aFiles[ 1 ][ F_NAME ], "" ) + LOCAL aFiles := Directory( cDir, "V" ) + + RETURN iif( Len( aFiles ) >= 1, aFiles[ 1 ][ F_NAME ], "" ) diff --git a/harbour/contrib/xhb/dumpvar.prg b/harbour/contrib/xhb/dumpvar.prg index cfa21844cd..7f05a93ab7 100644 --- a/harbour/contrib/xhb/dumpvar.prg +++ b/harbour/contrib/xhb/dumpvar.prg @@ -85,7 +85,7 @@ FUNCTION HB_DumpVar( xVar, lRecursive, nMaxRecursionLevel ) LOCAL nRecursionLevel := 1 LOCAL nIndent := 0 -// TraceLog( "HB_DumpVariable: xVar, lAssocAsObj, lRecursive", xVar, lAssocAsObj, lRecursive ) + // TraceLog( "HB_DumpVariable: xVar, lAssocAsObj, lRecursive", xVar, lAssocAsObj, lRecursive ) __defaultNIL( @nMaxRecursionLevel, 0 ) @@ -100,7 +100,7 @@ STATIC FUNCTION __HB_DumpVar( xVar, lAssocAsObj, lRecursive, nIndent, nRecursion __defaultNIL( @lAssocAsObj, .F. ) __defaultNIL( @lRecursive, .F. ) -// TraceLog( "Recursion: xVar, nRecursionLevel, nMaxRecursionLevel", xVar, nRecursionLevel, nMaxRecursionLevel ) + // TraceLog( "Recursion: xVar, nRecursionLevel, nMaxRecursionLevel", xVar, nRecursionLevel, nMaxRecursionLevel ) // return if there is limit in recursion IF nMaxRecursionLevel > 0 .AND. ; @@ -198,7 +198,7 @@ STATIC FUNCTION DShowProperties( oVar, nScope, lRecursive, nIndent, nRecursionLe IF Len( aMethods ) > 0 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] ) + "] " + hb_eol() + 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 ------" + hb_eol() cString += Space( nIndent ) + " | " + hb_eol() @@ -217,7 +217,7 @@ STATIC FUNCTION DShowArray( aVar, lRecursive, nIndent, nRecursionLevel, nMaxRecu __defaultNIL( @nIndent, 0 ) - //TraceLog( "DShowArray: aVar, lRecursive", aVar, lRecursive ) + // TraceLog( "DShowArray: aVar, lRecursive", aVar, lRecursive ) IF HB_ISARRAY( aVar ) nEolLen := Len( hb_eol() ) @@ -248,7 +248,7 @@ STATIC FUNCTION DShowHash( hVar, lRecursive, nIndent, nRecursionLevel, nMaxRecur __defaultNIL( @nIndent, 0 ) - //TraceLog( "DShowHash: hVar, ValType( hVar ), lRecursive", hVar, ValType( hVar ), ValToPrg( hVar ), lRecursive ) + // TraceLog( "DShowHash: hVar, ValType( hVar ), lRecursive", hVar, ValType( hVar ), ValToPrg( hVar ), lRecursive ) IF HB_ISHASH( hVar ) nEolLen := Len( hb_eol() ) @@ -430,8 +430,8 @@ STATIC FUNCTION __objGetValueFullList( oObject, aExcept, nScope, nNoScope ) aVars := __objGetMsgFullList( oObject, .T., HB_MSGLISTALL, nScope, nNoScope ) aReturn := {} FOR EACH aVar IN aVars - IF hb_AScan( aExcept, aVar[HB_OO_DATA_SYMBOL], , , .T. ) == 0 - //TraceLog( "__objGetValueFullList(): aVar[HB_OO_DATA_SYMBOL]", aVar[ HB_OO_DATA_SYMBOL ] ) + IF hb_AScan( aExcept, aVar[ HB_OO_DATA_SYMBOL ], , , .T. ) == 0 + // TraceLog( "__objGetValueFullList(): aVar[HB_OO_DATA_SYMBOL]", aVar[ HB_OO_DATA_SYMBOL ] ) AAdd( aReturn, { aVar[ HB_OO_DATA_SYMBOL ], __SendRawMsg( oObject, aVar[ HB_OO_DATA_SYMBOL ] ), aVar[ HB_OO_DATA_TYPE ], aVar[ HB_OO_DATA_SCOPE ] } ) ENDIF NEXT diff --git a/harbour/contrib/xhb/hbcomprs.prg b/harbour/contrib/xhb/hbcomprs.prg index 4cfc457f5e..f74f2608fd 100644 --- a/harbour/contrib/xhb/hbcomprs.prg +++ b/harbour/contrib/xhb/hbcomprs.prg @@ -63,6 +63,7 @@ THREAD STATIC t_nLastError := HB_ZLIB_RES_OK * HB_COMPRESS( nComprFactor, cSource, nSourceLen, @cDest, @nDestLen ) --> nError */ FUNCTION HB_COMPRESS( xPar1, xPar2, xPar3, xPar4, xPar5 ) + LOCAL nComprFactor LOCAL cSource LOCAL nSourceLen @@ -109,13 +110,13 @@ FUNCTION HB_COMPRESS( xPar1, xPar2, xPar3, xPar4, xPar5 ) IF lReturnByRef IF HB_ISNUMERIC( xPar1 ) - xPar4 := HB_ZCOMPRESS( cSource, nDestLen, @t_nLastError, nComprFactor ) + xPar4 := hb_ZCompress( cSource, nDestLen, @t_nLastError, nComprFactor ) IF ! HB_ISSTRING( xPar4 ) xPar4 := "" ENDIF xPar5 := Len( xPar4 ) ELSE - xPar3 := HB_ZCOMPRESS( cSource, nDestLen, @t_nLastError, nComprFactor ) + xPar3 := hb_ZCompress( cSource, nDestLen, @t_nLastError, nComprFactor ) IF ! HB_ISSTRING( xPar3 ) xPar3 := "" ENDIF @@ -124,13 +125,14 @@ FUNCTION HB_COMPRESS( xPar1, xPar2, xPar3, xPar4, xPar5 ) RETURN t_nLastError ENDIF - RETURN HB_ZCOMPRESS( cSource, nDestLen, @t_nLastError, nComprFactor ) + RETURN hb_ZCompress( cSource, nDestLen, @t_nLastError, nComprFactor ) /****** DECOMPRESSOR WRAPPER ***** * HB_UNCOMPRESS( nDestLen, cSource [, nSourceLen ] ) --> cDest * HB_UNCOMPRESS( nDestLen, cSource, nSourceLen, @cDest ) --> nError */ FUNCTION HB_UNCOMPRESS( nDestLen, cSource, nSourceLen, /* @ */ cDest ) + LOCAL oError IF ! HB_ISNUMERIC( nDestLen ) .OR. ; @@ -153,11 +155,11 @@ FUNCTION HB_UNCOMPRESS( nDestLen, cSource, nSourceLen, /* @ */ cDest ) ENDIF IF PCount() >= 4 - cDest := HB_ZUNCOMPRESS( cSource, nDestLen, @t_nLastError ) + cDest := hb_ZUncompress( cSource, nDestLen, @t_nLastError ) RETURN t_nLastError ENDIF - RETURN HB_ZUNCOMPRESS( cSource, nDestLen, @t_nLastError ) + RETURN hb_ZUncompress( cSource, nDestLen, @t_nLastError ) /********************************* * HB_COMPRESSERROR() --> nError @@ -169,12 +171,13 @@ FUNCTION HB_COMPRESSERROR() * HB_COMPRESSERRORDESC( nErrorCode ) --> cDesc */ FUNCTION HB_COMPRESSERRORDESC( nError ) - RETURN HB_ZERROR( nError ) + RETURN hb_ZError( nError ) /******************************* * HB_COMPRESSBUFLEN( nSrcLen ) --> nDestLen */ FUNCTION HB_COMPRESSBUFLEN( nSrcLen ) + LOCAL nRet IF ! HB_ISNUMERIC( nSrcLen ) diff --git a/harbour/contrib/xhb/hblog.prg b/harbour/contrib/xhb/hblog.prg index a255bce094..aa311c3320 100644 --- a/harbour/contrib/xhb/hblog.prg +++ b/harbour/contrib/xhb/hblog.prg @@ -120,7 +120,7 @@ PROCEDURE HB_StandardLogAdd( oChannel ) PROCEDURE HB_CloseStandardLog() -// If the logger is NIL also the mutex is NIL + // If the logger is NIL also the mutex is NIL IF s_StdLogger != NIL #ifdef HB_THREAD_SUPPORT hb_mutexLock( s_StdLogMutex ) @@ -634,7 +634,7 @@ METHOD New( nLevel, cDBFName, cIndexName, aStruct, cDriver ) CLASS HB_LogDbf ::cDBFName := iif( !Empty( cDrive ), cDrive + ":\", "" ) + ; iif( !Empty( cPath ), cPath + "\", "" ) + ; cName + cExt - //__OutDebug( "::cDBFName", ::cDBFName ) + // __OutDebug( "::cDBFName", ::cDBFName ) ENDIF IF HB_ISSTRING( cIndexName ) @@ -645,7 +645,7 @@ METHOD New( nLevel, cDBFName, cIndexName, aStruct, cDriver ) CLASS HB_LogDbf ::cIndexName := iif( !Empty( cDrive ), cDrive + ":\", "" ) + ; iif( !Empty( cPath ), cPath + "\", "" ) + ; cName + cExt - //__OutDebug( "::cCDXName", ::cCDXName ) + // __OutDebug( "::cCDXName", ::cCDXName ) ENDIF IF aStruct != NIL @@ -676,7 +676,7 @@ METHOD Open( cProgName ) CLASS HB_LogDbf INDEX ON Str( FIELD->priority, 2 ) + DToS( FIELD->date ) + FIELD->time + FIELD->MESSAGE TAG "priority" TO ( ::cIndexName ) LogDbf->( dbCloseArea() ) ENDIF -// __OutDebug( "::cDriver, ::cDBFName", ::cDriver, ::cDBFName ) + // __OutDebug( "::cDriver, ::cDBFName", ::cDriver, ::cDBFName ) dbUseArea( .T., ::cDriver, ::cDBFName, "LogDbf", .T. ) SET INDEX TO ( ::cIndexName ) diff --git a/harbour/contrib/xhb/hblognet.prg b/harbour/contrib/xhb/hblognet.prg index 5cbd355eef..9bdf09ab32 100644 --- a/harbour/contrib/xhb/hblognet.prg +++ b/harbour/contrib/xhb/hblognet.prg @@ -319,7 +319,7 @@ METHOD Send( nStyle, cMessage, cName, nPriority ) CLASS HB_LogInetPort hb_mutexLock( ::mtxBusy ) #else // IF we have not a thread, we must see if there is a new connection - sk := hb_inetAccept( ::skIn ) //timeout should be short + sk := hb_inetAccept( ::skIn ) // timeout should be short IF sk != NIL AAdd( ::aListeners, sk ) diff --git a/harbour/contrib/xhb/htjlist.prg b/harbour/contrib/xhb/htjlist.prg index 0adc2aef94..a81081f4bd 100644 --- a/harbour/contrib/xhb/htjlist.prg +++ b/harbour/contrib/xhb/htjlist.prg @@ -132,13 +132,13 @@ METHOD New( name, lOpen, width, height, bgColor, ; ::cMainNode := name - cStr += "" //SPACE(10) + cStr += "" // SPACE(10) cStr += name + " = new List(" cStr += iif( lOpen, "true,", "false," ) cStr += hb_ntos( width ) + "," cStr += hb_ntos( height ) + "," cStr += '"' + BGCOLOR + '"' + ");" + CRLF() - cStr += "" //SPACE(10) + cStr += "" // SPACE(10) cStr += name + [.setFont("<FONT FACE='] + FONT + [' SIZE=] + hb_ntos( fntSize ) + [' COLOR='] + fntColor + ['>","</FONT>");] + CRLF() ::nItems++ @@ -160,7 +160,7 @@ METHOD NewNode( name, lOpen, width, height, bgColor ) CLASS TJsList __defaultNIL( @WIDTH, 200 ) __defaultNIL( @HEIGHT, 22 ) __defaultNIL( @BGCOLOR, "white" ) - cStr += "" //SPACE(10) + cStr += "" // SPACE(10) cStr += name + "= new List(" cStr += iif( lOpen, "true,", "false," ) cStr += hb_ntos( width ) + "," diff --git a/harbour/contrib/xhb/htmutil.prg b/harbour/contrib/xhb/htmutil.prg index 51f4944e8b..e35c541ef5 100644 --- a/harbour/contrib/xhb/htmutil.prg +++ b/harbour/contrib/xhb/htmutil.prg @@ -148,7 +148,7 @@ FUNCTION PutCounter( oHtm, nNumber, cDir, nDigits, nWidth, bgColor, nBorder ) oHtm:Write( "</center>" ) - RETURN Nil + RETURN NIL PROCEDURE htmlBrowse( oHtm, cAction, lUseLinks ) @@ -178,7 +178,7 @@ PROCEDURE htmlBrowse( oHtm, cAction, lUseLinks ) oHtm:TableHead( aFlds[ i, 1 ] ) NEXT - WHILE ! EOF() + WHILE ! Eof() // each row has a different color... IF n == 0 @@ -289,7 +289,7 @@ PROCEDURE htmlBrowseSql( oHtm, cAction, lUseLinks, cTarget, oServer, oQuery ) oHtm:EndTableCell() NEXT oHtm:endTableRow() - IF !oquery:EOF() + IF !oquery:Eof() oquery:skip() ENDIF @@ -404,7 +404,7 @@ METHOD New( cVarName, cUrl, cName, x, y, w, h ) CLASS JWindow ::height := h ::width := w -// objectViewer( self ) + // objectViewer( self ) RETURN Self @@ -855,7 +855,7 @@ FUNCTION Greek2Html( cText ) t_aGreek := initGreek() ENDIF FOR I := 1 TO Len( cText ) - cStr += t_aGreek[ Asc( Substr( cText, i, 1 ) ) ] /* TOFIX: for unicode */ + cStr += t_aGreek[ Asc( SubStr( cText, i, 1 ) ) ] /* TOFIX: for unicode */ NEXT RETURN cStr diff --git a/harbour/contrib/xhb/regexrpl.prg b/harbour/contrib/xhb/regexrpl.prg index 408b3b8ff4..d8db07fd74 100644 --- a/harbour/contrib/xhb/regexrpl.prg +++ b/harbour/contrib/xhb/regexrpl.prg @@ -60,7 +60,7 @@ FUNCTION hb_RegexReplace( cRegex, cString, cReplace, lCaseSensitive, lNewLine, n LOCAL nOffSet := 0 LOCAL cSearch, nStart, nLenSearch, nLenReplace - aMatches := HB_RegExAll( cRegEx, cString, lCaseSensitive, lNewLine, nMaxMatches, nGetMatch, .F. ) + aMatches := hb_regexAll( cRegEx, cString, lCaseSensitive, lNewLine, nMaxMatches, nGetMatch, .F. ) cReturn := cString IF ! Empty( aMatches ) diff --git a/harbour/contrib/xhb/sprintf.prg b/harbour/contrib/xhb/sprintf.prg index 7adc60332c..ac5b5a8ee4 100644 --- a/harbour/contrib/xhb/sprintf.prg +++ b/harbour/contrib/xhb/sprintf.prg @@ -52,11 +52,12 @@ */ FUNCTION sprintf( ... ) + LOCAL aPar, cReturn, nPar, nPos, cTok LOCAL nLen := 0, lUnsigned, l0 := .F., lSign := .F., nDec, xVal LOCAL cString - aPar := HB_aParams() + aPar := hb_AParams() cReturn := "" cString := aPar[ 1 ] nPar := 2 @@ -133,7 +134,7 @@ FUNCTION sprintf( ... ) nLen := Val( SubStr( cString, nPos ) ) cTok := Left( cString, nPos - 1 ) DO WHILE SubStr( cString, nPos, 1 ) $ "1234567890." - nPos++ + nPos++ ENDDO cString := cTok + SubStr( cString, nPos ) nPos := At( "%", cString ) - 1 @@ -147,7 +148,7 @@ FUNCTION sprintf( ... ) CASE "l" CASE "f" CASE "i" - xVal := aPar[nPar++] + xVal := aPar[ nPar++ ] IF !HB_ISNUMERIC( xVal ) xVal := 0 ENDIF @@ -155,7 +156,7 @@ FUNCTION sprintf( ... ) IF nLen - Int( nLen ) > 0.0 nDec := Str( nLen ) DO WHILE Right( nDec, 1 ) == "0" - nDec := Left( nDec, Len( nDec ) - 1 ) + nDec := Left( nDec, Len( nDec ) - 1 ) ENDDO nDec := Val( SubStr( nDec, At( ".", nDec ) + 1 ) ) ELSE @@ -163,7 +164,7 @@ FUNCTION sprintf( ... ) ENDIF cTok := Str( iif( lUnsigned, Abs( xVal ), xVal ), nLen, nDec ) ELSE - cTok := hb_NToS( iif( lUnsigned, Abs( xVal ), xVal ) ) + cTok := hb_ntos( iif( lUnsigned, Abs( xVal ), xVal ) ) ENDIF IF l0 IF "-" $ cTok .AND. !( Left( cTok, 1 ) == "-" ) @@ -188,9 +189,9 @@ FUNCTION sprintf( ... ) CASE "c" CASE "s" IF nLen == 0 - nLen := Len( hb_cStr( aPar[nPar] ) ) + nLen := Len( hb_CStr( aPar[ nPar ] ) ) ENDIF - cReturn += PadL( hb_cStr( aPar[nPar++] ), nLen ) + cReturn += PadL( hb_CStr( aPar[ nPar++ ] ), nLen ) nLen := 0 l0 := .F. lSign := .F. diff --git a/harbour/contrib/xhb/stream.prg b/harbour/contrib/xhb/stream.prg index d5543c7cf4..5fab8246d1 100644 --- a/harbour/contrib/xhb/stream.prg +++ b/harbour/contrib/xhb/stream.prg @@ -101,7 +101,7 @@ METHOD PROCEDURE CopyTo( oTargetStream ) CLASS TStream LOCAL nPosition IF ! oTargetStream:lCanWrite - Throw( xhb_ErrorNew( "Stream", 0, 1001, ProcName(), "Target not writable.", HB_aParams() ) ) + Throw( xhb_ErrorNew( "Stream", 0, 1001, ProcName(), "Target not writable.", hb_AParams() ) ) ENDIF // Save. @@ -116,7 +116,7 @@ METHOD PROCEDURE CopyTo( oTargetStream ) CLASS TStream nBytesToRead -= nRead ENDDO - //Truncate incase it was a bigger file. + // Truncate incase it was a bigger file. oTargetStream:Write( "", 0, 0 ) // Restore. @@ -153,7 +153,7 @@ METHOD New( cFile, nMode ) CLASS TStreamFileReader ::Handle := FOpen( cFile, nMode ) IF ::Handle <= 0 - Throw( xhb_ErrorNew( "Stream", 0, 1004, ProcName(), "Open Error: " + Str( FError() ), HB_aParams() ) ) + Throw( xhb_ErrorNew( "Stream", 0, 1004, ProcName(), "Open Error: " + Str( FError() ), hb_AParams() ) ) ENDIF ::nPosition := 0 @@ -164,7 +164,9 @@ METHOD New( cFile, nMode ) CLASS TStreamFileReader RETURN Self METHOD PROCEDURE Finalize CLASS TStreamFileReader + ::Close() + RETURN METHOD Read( sBuffer, nOffset, nCount ) CLASS TStreamFileReader @@ -222,7 +224,7 @@ METHOD New( cFile, nMode ) CLASS TStreamFileWriter ::Handle := FOpen( cFile, nMode ) IF ::Handle <= 0 - Throw( xhb_ErrorNew( "Stream", 0, 1004, ProcName(), "Open Error: " + Str( FError() ), HB_aParams() ) ) + Throw( xhb_ErrorNew( "Stream", 0, 1004, ProcName(), "Open Error: " + Str( FError() ), hb_AParams() ) ) ENDIF ::nLength := FSeek( ::Handle, 0, FS_END ) @@ -232,7 +234,7 @@ METHOD New( cFile, nMode ) CLASS TStreamFileWriter ::Handle := FCreate( cFile, nMode ) IF ::Handle <= 0 - Throw( xhb_ErrorNew( "Stream", 0, 1004, ProcName(), "Create Error: " + Str( FError() ), HB_aParams() ) ) + Throw( xhb_ErrorNew( "Stream", 0, 1004, ProcName(), "Create Error: " + Str( FError() ), hb_AParams() ) ) ENDIF ::nPosition := 0 @@ -242,7 +244,9 @@ METHOD New( cFile, nMode ) CLASS TStreamFileWriter RETURN Self METHOD PROCEDURE Finalize CLASS TStreamFileWriter + ::Close() + RETURN METHOD Write( sBuffer, nOffset, nCount ) CLASS TStreamFileWriter @@ -254,7 +258,7 @@ METHOD Write( sBuffer, nOffset, nCount ) CLASS TStreamFileWriter ::nPosition += nWritten IF nWritten != nCount - Throw( xhb_ErrorNew( "Stream", 0, 1003, ProcName(), "Write failed - written:" + Str( nWritten ) + " bytes", HB_aParams() ) ) + Throw( xhb_ErrorNew( "Stream", 0, 1003, ProcName(), "Write failed - written:" + Str( nWritten ) + " bytes", hb_AParams() ) ) ENDIF RETURN nWritten @@ -266,7 +270,7 @@ METHOD PROCEDURE WriteByte( cByte ) CLASS TStreamFileWriter ::nPosition += nWritten IF nWritten != 1 - Throw( xhb_ErrorNew( "Stream", 0, 1006, ProcName(), "Write failed", HB_aParams() ) ) + Throw( xhb_ErrorNew( "Stream", 0, 1006, ProcName(), "Write failed", hb_AParams() ) ) ENDIF RETURN diff --git a/harbour/contrib/xhb/tests/compress.prg b/harbour/contrib/xhb/tests/compress.prg index 9dc3d20910..11128b775c 100644 --- a/harbour/contrib/xhb/tests/compress.prg +++ b/harbour/contrib/xhb/tests/compress.prg @@ -2,7 +2,7 @@ * $Id$ */ -//**************************************************** +// **************************************************** // Demo of realtime string compression // // Giancarlo Niccolai @@ -24,7 +24,7 @@ PROCEDURE Main() @ 2, 5 SAY "TEST 1: using on-the-fly Buffer creation" nBufLen := HB_CompressBuflen( Len( cText ) ) - //cComp and cDecomp will be created with the correct length + // cComp and cDecomp will be created with the correct length cComp := HB_Compress( cText ) cDecomp := HB_Uncompress( nBuflen, cComp ) @@ -41,7 +41,7 @@ PROCEDURE Main() // on exit, nBuflen will contain the length of the compressed buffer HB_Compress( cText, Len( cText ), @cComp, @nBuflen ) - HB_Uncompress( Len( cText ), cComp, nBuflen , @cDecomp ) + HB_Uncompress( Len( cText ), cComp, nBuflen, @cDecomp ) @ 8, 7 SAY "Uncompressed: (" + hb_ntos( Len( cText ) ) + ")" + cText + "<<" @ 9, 7 SAY "Compressed (" + hb_ntos( nBuflen ) + ")" + hb_StrToHex( cComp ) + "<<" diff --git a/harbour/contrib/xhb/tests/decode.prg b/harbour/contrib/xhb/tests/decode.prg index a2dc1d84de..a335e12275 100644 --- a/harbour/contrib/xhb/tests/decode.prg +++ b/harbour/contrib/xhb/tests/decode.prg @@ -53,6 +53,7 @@ #require "xhb" PROCEDURE Main() + LOCAL aArray ? "HB_DECODE() FUNCTION TESTS" diff --git a/harbour/contrib/xhb/tests/dll.prg b/harbour/contrib/xhb/tests/dll.prg index b0675b324d..5402d5b20f 100644 --- a/harbour/contrib/xhb/tests/dll.prg +++ b/harbour/contrib/xhb/tests/dll.prg @@ -9,5 +9,7 @@ IMPORT STATIC MessageBox( hWnd, cMsg, cText, nFlags ) FROM user32.dll EXPORTED AS MessageBoxA PROCEDURE Main() + ? MessageBox( 0, "Hello world!", "Harbour sez" ) + RETURN diff --git a/harbour/contrib/xhb/tests/xml1.prg b/harbour/contrib/xhb/tests/xml1.prg index 35c3b44bc1..8d1e190ed5 100644 --- a/harbour/contrib/xhb/tests/xml1.prg +++ b/harbour/contrib/xhb/tests/xml1.prg @@ -7,7 +7,8 @@ #include "hbxml.ch" PROCEDURE Main() - LOCAL cFile := hb_dirBase() + "test.xml" + + LOCAL cFile := hb_DirBase() + "test.xml" LOCAL cString LOCAL cNote, cDiscount LOCAL oDoc, oBook, oIterator, oCurrent diff --git a/harbour/contrib/xhb/tfile.prg b/harbour/contrib/xhb/tfile.prg index 7b0b2e6c08..bd80f2a1d3 100644 --- a/harbour/contrib/xhb/tfile.prg +++ b/harbour/contrib/xhb/tfile.prg @@ -97,9 +97,9 @@ CREATE CLASS TCgiFile METHOD GoBottom() INLINE FSeek( ::Handle, 0, FS_END ) - METHOD BOF() INLINE( FPOS( ::Handle ) == 0 ) + METHOD Bof() INLINE( FPOS( ::Handle ) == 0 ) - METHOD EOF() INLINE FPOS( ::Handle ) == ::FileSize + METHOD Eof() INLINE FPOS( ::Handle ) == ::FileSize METHOD SEEK( n, o ) INLINE FSeek( ::Handle, n, o ) @@ -206,7 +206,7 @@ METHOD _Read( nSize, cBuff ) CLASS TCgiFile ::BytesRead := FRead( ::Handle, @cBuff, nSize ) ::Buffer := cBuff - RETURN cBuff //nBytesRead ) + RETURN cBuff // nBytesRead ) /* ** ::ReadAhead( [<nSize>], [@<cBuff>] ) --> nBytesRead @@ -352,7 +352,7 @@ METHOD GOTO( nLine ) CLASS TCgiFile RETURN nPos ENDIF - WHILE !::EOF() + WHILE !::Eof() ::ReadLine() @@ -385,7 +385,7 @@ METHOD SKIP( nLines ) CLASS TCgiFile ENDIF - WHILE !::EOF() + WHILE !::Eof() IF nCount == nLines EXIT @@ -419,7 +419,7 @@ METHOD PrevPage( nBytes ) CLASS TCgiFile RETURN "" ENDIF - IF !::BOF() + IF !::Bof() FSeek( ::Handle, - nBytes, FS_RELATIVE ) ::cPage := FReadStr( ::Handle, nBytes ) FSeek( ::Handle, - nBytes, FS_RELATIVE ) @@ -440,7 +440,7 @@ METHOD NextPage( nBytes ) CLASS TCgiFile RETURN "" ENDIF - IF !::EOF() + IF !::Eof() ::cPage := FReadStr( ::Handle, nBytes ) ::nPage++ ENDIF diff --git a/harbour/contrib/xhb/tframe.prg b/harbour/contrib/xhb/tframe.prg index 45ff67e1e9..4a71f08faa 100644 --- a/harbour/contrib/xhb/tframe.prg +++ b/harbour/contrib/xhb/tframe.prg @@ -65,7 +65,7 @@ CREATE CLASS THtmlFrameSet METHOD END () METHOD Frame( cName, cURL, lBorder, lResize, lScrolling, ; - marginwidth, marginheight, cTarget, cScrolling ) + marginwidth, marginheight, cTarget, cScrolling ) ENDCLASS @@ -88,9 +88,9 @@ METHOD New( cFName, cTitle ) CLASS THtmlFrameSet ENDIF cStr += "<html>" + CRLF() + ; - " <head>" + CRLF() + ; - " <title>" + ::Title + "" + CRLF() + ; - " " + CRLF() + " " + CRLF() + ; + " " + ::Title + "" + CRLF() + ; + " " + CRLF() ::cStr += cStr @@ -167,7 +167,7 @@ METHOD END () CLASS THtmlFrameSet METHOD Frame( cName, cURL, lBorder, lResize, lScrolling, ; - marginwidth, marginheight, cTarget, cScrolling ) CLASS THtmlFrameSet + marginwidth, marginheight, cTarget, cScrolling ) CLASS THtmlFrameSet LOCAL cStr diff --git a/harbour/contrib/xhb/thtm.prg b/harbour/contrib/xhb/thtm.prg index baa88fdbbb..da5d5aab10 100644 --- a/harbour/contrib/xhb/thtm.prg +++ b/harbour/contrib/xhb/thtm.prg @@ -389,7 +389,7 @@ METHOD New( cTitle, cLinkTitle, cCharSet, aScriptSRC, ; ENDIF -// preload images... + // preload images... IF aImages != NIL ::aImages := aImages ::cStr += ; @@ -1195,9 +1195,9 @@ METHOD PutImage( cImage, nBorder, nHeight, ; METHOD CLOSE() CLASS THtml -//::cStr += ::cStr - ::cStr += "" + CRLF() - ::cStr += "" + CRLF() +// ::cStr += ::cStr + ::cStr += "" + CRLF() + ::cStr += "" + CRLF() FWrite( ::nh, ::cStr ) @@ -1987,7 +1987,7 @@ METHOD iFrame( name, src, border, marginwidth, marginheight, ; RETURN Self - /* New Methods */ +/* New Methods */ METHOD Span( c, Style ) CLASS THtml diff --git a/harbour/contrib/xhb/traceprg.prg b/harbour/contrib/xhb/traceprg.prg index c1c71cbe43..0d218c50b6 100644 --- a/harbour/contrib/xhb/traceprg.prg +++ b/harbour/contrib/xhb/traceprg.prg @@ -111,7 +111,7 @@ FUNCTION xhb_setTraceStack( xLevel ) RETURN nTraceLevel -//--------------------------------------------------------------// +// --------------------------------------------------------------// FUNCTION TraceLog( ... ) @@ -172,8 +172,11 @@ FUNCTION TraceLog( ... ) // -STATIC FUNCTION cWithPath( cFilename ) /* Ensure cFilename contains path. If it doesn't, add current directory to the front of it */ +STATIC FUNCTION cWithPath( cFilename ) + LOCAL cPath - hb_fnamesplit( cFilename, @cPath ) + + hb_FNameSplit( cFilename, @cPath ) + RETURN iif( Empty( cPath ), "." + hb_ps(), "" ) + cFilename diff --git a/harbour/contrib/xhb/trpc.prg b/harbour/contrib/xhb/trpc.prg index ea023401f6..b74e5975b7 100644 --- a/harbour/contrib/xhb/trpc.prg +++ b/harbour/contrib/xhb/trpc.prg @@ -541,7 +541,7 @@ METHOD RUN() CLASS tRPCServeCon /* Challeng reply */ CASE cCode == "XHBR95" IF nSafeStatus == RPCS_STATUS_CHALLENGE - lBreak := ! ::RecvChallenge( ) + lBreak := ! ::RecvChallenge() IF ! lBreak nSafeStatus := RPCS_STATUS_LOGGED ENDIF @@ -754,7 +754,7 @@ METHOD LaunchChallenge( cUserid, cPassword ) CLASS tRPCServeCon /* Let's generate the sequence */ cChallenge := "" FOR nCount := 1 TO 255 - cChallenge += hb_BChar( HB_Random(0, 255 ) ) + cChallenge += hb_BChar( hb_Random( 0, 255 ) ) NEXT ::nChallengeCRC := HB_Checksum( cChallenge ) @@ -770,6 +770,7 @@ METHOD LaunchChallenge( cUserid, cPassword ) CLASS tRPCServeCon METHOD RecvChallenge() CLASS tRPCServeCon + LOCAL cNumber := Space( 8 ) IF hb_inetRecvAll( ::skRemote, @cNumber ) != 8 @@ -922,7 +923,7 @@ METHOD LaunchFunction( cFuncName, aParams, nMode, aDesc ) CLASS tRPCServeCon LOCAL oFunc - //Check for function existance + // Check for function existance oFunc := ::oServer:Find( cFuncName ) IF Empty( oFunc ) // signal error @@ -939,7 +940,7 @@ METHOD LaunchFunction( cFuncName, aParams, nMode, aDesc ) CLASS tRPCServeCon RETURN .T. ENDIF - //check for parameters + // check for parameters IF aParams == NIL .OR. ! oFunc:CheckTypes( aParams ) // signal error ::oServer:OnFunctionError( Self, cFuncName, 02 ) @@ -966,7 +967,7 @@ METHOD FunctionRunner( cFuncName, oFunc, nMode, aParams, aDesc ) CLASS tRPCServe LOCAL oRet, oElem, aRet LOCAL aSubst, nSubstPos -//? "TH:", ::thFunction + // ? "TH:", ::thFunction DO CASE CASE nMode == 0 // just run the function @@ -1104,7 +1105,7 @@ METHOD SendResult( oRet, cFuncName ) IF ::lCanceled hb_mutexUnlock( ::mtxBusy ) ::oServer:OnFunctionCanceled( Self, cFuncName ) - RETURN .T. //as if it were done + RETURN .T. // as if it were done ENDIF hb_mutexUnlock( ::mtxBusy ) @@ -1255,7 +1256,7 @@ CREATE CLASS tRPCService /* Provide encryption key for a user */ METHOD GetEncryption( cUserId ) METHOD OnFunctionScan() - METHOD OnServerScan( ) + METHOD OnServerScan() METHOD OnClientConnect( oClient ) METHOD OnClientLogin( oClient ) METHOD OnClientRequest( oClient, nRequest, cData ) @@ -1436,7 +1437,7 @@ METHOD StartService( skIn ) CLASS tRPCService RETURN .T. -METHOD UDPListen( ) CLASS tRPCService +METHOD UDPListen() CLASS tRPCService LOCAL cData := Space( 1000 ) LOCAL nPacketLen @@ -1464,6 +1465,7 @@ METHOD UDPParseRequest( cData, nPacketLen ) CLASS tRPCService RETURN .F. METHOD UDPInterpretRequest( cData, nPacketLen, cRes ) CLASS tRPCService + LOCAL cCode, cMatch, cNumber, cSerial LOCAL oFunc @@ -1471,7 +1473,7 @@ METHOD UDPInterpretRequest( cData, nPacketLen, cRes ) CLASS tRPCService RETURN .F. ENDIF - cCode := hb_BSubstr( cData, 1, 6 ) + cCode := hb_BSubStr( cData, 1, 6 ) DO CASE /* XHRB00 - server scan */ @@ -1480,23 +1482,23 @@ METHOD UDPInterpretRequest( cData, nPacketLen, cRes ) CLASS tRPCService RETURN .F. ENDIF IF nPacketLen > 6 - cMatch := hb_Deserialize( hb_BSubstr( cData, 7 ) ) + cMatch := hb_Deserialize( hb_BSubStr( cData, 7 ) ) IF hb_regexMatch( cMatch, ::cServerName ) - cRes := "XHBR10" + hb_Serialize( ::cServerName ) + cRes := "XHBR10" + hb_Serialize( ::cServerName ) ENDIF ELSE cRes := "XHBR10" + hb_Serialize( ::cServerName ) ENDIF RETURN .T. - /* XRB01 - Function scan */ + /* XRB01 - Function scan */ CASE cCode == "XHBR01" IF ! ::OnFunctionScan() RETURN .F. ENDIF /* minimal length to be valid */ IF nPacketLen > 24 - cSerial := hb_DeserialBegin( hb_BSubstr( cData, 7 ) ) + cSerial := hb_DeserialBegin( hb_BSubStr( cData, 7 ) ) cMatch := hb_DeserialNext( @cSerial ) cNumber := NIL IF ! Empty( cMatch ) @@ -1524,6 +1526,7 @@ METHOD UDPInterpretRequest( cData, nPacketLen, cRes ) CLASS tRPCService ENDCASE /* Ignore malformed requests. */ + RETURN .F. METHOD Terminating( oConnection ) CLASS tRPCService @@ -1569,8 +1572,8 @@ METHOD AuthorizeChallenge( cUserId, cData ) CLASS tRPCService RETURN NIL - /* Default authorization will ALWAYS return 1 if a bAuthorize block is not provided */ - /* IF cPassword is NIL, must return the level of the given userid */ +/* Default authorization will ALWAYS return 1 if a bAuthorize block is not provided */ +/* IF cPassword is NIL, must return the level of the given userid */ METHOD Authorize( cUserid, cPassword ) CLASS tRPCService @@ -1580,7 +1583,7 @@ METHOD Authorize( cUserid, cPassword ) CLASS tRPCService RETURN 1 - /* By default, do not provide an encryption key for any user */ +/* By default, do not provide an encryption key for any user */ METHOD GetEncryption( cUserId ) CLASS tRPCService diff --git a/harbour/contrib/xhb/trpccli.prg b/harbour/contrib/xhb/trpccli.prg index 4ebc7f965d..fc0bccd27e 100644 --- a/harbour/contrib/xhb/trpccli.prg +++ b/harbour/contrib/xhb/trpccli.prg @@ -93,7 +93,7 @@ CREATE CLASS tRPCClient METHOD StopScan() /* Function call */ - METHOD CheckServer( cRemote ) //Checks if a server is ready on tcp + METHOD CheckServer( cRemote ) // Checks if a server is ready on tcp METHOD SetLoopMode( nMethod, xData, nEnd, nStep ) METHOD Call( ... ) // variable parameters METHOD CallAgain() INLINE ::TCPAccept() @@ -652,7 +652,7 @@ METHOD SetPeriodCallback( ... ) CLASS tRPCClient LOCAL nCount IF PCount() < 3 - //TODO set an error + // TODO set an error RETURN .F. ENDIF @@ -730,7 +730,7 @@ METHOD StopCall() CLASS tRPCClient // send cancelation request hb_inetSendAll( ::skTCP, "XHBR29" ); - //Stops waiting for a result + // Stops waiting for a result hb_mutexLock( ::mtxBusy ) IF hb_threadID( ::thTCPAccept ) != 0 hb_threadQuitRequest( ::thTCPAccept ) diff --git a/harbour/contrib/xhb/ttable.prg b/harbour/contrib/xhb/ttable.prg index 0ab9f21be1..4bedf68f6f 100644 --- a/harbour/contrib/xhb/ttable.prg +++ b/harbour/contrib/xhb/ttable.prg @@ -152,9 +152,9 @@ FUNCTION NetLock( nType, lReleaseLocks, nSeconds ) LOCAL cWord IF ! HB_ISNUMERIC( nType ) .OR. ; - ( nType != 1 .AND. ; - nType != 2 .AND. ; - nType != 3 ) + ( nType != 1 .AND. ; + nType != 2 .AND. ; + nType != 3 ) Alert( "Invalid Argument passed to NETLOCK()" ) RETURN lSuccess ENDIF @@ -182,12 +182,12 @@ FUNCTION NetLock( nType, lReleaseLocks, nSeconds ) WHILE lContinue - #if 0 +#if 0 IF ( nKey := Inkey() ) == K_ESC RestScreen( MaxRow(), 0, MaxRow(), MaxCol() + 1, cSave ) EXIT ENDIF - #endif +#endif WHILE nSeconds > 0 .AND. lContinue IF Eval( bOperation, xIdentifier ) @@ -232,7 +232,7 @@ FUNCTION NetLock( nType, lReleaseLocks, nSeconds ) lContinue := ( nCh == 1 ) IF ! lContinue - //EXIT + // EXIT RestScreen( MaxRow(), 0, MaxRow(), MaxCol() + 1, cSave ) RETURN lSuccess ENDIF @@ -592,22 +592,22 @@ METHOD PROCEDURE Put() CLASS HBRecord * */ -//METHOD SetFocus() INLINE ( ::Alias )->( Select( ::Area ) ) +// METHOD SetFocus() INLINE ( ::Alias )->( Select( ::Area ) ) // // -//encapsulated methods +// encapsulated methods // // -//Methods +// Methods // // -//table movement +// table movement // // -//RELATION +// RELATION // // -//ORDER Management +// ORDER Management // CREATE CLASS HBTable @@ -638,8 +638,8 @@ CREATE CLASS HBTable VAR aChildren INIT {} VAR oParent - METHOD EOF() INLINE ( ::Alias )->( EOF() ) - METHOD BOF() INLINE ( ::Alias )->( BOF() ) + METHOD Eof() INLINE ( ::Alias )->( Eof() ) + METHOD Bof() INLINE ( ::Alias )->( Bof() ) METHOD RecNo() INLINE ( ::Alias )->( RecNo() ) METHOD LastRec() INLINE ( ::Alias )->( LastRec() ) METHOD SKIP( n ) INLINE ( ::Alias )->( dbSkip( n ) ), ; @@ -651,7 +651,7 @@ CREATE CLASS HBTable METHOD SetFocus() INLINE ( ::Alias )->( Select( ::ALias ) ) METHOD APPEND( l ) INLINE iif( ::isNet, ( ::Alias )->( NetAppend( l ) ), ; ( ::alias )->( dbAppend() ) ) - METHOD RECALL( ) INLINE ( ::Alias )->( NetRecall( ) ) + METHOD RECALL() INLINE ( ::Alias )->( NetRecall() ) METHOD LOCATE( bFor, bWhile, nNext, nRec, lRest ) INLINE ; ( ::Alias )->( __dbLocate( bFor, bWhile, ; @@ -668,7 +668,7 @@ CREATE CLASS HBTable METHOD dbIsShared() INLINE ( ::Alias )->( dbInfo( DBI_SHARED ) ) - METHOD dbIsFLocked( ) INLINE ( ::Alias )->( dbInfo( DBI_ISFLOCK ) ) + METHOD dbIsFLocked() INLINE ( ::Alias )->( dbInfo( DBI_ISFLOCK ) ) METHOD dbLockCount() INLINE ( ::Alias )->( dbInfo( DBI_LOCKCOUNT ) ) @@ -700,15 +700,15 @@ CREATE CLASS HBTable METHOD ordSetFocus( ncTag ) INLINE ( ::Alias )->( ordSetFocus( ncTag ) ) METHOD ordName( nOrder ) INLINE ; - ( ::Alias )->( ordName( nOrder, ::cOrderBag ) ) ; + ( ::Alias )->( ordName( nOrder, ::cOrderBag ) ) METHOD ordNumber( cOrder ) INLINE ; - ( ::Alias )->( ordNumber( cOrder, ::cOrderBag ) ) ; + ( ::Alias )->( ordNumber( cOrder, ::cOrderBag ) ) METHOD ordScope( n, u ) INLINE ( ::Alias )->( ordScope( n, u ) ) METHOD ordIsUnique( nc ) INLINE ( ::Alias )->( ordIsUnique( nc, ; - ::cOrderBag ) ) ; + ::cOrderBag ) ) METHOD ordSkipUnique( n ) INLINE ( ::Alias )->( ordSkipUnique( n ) ) METHOD ordSetRelation( n, b, c ) INLINE ( ::Alias )->( ordSetRelation( n, b, c ) ) @@ -770,9 +770,9 @@ CREATE CLASS HBTable ENDCLASS -//--------------------- +// --------------------- // Constructor... -//--------------------- +// --------------------- METHOD New( cDBF, cALIAS, cOrderBag, cDRIVER, ; lNET, cPATH, lNEW, lREADONLY ) CLASS HBTable @@ -796,13 +796,13 @@ METHOD New( cDBF, cALIAS, cOrderBag, cDRIVER, ; ::cOrderBag := FixExt( cOrderBag ) cOldRdd := rddSetDefault( ::driver ) - ::cOrderFile := ::cOrderBag + ordBagExt() //".cdx" + ::cOrderFile := ::cOrderBag + ordBagExt() // ".cdx" rddSetDefault( cOldRdd ) ::Driver := cDRIVER ::aOrders := {} ::Area := 0 ::Alias := cALIAS - ::nDataOffset := Len( self ) //66 + ::nDataOffset := Len( self ) // 66 RETURN Self @@ -937,7 +937,7 @@ METHOD PROCEDURE READ( lKeepBuffer ) CLASS HBTable __defaultNIL( @lKeepBuffer, .F. ) -// ? Len( ::Buffer ) + // ? Len( ::Buffer ) FOR EACH Buffer in ::Buffer @@ -1447,7 +1447,7 @@ METHOD OnError( uParam ) CLASS HBTable nPos := ( ::Alias )->( FieldPos( cMsg ) ) IF nPos != 0 - uRet := ( ::Alias )->( iif( uParam == NIL, FieldGet(nPos ), FieldPut(nPos, uParam ) ) ) + uRet := ( ::Alias )->( iif( uParam == NIL, FieldGet( nPos ), FieldPut( nPos, uParam ) ) ) ELSE oErr := ErrorNew() @@ -1524,7 +1524,7 @@ METHOD PROCEDURE CREATE() CLASS HBOrder __defaultNIL( @::cOrderBag, ::oTable:cOrderBag ) -// ? "<<<", ::alias, ::cOrderBag + // ? "<<<", ::alias, ::cOrderBag ( ::alias )->( ordCondSet( ::cFor, ::bFor, ; .T., ; diff --git a/harbour/contrib/xhb/xcstr.prg b/harbour/contrib/xhb/xcstr.prg index 9dc80ef0de..113ecf3279 100644 --- a/harbour/contrib/xhb/xcstr.prg +++ b/harbour/contrib/xhb/xcstr.prg @@ -118,15 +118,15 @@ FUNCTION StringToLiteral( cString ) LOCAL lSingle := .F. IF hb_regexHas( "\n|\r", cString ) .OR. ; - ( ( lDouble := '"' $ cString ) .AND. ; - ( lSingle := "'" $ cString ) .AND. ; - hb_regexHas( "\[|\]", cString ) ) + ( ( lDouble := '"' $ cString ) .AND. ; + ( lSingle := "'" $ cString ) .AND. ; + hb_regexHas( "\[|\]", cString ) ) cString := StrTran( cString, '"', '\"' ) cString := StrTran( cString, Chr( 10 ), "\n" ) cString := StrTran( cString, Chr( 13 ), "\r" ) - //TraceLog( cString ) + // TraceLog( cString ) RETURN 'E"' + cString + '"' ELSEIF ! lDouble @@ -143,7 +143,7 @@ FUNCTION ValToPrg( xVal, cName, nPad, aObjs ) LOCAL aVar, cRet, cPad, nObj -// TraceLog( xVal, cName, nPad, aObjs ) + // TraceLog( xVal, cName, nPad, aObjs ) SWITCH ValType( xVal ) CASE "C" @@ -236,7 +236,7 @@ FUNCTION ValToPrg( xVal, cName, nPad, aObjs ) nPad += 3 cPad := Space( nPad ) - FOR EACH aVar IN __objGetValueList( xVal ) + FOR EACH aVar IN __objGetValueLIST( xVal ) cRet += cPad + cName + ":" + aVar[ 1 ] + " := " + ValToPrg( aVar[ 2 ], cName + ":" + aVar[ 1 ], nPad, aObjs ) + CRLF NEXT @@ -244,7 +244,7 @@ FUNCTION ValToPrg( xVal, cName, nPad, aObjs ) RETURN cRet OTHERWISE - //TraceLog( xVal, cName, nPad ) + // TraceLog( xVal, cName, nPad ) IF xVal == NIL cRet := "NIL" ELSE @@ -252,7 +252,7 @@ FUNCTION ValToPrg( xVal, cName, nPad, aObjs ) ENDIF ENDSWITCH -// TraceLog( cRet ) + // TraceLog( cRet ) RETURN cRet diff --git a/harbour/contrib/xhb/xdbmodst.prg b/harbour/contrib/xhb/xdbmodst.prg index 07f3cdcc72..c92aa85a00 100644 --- a/harbour/contrib/xhb/xdbmodst.prg +++ b/harbour/contrib/xhb/xdbmodst.prg @@ -233,7 +233,7 @@ FUNCTION dbMerge( xSource, lAppend ) BEGIN SEQUENCE WITH {| oErr | Break( oErr ) } // Test type compatability - FieldPut( cField:__EnumIndex(), ValToType( (nSource )->( FieldGet( nSourcePos ) ), cTargetType ) ) + FieldPut( cField:__EnumIndex(), ValToType( ( nSource )->( FieldGet( nSourcePos ) ), cTargetType ) ) // Restore FieldPut( cField:__EnumIndex(), xField ) @@ -241,7 +241,7 @@ FUNCTION dbMerge( xSource, lAppend ) // Ok to process AAdd( aTranslate, { cField:__EnumIndex(), nSourcePos, {| xSource | ValToType( xSource, cTargetType ) } } ) RECOVER // USING oErr - //TraceLog( oErr:Description, oErr:Operation ) + // TraceLog( oErr:Description, oErr:Operation ) END SEQUENCE END SEQUENCE ENDIF @@ -259,7 +259,7 @@ FUNCTION dbMerge( xSource, lAppend ) nRecNo := ( nSource )->( RecNo() ) ( nSource )->( dbGoTop( 1 ) ) - WHILE ! ( nSource )->( EOF() ) + WHILE ! ( nSource )->( Eof() ) APPEND BLANK FOR EACH aTranslation IN aTranslate diff --git a/harbour/contrib/xhb/xhbcomp.prg b/harbour/contrib/xhb/xhbcomp.prg index 901a51f14e..4dd39734ce 100644 --- a/harbour/contrib/xhb/xhbcomp.prg +++ b/harbour/contrib/xhb/xhbcomp.prg @@ -65,6 +65,7 @@ ANNOUNCE XHB_LIB INIT PROCEDURE xhb_Init() + /* Add calls to do initial settings to Harbour to be more compatible with xhb. */ ASSOCIATE CLASS _Character WITH TYPE Character @@ -73,9 +74,10 @@ INIT PROCEDURE xhb_Init() ASSOCIATE CLASS _Hash WITH TYPE Hash ASSOCIATE CLASS _Block WITH TYPE Block -RETURN + RETURN CREATE CLASS Character FUNCTION _Character + OPTIONAL INHERIT HBCharacter OPERATOR "[]" FUNCTION XHB_INDEX() OPERATOR "+" FUNCTION XHB_PLUS() @@ -98,6 +100,7 @@ CREATE CLASS Character FUNCTION _Character ENDCLASS CREATE CLASS Numeric FUNCTION _Numeric + OPTIONAL INHERIT HBNumeric OPERATOR "+" FUNCTION XHB_PLUS() OPERATOR "-" FUNCTION XHB_MINUS() @@ -115,15 +118,19 @@ CREATE CLASS Numeric FUNCTION _Numeric OPERATOR "<=" FUNCTION XHB_LESSEQ() OPERATOR ">" FUNCTION XHB_GREATER() OPERATOR ">=" FUNCTION XHB_GREATEREQ() + ENDCLASS CREATE CLASS Array FUNCTION _Array + OPTIONAL INHERIT HBArray OPERATOR "[]" FUNCTION XHB_INDEX() OPERATOR "$$" FUNCTION XHB_INCLUDE() + ENDCLASS CREATE CLASS Hash INHERIT __HBHash FUNCTION _Hash + OPTIONAL INHERIT HBHash ON ERROR FUNCTION XHB_HASHERROR() OPERATOR "+" FUNCTION XHB_PLUS() @@ -131,9 +138,12 @@ CREATE CLASS Hash INHERIT __HBHash FUNCTION _Hash OPERATOR "$$" FUNCTION XHB_INCLUDE() OPERATOR "=" FUNCTION XHB_EQUAL() OPERATOR "<>" FUNCTION XHB_NOTEQUAL() + ENDCLASS CREATE CLASS Block FUNCTION _Block + OPTIONAL INHERIT HBBlock OPERATOR "==" FUNCTION XHB_EEQUAL() + ENDCLASS diff --git a/harbour/contrib/xhb/xhberr.prg b/harbour/contrib/xhb/xhberr.prg index 9edcc91a20..61a37f84d3 100644 --- a/harbour/contrib/xhb/xhberr.prg +++ b/harbour/contrib/xhb/xhberr.prg @@ -189,7 +189,7 @@ STATIC FUNCTION xhb_DefError( oError ) ENDIF // Show alert box - //TraceLog( cMessage ) + // TraceLog( cMessage ) nChoice := 0 DO WHILE nChoice == 0 @@ -316,7 +316,7 @@ STATIC FUNCTION LogError( oerr ) cScreen := SaveScreen() ENDIF -// Alert( "An error occured, Information will be ;written to error.log" ) + // Alert( "An error occured, Information will be ;written to error.log" ) IF ! lAppendLog nHandle := FCreate( cLogFile, FC_NORMAL ) @@ -349,7 +349,7 @@ STATIC FUNCTION LogError( oerr ) FWriteLine( nHandle, "" ) FWriteLine( nHandle, "Application name...: " + hb_cmdargargv() ) FWriteLine( nHandle, "Workstation name...: " + NetName() ) - FWriteLine( nHandle, "Available memory...: " + strvalue( Memory(0 ) ) ) + FWriteLine( nHandle, "Available memory...: " + strvalue( Memory( 0 ) ) ) FWriteLine( nHandle, "Current disk.......: " + DiskName() ) FWriteLine( nHandle, "Current directory..: " + CurDir() ) FWriteLine( nHandle, "Free disk space....: " + strvalue( DiskSpace() ) ) @@ -364,7 +364,7 @@ STATIC FUNCTION LogError( oerr ) IF hb_IsFunction( "Select" ) FWriteLine( nHandle, "" ) - FWriteLine( nHandle, "Current Area ......:" + strvalue( &("Select()" ) ) ) + FWriteLine( nHandle, "Current Area ......:" + strvalue( &( "Select()" ) ) ) ENDIF FWriteLine( nHandle, "" ) @@ -546,9 +546,9 @@ STATIC FUNCTION LogError( oerr ) IF HB_ISSTRING( cScreen ) FWriteLine( nHandle, PadC( " Video Screen Dump ", nCols, "#" ) ) FWriteLine( nHandle, "" ) - //FWriteLine( nHandle, "" ) + // FWriteLine( nHandle, "" ) FWriteLine( nHandle, "+" + Replicate( "-", nCols + 1 ) + "+" ) - //FWriteLine( nHandle, "" ) + // FWriteLine( nHandle, "" ) nCellSize := Len( SaveScreen( 0, 0, 0, 0 ) ) nRange := ( nCols + 1 ) * nCellSize FOR nCount := 1 TO nRows + 1 @@ -665,7 +665,7 @@ STATIC FUNCTION strvalue( c, l ) STATIC PROCEDURE FWriteLine( nh, c ) FWrite( nh, c + hb_eol() ) -// HB_OutDebug( c + hb_eol() ) + // HB_OutDebug( c + hb_eol() ) RETURN @@ -689,7 +689,7 @@ FUNCTION __BreakBlock() RETURN {| e | Break( e ) } -FUNCTION __ErrorBlock( ) +FUNCTION __ErrorBlock() RETURN {| e | __MinimalErrorHandler( e ) } diff --git a/harbour/contrib/xhb/xhbfunp.prg b/harbour/contrib/xhb/xhbfunp.prg index eb7b217ee4..8043552ba6 100644 --- a/harbour/contrib/xhb/xhbfunp.prg +++ b/harbour/contrib/xhb/xhbfunp.prg @@ -57,4 +57,4 @@ FUNCTION gtGetClipboard() ; RETURN hb_gtInfo( HB_GTI_CLIPBOARDDATA FUNCTION gtGetClipBoardSize() ; RETURN Len( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) ) FUNCTION gtPasteClipBoard() ; RETURN hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) -FUNCTION INETDESTROY( x ) ; RETURN iif( HB_INETISSOCKET( x ), hb_INETCLOSE( x ), ) +FUNCTION INETDESTROY( x ) ; RETURN iif( hb_inetIsSocket( x ), hb_inetClose( x ), ) diff --git a/harbour/contrib/xhb/xhbmemo.prg b/harbour/contrib/xhb/xhbmemo.prg index b2fc47eb28..4d0892696a 100644 --- a/harbour/contrib/xhb/xhbmemo.prg +++ b/harbour/contrib/xhb/xhbmemo.prg @@ -83,27 +83,28 @@ METHOD MemoInit( xUDF ) CLASS XHB_TMemoEditor __defaultNIL( @xUDF, NIL ) - ::aEditKeys := { K_DOWN,; - K_UP,; - K_LEFT,; - K_RIGHT,; - K_CTRL_LEFT,; - K_CTRL_RIGHT,; - K_HOME,; - K_END,; - K_CTRL_HOME,; - K_CTRL_END,; - K_PGUP,; - K_PGDN,; - K_CTRL_PGUP,; - K_CTRL_PGDN,; - K_RETURN,; - K_ENTER,; - K_DEL,; - K_BS,; - K_CTRL_BS,; - K_TAB,; - K_SH_TAB } + ::aEditKeys := { ; + K_DOWN, ; + K_UP, ; + K_LEFT, ; + K_RIGHT, ; + K_CTRL_LEFT, ; + K_CTRL_RIGHT, ; + K_HOME, ; + K_END, ; + K_CTRL_HOME, ; + K_CTRL_END, ; + K_PGUP, ; + K_PGDN, ; + K_CTRL_PGUP, ; + K_CTRL_PGDN, ; + K_RETURN, ; + K_ENTER, ; + K_DEL, ; + K_BS, ; + K_CTRL_BS, ; + K_TAB, ; + K_SH_TAB } ::aAsciiKeys := Array( 255 - 31 ) // asc codes greater than space. AEval( ::aAsciiKeys, {| c, i | iif( Empty( c ), ::aAsciiKeys[ i ] := i + 31, ) } ) @@ -174,7 +175,7 @@ METHOD Edit() CLASS XHB_TMemoEditor nNextKey := 0 ENDIF - IF nNextKey == 0 .AND. ( ::bKeyBlock := Setkey( nKey ) ) != NIL + IF nNextKey == 0 .AND. ( ::bKeyBlock := SetKey( nKey ) ) != NIL Eval( ::bKeyBlock, ::ProcName, ::ProcLine, ReadVar() ) @@ -214,19 +215,19 @@ METHOD Edit() CLASS XHB_TMemoEditor IF ::bKeyBlock == NIL - IF ( AScan( ::aEditKeys, nKey ) > 0 .OR.; - AScan( ::aAsciiKeys, nKey ) > 0 .OR.; - AScan( ::aConfigurableKeys, nKey ) > 0 .OR.; - AScan( ::aExtKeys, nKey ) > 0 .OR.; - ( nKey == K_INS .AND. !::ExistUdf() ) .OR.; + IF ( AScan( ::aEditKeys, nKey ) > 0 .OR. ; + AScan( ::aAsciiKeys, nKey ) > 0 .OR. ; + AScan( ::aConfigurableKeys, nKey ) > 0 .OR. ; + AScan( ::aExtKeys, nKey ) > 0 .OR. ; + ( nKey == K_INS .AND. !::ExistUdf() ) .OR. ; ( nKey == K_ESC .AND. !::ExistUdf() ) ) ::Super:Edit( nKey ) - ELSEIF AScan( ::aConfigurableKeys, nKey ) == 0 .AND.; - AScan( ::aExtKeys, nKey ) == 0 .AND.; - ( nKey > 255 .OR. nKey < 0 ) .OR.; - ( nKey == K_INS .AND. ::lEditAllow .AND. ::ExistUdf() ) .OR.; + ELSEIF AScan( ::aConfigurableKeys, nKey ) == 0 .AND. ; + AScan( ::aExtKeys, nKey ) == 0 .AND. ; + ( nKey > 255 .OR. nKey < 0 ) .OR. ; + ( nKey == K_INS .AND. ::lEditAllow .AND. ::ExistUdf() ) .OR. ; ( nKey == K_ESC .AND. ::ExistUdf() ) ::KeyboardHook( nKey ) @@ -237,13 +238,13 @@ METHOD Edit() CLASS XHB_TMemoEditor IF ::ExistUdf() - IF AScan( ::aEditKeys, nKey ) > 0 .OR.; - AScan( ::aAsciiKeys, nKey ) > 0 .OR.; - AScan( ::aConfigurableKeys, nKey ) > 0 .OR.; - AScan( ::aExtKeys, nKey ) > 0 .OR.; + IF AScan( ::aEditKeys, nKey ) > 0 .OR. ; + AScan( ::aAsciiKeys, nKey ) > 0 .OR. ; + AScan( ::aConfigurableKeys, nKey ) > 0 .OR. ; + AScan( ::aExtKeys, nKey ) > 0 .OR. ; nKey == K_F1 - IF NextKey() == 0 .AND.; + IF NextKey() == 0 .AND. ; AScan( ::aConfigurableKeys, nKey ) == 0 .AND. nKey != K_F1 nUdfReturn := ::CallUdf( ME_IDLE ) @@ -293,6 +294,7 @@ METHOD HandleUdf( nKey, nUdfReturn, lEdited ) CLASS XHB_TMemoEditor A little trick to be able to handle a nUdfReturn with value of NIL like it had a value of ME_DEFAULT */ + __defaultNIL( @nUdfReturn, ME_DEFAULT ) __defaultNIL( @lEdited, .F. ) @@ -305,58 +307,58 @@ METHOD HandleUdf( nKey, nUdfReturn, lEdited ) CLASS XHB_TMemoEditor // HBEditor is not able to handle keys with a value higher than 256 or lower than 1 // - if !lEdited .AND.; - ( AScan( ::aAsciiKeys, nKey ) > 0 .OR.; - AScan( { K_ALT_W, K_CTRL_W }, nKey ) > 0 .OR.; - AScan( ::aExtKeys, nKey ) > 0 .OR.; - nKey == K_ESC .OR.; - nKey == K_INS .OR.; + IF !lEdited .AND. ; + ( AScan( ::aAsciiKeys, nKey ) > 0 .OR. ; + AScan( { K_ALT_W, K_CTRL_W }, nKey ) > 0 .OR. ; + AScan( ::aExtKeys, nKey ) > 0 .OR. ; + nKey == K_ESC .OR. ; + nKey == K_INS .OR. ; AScan( ::aMouseKeys, nKey ) > 0 ) ::Super:Edit( nKey ) - endif - exit + ENDIF + EXIT CASE ME_IGNORE // (32) // Ignore unknow key, only check insert state. ::DisplayInsert( ::lInsert() ) - exit + EXIT CASE ME_DATA // (33) - if !lEdited .AND.; - ( AScan( ::aAsciiKeys, nKey ) > 0 .OR.; - AScan( ::aExtKeys, nKey ) > 0 .OR.; - nKey == K_ESC .OR.; - nKey== K_INS ) + IF !lEdited .AND. ; + ( AScan( ::aAsciiKeys, nKey ) > 0 .OR. ; + AScan( ::aExtKeys, nKey ) > 0 .OR. ; + nKey == K_ESC .OR. ; + nKey == K_INS ) ::Super:Edit( nKey ) - endif - exit + ENDIF + EXIT CASE ME_TOGGLEWRAP // (34) ::lWordWrap := ! ::lWordWrap - exit + EXIT CASE ME_TOGGLESCROLL // (35) ::lVerticalScroll := ! ::lVerticalScroll - exit + EXIT CASE ME_WORDRIGHT // (100) ::WordRight() - exit + EXIT CASE ME_BOTTOMRIGHT // (101) ::Bottom() ::End() - exit + EXIT CASE ME_PASTE // (110) // see inkey.ch - exit + EXIT OTHERWISE // ME_UNKEY (1 TO 31) @@ -400,19 +402,20 @@ METHOD CallUdf( nMode ) CLASS XHB_TMemoEditor RETURN xResult // Prg Level Call of MemoEdit() -//-------------------------------------------------------------------// +// -------------------------------------------------------------------// -FUNCTION xhb_MemoEdit( cString,; - nTop, nLeft,; - nBottom, nRight,; - lEditMode,; - xUDF,; - nLineLength,; - nTabSize,; - nTextBuffRow,; - nTextBuffColumn,; - nWindowRow,; - nWindowColumn ) +FUNCTION xhb_MemoEdit( ; + cString, ; + nTop, nLeft, ; + nBottom, nRight, ; + lEditMode, ; + xUDF, ; + nLineLength, ; + nTabSize, ; + nTextBuffRow, ; + nTextBuffColumn, ; + nWindowRow, ; + nWindowColumn ) LOCAL oEd @@ -434,50 +437,50 @@ FUNCTION xhb_MemoEdit( cString,; // 2006/JUL/22 - E.F. Check argument types. // - IF !HB_ISNIL( cString ) .AND. ! HB_ISSTRING( cString ) .AND. ! HB_IsMemo( cString ) - Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", Procname() ) ) + IF !HB_ISNIL( cString ) .AND. ! HB_ISSTRING( cString ) .AND. ! HB_ISMEMO( cString ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", ProcName() ) ) ENDIF IF !HB_ISNIL( nTop ) .AND. !HB_ISNUMERIC( nTop ) - Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", Procname() ) ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", ProcName() ) ) ENDIF IF !HB_ISNIL( nLeft ) .AND. !HB_ISNUMERIC( nLeft ) - Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", Procname() ) ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", ProcName() ) ) ENDIF IF !HB_ISNIL( nRight ) .AND. !HB_ISNUMERIC( nRight ) - Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", Procname() ) ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", ProcName() ) ) ENDIF IF !HB_ISNIL( nBottom ) .AND. !HB_ISNUMERIC( nBottom ) - Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", Procname() ) ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", ProcName() ) ) ENDIF IF !HB_ISNIL( lEditMode ) .AND. !HB_ISLOGICAL( lEditMode ) - Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", Procname() ) ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", ProcName() ) ) ENDIF IF !HB_ISNIL( xUDF ) .AND. ( !HB_ISSTRING( xUDF ) .AND. !HB_ISLOGICAL( xUDF ) ) - Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", Procname() ) ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", ProcName() ) ) ENDIF IF !HB_ISNIL( nLineLength ) .AND. !HB_ISNUMERIC( nLineLength ) - Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", Procname() ) ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", ProcName() ) ) ENDIF IF !HB_ISNIL( nTabSize ) .AND. !HB_ISNUMERIC( nTabSize ) - Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", Procname() ) ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", ProcName() ) ) ENDIF IF !HB_ISNIL( nTextBuffRow ) .AND. !HB_ISNUMERIC( nTextBuffRow ) - Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", Procname() ) ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", ProcName() ) ) ENDIF IF !HB_ISNIL( nTextBuffColumn ) .AND. !HB_ISNUMERIC( nTextBuffColumn ) - Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", Procname() ) ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", ProcName() ) ) ENDIF IF !HB_ISNIL( nWindowRow ) .AND. !HB_ISNUMERIC( nWindowRow ) - Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", Procname() ) ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", ProcName() ) ) ENDIF IF !HB_ISNIL( nWindowColumn ) .AND. !HB_ISNUMERIC( nWindowColumn ) - Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", Procname() ) ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument type error", ProcName() ) ) ENDIF // 2006/JUL/22 - E.F. To avoid run time error. IF nTop > nBottom .OR. nLeft > nRight - Throw( ErrorNew( "BASE", 0, 1127, " Argument error", Procname() ) ) + Throw( ErrorNew( "BASE", 0, 1127, " Argument error", ProcName() ) ) ENDIF IF HB_ISSTRING( xUDF ) .AND. Empty( xUDF ) @@ -487,15 +490,15 @@ FUNCTION xhb_MemoEdit( cString,; /* 24/10/2005 - Clipper MemoEdit() converts Tabs into spaces */ - oEd := XHB_TMemoEditor():New( StrTran( cString, Chr( 9 ), Space( nTabSize ) ),; - nTop, nLeft, nBottom, nRight,; - lEditMode,; - nLineLength,; - nTabSize,; - nTextBuffRow,; - nTextBuffColumn,; - nWindowRow,; - nWindowColumn ) + oEd := XHB_TMemoEditor():New( StrTran( cString, Chr( 9 ), Space( nTabSize ) ), ; + nTop, nLeft, nBottom, nRight, ; + lEditMode, ; + nLineLength, ; + nTabSize, ; + nTextBuffRow, ; + nTextBuffColumn, ; + nWindowRow, ; + nWindowColumn ) oEd:ProcName := ProcName( 1 ) oEd:ProcLine := ProcLine( 1 ) diff --git a/harbour/contrib/xhb/xhbmt.prg b/harbour/contrib/xhb/xhbmt.prg index caedb52329..c76b2a69fb 100644 --- a/harbour/contrib/xhb/xhbmt.prg +++ b/harbour/contrib/xhb/xhbmt.prg @@ -52,70 +52,73 @@ /* real functions used as wrappers in above translations */ -function StartThread( p1, p2, ... ) - if PCount() < 2 - return hb_threadStart( p1 ) - elseif HB_ISOBJECT( p1 ) .and. HB_ISSTRING( p2 ) - return hb_threadStart( {|...| p1:&p2( ... ) }, ... ) - endif - return hb_threadStart( p1, p2, ... ) +FUNCTION StartThread( p1, p2, ... ) + IF PCount() < 2 + RETURN hb_threadStart( p1 ) + ELSEIF HB_ISOBJECT( p1 ) .AND. HB_ISSTRING( p2 ) + RETURN hb_threadStart( {| ...| p1:&p2( ... ) }, ... ) + ENDIF + + RETURN hb_threadStart( p1, p2, ... ) + +FUNCTION Subscribe( mtx, nTimeOut, lSubscribed ) + + LOCAL xSubscribed -function Subscribe( mtx, nTimeOut, lSubscribed ) - local xSubscribed lSubscribed := hb_mutexSubscribe( mtx, ; - iif( HB_ISNUMERIC( nTimeOut ), nTimeOut / 1000, ), ; - @xSubscribed ) - return xSubscribed + iif( HB_ISNUMERIC( nTimeOut ), nTimeOut / 1000, ), ; + @xSubscribed ) + RETURN xSubscribed + +FUNCTION SubscribeNow( mtx, nTimeOut, lSubscribed ) + + LOCAL xSubscribed -function SubscribeNow( mtx, nTimeOut, lSubscribed ) - local xSubscribed lSubscribed := hb_mutexSubscribeNow( mtx, ; - iif( HB_ISNUMERIC( nTimeOut ), nTimeOut / 1000, ), ; - @xSubscribed ) - return xSubscribed + iif( HB_ISNUMERIC( nTimeOut ), nTimeOut / 1000, ), ; + @xSubscribed ) + RETURN xSubscribed -function IsSameThread( pThID1, pThID2 ) - return hb_threadId( pThID1 ) == iif( pcount() < 2, hb_threadId(), ; - hb_threadId( pThID2 ) ) +FUNCTION IsSameThread( pThID1, pThID2 ) + RETURN hb_threadID( pThID1 ) == iif( PCount() < 2, hb_threadID(), ; + hb_threadID( pThID2 ) ) +FUNCTION IsValidThread( pThID ) -function IsValidThread( pThID ) - local lValid + LOCAL lValid - begin sequence with {|| break() } - lValid := hb_threadId( pThID ) != 0 + BEGIN SEQUENCE WITH {|| Break() } + lValid := hb_threadID( pThID ) != 0 recover lValid := .F. - end sequence + END SEQUENCE - return lValid + RETURN lValid +FUNCTION KillThread( pThID ) -function KillThread( pThID ) hb_threadQuitRequest( pThID ) - return NIL + RETURN NIL + +FUNCTION StopThread( pThID ) -function StopThread( pThID ) hb_threadQuitRequest( pThID ) hb_threadJoin( pThID ) - return NIL + RETURN NIL -function ThreadSleep( nTimeOut ) - return hb_idleSleep( nTimeOut / 1000 ) +FUNCTION ThreadSleep( nTimeOut ) + RETURN hb_idleSleep( nTimeOut / 1000 ) +FUNCTION hb_MutexTryLock( mtx ) + RETURN hb_mutexLock( mtx, 0 ) -function hb_MutexTryLock( mtx ) - return hb_mutexLock( mtx, 0 ) +FUNCTION hb_MutexTimeOutLock( mtx, nTimeOut ) + RETURN hb_mutexLock( mtx, iif( HB_ISNUMERIC( nTimeOut ), nTimeOut / 1000, 0 ) ) - -function hb_MutexTimeOutLock( mtx, nTimeOut ) - return hb_mutexLock( mtx, iif( HB_ISNUMERIC( nTimeOut ), nTimeOut / 1000, 0 ) ) - - -function GetSystemThreadId( pThID ) - return iif( PCount() < 1, hb_threadId(), hb_threadId( pThID ) ) +FUNCTION GetSystemThreadId( pThID ) + RETURN iif( PCount() < 1, hb_threadID(), hb_threadID( pThID ) ) diff --git a/harbour/contrib/xhb/xhbole.prg b/harbour/contrib/xhb/xhbole.prg index 7c2ee9f893..76372200a4 100644 --- a/harbour/contrib/xhb/xhbole.prg +++ b/harbour/contrib/xhb/xhbole.prg @@ -80,17 +80,19 @@ FUNCTION CreateOLEObject() STATIC s_bBreak := {| oError | Break( oError ) } STATIC FUNCTION s_oleOpError( cOperator, ... ) - STATIC sc_hErrCode := { "==" => 1070, ; - "=" => 1071, ; - "!=" => 1072, ; - "+" => 1081, ; - "-" => 1082, ; - "*" => 1083, ; - "/" => 1084, ; - "%" => 1085, ; - "++" => 1086, ; - "--" => 1087, ; - "^" => 1088 } + + STATIC sc_hErrCode := { ; + "==" => 1070, ; + "=" => 1071, ; + "!=" => 1072, ; + "+" => 1081, ; + "-" => 1082, ; + "*" => 1083, ; + "/" => 1084, ; + "%" => 1085, ; + "++" => 1086, ; + "--" => 1087, ; + "^" => 1088 } LOCAL oErr oErr := ErrorNew() @@ -108,6 +110,7 @@ STATIC FUNCTION s_oleOpError( cOperator, ... ) RETURN oErr STATIC FUNCTION s_oleError( nGenCode, cDescript ) + LOCAL oErr oErr := ErrorNew() @@ -131,6 +134,7 @@ STATIC FUNCTION s_oleError( nGenCode, cDescript ) CREATE CLASS TOLEAUTO FROM WIN_OLEAUTO + VAR cClassName METHOD hObj( xOle ) SETGET @@ -160,9 +164,11 @@ CREATE CLASS TOLEAUTO FROM WIN_OLEAUTO METHOD OleValuePower( xArg ) OPERATOR "^" METHOD OleValueInc() OPERATOR "++" METHOD OleValueDec() OPERATOR "--" + ENDCLASS METHOD hObj( xOle ) CLASS TOLEAUTO + IF xOle != NIL IF HB_ISNUMERIC( xOle ) xOle := __OLEPDISP( xOle ) @@ -171,10 +177,13 @@ METHOD hObj( xOle ) CLASS TOLEAUTO ::__hObj := xOle ENDIF ENDIF + RETURN ::__hObj METHOD New( xOle, cClass, cLicense ) CLASS TOLEAUTO + LOCAL hOle + IF HB_ISSTRING( xOle ) hOle := __OleCreateObject( xOle,, cLicense ) IF ! Empty( hOle ) @@ -193,9 +202,11 @@ METHOD New( xOle, cClass, cLicense ) CLASS TOLEAUTO ::cClassName := hb_ntos( win_P2N( ::__hObj ) ) ENDIF ENDIF + RETURN Self METHOD GetActiveObject( cClass ) CLASS TOLEAUTO + IF HB_ISSTRING( cClass ) IF ! Empty( ::__hObj := __OleGetActiveObject( cClass ) ) ::cClassName := cClass @@ -204,9 +215,10 @@ METHOD GetActiveObject( cClass ) CLASS TOLEAUTO ENDIF ELSE WAPI_MessageBox( , "Invalid parameter type to constructor TOleAuto():GetActiveObject()!", ; - "OLE Interface", ) + "OLE Interface", ) ::__hObj := NIL ENDIF + RETURN Self METHOD OleValue() CLASS TOLEAUTO diff --git a/harbour/contrib/xhb/xhbtedit.prg b/harbour/contrib/xhb/xhbtedit.prg index 19e14e5ade..59e5d0575d 100644 --- a/harbour/contrib/xhb/xhbtedit.prg +++ b/harbour/contrib/xhb/xhbtedit.prg @@ -243,7 +243,7 @@ CREATE CLASS XHBEditor METHOD DelWordRight() // Delete word right key METHOD ReformParagraph() // Reformat paragraph. behaviour - ///////////////// + // --------------- PROTECTED: @@ -288,10 +288,10 @@ METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabS // 2006/JUL/21 - E.F. To avoid out of boundaries. // Editor window boundaries - ::nTop := Min( Max( 0,nTop ), MaxRow() ) - ::nLeft := Min( Max( 0,nLeft ), MaxCol() ) - ::nBottom := Max( 0, Min( MaxRow(),nBottom ) ) - ::nRight := Max( 0, Min( MaxCol(),nRight ) ) + ::nTop := Min( Max( 0, nTop ), MaxRow() ) + ::nLeft := Min( Max( 0, nLeft ), MaxCol() ) + ::nBottom := Max( 0, Min( MaxRow(), nBottom ) ) + ::nRight := Max( 0, Min( MaxCol(), nRight ) ) // How many cols and rows are available @@ -346,12 +346,12 @@ METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabS // 2006/JUL/20 - E.F. - We should not replace SoftCR with Chr( 32 ). // See Text2Array function for more details. -// IF hb_BChar( 141 ) $ cString -// acsn := Chr( 32 ) + Chr( 141 ) + Chr( 10 ) -// cString := StrTran( cString, acsn, " " ) -// acsn := Chr( 141 ) + Chr( 10 ) -// cString := StrTran( cString, acsn, " " ) -// ENDIF + // IF hb_BChar( 141 ) $ cString + // acsn := Chr( 32 ) + Chr( 141 ) + Chr( 10 ) + // cString := StrTran( cString, acsn, " " ) + // acsn := Chr( 141 ) + Chr( 10 ) + // cString := StrTran( cString, acsn, " " ) + // ENDIF // Load text to internal array. @@ -382,7 +382,7 @@ METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabS // Set cursor position; also initializes phisical to virtual mapping - //::SetPos( ::nTop + ::nRow - ::nFirstRow, ::nLeft + ::nCol - ::nFirstCol ) + // ::SetPos( ::nTop + ::nRow - ::nFirstRow, ::nLeft + ::nCol - ::nFirstCol ) ::SetPos( ::nTop + ::nWndRow, ::nLeft + ::nWndCol ) ::RefreshWindow() @@ -454,15 +454,15 @@ METHOD RefreshWindow() CLASS XHBEditor // CLEAR THE WHOLE WINDOW!!! previous version wished to spare some output, but // C is faster than a VM loop!! // - //ScrollFixed( ::nTop, ::nLeft, ::nBottom, ::nRight ) + // ScrollFixed( ::nTop, ::nLeft, ::nBottom, ::nRight ) FOR i := 0 TO Min( ::nNumRows - 1, ::LastRow() - 1 ) // 2006/JUL/23 - E.F. Adjusted to avoid out of bound. // Don't replace ::GetLine( nRow ) by ::aText[ nRow ]:cText here, // because getline return line number in tbrwtext.prg (debug). - hb_DispOutAt( Min( ::nTop + i,::nBottom ), ::nLeft, ; - PadR( iif( ::nFirstRow + i <= ::LastRow(), SubStr( ::GetLine( ::nFirstRow + i ), ::nFirstCol, ::nNumCols ), Space(::nNumCols ) ), ::nNumCols ), ; + hb_DispOutAt( Min( ::nTop + i, ::nBottom ), ::nLeft, ; + PadR( iif( ::nFirstRow + i <= ::LastRow(), SubStr( ::GetLine( ::nFirstRow + i ), ::nFirstCol, ::nNumCols ), Space( ::nNumCols ) ), ::nNumCols ), ; ::LineColor( ::nFirstRow + i ) ) NEXT @@ -543,7 +543,7 @@ METHOD RefreshLine( lRefreshColSel ) CLASS XHBEditor // nCol := nFirstCol + ::nColSelStart - 1 nCol := Max( ::nLeft, nFirstCol + ::nColSelStart - 1 ) - hb_DispOutAt( ::Row(), nCol, SubStr( ::GetLine( ::nRow ), Max(1,::nColSelStart ), (::nColSelEnd - ::nColSelStart + 1 ) ), ::ColColor() ) + hb_DispOutAt( ::Row(), nCol, SubStr( ::GetLine( ::nRow ), Max( 1, ::nColSelStart ), ( ::nColSelEnd - ::nColSelStart + 1 ) ), ::ColColor() ) ENDIF @@ -576,7 +576,7 @@ METHOD RefreshColumn() CLASS XHBEditor // Don't replace ::GetLine( nRow ) by ::aText[ nRow ]:cText here // because getline return line number in tbrwtext.prg (debug). FOR i := 0 TO Min( ::nNumRows - 1, ::LastRow() - 1 ) - hb_DispOutAt( ::nTop + i, nOCol, SubStr( ::GetLine(::nFirstRow + i ), ::nCol, 1 ), ::LineColor( ::nFirstRow + i ) ) + hb_DispOutAt( ::nTop + i, nOCol, SubStr( ::GetLine( ::nFirstRow + i ), ::nCol, 1 ), ::LineColor( ::nFirstRow + i ) ) NEXT DispEnd() @@ -733,7 +733,7 @@ METHOD Edit( nPassedKey ) CLASS XHBEditor CASE K_CTRL_C // Copy hb_gtInfo( HB_GTI_CLIPBOARDDATA, ::GetTextSelection() ) - //::ClrTextSelection() + // ::ClrTextSelection() EXIT CASE K_CTRL_X // Cut @@ -823,7 +823,7 @@ METHOD Edit( nPassedKey ) CLASS XHBEditor CASE K_DOWN IF hb_bitAnd( hb_gtInfo( HB_GTI_KBDSHIFTS ), HB_GTI_KBD_SHIFT ) != 0 IF ::nRow <= ::LastRow() - ::SetTextSelection( "ROW", +1 ) + ::SetTextSelection( "ROW", + 1 ) ENDIF ELSE ::ClrTextSelection() @@ -865,7 +865,7 @@ METHOD Edit( nPassedKey ) CLASS XHBEditor CASE K_RIGHT IF hb_bitAnd( hb_gtInfo( HB_GTI_KBDSHIFTS ), HB_GTI_KBD_SHIFT ) != 0 IF ::nCol < ::nWordWrapCol + 1 - ::SetTextSelection( "COL", +1 ) + ::SetTextSelection( "COL", + 1 ) ENDIF ELSE ::ClrTextSelection() @@ -1044,7 +1044,7 @@ METHOD PageDown() CLASS XHBEditor IF ::lVerticalScroll - IF nJump > ( ::LastRow() - ::nRow ) //nJump < ::nNumRows + IF nJump > ( ::LastRow() - ::nRow ) // nJump < ::nNumRows ::Bottom() ELSE ::nFirstRow += nJump @@ -1094,7 +1094,7 @@ METHOD Up() CLASS XHBEditor IF ::lVerticalScroll IF ::nRow > 1 ::GotoLine( ::nRow - 1 ) - //::GotoPos( ::nRow - 1, ::nCol ) + // ::GotoPos( ::nRow - 1, ::nCol ) ENDIF ELSE IF ::nFirstRow > 1 @@ -1184,7 +1184,7 @@ METHOD Right() CLASS XHBEditor ENDIF ELSE IF ::nCol < Max( ::nNumCols, ::nWordWrapCol + 1 ) - //::GotoCol( ::nCol + 1 ) + // ::GotoCol( ::nCol + 1 ) ::GotoPos( ::nRow, ::nCol + 1, .T. ) ENDIF ENDIF @@ -1234,7 +1234,7 @@ METHOD WordRight() CLASS XHBEditor DO while ::nCol > 1 .AND. !Empty( ::GetCol( ::nRow, ::nCol ) ) ::Left() ENDDO - DO while ::nCol < nMaxCol .AND. Empty( ::GetCol( ::nRow,::nCol ) ) + DO while ::nCol < nMaxCol .AND. Empty( ::GetCol( ::nRow, ::nCol ) ) ::Right() ENDDO ENDIF @@ -1280,7 +1280,7 @@ METHOD End() CLASS XHBEditor // 2006/07/19 - E.F. Changed to avoid the cursor out of line. // - ::GotoCol( Min( ::LineLen( ::nRow ) + 1, Max(::nNumCols,::nWordWrapCol + 1 ) ) ) + ::GotoCol( Min( ::LineLen( ::nRow ) + 1, Max( ::nNumCols, ::nWordWrapCol + 1 ) ) ) RETURN Self @@ -1296,7 +1296,7 @@ METHOD Left() CLASS XHBEditor // ::GotoPos( ::nRow - 1, Max( ::nNumCols, ::nWordWrapCol + 1 ), .T. ) ENDIF - //else do nothing + // else do nothing ENDIF ELSE ::GotoCol( ::nCol - 1 ) @@ -1321,7 +1321,7 @@ METHOD WordLeft() CLASS XHBEditor IF ::lWordWrap .AND. ::nCol == 1 .AND. ::nRow > 1 ::Up() ::End() - DO while ::nCol == 1 .AND. ::nRow > 1 .AND. Empty( ::GetCol( ::nRow,::nCol ) ) + DO while ::nCol == 1 .AND. ::nRow > 1 .AND. Empty( ::GetCol( ::nRow, ::nCol ) ) ::Up() IF !::IsEmptyLine( ::nRow ) ::End() @@ -1348,10 +1348,10 @@ METHOD WordLeft() CLASS XHBEditor // go to the next word. IF !::lWordWrap .AND. ; ::nCol < ::LineLen( ::nRow ) .AND. ; - Empty( ::GetCol( ::nRow,::nCol ) ) + Empty( ::GetCol( ::nRow, ::nCol ) ) ::WordRight() ELSEIF ::lWordWrap .AND. ::nCol == 1 .AND. ::nRow == 1 .AND. ; - Empty( ::GetCol( ::nRow,::nCol ) ) + Empty( ::GetCol( ::nRow, ::nCol ) ) ::WordRight() ELSEIF ::lWordWrap .AND. ::nCol == 1 .AND. ::nRow > 1 DO While ::nCol == 1 .AND. ::nRow > 1 .AND. Empty( ::GetCol( ::nRow, ::nCol ) ) @@ -1550,12 +1550,12 @@ METHOD K_Del() CLASS XHBEditor RETURN Self ENDIF - IF ::nCol > ::LineLen( ::nRow ) //.and. ::nRow < ::LastRow() + IF ::nCol > ::LineLen( ::nRow ) // .and. ::nRow < ::LastRow() // eventually pad. // - //IF ::nCol > ::LineLen( ::nRow ) + 1 + // IF ::nCol > ::LineLen( ::nRow ) + 1 // ::aText[ ::nRow ]:cText := Padr( ::aText[ ::nRow ]:cText, ::nCol - 1 ) - //ENDIF + // ENDIF lMerge := .T. ELSEIF ::nCol <= ::LineLen( ::nRow ) @@ -1628,7 +1628,7 @@ METHOD K_Tab() CLASS XHBEditor ENDIF ::lChanged := .T. - ::lRightScroll := .F. //prevent auto linewrap + ::lRightScroll := .F. // prevent auto linewrap FOR i := 1 to ::nTabWidth IF ::nCol < ::nWordWrapCol - ::nTabWidth - ::nTabWidth ::Right() @@ -1643,7 +1643,7 @@ METHOD K_Tab() CLASS XHBEditor lHardCR := .F. // should already by .F., but just to be safe, and it is a tiny line of code... IF ::aText[ ::nRow ]:lSoftCR - IF !::aText[ ::nRow+1 ]:lSoftCR // the next line has a hard return, keep it + IF !::aText[ ::nRow + 1 ]:lSoftCR // the next line has a hard return, keep it lHardCR := .T. ENDIF @@ -1674,26 +1674,26 @@ METHOD K_Return() CLASS XHBEditor IF ::lEditAllow // 2006/JUL/24 - E.F. - Fixed at insert mode. - #if 0 +#if 0 IF ::lInsert IF ::nRow == ::LastRow() IF ::nCol > ::LineLen( ::nRow ) ::AddLine( "", .F. ) - else - ::InsertLine( Substr( ::aText[ ::nRow ]:cText, ::nCol ), .F., ::nRow + 1 ) + ELSE + ::InsertLine( SubStr( ::aText[ ::nRow ]:cText, ::nCol ), .F., ::nRow + 1 ) ENDIF ELSEIF ::aText[ ::nRow ]:lSoftCR - ::aText[ ::nRow + 1 ]:cText := Substr( ::aText[ ::nRow ]:cText, ::nCol ) + " " + ::aText[ ::nRow + 1 ]:cText + ::aText[ ::nRow + 1 ]:cText := SubStr( ::aText[ ::nRow ]:cText, ::nCol ) + " " + ::aText[ ::nRow + 1 ]:cText ::SplitLine( ::nRow + 1 ) ELSE - ::InsertLine( Substr( ::aText[ ::nRow ]:cText, ::nCol ), .F., ::nRow + 1 ) + ::InsertLine( SubStr( ::aText[ ::nRow ]:cText, ::nCol ), .F., ::nRow + 1 ) ENDIF ::aText[ ::nRow ]:cText := Left( ::aText[ ::nRow ]:cText, ::nCol - 1 ) ELSEIF ::nRow == ::LastRow() ::AddLine( "", .F. ) ENDIF - #endif +#endif IF ::lInsert @@ -1973,7 +1973,7 @@ METHOD GotoCol( nCol ) CLASS XHBEditor // line, with or without chars. // Note: ::nWordWrapCol can be different than ::nNumCols if user has // informed nLineLength > 0. - nCol := Max( 1, Min( nCol, Max(::nNumCols,::nWordWrapCol + 1 ) ) ) + nCol := Max( 1, Min( nCol, Max( ::nNumCols, ::nWordWrapCol + 1 ) ) ) // I need to move cursor if is past requested line number and if requested line is // inside first screen of text otherwise ::nFirstRow would be wrong @@ -2081,7 +2081,7 @@ STATIC FUNCTION GetParagraph( oSelf, nRow ) IF oSelf:LastRow() <= 0 // V@ EXIT ENDIF - //GAD This is not needed and will corrupt long lines that do not have any spaces with wordwrap on. + // GAD This is not needed and will corrupt long lines that do not have any spaces with wordwrap on. /* IF Len( cLine ) > 0 .and. !( Right( cLine, 1 ) == " " ) cLine += " " ENDIF @@ -2151,7 +2151,7 @@ METHOD SplitLine( nRow ) CLASS XHBEditor // Split line at fist space before current position // - DO WHILE nFirstSpace > 1 .AND. !( cLine[nFirstSpace] == " " ) + DO WHILE nFirstSpace > 1 .AND. !( cLine[ nFirstSpace ] == " " ) nFirstSpace-- ENDDO @@ -2170,8 +2170,8 @@ METHOD SplitLine( nRow ) CLASS XHBEditor // 2006/07/19 - E.F. - Changed cut point at witdh of line to maintain. // amount of chars same as Clipper. // - //cSplittedLine := Left( cLine, ::nWordWrapCol ) - cSplittedLine := Left( cLine, Min( ::nWordWrapCol + 1,::nNumCols ) ) + // cSplittedLine := Left( cLine, ::nWordWrapCol ) + cSplittedLine := Left( cLine, Min( ::nWordWrapCol + 1, ::nNumCols ) ) ENDIF @@ -2179,7 +2179,7 @@ METHOD SplitLine( nRow ) CLASS XHBEditor // then we are unable to keep trace of where the line break was while // reformatting // - //GAD + // GAD IF !( Right( cSplittedLine, 1 ) == " " ) .AND. nFirstSpace > 1 // 2006/JUL/21 - E.F. - Added condition to not stay out of max columns. IF Len( cSplittedLine ) < ::nNumCols @@ -2219,7 +2219,7 @@ METHOD SplitLine( nRow ) CLASS XHBEditor // next line? IF nCurSpace == 0 nRow++ - //fake border new. + // fake border new. ::nFirstCol := 1 ::GotoPos( nRow, nPosInWord, .T. ) ELSEIF nCurSpace == ::nCol @@ -2563,7 +2563,7 @@ METHOD SetTextSelection( cAction, nCount ) CLASS XHBEditor ::nColSelStart := ::nColSelEnd := 0 IF ::nRowSelEnd == ::LastRow() - //::nRowSelEnd := ::LastRow()-1 + // ::nRowSelEnd := ::LastRow()-1 /* 2006/SEP/17 - E.F. - At this point we need add a new line to be able to select the last row. */ @@ -2714,7 +2714,7 @@ METHOD DelText() CLASS XHBEditor ENDIF // 2006/SEP/17 - E.F. - changed to ::top() to avoid cursor out of bound. - //::Gotop() + // ::Gotop() ::Top() ::aText := {} @@ -2983,7 +2983,7 @@ STATIC FUNCTION Text2Array( cString, nWordWrapCol ) // hb_tokenPtr() needs that string to be tokenized be terminated with a token delimiter IF ! Right( cString, Len( cEOL ) ) == cEOL cString += cEOL - //GAD so we don't add a blank line by accident at the end of this. + // GAD so we don't add a blank line by accident at the end of this. lTokenized := .T. ENDIF @@ -3019,7 +3019,7 @@ STATIC FUNCTION Text2Array( cString, nWordWrapCol ) ELSE cSplittedLine := Left( cLine, nWordWrapCol ) // 2006/07/19 - E.F. Changed cut point of second split. - //cLine := SubStr( cLine, nWordWrapCol + 1 ) + // cLine := SubStr( cLine, nWordWrapCol + 1 ) cLine := SubStr( cLine, Len( cSplittedLine ) + 1 ) ENDIF AAdd( aArray, HBTextLine():New( cSplittedLine, .T. ) ) @@ -3040,7 +3040,7 @@ STATIC FUNCTION Text2Array( cString, nWordWrapCol ) ENDIF ENDDO - //If string ends with EOL delimeters we have to add it here. + // If string ends with EOL delimeters we have to add it here. IF !lTokenized .AND. Right( cString, nEOLLen ) == cEOL AAdd( aArray, HBTextLine():New( , .F. ) ) ENDIF diff --git a/harbour/contrib/xhb/xhbver.prg b/harbour/contrib/xhb/xhbver.prg index 1d4ebaf5d0..0e8f960df2 100644 --- a/harbour/contrib/xhb/xhbver.prg +++ b/harbour/contrib/xhb/xhbver.prg @@ -55,6 +55,7 @@ #include "xhbver.ch" FUNCTION hb_buildinfo( n ) + LOCAL v := Array( _HB_VER_LAST - 1 ) v[ _HB_VER_MAJOR ] := hb_Version( HB_VERSION_MAJOR ) @@ -108,7 +109,7 @@ FUNCTION hb_buildinfo( n ) v[ _HB_SYMBOL_NAME_LEN ] := 63 /* Constant in Harbour */ v[ _HB_MULTITHREAD ] := hb_mtvm() v[ _HB_VM_OPTIMIZATION ] := 2 /* Emulate xhb */ - v[ _HB_LANG_ID ] := hb_LangSelect() + v[ _HB_LANG_ID ] := hb_langSelect() v[ _HB_ARRAY_MODE ] := 0 /* Emulate xhb */ v[ _HB_CREDITS ] := { "See 'harbour -credits'" } diff --git a/harbour/contrib/xhb/xhw32prn.prg b/harbour/contrib/xhb/xhw32prn.prg index c188a4cbcf..ad9407aa13 100644 --- a/harbour/contrib/xhb/xhw32prn.prg +++ b/harbour/contrib/xhb/xhw32prn.prg @@ -56,10 +56,10 @@ #ifndef __PLATFORM__WINDOWS FUNCTION WIN32PRN() -RETURN NIL + RETURN NIL FUNCTION WIN32BMP() -RETURN NIL + RETURN NIL #else @@ -77,28 +77,32 @@ CREATE CLASS WIN32PRN FROM WIN_PRN METHOD TextOut( cString, lNewLine, lUpdatePosX, nAlignHori, nAlignVert ) METHOD TextOutAt( nPosX, nPosY, cString, lNewLine, lUpdatePosX, nAlignHori, nAlignVert ) METHOD TextAtFont( nPosX, nPosY, cString, cFont, nPointSize, ; - nWidth, nBold, lUnderLine, lItalic, lNewLine, ; - lUpdatePosX, nColor, nAlignHori, nAlignVert ) + nWidth, nBold, lUnderLine, lItalic, lNewLine, ; + lUpdatePosX, nColor, nAlignHori, nAlignVert ) VAR SetTextHori INIT TA_LEFT // Default horizontal alignment SetTextAlign() (TEXTOUT) VAR SetTextVert INIT TA_BOTTOM // Default vertical alignment for SetTextAlign() (TEXTOUT) /* not implemented */ -// METHOD TextOutW( wString, lNewLine, lUpdatePosX, nAlignHori, nAlignVert ) -// METHOD TextOutWAt( nPosX, nPosY, wString, lNewLine, lUpdatePosX, nAlignHori, nAlignVert ) +// METHOD TextOutW( wString, lNewLine, lUpdatePosX, nAlignHori, nAlignVert ) +// METHOD TextOutWAt( nPosX, nPosY, wString, lNewLine, lUpdatePosX, nAlignHori, nAlignVert ) ENDCLASS METHOD Create() CLASS WIN32PRN + IF ::PaperLength > 0 .AND. ::PaperWidth > 0 ::FormType := FORM_CUSTOM ENDIF + RETURN ::WIN_PRN:Create() METHOD StartPage() CLASS WIN32PRN + IF ::PaperLength > 0 .AND. ::PaperWidth > 0 ::FormType := FORM_CUSTOM ENDIF + RETURN ::WIN_PRN:StartPage() METHOD TextOut( cString, lNewLine, lUpdatePosX, nAlignHori, nAlignVert ) CLASS WIN32PRN @@ -107,7 +111,7 @@ METHOD TextOut( cString, lNewLine, lUpdatePosX, nAlignHori, nAlignVert ) CLASS W __defaultNIL( @nAlignVert, ::SetTextVert ) RETURN ::WIN_PRN:TextOut( cString, lNewLine, lUpdatePosX, ; - HB_BITOR( nAlignHori, nAlignVert ) ) + hb_bitOr( nAlignHori, nAlignVert ) ) METHOD TextOutAt( nPosX, nPosY, cString, lNewLine, lUpdatePosX, nAlignHori, nAlignVert ) CLASS WIN32PRN @@ -115,19 +119,19 @@ METHOD TextOutAt( nPosX, nPosY, cString, lNewLine, lUpdatePosX, nAlignHori, nAli __defaultNIL( @nAlignVert, ::SetTextVert ) RETURN ::WIN_PRN:TextOutAt( nPosX, nPosY, cString, lNewLine, lUpdatePosX, ; - HB_BITOR( nAlignHori, nAlignVert ) ) + hb_bitOr( nAlignHori, nAlignVert ) ) METHOD TextAtFont( nPosX, nPosY, cString, cFont, nPointSize, ; - nWidth, nBold, lUnderLine, lItalic, lNewLine, ; - lUpdatePosX, nColor, nAlignHori, nAlignVert ) CLASS WIN32PRN + nWidth, nBold, lUnderLine, lItalic, lNewLine, ; + lUpdatePosX, nColor, nAlignHori, nAlignVert ) CLASS WIN32PRN __defaultNIL( @nAlignHori, ::SetTextHori ) __defaultNIL( @nAlignVert, ::SetTextVert ) RETURN ::WIN_PRN:TextAtFont( nPosX, nPosY, cString, cFont, nPointSize, ; - nWidth, nBold, lUnderLine, lItalic, lNewLine, ; - lUpdatePosX, nColor, ; - HB_BITOR( nAlignHori, nAlignVert ) ) + nWidth, nBold, lUnderLine, lItalic, lNewLine, ; + lUpdatePosX, nColor, ; + hb_bitOr( nAlignHori, nAlignVert ) ) CREATE CLASS Win32Bmp FROM WIN_BMP ENDCLASS diff --git a/harbour/doc/en/browse.txt b/harbour/doc/en/browse.txt index 65224b1818..fb79030d38 100644 --- a/harbour/doc/en/browse.txt +++ b/harbour/doc/en/browse.txt @@ -120,16 +120,16 @@ Ctrl Right Pan one column to the right Ctrl Home Move to the leftmost column Ctrl End Move to the rightmost column - /table> + When is omitted, two more keys are active: - table> + Key Meaning Esc Terminate BROWSE() Enter Terminate BROWSE() - /table> +
When DBEDIT() execute it pass the following arguments: nMode and the index of current record in . If diff --git a/harbour/doc/en/cmdline.txt b/harbour/doc/en/cmdline.txt index ce5aa8c0d0..00f4983c24 100644 --- a/harbour/doc/en/cmdline.txt +++ b/harbour/doc/en/cmdline.txt @@ -16,29 +16,29 @@ $DESCRIPTION$ This spec goes for CLIPPERCMD, HARBOURCMD, Harbour compiler and #pragma directives in the source code. - + The command line always overrides the envvar. - + Note that some switches are not accepted in envvar, some others in #pragmas. - + First the parser should start to step through all the tokens in the string separated by whitespace. (or just walk through all argv[]) - + 1.) If the token begins with "-", it should be treated as a new style switch. - + One or more switch characters can follow this. The "-" sign inside the token will turn off the switch. - + If the switch has an argument all the following characters are treated as part of the argument. - + The "/" sign has no special meaning here. - + Switch Result option - + -wn ( W N ) -w-n ( !W N ) -wi/harbour/include/ ( W I=/harbour/include/ ) @@ -53,57 +53,57 @@ -w-n-p- ( !W !N !P ) -w- -w -w- ( finally: !W )
- + 2.) If the token begins with "/", it should be treated as a compatibility style switch. - + The parser scans the token for the next "/" sign or EOS and treats the resulting string as one switch. - + This means that a switch with an argument containing "/" sign has some limitations. This may be solved by allowing the usage of quote characters. This is mostly a problem on systems which use "/" as path separator. - + The "-" sign has no special meaning here, it can't be used to disable a switch. - + Switch Result option - + /w/n ( W N ) /wo/n ( [invalid switch: wo] N ) /ihello/world/ ( I=hello [invalid switch: world] [invalid switch: /] ) /i"hello/world/"/w ( I=hello/world/ W ) /ihello\world\ ( I=hello\world\ )
- + 3.) If the token begins with anything else it should be skipped. - + The Harbour switches are always case insensitive. - + In the Harbour commandline the two style can be used together: harbour -wnes2 /gc0/q0 -iC:\hello - + Exceptions: - + - Handling of the /CREDIT undocumented switch on Harbour command line is unusual, check the current code for this. - + - The CLIPPER, HARBOUR and Harbour application command line parsing is a different beast, see cmdarg.c for a NOTE. - + Notes: - + - All occurrences where a path is accepted, Harbour should handle the quote char to specify path containing space, negative sign, slash, or any other chars with special meaning. - + /i"C:/hello/" -i"C:/hello-n" /i"C:/Program Files/" -i"C:/Program Files/" - + Just some examples for the various accepted forms: //F20 == /F20 == F20 == F:20 == F20X diff --git a/harbour/doc/en/compiler.txt b/harbour/doc/en/compiler.txt index 65fabe9343..3fa09d2289 100644 --- a/harbour/doc/en/compiler.txt +++ b/harbour/doc/en/compiler.txt @@ -16,131 +16,131 @@ $DESCRIPTION$ Invoking the Harbour compiler: ============================== - + harbour [options] or harbour [options] or harbour [options] [options] - + The command line options have to be separated by at least one space. The option can start with either '/' character or '-' character. - + The Harbour command line options: ================================= - + /a automatic memvar declaration ================= - + This causes all variables declared by PARAMETER, PRIVATE or PUBLIC statements to be automatically declared as MEMVAR variables. - + /b debug info ================= - + The compiler generates all information required for debugging - + /build display detailed version info ================= - + /credits display credits ================= - + /d[=] #define ================= - + /es[] set exit severity ================= - + /es or /es0 - all warnings are ignored and exit code returned by the compiler is equal to 0 if there are no errors in compiled source file. - + /es1 - any warnings generate a non-zero exit code, but output is still created. - + /es2 - all warnings are treated as errors and no output file is created. The exit code is set to a non-zero value. - + /fn[:[l|u]|-] set filename casing (l=lower u=upper) ================= - + /fd[:[l|u]|-] set directory casing (l=lower u=upper) ================= - + /fp[:] set path separator ================= - + /fs[-] turn filename space trimming on or off (default) ================= - + /g output type generated is ================= - + /gc[] output type: C source (.c) (default) : 0=compact (default) 1=normal 2=verbose 3=generate real C code - + /gh output type: Harbour Portable Object (.hrb) - + /gd[.] generate dependencies list into (.d) file - + /ge[] error output : 0=Clipper (default) 1=IDE friendly - + /i #include file search path ================= - + /i[-|+] disable/enable support for INCLUDE envvar ================= - + /j[] generate i18n gettext file (.pot) ================= - + /k compilation mode (type -k? for more data) ================= - + /kc clear all flags (strict Clipper mode) - + /kh Harbour mode (default) - + /ko allow operator optimizations - + /ki enable support for HB_INLINE (default) - + /kr runtime settings enabled - + /ks allow indexed assignment on all types - + /kx extended Xbase++ mode (default) - + /ku strings in user encoding - + /kd accept macros with declared symbols - + /km turn off macrotext substitution - + /kj turn off jump optimization in pcode - + /k? this info - + /l suppress line number information ================= - + The compiler does not generate the source code line numbers in the output file. The PROCLINE() function will return 0 for modules compiled using this option. - + /m compile module only ================= - + /n[] no implicit starting procedure ================= : 0=no implicit starting procedure 1=no starting procedure at all 2=add starting procedure if necessary - + The compiler does not create a procedure with the same name as the compiled file. This means that any declarations placed before the first PROCEDURE or FUNCTION statement have file- @@ -148,167 +148,167 @@ defined in the compiled source file. All executable statements placed at the beginning of the file and before the first PROCEDURE/FUNCTION statement are ignored. - + /o object file drive and/or path ================= - + /p generate pre-processed output (.ppo) file ================= - + The compiler only creates the file that contains the result of pre-processing the source file. - + /p+ generate pre-processor trace (.ppt) file ================= - + /q quiet ================= - + The compiler does not print any messages during compiling (except the copyright info). - + /q0 quiet and don't display program header - + /q2 disable all output messages - + /r[] request linker to search (or none) ================= - + Currently not supported in Harbour. - + /r= sets maximum number of preprocessor iterations ================= - + This set the maximum number of preprocessor iterations during processing the source code. If this switch is not used then the preprocessor stops after 1024 iterations. This value is used to stop processing of infinite loops, for example: #command ( => (,7 - + /s[m] syntax check only [minimal for dependencies list] ================= - + The compiler checks the syntax only. No output file is generated. - + /t path for temp file creation ================= - + Currently not used in Harbour (the Harbour compiler does not create any temporary files). - + /u[] use command def set in (or none) ================= - + /u+ add command def set from ================= - + /undef: #undef ================= - + /v variables are assumed M-> ================= - + All undeclared or unaliased variables are assumed MEMVAR variables (private or public variables). If this switch is not used then the scope of such variables is checked at runtime. - + /w[] set warning level number (0..3, default 1) ================= - + /w0 - no warnings - + /w or /w1 - CA-Cl*pper compatible warnings - + /w2 - some useful warnings missed in CA-Cl*pper - + /w3 - warnings generated for Harbour language extensions and also enables strong type checking but only warns against declared types, or types which may be calculated at compile time - + /x[] set symbol init function name prefix (for .c only) ================= - + Sets the prefix added to the generated symbol init function name (in C output currently). This function is generated automatically for every PRG module compiled. This additional prefix can be used to suppress problems with duplicated symbols during linking an application with some third party libraries. - + /z suppress shortcutting (.and. & .or.) ================= - + Compilation in batch mode. ========================== - + @ compile list of modules in ================= - + Not supported yet. - + Known incompatibilities between Harbour and CA-Cl*pper compilers ============================================================= - + NOTE: - + If you want a 100% compatible runtime libraries then you have to define HARBOUR_STRICT_CLIPPER_COMPATIBILITY. This option should be defined in the file include/hbsetup.h (in fact this option is placed in a comment by default - you need to remove the /* */ characters only). This change has to be done before invoking the make utility. - - + + Handling of undeclared variables ================================ - + When a value is assigned to an undeclared variable and the '-v' command line option is not used, then the CA-Cl*pper compiler assumes that the variable is a PRIVATE or a PUBLIC variable and generates POPM (pop memvar) opcode. - + When the value of an undeclared variable is accessed and the '-v' command line option is not used, the CA-Cl*pper compiler generates PUSHV (push variable) opcode that determines the type of variable at runtime. If a field with the requested name exists in the current workarea then its value is used. If there is no field then a PRIVATE or a PUBLIC variable is used (if exists). - + The Harbour compiler generates an opcode to determine the type of variable at runtime (POPVARIABLE or PUSHVARIABLE) in both cases (assignment and access). - + The difference can be checked by the following code: - + PROCEDURE Main() PRIVATE myname - + DBCREATE( "TEST", { { "MYNAME", "C", 10, 0} } ) USE test NEW SELECT test APPEND BLANK - + FIELD->myname := "FIELD" MEMVAR->myname := "MEMVAR" - + myname := myname + " assigned" - + // In CA-Cl*pper: "FIELD", In Harbour: "FIELD assigned" ? FIELD->myname - + // In CA-Cl*pper: "MEMVAR assigned", In Harbour: "MEMVAR" ? MEMVAR->myname - + USE - + RETURN - + Passing an undeclared variable by the reference =============================================== - + The CA-Cl*pper compiler uses the special opcode PUSHP to pass a reference to an undeclared variable ( '@' operator ). The type of passed variable is checked at runtime (field or memvar). However, @@ -318,64 +318,64 @@ PUSHMEMVARREF opcode in such cases. Notice that the runtime behavior is the same in CA-Cl*pper and in Harbour - only the generated opcodes are different. - - + + Handling of object messages =========================== - + The HARBOUR_STRICT_CLIPPER_COMPATIBILITY setting determines the way chained send messages are handled. - + For example, the following code: - + a:b( COUNT() ):c += 1 - + will be handled as: - + a:b( COUNT() ):c := a:b( COUNT() ):c + 1 - + in strict CA-Cl*pper compatibility mode and - + temp := a:b( COUNT() ), temp:c += 1 - + in non-strict mode. - + In practice, CA-Cl*pper will call the COUNT() function two times: the first time before addition and the second one after addition. In Harbour, COUNT() will be called only once, before addition. - + The Harbour (non-strict) method is: 1) faster 2) it guarantees that the same instance variable of the same object will be changed - + (See also: src/compiler/expropt.c) - + Initialization of static variables ================================== - + There is a difference in the initialization of static variables that are initialized with a codeblock that refers to a local variable. For example: - + - PROCEDURE TEST() - LOCAL MyLocalVar - STATIC MyStaticVar := {|| MyLocalVar } - - MyLocalVar :=0 - ? EVAL( MyStaticVar ) - - RETURN + PROCEDURE Main() + LOCAL MyLocalVar + STATIC s_MyStaticVar := {|| MyLocalVar } + + MyLocalVar := 0 + ? EVAL( s_MyStaticVar ) + + RETURN - + The above code compiles fine in CA-Cl*pper, but it generates a runtime error Error/BASE 1132 Bound error: array access Called form (b)STATICS$(0) - + In Harbour this code generates a compile time error: Error E0009 Illegal variable (b) initializer: 'MyLocalVar' - + Both CA-Cl*pper and Harbour are handling all local variables used in a codeblock in a special way: they are detached from the local stack of function/procedure where they are declared. This allows access to @@ -385,6 +385,6 @@ main procedure and before all INIT procedures. The local variables don't exist on the eval stack when static variables are initialized, so they cannot be detached. - + $END$ */ diff --git a/harbour/doc/en/garbage.txt b/harbour/doc/en/garbage.txt index 65b011e8bb..c1890bccf5 100644 --- a/harbour/doc/en/garbage.txt +++ b/harbour/doc/en/garbage.txt @@ -15,12 +15,12 @@ The garbage collector uses the following logic: - first collect all memory allocations that can cause garbage; - next scan all variables if these memory blocks are still referenced. - + Notice that only arrays, objects and codeblocks are collected because these are the only datatypes that can cause self-references (a[1]:=a) or circular references (a[1]:=b; b[1]:=c; c[1]:=a) that cannot be properly deallocated by simple reference counting. - + Since all variables in harbour are stored inside some available tables (the eval stack, memvars table and array of static variables) then checking if the reference is still alive is quite easy and doesn't require any @@ -29,7 +29,7 @@ implementation that also stores some values that can contain memory references. These data are used to initialize class instance variables and are stored in class shared variables. - + In special cases when the value of a harbour variable is stored internally in some static area (at C or assembler level), the garbage collector will be not able to scan such values since it doesn't know their location. This @@ -38,44 +38,44 @@ a pointer to the value created with hb_itemNew() function. Example: static HB_ITEM s_item; // this item can be released by the GC - + static PHB_ITEM pItem; // this item will be maintained correctly pItem = hb_itemNew( hb_param(1, IT_BLOCK) ); - + However, scanning of all variables can be a time consuming operation. It requires that all allocated arrays have to be traversed through all their elements to find more arrays. Also all codeblocks are scanned for detached local variables they are referencing. For this reason, looking for unreferenced memory blocks is performed during the idle states. - + The idle state is a state when there is no real application code executed. For example, the user code is stopped for 0.1 of a second during INKEY(0.1) - Harbour is checking the keyboard only during this time. It leaves however quite enough time for many other background tasks. One such background task can be looking for unreferenced memory blocks. - + Allocating memory ----------------- - + The garbage collector collects memory blocks allocated with hb_gcAlloc() function calls. Memory allocated by hb_gcAlloc() should be released with hb_gcFree() function. - + The garbage collecting ---------------------- - + During scanning of unreferenced memory the GC is using a mark & sweep algorithm. This is done in three steps: - + 1) mark all memory blocks allocated by the GC with unused flag; - + 2) sweep (scan) all known places and clear unused flag for memory blocks that are referenced there; - + 3) finalize collecting by deallocation of all memory blocks that are still marked as unused and that are not locked. - + To speed things up, the mark step is simplified by swapping the meaning of the unused flag. After deallocation of unused blocks all still alive memory blocks are marked with the same 'used' flag so we can reverse @@ -84,10 +84,10 @@ using the current flag, which assures that all memory blocks are marked with the same flag before the sweep step will start. See hb_gcCollectAll() and hb_gcItemRef() - + Calling the garbage collector from harbour code ----------------------------------------------- - + The garbage collector can be called directly from the harbour code. This is usefull in situations where there is no idle states available or the application is working in the loop with no user interaction @@ -116,7 +116,7 @@ HB_GARBAGE_FUNC_PTR pCleanupFunc ); $ARGUMENTS$ Requested size of memory block - + Pointer to HB_GARBAGE_FUNC function that will be called directly before releasing the garbage memory block or NULL. This function should release all other memory allocated and stored inside @@ -236,7 +236,7 @@ scanning of referenced memory pointers. This function checks the type of passed item and scans recursively all other memory blocks referenced by this item if it is an array, an object or a codeblock. - + NOTE: This function is reserved for the garbage collector only. It cannot be called from the user code - calling it can cause unpredicted results (memory blocks referenced by the diff --git a/harbour/doc/en/gnulice.txt b/harbour/doc/en/gnulice.txt index 60fbf85df8..74221fcb0d 100644 --- a/harbour/doc/en/gnulice.txt +++ b/harbour/doc/en/gnulice.txt @@ -18,12 +18,12 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - + Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - + Preamble - + The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change @@ -33,7 +33,7 @@ to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. - + When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and @@ -41,42 +41,42 @@ or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. - + To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. - + For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. - + We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or vmodify the software. - + Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. - + Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. - + The precise terms and conditions for copying, distribution and modification follow. - + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - + 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The @@ -93,7 +93,7 @@ contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. - + 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate @@ -103,20 +103,20 @@ this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - + a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. - + b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. - + c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an @@ -127,7 +127,7 @@ of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate @@ -138,40 +138,40 @@ the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. - + Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. - + In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - + 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: - + a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, - + b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, - + c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) - + The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus @@ -182,13 +182,13 @@ form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. - + If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -196,7 +196,7 @@ License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. - + 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are @@ -205,7 +205,7 @@ Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. - + 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject @@ -213,7 +213,7 @@ restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. - + $SEEALSO$ GNU License.. $END$ @@ -244,12 +244,12 @@ copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. - + If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. - + It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting @@ -260,10 +260,10 @@ system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. - + This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this @@ -272,12 +272,12 @@ in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. - + 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - + Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the @@ -285,7 +285,7 @@ published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. - + 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by @@ -294,9 +294,9 @@ will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - + NO WARRANTY - + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS @@ -307,7 +307,7 @@ PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE @@ -318,82 +318,82 @@ OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - + END OF TERMS AND CONDITIONS - + Appendix: How to Apply These Terms to Your New Programs - + If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. - + To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found: - + Copyright (C) yyyy - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - + Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. - + The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. - + You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: - + Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. - + signature of Ty Coon, 1 April 1989 - + Ty Coon, President of Vice - + This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. - + FSF & GNU inquiries & questions to gnu@gnu.org. Copyright notice above. - + Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA Updated: 3 Jan 2000 rms - + $SEEALSO$ License,GNU License $END$ diff --git a/harbour/doc/en/harbext.txt b/harbour/doc/en/harbext.txt index f6e0bc8ba2..6c0970ee9e 100644 --- a/harbour/doc/en/harbext.txt +++ b/harbour/doc/en/harbext.txt @@ -14,74 +14,74 @@ $DESCRIPTION$ Language extensions: -------------------- - + * Class generation and management. - + CA-Cl*pper only allowed creation of objects from a few standard classes. - + In Harbour, you can create your own classes--complete with Methods, Instance Variables, Class Variables and Inheritance. Entire applications can be designed and coded in Object Oriented style. - + * @() - + Returns the pointer (address) to a function. - + The returned value is not useful to application-level programming, but is used at a low level to implement object oriented coding. (Internally, a class method is a static function and there is no symbol for it, so it is accessed via its address). - + * Class HBGetList - + Object oriented support for GetLists management. - + * ProcName() support for class Method names. - + Class Methods can be retrieved from the call stack. - + * Memory() has new return values. - + See hbmemory.ch - + * Transform() --> new function in format string - + @0 Make a zero padded string out of the number. - + * SToD() --> dDate - + New function that converts a yyyymmdd string to a Date value. - + * Optional Compile Time STRONG TYPE declaration (and compile time TYPE MISMATCH warnings) - + Example: LOCAL/STATIC Var AS ... - + * The Harbour debugger provides new interesting classes: - + - Class TDbWindow could be the foundation for a generic multiplatform - + - Class TForm - + - Class TDbMenu implement both pulldown and popup menus. - + RTL enhanced functionality: --------------------------- - + - Directory( , , ) - + The 3rd parameter is a Harbour (optional) parameter and indicates that on those platforms that support long filenames, that you wish to receive what would be considered the dos equivalant 8.3 name. Could affect Adir() and Dir if they were modified to take advantage of it - currently, they will return long names if the os supports it. - + - HB_DiskSpace( , ) - + The second parameter is a Harbour (optional) parameter and indicates the type of diskinfo being requested. See en/diskspac.txt for info. - + $END$ */ diff --git a/harbour/doc/en/hb_apigt.txt b/harbour/doc/en/hb_apigt.txt index fedc055752..247fb33105 100644 --- a/harbour/doc/en/hb_apigt.txt +++ b/harbour/doc/en/hb_apigt.txt @@ -12,22 +12,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtInit( int iFilenoStdin, int iFilenoStdout, int iFilenoStderr ) $ARGUMENTS$ - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -37,7 +37,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -51,18 +51,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtExit( void ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -72,7 +72,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -86,22 +86,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtAdjustPos( int iHandle, char * pStr, ULONG ulLen ) $ARGUMENTS$ - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -111,7 +111,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -125,28 +125,28 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtBox( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE * pbyFrame ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -156,7 +156,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -170,26 +170,26 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtBoxD( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -199,7 +199,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -213,26 +213,26 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtBoxS( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -242,7 +242,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -256,10 +256,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtColorSelect( USHORT uiColorIndex ) --> ( USHORT )usResult $ARGUMENTS$ @@ -267,9 +267,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -279,7 +279,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -293,10 +293,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtColorToN( char * szColorString ) --> ( USHORT )usResult $ARGUMENTS$ @@ -304,9 +304,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -316,7 +316,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -330,20 +330,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtDispBegin( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -353,7 +353,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -367,20 +367,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtDispCount( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -390,7 +390,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -404,20 +404,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtDispEnd( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -427,7 +427,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -441,28 +441,28 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtDrawShadow( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -472,7 +472,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -486,10 +486,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtGetBlink( HB_BOOL * pbBlink ) --> ( USHORT )usResult $ARGUMENTS$ @@ -497,9 +497,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -509,7 +509,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -523,10 +523,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtGetColorStr( char * pszColorString ) --> ( USHORT )usResult $ARGUMENTS$ @@ -534,9 +534,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -546,7 +546,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -560,10 +560,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtGetCursor( USHORT * puiCursorShape ) --> ( USHORT )usResult $ARGUMENTS$ @@ -571,9 +571,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -583,7 +583,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -597,22 +597,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtGetPos( SHORT * piRow, SHORT * piCol ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -622,7 +622,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -636,20 +636,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtIsColor( void ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -659,7 +659,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -673,20 +673,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtMaxCol( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -696,7 +696,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -710,20 +710,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtMaxRow( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -733,7 +733,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -747,20 +747,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtPostExt( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -770,7 +770,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -784,20 +784,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtPreExt( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -807,7 +807,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -824,17 +824,17 @@ Prepare the reminal for shell output $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtSuspend( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -844,7 +844,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -861,17 +861,17 @@ Resume the terminal after the shell output $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtResume( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -881,7 +881,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -895,10 +895,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtReadKey( HB_inkey_enum eventmask ) --> ( int )iResult $ARGUMENTS$ @@ -906,9 +906,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -918,7 +918,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -932,28 +932,28 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtRectSize( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, USHORT * puiBuffSize ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -963,7 +963,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -977,26 +977,26 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtRepChar( USHORT uiRow, USHORT uiCol, BYTE byChar, USHORT uiCount ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1006,7 +1006,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1020,28 +1020,28 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtRest( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, void * pScrBuff ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1051,7 +1051,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1065,28 +1065,28 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtSave( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, void * pScrBuff ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1096,7 +1096,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1110,22 +1110,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtScrDim( USHORT * puiHeight, USHORT * puiWidth ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1135,7 +1135,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1149,30 +1149,30 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtScroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, SHORT iRows, SHORT iCols ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1182,7 +1182,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1196,10 +1196,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtSetBlink( HB_BOOL bBlink ) --> ( USHORT )usResult $ARGUMENTS$ @@ -1207,9 +1207,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1219,7 +1219,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1233,10 +1233,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtSetColorStr( char * pszColorString ) --> ( USHORT )usResult $ARGUMENTS$ @@ -1244,9 +1244,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1256,7 +1256,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1270,10 +1270,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtSetCursor( USHORT uiCursorShape ) --> ( USHORT )usResult $ARGUMENTS$ @@ -1281,9 +1281,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1293,7 +1293,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1307,22 +1307,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtSetMode( USHORT uiRows, USHORT uiCols ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1332,7 +1332,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1346,22 +1346,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtSetPos( SHORT iRow, SHORT iCol ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1371,7 +1371,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1385,24 +1385,24 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtSetPosContext( SHORT iRow, SHORT iCol, SHORT iMode ) --> ( USHORT )usResult $ARGUMENTS$ - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1412,7 +1412,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1426,10 +1426,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtSetSnowFlag( HB_BOOL bNoSnow ) --> ( USHORT )usResult $ARGUMENTS$ @@ -1437,9 +1437,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1449,7 +1449,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1463,20 +1463,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtTone( double dFrequency, double dDuration ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1486,7 +1486,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1500,22 +1500,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtWrite( BYTE * pbyStr, ULONG ulLen ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1525,7 +1525,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1539,26 +1539,26 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtWriteAt( USHORT uiRow, USHORT uiCol, BYTE * pbyStr, ULONG ulLen ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1568,7 +1568,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1582,22 +1582,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtWriteCon( BYTE * pbyStr, ULONG ulLen ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1607,7 +1607,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1621,20 +1621,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtVersion( void ) --> ( char * )pszResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1644,7 +1644,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1658,20 +1658,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtWCreate( HB_GT_RECT * rect, HB_GT_WND ** wnd ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1681,7 +1681,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1695,18 +1695,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtWDestroy( HB_GT_WND * wnd ) $ARGUMENTS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1716,7 +1716,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1730,20 +1730,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtWFlash( void ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1753,7 +1753,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1767,18 +1767,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtWApp( HB_GT_WND ** wnd ) $ARGUMENTS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1788,7 +1788,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1802,18 +1802,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtWCurrent( HB_GT_WND * wnd ) $ARGUMENTS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1823,7 +1823,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1837,20 +1837,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtWPos( HB_GT_WND * wnd, HB_GT_RECT * rect ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1860,7 +1860,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1874,22 +1874,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtWVis( HB_GT_WND * wnd, USHORT uiStatus ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1899,7 +1899,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1916,7 +1916,7 @@ System Level Request $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtSLR( HB_GT_SLR * pSLR ) --> ( USHORT )usResult $ARGUMENTS$ @@ -1924,9 +1924,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1936,7 +1936,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1950,10 +1950,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtModalRead( void * ) --> ( USHORT )usResult $ARGUMENTS$ @@ -1961,9 +1961,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1973,7 +1973,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1987,20 +1987,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtBeginWrite( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2010,7 +2010,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2024,20 +2024,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtEndWrite( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2047,7 +2047,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2061,20 +2061,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtFlushCursor( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2084,7 +2084,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2098,10 +2098,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtSetColor( HB_GT_RGB * color ) --> ( USHORT )usResult $ARGUMENTS$ @@ -2109,9 +2109,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2121,7 +2121,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2135,10 +2135,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtGetColor( HB_GT_RGB * color ) --> ( USHORT )usResult $ARGUMENTS$ @@ -2146,9 +2146,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2158,7 +2158,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2172,10 +2172,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gtSetBorder( HB_GT_RGB * color ) --> ( USHORT )usResult $ARGUMENTS$ @@ -2183,9 +2183,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2195,7 +2195,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2209,22 +2209,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_Init( int iFilenoStdin, int iFilenoStdout, int iFilenoStderr ) $ARGUMENTS$ - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2234,7 +2234,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2248,18 +2248,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_Exit( void ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2269,7 +2269,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2283,22 +2283,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_AdjustPos( BYTE * pStr, ULONG ulLen ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2308,7 +2308,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2322,30 +2322,30 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_Box( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE * pbyFrame, BYTE byAttr ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2355,7 +2355,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2369,30 +2369,30 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_BoxD( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE * pbyFrame, BYTE byAttr ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2402,7 +2402,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2416,30 +2416,30 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_BoxS( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE * pbyFrame, BYTE byAttr ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2449,7 +2449,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2463,20 +2463,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_Col( void ) --> ( SHORT )sResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2486,7 +2486,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2500,18 +2500,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_DispBegin( void ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2521,7 +2521,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2535,20 +2535,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_DispCount( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2558,7 +2558,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2572,18 +2572,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_DispEnd( void ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2593,7 +2593,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2607,20 +2607,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_GetBlink( void ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2630,7 +2630,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2644,20 +2644,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_GetCursorStyle( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2667,7 +2667,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2681,20 +2681,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_GetScreenHeight( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2704,7 +2704,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2718,20 +2718,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_GetScreenWidth( void ) --> ( USHORT )usResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2741,7 +2741,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2755,26 +2755,26 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_GetText( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE * pbyDst ) $ARGUMENTS$ - + - + - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2784,7 +2784,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2798,28 +2798,28 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_HorizLine( USHORT uiRow, USHORT uiLeft, USHORT uiRight, BYTE byChar, BYTE byAttr ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2829,7 +2829,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2843,20 +2843,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_IsColor( void ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2866,7 +2866,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2880,20 +2880,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_PreExt( void ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2903,7 +2903,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2917,20 +2917,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_PostExt( void ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2940,7 +2940,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2957,17 +2957,17 @@ Suspend the terminal before the shell call $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_Suspend( void ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2977,7 +2977,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2994,17 +2994,17 @@ Resume the terminal after the shell call $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_Resume( void ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3014,7 +3014,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3028,26 +3028,26 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_Puts( USHORT uiRow, USHORT uiCol, BYTE byAttr, BYTE * pbyStr, ULONG ulLen ) $ARGUMENTS$ - + - + - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3057,7 +3057,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3071,26 +3071,26 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_PutText( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE * pbySrc ) $ARGUMENTS$ - + - + - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3100,7 +3100,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3114,10 +3114,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_ReadKey( HB_inkey_enum eventmask ) --> ( int )iResult $ARGUMENTS$ @@ -3125,9 +3125,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3137,7 +3137,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3151,22 +3151,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_RectSize( USHORT rows, USHORT cols ) --> ( int )iResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3176,7 +3176,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3190,26 +3190,26 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_Replicate( USHORT uiTop, USHORT uiLeft, BYTE byAttr, BYTE byChar, ULONG ulLen ) $ARGUMENTS$ - + - + - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3219,7 +3219,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3233,20 +3233,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_Row( void ) --> ( SHORT )sResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3256,7 +3256,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3270,30 +3270,30 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_Scroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr, SHORT iRows, SHORT iCols ) $ARGUMENTS$ - + - + - + - + - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3303,7 +3303,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3317,26 +3317,26 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_SetAttribute( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr ) $ARGUMENTS$ - + - + - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3346,7 +3346,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3360,18 +3360,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_SetBlink( HB_BOOL bBlink ) $ARGUMENTS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3381,7 +3381,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3395,18 +3395,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_SetCursorStyle( USHORT uiCursorShape ) $ARGUMENTS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3416,7 +3416,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3430,22 +3430,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_SetMode( USHORT uiRows, USHORT uiCols ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3455,7 +3455,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3469,22 +3469,22 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_SetPos( SHORT iRow, SHORT iCol, SHORT iMethod ) $ARGUMENTS$ - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3494,7 +3494,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3508,20 +3508,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_Tone( double dFrequency, double dDuration ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3531,7 +3531,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3545,20 +3545,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_Version( void ) --> ( char * )pszResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3568,7 +3568,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3582,28 +3582,28 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_gt_VertLine( USHORT uiCol, USHORT uiTop, USHORT uiBottom, BYTE byChar, BYTE byAttr ) --> ( USHORT )usResult $ARGUMENTS$ - + - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3613,7 +3613,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3630,21 +3630,21 @@ Wait for keyboard input $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_inkey( HB_BOOL bWait, double dSeconds, HB_inkey_enum event_mask ) --> ( int )iResult $ARGUMENTS$ - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3654,7 +3654,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3671,17 +3671,17 @@ Extract the next key from the Harbour keyboard buffer $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_inkeyGet( void ) --> ( int )iResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3691,7 +3691,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3708,15 +3708,15 @@ Inserts an inkey code into the keyboard buffer $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_inkeyPut( int ch ) $ARGUMENTS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3726,7 +3726,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3743,17 +3743,17 @@ Return the value of the last key that was extracted $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_inkeyLast( void ) --> ( int )iResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3763,7 +3763,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3780,17 +3780,17 @@ Return the next key without extracting it $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_inkeyNext( void ) --> ( int )iResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3800,7 +3800,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3817,15 +3817,15 @@ Poll the console keyboard to stuff the Harbour buffer $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_inkeyPoll( void ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3835,7 +3835,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3852,15 +3852,15 @@ Reset the Harbour keyboard buffer $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_inkeyReset( HB_BOOL allocate ) $ARGUMENTS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3870,7 +3870,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3884,20 +3884,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouseIsPresent( void ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3907,7 +3907,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3921,20 +3921,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouseGetCursor( void ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3944,7 +3944,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3958,18 +3958,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouseSetCursor( HB_BOOL bVisible ) $ARGUMENTS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3979,7 +3979,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3993,20 +3993,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouseCol( void ) --> ( int )iResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4016,7 +4016,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4030,20 +4030,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouseRow( void ) --> ( int )iResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4053,7 +4053,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4067,20 +4067,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouseSetPos( int iRow, int iCol ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4090,7 +4090,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4104,10 +4104,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouseIsButtonPressed( int iButton ) --> ( HB_BOOL )bResult $ARGUMENTS$ @@ -4115,9 +4115,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4127,7 +4127,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4141,20 +4141,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouseCountButton( void ) --> ( int )iResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4164,7 +4164,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4178,24 +4178,24 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouseSetBounds( int iTop, int iLeft, int iBottom, int iRight ) $ARGUMENTS$ - + - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4205,7 +4205,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4219,24 +4219,24 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouseGetBounds( int * piTop, int * piLeft, int * piBottom, int * piRight ) $ARGUMENTS$ - + - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4246,7 +4246,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4260,18 +4260,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouse_Init( void ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4281,7 +4281,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4295,18 +4295,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouse_Exit( void ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4316,7 +4316,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4330,20 +4330,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouse_IsPresent( void ) --> ( HB_BOOL )bResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4353,7 +4353,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4367,18 +4367,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouse_Show( void ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4388,7 +4388,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4402,18 +4402,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouse_Hide( void ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4423,7 +4423,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4437,20 +4437,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouse_Col( void ) --> ( int )iResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4460,7 +4460,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4474,20 +4474,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouse_Row( void ) --> ( int )iResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4497,7 +4497,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4511,20 +4511,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouse_SetPos( int iRow, int iCol ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4534,7 +4534,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4548,10 +4548,10 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouse_IsButtonPressed( int iButton ) --> ( HB_BOOL )bResult $ARGUMENTS$ @@ -4559,9 +4559,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4571,7 +4571,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4585,20 +4585,20 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouse_CountButton( void ) --> ( int )iResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4608,7 +4608,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4622,24 +4622,24 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouse_SetBounds( int iTop, int iLeft, int iBottom, int iRight ) $ARGUMENTS$ - + - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4649,7 +4649,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4663,24 +4663,24 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_mouse_GetBounds( int * piTop, int * piLeft, int * piBottom, int * piRight ) $ARGUMENTS$ - + - + - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4690,7 +4690,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4704,18 +4704,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_setkeyInit( void ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4725,7 +4725,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4739,18 +4739,18 @@ $SUBCATEGORY$ Terminal $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapigt.h" hb_setkeyExit( void ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4760,6 +4760,6 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ diff --git a/harbour/doc/en/hb_apird.txt b/harbour/doc/en/hb_apird.txt index 2b48240e45..ef43c9e8a6 100644 --- a/harbour/doc/en/hb_apird.txt +++ b/harbour/doc/en/hb_apird.txt @@ -12,10 +12,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddInsertAreaNode( char *szDriver ) --> ( USHORT )usResult $ARGUMENTS$ @@ -23,9 +23,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -35,7 +35,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -49,20 +49,20 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddGetCurrentWorkAreaNumber( void ) --> ( int )iResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -72,7 +72,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -86,20 +86,20 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddGetCurrentWorkAreaPointer( void ) --> ( void * )pResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -109,7 +109,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -123,10 +123,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddSelectWorkAreaAlias( char * szAlias ) --> ( HB_ERRCODE )hResult $ARGUMENTS$ @@ -134,9 +134,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -146,7 +146,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -160,10 +160,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddSelectWorkAreaNumber( int iArea ) --> ( HB_ERRCODE )hResult $ARGUMENTS$ @@ -171,9 +171,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -183,7 +183,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -197,10 +197,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddSelectWorkAreaSymbol( PHB_SYMB pSymAlias ) --> ( HB_ERRCODE )hResult $ARGUMENTS$ @@ -208,9 +208,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -220,7 +220,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -234,22 +234,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddGetFieldValue( PHB_ITEM pItem, PHB_SYMB pFieldSymbol ) --> ( HB_ERRCODE )hResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -259,7 +259,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -273,22 +273,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddPutFieldValue( PHB_ITEM pItem, PHB_SYMB pFieldSymbol ) --> ( HB_ERRCODE )hResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -298,7 +298,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -312,22 +312,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddFieldGet( PHB_ITEM pItem, PHB_SYMB pFieldSymbol ) --> ( HB_ERRCODE )hResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -337,7 +337,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -351,22 +351,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddFieldPut( PHB_ITEM pItem, PHB_SYMB pFieldSymbol ) --> ( HB_ERRCODE )hResult $ARGUMENTS$ - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -376,7 +376,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -390,18 +390,18 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddShutDown( void ) $ARGUMENTS$ - + $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -411,7 +411,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -425,26 +425,26 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddInherit( PRDDFUNCS pTable, PRDDFUNCS pSubTable, PRDDFUNCS pSuperTable, BYTE * szDrvName ) --> ( HB_ERRCODE )hResult $ARGUMENTS$ - + - + - + $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -454,7 +454,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -468,10 +468,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddDisinherit( BYTE * drvName ) --> ( HB_ERRCODE )hResult $ARGUMENTS$ @@ -479,9 +479,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -491,7 +491,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -505,10 +505,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddExtendType( USHORT fieldType ) --> ( USHORT )usResult $ARGUMENTS$ @@ -516,9 +516,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -528,7 +528,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -542,10 +542,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype - + #include "hbapirdd.h" hb_rddFieldType( USHORT extendType ) --> ( USHORT )usResult $ARGUMENTS$ @@ -553,9 +553,9 @@ $RETURNS$ $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -565,7 +565,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -579,22 +579,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_BOF( w, sp ) --> lprfsHost->bof )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->bof )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -604,7 +604,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -618,22 +618,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_EOF( w, sp ) --> lprfsHost->eof )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->eof )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -643,7 +643,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -657,22 +657,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_FOUND( w, sp ) --> lprfsHost->found )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->found )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -682,7 +682,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -696,22 +696,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_GOTO( w, l ) --> lprfsHost->go )( w, l ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->go )( w, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -721,7 +721,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -735,22 +735,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_GOTOID( w, sp ) --> lprfsHost->goToId )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->goToId )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -760,7 +760,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -774,10 +774,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_GOBOTTOM( w ) --> lprfsHost->goBottom )( w ) )> $ARGUMENTS$ @@ -785,9 +785,9 @@ $RETURNS$ lprfsHost->goBottom )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -797,7 +797,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -811,10 +811,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_GOTOP( w ) --> lprfsHost->goTop )( w ) )> $ARGUMENTS$ @@ -822,9 +822,9 @@ $RETURNS$ lprfsHost->goTop )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -834,7 +834,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -848,26 +848,26 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SEEK( w, i1, v, i2 ) --> lprfsHost->seek )( w, i1, v, i2 ) )> $ARGUMENTS$ - + - + - + $RETURNS$ lprfsHost->seek )( w, i1, v, i2 ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -877,7 +877,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -891,22 +891,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SKIP( w, l ) --> lprfsHost->skip )( w, l ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->skip )( w, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -916,7 +916,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -930,22 +930,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SKIPFILTER( w, l ) --> lprfsHost->skipFilter )( w, l ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->skipFilter )( w, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -955,7 +955,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -969,22 +969,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SKIPRAW( w, l ) --> lprfsHost->skipRaw )( w, l ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->skipRaw )( w, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -994,7 +994,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1008,22 +1008,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ADDFIELD( w, ip ) --> lprfsHost->addField )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->addField )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1033,7 +1033,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1047,22 +1047,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_APPEND( w, l ) --> lprfsHost->append )( w, l ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->append )( w, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1072,7 +1072,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1086,22 +1086,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_CREATEFIELDS( w, v ) --> lprfsHost->createFields )( w, v ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->createFields )( w, v ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1111,7 +1111,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1125,10 +1125,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_DELETE( w ) --> lprfsHost->deleterec )( w ) )> $ARGUMENTS$ @@ -1136,9 +1136,9 @@ $RETURNS$ lprfsHost->deleterec )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1148,7 +1148,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1162,22 +1162,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_DELETED( w, sp ) --> lprfsHost->deleted )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->deleted )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1187,7 +1187,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1201,22 +1201,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_FIELDCOUNT( w, sp ) --> lprfsHost->fieldCount )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->fieldCount )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1226,7 +1226,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1240,22 +1240,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_FIELDDISPLAY( w, sp ) --> lprfsHost->fieldDisplay )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->fieldDisplay )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1265,7 +1265,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1279,26 +1279,26 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_FIELDINFO( w, s1, s2, v ) --> lprfsHost->fieldInfo )( w, s1, s2, v ) )> $ARGUMENTS$ - + - + - + $RETURNS$ lprfsHost->fieldInfo )( w, s1, s2, v ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1308,7 +1308,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1322,24 +1322,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_FIELDNAME( w, i, bp ) --> lprfsHost->fieldName )( w, i, bp ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->fieldName )( w, i, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1349,7 +1349,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1363,10 +1363,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_FLUSH( w ) --> lprfsHost->flush )( w ) )> $ARGUMENTS$ @@ -1374,9 +1374,9 @@ $RETURNS$ lprfsHost->flush )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1386,7 +1386,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1400,22 +1400,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_GETREC( w, bpp ) --> lprfsHost->getRec )( w, bpp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->getRec )( w, bpp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1425,7 +1425,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1439,24 +1439,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_GETVALUE( w, i, v ) --> lprfsHost->getValue )( w, i, v ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->getValue )( w, i, v ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1466,7 +1466,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1480,24 +1480,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_GETVARLEN( w, i, lp ) --> lprfsHost->getVarLen )( w, i, lp ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->getVarLen )( w, i, lp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1507,7 +1507,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1521,10 +1521,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_GOCOLD( w ) --> lprfsHost->goCold )( w ) )> $ARGUMENTS$ @@ -1532,9 +1532,9 @@ $RETURNS$ lprfsHost->goCold )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1544,7 +1544,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1558,10 +1558,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_GOHOT( w ) --> lprfsHost->goHot )( w ) )> $ARGUMENTS$ @@ -1569,9 +1569,9 @@ $RETURNS$ lprfsHost->goHot )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1581,7 +1581,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1595,24 +1595,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_PUTVALUE( w, i, v ) --> lprfsHost->putValue )( w, i, v ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->putValue )( w, i, v ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1622,7 +1622,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1636,22 +1636,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_PUTREC( w, bp ) --> lprfsHost->putRec )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->putRec )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1661,7 +1661,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1675,10 +1675,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_RECALL( w ) --> lprfsHost->recall )( w ) )> $ARGUMENTS$ @@ -1686,9 +1686,9 @@ $RETURNS$ lprfsHost->recall )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1698,7 +1698,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1712,22 +1712,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_RECCOUNT( w, sp ) --> lprfsHost->reccount )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->reccount )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1737,7 +1737,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1751,26 +1751,26 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_RECINFO( w, v1, i, v2 ) --> lprfsHost->recInfo )( w, v1, i, v2 ) )> $ARGUMENTS$ - + - + - + $RETURNS$ lprfsHost->recInfo )( w, v1, i, v2 ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1780,7 +1780,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1794,22 +1794,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_RECNO( w, i ) --> lprfsHost->recno )( w, i ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->recno )( w, i ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1819,7 +1819,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1833,22 +1833,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SETFIELDEXTENT( w, s ) --> lprfsHost->setFieldExtent )( w, s ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->setFieldExtent )( w, s ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1858,7 +1858,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1872,22 +1872,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ALIAS( w, bp ) --> lprfsHost->alias )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->alias )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1897,7 +1897,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1911,10 +1911,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_CLOSE( w ) --> lprfsHost->close )( w ) )> $ARGUMENTS$ @@ -1922,9 +1922,9 @@ $RETURNS$ lprfsHost->close )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1934,7 +1934,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1948,22 +1948,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_CREATE( w, ip ) --> lprfsHost->create )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->create )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -1973,7 +1973,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -1987,24 +1987,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_INFO( w, i, g ) --> lprfsHost->info )( w, i, g ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->info )( w, i, g ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2014,7 +2014,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2028,10 +2028,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_NEW( w ) --> lprfsHost->newarea )( w ) )> $ARGUMENTS$ @@ -2039,9 +2039,9 @@ $RETURNS$ lprfsHost->newarea )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2051,7 +2051,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2065,22 +2065,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_OPEN( w, ip ) --> lprfsHost->open )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->open )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2090,7 +2090,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2104,10 +2104,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_RELEASE( w ) --> lprfsHost->release )( w ) )> $ARGUMENTS$ @@ -2115,9 +2115,9 @@ $RETURNS$ lprfsHost->release )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2127,7 +2127,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2141,22 +2141,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_STRUCTSIZE( w, sp ) --> lprfsHost->structSize )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->structSize )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2166,7 +2166,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2180,22 +2180,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SYSNAME( w, bp ) --> lprfsHost->sysName )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->sysName )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2205,7 +2205,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2219,22 +2219,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_DBEVAL( w, ip ) --> lprfsHost->dbEval )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->dbEval )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2244,7 +2244,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2258,10 +2258,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_PACK( w ) --> lprfsHost->pack )( w ) )> $ARGUMENTS$ @@ -2269,9 +2269,9 @@ $RETURNS$ lprfsHost->pack )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2281,7 +2281,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2295,24 +2295,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_PACKREC( w, l, sp ) --> lprfsHost->packRec )( w, l, sp ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->packRec )( w, l, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2322,7 +2322,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2336,22 +2336,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SORT( w, ip ) --> lprfsHost->sort )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->sort )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2361,7 +2361,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2375,22 +2375,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_TRANS( w, ip ) --> lprfsHost->trans )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->trans )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2400,7 +2400,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2414,22 +2414,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_TRANSREC( w, ip ) --> lprfsHost->transRec )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->transRec )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2439,7 +2439,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2453,10 +2453,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ZAP( w ) --> lprfsHost->zap )( w ) )> $ARGUMENTS$ @@ -2464,9 +2464,9 @@ $RETURNS$ lprfsHost->zap )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2476,7 +2476,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2490,22 +2490,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_CHILDEND( w, ip ) --> lprfsHost->childEnd )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->childEnd )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2515,7 +2515,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2529,22 +2529,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_CHILDSTART( w, ip ) --> lprfsHost->childStart )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->childStart )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2554,7 +2554,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2568,22 +2568,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_CHILDSYNC( w, ip ) --> lprfsHost->childSync )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->childSync )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2593,7 +2593,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2607,10 +2607,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SYNCCHILDREN( w ) --> lprfsHost->syncChildren )( w ) )> $ARGUMENTS$ @@ -2618,9 +2618,9 @@ $RETURNS$ lprfsHost->syncChildren )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2630,7 +2630,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2644,10 +2644,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_CLEARREL( w ) --> lprfsHost->clearRel )( w ) )> $ARGUMENTS$ @@ -2655,9 +2655,9 @@ $RETURNS$ lprfsHost->clearRel )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2667,7 +2667,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2681,10 +2681,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_FORCEREL( w ) --> lprfsHost->forceRel )( w ) )> $ARGUMENTS$ @@ -2692,9 +2692,9 @@ $RETURNS$ lprfsHost->forceRel )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2704,7 +2704,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2718,24 +2718,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_RELAREA( w, s, sp ) --> lprfsHost->relArea )( w, s, sp ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->relArea )( w, s, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2745,7 +2745,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2759,22 +2759,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_RELEVAL( w, ip ) --> lprfsHost->relEval )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->relEval )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2784,7 +2784,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2798,24 +2798,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_RELTEXT( w, s, bp ) --> lprfsHost->relText )( w, s, bp ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->relText )( w, s, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2825,7 +2825,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2839,22 +2839,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SETREL( w, ip ) --> lprfsHost->setRel )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->setRel )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2864,7 +2864,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2878,22 +2878,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDLSTADD( w, lp ) --> lprfsHost->orderListAdd )( w, lp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->orderListAdd )( w, lp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2903,7 +2903,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2917,22 +2917,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDLSTDELETE( w, lp ) --> lprfsHost->orderListDelete )( w, lp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->orderListDelete )( w, lp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2942,7 +2942,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2956,22 +2956,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDLSTFOCUS( w, lp ) --> lprfsHost->orderListFocus )( w, lp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->orderListFocus )( w, lp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -2981,7 +2981,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -2995,10 +2995,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDLSTREBUILD( w ) --> lprfsHost->orderListRebuild )( w ) )> $ARGUMENTS$ @@ -3006,9 +3006,9 @@ $RETURNS$ lprfsHost->orderListRebuild )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3018,7 +3018,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3032,10 +3032,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDLSTCLEAR( w ) --> lprfsHost->orderListClear )( w ) )> $ARGUMENTS$ @@ -3043,9 +3043,9 @@ $RETURNS$ lprfsHost->orderListClear )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3055,7 +3055,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3069,22 +3069,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDSETCOND( w, ip ) --> lprfsHost->orderCondition )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->orderCondition )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3094,7 +3094,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3108,22 +3108,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDCREATE( w, ip ) --> lprfsHost->orderCreate )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->orderCreate )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3133,7 +3133,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3147,22 +3147,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDDESTROY( w, p ) --> lprfsHost->orderDestroy )( w, p ) )> $ARGUMENTS$ - +

$RETURNS$ lprfsHost->orderDestroy )( w, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3172,7 +3172,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3186,24 +3186,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDINFO( w, i, p ) --> lprfsHost->orderInfo )( w, i, p ) )> $ARGUMENTS$ - + - +

$RETURNS$ lprfsHost->orderInfo )( w, i, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3213,7 +3213,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3227,22 +3227,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDEXPR( w, p ) --> lprfsHost->orderInfo )( w, DBOI_EXPRESSION, p ) )> $ARGUMENTS$ - +

$RETURNS$ lprfsHost->orderInfo )( w, DBOI_EXPRESSION, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3252,7 +3252,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3266,22 +3266,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDCOND( w, p ) --> lprfsHost->orderInfo )( w, DBOI_CONDITION, p ) )> $ARGUMENTS$ - +

$RETURNS$ lprfsHost->orderInfo )( w, DBOI_CONDITION, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3291,7 +3291,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3305,22 +3305,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDRECNO( w, p ) --> lprfsHost->orderInfo )( w, DBOI_RECNO, p ) )> $ARGUMENTS$ - +

$RETURNS$ lprfsHost->orderInfo )( w, DBOI_RECNO, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3330,7 +3330,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3344,22 +3344,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDPOS( w, p ) --> lprfsHost->orderInfo )( w, DBOI_POSITION, p ) )> $ARGUMENTS$ - +

$RETURNS$ lprfsHost->orderInfo )( w, DBOI_POSITION, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3369,7 +3369,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3383,22 +3383,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDNUMBER( w, p ) --> lprfsHost->orderInfo )( w, DBOI_NUMBER, p ) )> $ARGUMENTS$ - +

$RETURNS$ lprfsHost->orderInfo )( w, DBOI_NUMBER, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3408,7 +3408,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3422,22 +3422,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDNAME( w, p ) --> lprfsHost->orderInfo )( w, DBOI_NAME, p ) )> $ARGUMENTS$ - +

$RETURNS$ lprfsHost->orderInfo )( w, DBOI_NAME, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3447,7 +3447,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3461,22 +3461,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDBAGNAME( w, p ) --> lprfsHost->orderInfo )( w, DBOI_BAGNAME, p ) )> $ARGUMENTS$ - +

$RETURNS$ lprfsHost->orderInfo )( w, DBOI_BAGNAME, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3486,7 +3486,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3500,22 +3500,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ORDBAGEXT( w, p ) --> lprfsHost->orderInfo )( w, DBOI_BAGEXT, p ) )> $ARGUMENTS$ - +

$RETURNS$ lprfsHost->orderInfo )( w, DBOI_BAGEXT, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3525,7 +3525,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3539,10 +3539,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_CLEARFILTER( w ) --> lprfsHost->clearFilter )( w ) )> $ARGUMENTS$ @@ -3550,9 +3550,9 @@ $RETURNS$ lprfsHost->clearFilter )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3562,7 +3562,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3576,10 +3576,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_CLEARLOCATE( w ) --> lprfsHost->clearLocate )( w ) )> $ARGUMENTS$ @@ -3587,9 +3587,9 @@ $RETURNS$ lprfsHost->clearLocate )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3599,7 +3599,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3613,10 +3613,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_CLEARSCOPE( w ) --> lprfsHost->clearScope )( w ) )> $ARGUMENTS$ @@ -3624,9 +3624,9 @@ $RETURNS$ lprfsHost->clearScope )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3636,7 +3636,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3650,24 +3650,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_COUNTSCOPE( w, ip, lp ) --> lprfsHost->countScope )( w, ip, lp ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->countScope )( w, ip, lp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3677,7 +3677,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3691,22 +3691,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_FILTERTEXT( w, bp ) --> lprfsHost->filterText )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->filterText )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3716,7 +3716,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3730,24 +3730,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SCOPEINFO( w, i, v ) --> lprfsHost->scopeInfo )( w, i, v ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->scopeInfo )( w, i, v ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3757,7 +3757,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3771,22 +3771,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SETFILTER( w, ip ) --> lprfsHost->setFilter )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->setFilter )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3796,7 +3796,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3810,22 +3810,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SETLOCATE( w, ip ) --> lprfsHost->setLocate )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->setLocate )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3835,7 +3835,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3849,22 +3849,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SETSCOPE( w, ip ) --> lprfsHost->setScope )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->setScope )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3874,7 +3874,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3888,24 +3888,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SKIPSCOPE( w, bp, l ) --> lprfsHost->skipScope )( w, bp, l ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->skipScope )( w, bp, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3915,7 +3915,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3929,22 +3929,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_COMPILE( w, bp ) --> lprfsHost->compile )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->compile )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3954,7 +3954,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -3968,22 +3968,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_ERROR( w, ip ) --> lprfsHost->error )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->error )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -3993,7 +3993,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4007,22 +4007,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_EVALBLOCK( w, v ) --> lprfsHost->evalBlock )( w, v ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->evalBlock )( w, v ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4032,7 +4032,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4046,22 +4046,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_GETLOCKS( w, g ) --> lprfsHost->info )( w, DBI_GETLOCKARRAY, g ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->info )( w, DBI_GETLOCKARRAY, g ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4071,7 +4071,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4085,24 +4085,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_RAWLOCK( w, i, l ) --> lprfsHost->rawlock )( w, i, l ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->rawlock )( w, i, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4112,7 +4112,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4126,22 +4126,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_LOCK( w, sp ) --> lprfsHost->lock )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->lock )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4151,7 +4151,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4165,22 +4165,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_UNLOCK( w, l ) --> lprfsHost->unlock )( w, l ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->unlock )( w, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4190,7 +4190,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4204,10 +4204,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_CLOSEMEMFILE( w ) --> lprfsHost->closeMemFile )( w ) )> $ARGUMENTS$ @@ -4215,9 +4215,9 @@ $RETURNS$ lprfsHost->closeMemFile )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4227,7 +4227,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4241,22 +4241,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_CREATEMEMFILE( w, bp ) --> lprfsHost->createMemFile )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->createMemFile )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4266,7 +4266,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4280,24 +4280,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_GETVALUEFILE( w, i, bp ) --> lprfsHost->getValueFile )( w, i, bp ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->getValueFile )( w, i, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4307,7 +4307,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4321,22 +4321,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_OPENMEMFILE( w, bp ) --> lprfsHost->openMemFile )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->openMemFile )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4346,7 +4346,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4360,24 +4360,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_PUTVALUEFILE( w, i, bp ) --> lprfsHost->putValueFile )( w, i, bp ) )> $ARGUMENTS$ - + - + $RETURNS$ lprfsHost->putValueFile )( w, i, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4387,7 +4387,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4401,10 +4401,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_READDBHEADER( w ) --> lprfsHost->readDBHeader )( w ) )> $ARGUMENTS$ @@ -4412,9 +4412,9 @@ $RETURNS$ lprfsHost->readDBHeader )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4424,7 +4424,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4438,10 +4438,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_WRITEDBHEADER( w ) --> lprfsHost->writeDBHeader )( w ) )> $ARGUMENTS$ @@ -4449,9 +4449,9 @@ $RETURNS$ lprfsHost->writeDBHeader )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4461,7 +4461,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4475,22 +4475,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_RECSIZE( w, lp ) --> lprfsHost->info )( w, DBI_GETRECSIZE, lp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->info )( w, DBI_GETRECSIZE, lp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4500,7 +4500,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4514,22 +4514,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_HEADERSIZE( w, fp ) --> lprfsHost->info )( w, DBI_GETHEADERSIZE, fp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->info )( w, DBI_GETHEADERSIZE, fp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4539,7 +4539,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4553,22 +4553,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_LUPDATE( w, fp ) --> lprfsHost->info )( w, DBI_LASTUPDATE, fp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->info )( w, DBI_LASTUPDATE, fp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4578,7 +4578,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4592,22 +4592,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_SETDELIM( w, fp ) --> lprfsHost->info )( w, DBI_SETDELIMITER, fp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->info )( w, DBI_SETDELIMITER, fp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4617,7 +4617,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4631,22 +4631,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_GETDELIM( w, fp ) --> lprfsHost->info )( w, DBI_GETDELIMITER, fp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->info )( w, DBI_GETDELIMITER, fp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4656,7 +4656,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4670,22 +4670,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SELF_TABLEEXT( w, fp ) --> lprfsHost->info )( w, DBI_TABLEEXT, fp ) )> $ARGUMENTS$ - + $RETURNS$ lprfsHost->info )( w, DBI_TABLEEXT, fp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4695,7 +4695,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4709,22 +4709,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_BOF( w, sp ) --> bof )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ bof )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4734,7 +4734,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4748,22 +4748,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_EOF( w, sp ) --> eof )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ eof )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4773,7 +4773,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4787,22 +4787,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_FOUND( w, sp ) --> found )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ found )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4812,7 +4812,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4826,22 +4826,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_GOTO( w, l ) --> go )( w, l ) )> $ARGUMENTS$ - + $RETURNS$ go )( w, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4851,7 +4851,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4865,22 +4865,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_GOTOID( w, sp ) --> goToId )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ goToId )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4890,7 +4890,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4904,10 +4904,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_GOBOTTOM( w ) --> goBottom )( w ) )> $ARGUMENTS$ @@ -4915,9 +4915,9 @@ $RETURNS$ goBottom )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4927,7 +4927,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4941,10 +4941,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_GOTOP( w ) --> goTop )( w ) )> $ARGUMENTS$ @@ -4952,9 +4952,9 @@ $RETURNS$ goTop )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -4964,7 +4964,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -4978,26 +4978,26 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SEEK( w, i1, v, i2 ) --> seek )( w, i1, v, i2 ) )> $ARGUMENTS$ - + - + - + $RETURNS$ seek )( w, i1, v, i2 ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5007,7 +5007,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5021,22 +5021,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SKIP( w, l ) --> skip )( w, l ) )> $ARGUMENTS$ - + $RETURNS$ skip )( w, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5046,7 +5046,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5060,22 +5060,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SKIPFILTER( w, l ) --> skipFilter )( w, l ) )> $ARGUMENTS$ - + $RETURNS$ skipFilter )( w, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5085,7 +5085,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5099,22 +5099,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SKIPRAW( w, l ) --> skipRaw )( w, l ) )> $ARGUMENTS$ - + $RETURNS$ skipRaw )( w, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5124,7 +5124,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5138,22 +5138,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ADDFIELD( w, ip ) --> addField )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ addField )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5163,7 +5163,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5177,22 +5177,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_APPEND( w, l ) --> append )( w, l ) )> $ARGUMENTS$ - + $RETURNS$ append )( w, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5202,7 +5202,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5216,22 +5216,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_CREATEFIELDS( w, v ) --> createFields )( w, v ) )> $ARGUMENTS$ - + $RETURNS$ createFields )( w, v ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5241,7 +5241,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5255,10 +5255,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_DELETE( w ) --> deleterec )( w ) )> $ARGUMENTS$ @@ -5266,9 +5266,9 @@ $RETURNS$ deleterec )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5278,7 +5278,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5292,22 +5292,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_DELETED( w, sp ) --> deleted )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ deleted )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5317,7 +5317,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5331,22 +5331,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_FIELDCOUNT( w, sp ) --> fieldCount )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ fieldCount )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5356,7 +5356,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5370,22 +5370,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_FIELDDISPLAY( w, sp ) --> fieldDisplay )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ fieldDisplay )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5395,7 +5395,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5409,26 +5409,26 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_FIELDINFO( w, s1, s2, v ) --> fieldInfo )( w, s1, s2, v ) )> $ARGUMENTS$ - + - + - + $RETURNS$ fieldInfo )( w, s1, s2, v ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5438,7 +5438,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5452,24 +5452,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_FIELDNAME( w, i, bp ) --> fieldName )( w, i, bp ) )> $ARGUMENTS$ - + - + $RETURNS$ fieldName )( w, i, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5479,7 +5479,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5493,10 +5493,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_FLUSH( w ) --> flush )( w ) )> $ARGUMENTS$ @@ -5504,9 +5504,9 @@ $RETURNS$ flush )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5516,7 +5516,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5530,22 +5530,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_GETREC( w, bpp ) --> getRec )( w, bpp ) )> $ARGUMENTS$ - + $RETURNS$ getRec )( w, bpp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5555,7 +5555,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5569,24 +5569,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_GETVALUE( w, i, v ) --> getValue )( w, i, v ) )> $ARGUMENTS$ - + - + $RETURNS$ getValue )( w, i, v ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5596,7 +5596,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5610,24 +5610,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_GETVARLEN( w, i, lp ) --> getVarLen )( w, i, lp ) )> $ARGUMENTS$ - + - + $RETURNS$ getVarLen )( w, i, lp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5637,7 +5637,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5651,10 +5651,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_GOCOLD( w ) --> goCold )( w ) )> $ARGUMENTS$ @@ -5662,9 +5662,9 @@ $RETURNS$ goCold )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5674,7 +5674,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5688,10 +5688,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_GOHOT( w ) --> goHot )( w ) )> $ARGUMENTS$ @@ -5699,9 +5699,9 @@ $RETURNS$ goHot )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5711,7 +5711,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5725,24 +5725,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_PUTVALUE( w, i, v ) --> putValue )( w, i, v ) )> $ARGUMENTS$ - + - + $RETURNS$ putValue )( w, i, v ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5752,7 +5752,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5766,22 +5766,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_PUTREC( w, bp ) --> putRec )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ putRec )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5791,7 +5791,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5805,10 +5805,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_RECALL( w ) --> recall )( w ) )> $ARGUMENTS$ @@ -5816,9 +5816,9 @@ $RETURNS$ recall )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5828,7 +5828,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5842,22 +5842,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_RECCOUNT( w, sp ) --> reccount )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ reccount )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5867,7 +5867,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5881,26 +5881,26 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_RECINFO( w, v1, i, v2 ) --> recInfo )( w, v1, i, v2 ) )> $ARGUMENTS$ - + - + - + $RETURNS$ recInfo )( w, v1, i, v2 ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5910,7 +5910,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5924,22 +5924,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_RECNO( w, sp ) --> recno )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ recno )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5949,7 +5949,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -5963,22 +5963,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SETFIELDEXTENT( w, s ) --> setFieldExtent )( w, s ) )> $ARGUMENTS$ - + $RETURNS$ setFieldExtent )( w, s ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -5988,7 +5988,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6002,22 +6002,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ALIAS( w, bp ) --> alias )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ alias )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6027,7 +6027,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6041,10 +6041,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_CLOSE( w ) --> close )( w ) )> $ARGUMENTS$ @@ -6052,9 +6052,9 @@ $RETURNS$ close )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6064,7 +6064,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6078,22 +6078,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_CREATE( w, ip ) --> create )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ create )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6103,7 +6103,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6117,24 +6117,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_INFO( w, i, g ) --> info )( w, i, g ) )> $ARGUMENTS$ - + - + $RETURNS$ info )( w, i, g ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6144,7 +6144,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6158,10 +6158,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_NEW( w ) --> newarea )( w ) )> $ARGUMENTS$ @@ -6169,9 +6169,9 @@ $RETURNS$ newarea )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6181,7 +6181,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6195,22 +6195,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_OPEN( w, ip ) --> open )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ open )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6220,7 +6220,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6234,10 +6234,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_RELEASE( w ) --> release )( w ) )> $ARGUMENTS$ @@ -6245,9 +6245,9 @@ $RETURNS$ release )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6257,7 +6257,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6271,22 +6271,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_STRUCTSIZE( w, sp ) --> structSize )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ structSize )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6296,7 +6296,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6310,22 +6310,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SYSNAME( w, bp ) --> sysName )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ sysName )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6335,7 +6335,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6349,22 +6349,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_DBEVAL( w, ip ) --> dbEval )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ dbEval )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6374,7 +6374,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6388,10 +6388,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_PACK( w ) --> pack )( w ) )> $ARGUMENTS$ @@ -6399,9 +6399,9 @@ $RETURNS$ pack )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6411,7 +6411,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6425,24 +6425,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_PACKREC( w, l, sp ) --> packRec )( w, l, sp ) )> $ARGUMENTS$ - + - + $RETURNS$ packRec )( w, l, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6452,7 +6452,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6466,22 +6466,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SORT( w, ip ) --> sort )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ sort )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6491,7 +6491,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6505,22 +6505,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_TRANS( w, ip ) --> trans )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ trans )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6530,7 +6530,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6544,22 +6544,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_TRANSREC( w, ip ) --> transRec )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ transRec )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6569,7 +6569,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6583,10 +6583,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ZAP( w ) --> zap )( w ) )> $ARGUMENTS$ @@ -6594,9 +6594,9 @@ $RETURNS$ zap )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6606,7 +6606,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6620,22 +6620,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_CHILDEND( w, ip ) --> childEnd )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ childEnd )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6645,7 +6645,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6659,22 +6659,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_CHILDSTART( w, ip ) --> childStart )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ childStart )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6684,7 +6684,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6698,22 +6698,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_CHILDSYNC( w, ip ) --> childSync )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ childSync )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6723,7 +6723,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6737,10 +6737,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SYNCCHILDREN( w ) --> syncChildren )( w ) )> $ARGUMENTS$ @@ -6748,9 +6748,9 @@ $RETURNS$ syncChildren )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6760,7 +6760,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6774,10 +6774,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_CLEARREL( w ) --> clearRel )( w ) )> $ARGUMENTS$ @@ -6785,9 +6785,9 @@ $RETURNS$ clearRel )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6797,7 +6797,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6811,10 +6811,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_FORCEREL( w ) --> forceRel )( w ) )> $ARGUMENTS$ @@ -6822,9 +6822,9 @@ $RETURNS$ forceRel )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6834,7 +6834,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6848,24 +6848,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_RELAREA( w, s, sp ) --> relArea )( w, s, sp ) )> $ARGUMENTS$ - + - + $RETURNS$ relArea )( w, s, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6875,7 +6875,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6889,22 +6889,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_RELEVAL( w, ip ) --> relEval )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ relEval )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6914,7 +6914,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6928,24 +6928,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_RELTEXT( w, s, bp ) --> relText )( w, s, bp ) )> $ARGUMENTS$ - + - + $RETURNS$ relText )( w, s, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6955,7 +6955,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -6969,22 +6969,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SETREL( w, ip ) --> setRel )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ setRel )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -6994,7 +6994,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7008,22 +7008,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDLSTADD( w, lp ) --> orderListAdd )( w, lp ) )> $ARGUMENTS$ - + $RETURNS$ orderListAdd )( w, lp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7033,7 +7033,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7047,22 +7047,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDLSTDELETE( w, lp ) --> orderListDelete )( w, lp ) )> $ARGUMENTS$ - + $RETURNS$ orderListDelete )( w, lp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7072,7 +7072,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7086,22 +7086,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDLSTFOCUS( w, lp ) --> orderListFocus )( w, lp ) )> $ARGUMENTS$ - + $RETURNS$ orderListFocus )( w, lp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7111,7 +7111,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7125,10 +7125,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDLSTREBUILD( w ) --> orderListRebuild )( w ) )> $ARGUMENTS$ @@ -7136,9 +7136,9 @@ $RETURNS$ orderListRebuild )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7148,7 +7148,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7162,10 +7162,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDLSTCLEAR( w ) --> orderListClear )( w ) )> $ARGUMENTS$ @@ -7173,9 +7173,9 @@ $RETURNS$ orderListClear )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7185,7 +7185,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7199,22 +7199,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDSETCOND( w, ip ) --> orderCondition )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ orderCondition )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7224,7 +7224,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7238,22 +7238,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDCREATE( w, ip ) --> orderCreate )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ orderCreate )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7263,7 +7263,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7277,22 +7277,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDDELETE( w, ip ) --> orderDelete )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ orderDelete )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7302,7 +7302,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7316,24 +7316,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDINFO( w, i, p ) --> orderInfo )( w, i, p ) )> $ARGUMENTS$ - + - +

$RETURNS$ orderInfo )( w, i, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7343,7 +7343,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7357,22 +7357,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDEXPR( w, p ) --> orderInfo )( w, DBOI_EXPRESSION, p ) )> $ARGUMENTS$ - +

$RETURNS$ orderInfo )( w, DBOI_EXPRESSION, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7382,7 +7382,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7396,22 +7396,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDCOND( w, p ) --> orderInfo )( w, DBOI_CONDITION, p ) )> $ARGUMENTS$ - +

$RETURNS$ orderInfo )( w, DBOI_CONDITION, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7421,7 +7421,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7435,22 +7435,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDRECNO( w, p ) --> orderInfo )( w, DBOI_RECNO, p ) )> $ARGUMENTS$ - +

$RETURNS$ orderInfo )( w, DBOI_RECNO, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7460,7 +7460,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7474,22 +7474,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDPOS( w, p ) --> orderInfo )( w, DBOI_POSITION, p ) )> $ARGUMENTS$ - +

$RETURNS$ orderInfo )( w, DBOI_POSITION, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7499,7 +7499,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7513,22 +7513,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDNUMBER( w, p ) --> orderInfo )( w, DBOI_NUMBER, p ) )> $ARGUMENTS$ - +

$RETURNS$ orderInfo )( w, DBOI_NUMBER, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7538,7 +7538,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7552,22 +7552,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDNAME( w, p ) --> orderInfo )( w, DBOI_NAME, p ) )> $ARGUMENTS$ - +

$RETURNS$ orderInfo )( w, DBOI_NAME, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7577,7 +7577,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7591,22 +7591,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDBAGNAME( w, p ) --> orderInfo )( w, DBOI_BAGNAME, p ) )> $ARGUMENTS$ - +

$RETURNS$ orderInfo )( w, DBOI_BAGNAME, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7616,7 +7616,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7630,22 +7630,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ORDBAGEXT( w, p ) --> orderInfo )( w, DBOI_BAGEXT, p ) )> $ARGUMENTS$ - +

$RETURNS$ orderInfo )( w, DBOI_BAGEXT, p ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7655,7 +7655,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7669,10 +7669,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_CLEARFILTER( w ) --> clearFilter )( w ) )> $ARGUMENTS$ @@ -7680,9 +7680,9 @@ $RETURNS$ clearFilter )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7692,7 +7692,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7706,10 +7706,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_CLEARLOCATE( w ) --> clearLocate )( w ) )> $ARGUMENTS$ @@ -7717,9 +7717,9 @@ $RETURNS$ clearLocate )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7729,7 +7729,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7743,10 +7743,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_CLEARSCOPE( w ) --> clearScope )( w ) )> $ARGUMENTS$ @@ -7754,9 +7754,9 @@ $RETURNS$ clearScope )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7766,7 +7766,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7780,24 +7780,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_COUNTSCOPE( w, ip, lp ) --> countScope )( w, ip, lp ) )> $ARGUMENTS$ - + - + $RETURNS$ countScope )( w, ip, lp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7807,7 +7807,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7821,22 +7821,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_FILTERTEXT( w, bp ) --> filterText )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ filterText )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7846,7 +7846,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7860,24 +7860,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SCOPEINFO( w, i, v ) --> scopeInfo )( w, i, v ) )> $ARGUMENTS$ - + - + $RETURNS$ scopeInfo )( w, i, v ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7887,7 +7887,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7901,22 +7901,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SETFILTER( w, ip ) --> setFilter )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ setFilter )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7926,7 +7926,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7940,22 +7940,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SETLOCATE( w, ip ) --> setLocate )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ setLocate )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -7965,7 +7965,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -7979,22 +7979,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SETSCOPE( w, ip ) --> setScope )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ setScope )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8004,7 +8004,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8018,24 +8018,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SKIPSCOPE( w, bp, l ) --> skipScope )( w, bp, l ) )> $ARGUMENTS$ - + - + $RETURNS$ skipScope )( w, bp, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8045,7 +8045,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8059,22 +8059,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_COMPILE( w, bp ) --> compile )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ compile )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8084,7 +8084,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8098,22 +8098,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_ERROR( w, ip ) --> error )( w, ip ) )> $ARGUMENTS$ - + $RETURNS$ error )( w, ip ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8123,7 +8123,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8137,22 +8137,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_EVALBLOCK( w, v ) --> evalBlock )( w, v ) )> $ARGUMENTS$ - + $RETURNS$ evalBlock )( w, v ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8162,7 +8162,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8176,22 +8176,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_GETLOCKS( w, g ) --> info )( w, DBI_GETLOCKARRAY, g ) )> $ARGUMENTS$ - + $RETURNS$ info )( w, DBI_GETLOCKARRAY, g ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8201,7 +8201,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8215,24 +8215,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_RAWLOCK( w, i, l ) --> rawlock )( w, i, l ) )> $ARGUMENTS$ - + - + $RETURNS$ rawlock )( w, i, l ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8242,7 +8242,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8256,22 +8256,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_LOCK( w, sp ) --> lock )( w, sp ) )> $ARGUMENTS$ - + $RETURNS$ lock )( w, sp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8281,7 +8281,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8295,10 +8295,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_UNLOCK( w ) --> unlock )( w ) )> $ARGUMENTS$ @@ -8306,9 +8306,9 @@ $RETURNS$ unlock )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8318,7 +8318,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8332,10 +8332,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_CLOSEMEMFILE( w ) --> closeMemFile )( w ) )> $ARGUMENTS$ @@ -8343,9 +8343,9 @@ $RETURNS$ closeMemFile )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8355,7 +8355,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8369,22 +8369,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_CREATEMEMFILE( w, bp ) --> createMemFile )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ createMemFile )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8394,7 +8394,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8408,24 +8408,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_GETVALUEFILE( w, i, bp ) --> getValueFile )( w, i, bp ) )> $ARGUMENTS$ - + - + $RETURNS$ getValueFile )( w, i, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8435,7 +8435,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8449,22 +8449,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_OPENMEMFILE( w, bp ) --> openMemFile )( w, bp ) )> $ARGUMENTS$ - + $RETURNS$ openMemFile )( w, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8474,7 +8474,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8488,24 +8488,24 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_PUTVALUEFILE( w, i, bp ) --> putValueFile )( w, i, bp ) )> $ARGUMENTS$ - + - + $RETURNS$ putValueFile )( w, i, bp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8515,7 +8515,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8529,10 +8529,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_READDBHEADER( w ) --> readDBHeader )( w ) )> $ARGUMENTS$ @@ -8540,9 +8540,9 @@ $RETURNS$ readDBHeader )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8552,7 +8552,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8566,10 +8566,10 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_WRITEDBHEADER( w ) --> writeDBHeader )( w ) )> $ARGUMENTS$ @@ -8577,9 +8577,9 @@ $RETURNS$ writeDBHeader )( w ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8589,7 +8589,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8603,22 +8603,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_RECSIZE( w, lp ) --> info )( w, DBI_GETRECSIZE, lp ) )> $ARGUMENTS$ - + $RETURNS$ info )( w, DBI_GETRECSIZE, lp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8628,7 +8628,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8642,22 +8642,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_HEADERSIZE( w, fp ) --> info )( w, DBI_GETHEADERSIZE, fp ) )> $ARGUMENTS$ - + $RETURNS$ info )( w, DBI_GETHEADERSIZE, fp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8667,7 +8667,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8681,22 +8681,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_LUPDATE( w, fp ) --> info )( w, DBI_LASTUPDATE, fp ) )> $ARGUMENTS$ - + $RETURNS$ info )( w, DBI_LASTUPDATE, fp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8706,7 +8706,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8720,22 +8720,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_SETDELIM( w, fp ) --> info )( w, DBI_SETDELIMITER, fp ) )> $ARGUMENTS$ - + $RETURNS$ info )( w, DBI_SETDELIMITER, fp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8745,7 +8745,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8759,22 +8759,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_GETDELIM( w, fp ) --> info )( w, DBI_GETDELIMITER, fp ) )> $ARGUMENTS$ - + $RETURNS$ info )( w, DBI_GETDELIMITER, fp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8784,7 +8784,7 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ @@ -8798,22 +8798,22 @@ $SUBCATEGORY$ RDD $ONELINER$ - + $SYNTAX$ C Prototype (macro definition) - + #include "hbapirdd.h" SUPER_TABLEEXT( w, fp ) --> info )( w, DBI_TABLEEXT, fp ) )> $ARGUMENTS$ - + $RETURNS$ info )( w, DBI_TABLEEXT, fp ) )> $DESCRIPTION$ - + $EXAMPLES$ - + $STATUS$ R $COMPLIANCE$ @@ -8823,6 +8823,6 @@ $PLATFORMS$ All $SEEALSO$ - + $END$ */ diff --git a/harbour/doc/en/hbflock.txt b/harbour/doc/en/hbflock.txt index c05cff980a..d5929e82b3 100644 --- a/harbour/doc/en/hbflock.txt +++ b/harbour/doc/en/hbflock.txt @@ -18,11 +18,11 @@ --> $ARGUMENTS$ Dos file handle - + set> Offset of the first byte of the region to be locked. - + Number of bytes to be locked. - + e> The type (read or write) of lock requested. $RETURNS$ .T. if the lock was obtained, else .F. @@ -30,16 +30,16 @@ This function attempts to lock a region of the file whose file handle is . This is a low level file function. To lock Harbour data files use either the FLOCK() or RLOCK() function. - + The value of is obtained from either a call to the FOPEN() or the FCREATE() function. - + is the offset (from the beginning of the file) to the first of the region to be locked. (Offsets from the current position nd of file are not currently supported.) - + is the length of the region to be locked in bytes. - + e> is the type of lock requested. There are two types of locks: sive write locks ( = 0x0000 ) - the default, and shared locks( = 0x0100 ). Additionally you can specify a @@ -74,12 +74,12 @@ Unlocks part or all of any file $SYNTAX$ HB_FUNLOCK( , , ) --> - + $ARGUMENTS$ Dos file handle - + set> Offset of the first byte of the region to be locked. - + Number of bytes to be locked. $RETURNS$ .T. if the lock was removed, else .F. @@ -87,14 +87,14 @@ This function attempts to unlock a region of the file whose file handle is . This is a low level file function. To unlock Harbour data files use the DBUNLOCK() function. - + The value of is obtained from either a call to the FOPEN() or the FCREATE() function. - + is the offset (from the beginning of the file) to the first of the region to be unlocked. (Offsets from the current position nd of file are not currently supported.) - + is the length of the region to be unlocked in bytes. $EXAMPLES$ refer to tfl.prg diff --git a/harbour/doc/en/idle.txt b/harbour/doc/en/idle.txt index dbb76d736e..c04c60f10f 100644 --- a/harbour/doc/en/idle.txt +++ b/harbour/doc/en/idle.txt @@ -17,17 +17,17 @@ state is entered during INKEY() calls currently. All applications that don't use INKEY() function call can signal the idle states with the call of HB_IDLESTATE() function (or hb_idleState() on C level). - + During idle states the virtual machine calls the garbage collector and it can call user defined actions (background tasks). It also releases the CPU time slices for some poor platforms that are not smart enough to detect it automatically. - + For defining the background tasks see the HB_IDLEADD() and HB_IDLEDEL() functions. - + For direct call for background actions see HB_IDLESTATE() function. - + For signaling the idle state from C code see the hb_idleState() API function. $SEEALSO$ @@ -95,7 +95,7 @@ HB_IDLEDEL() removes the action associated with passed identifier from the list of background tasks. The identifer should be the value returned by the previous call of HB_IDLEADD() function. - + If specified task is defined then the codeblock is returned otherwise the NIL value is returned. $EXAMPLES$ @@ -134,7 +134,7 @@ HB_IDLEADD() function. Every call to this function evaluates a different task in the order of task creation. There are no arguments passed during a codeblock evaluation. - + This function can be safely called even if there are no background tasks defined. $EXAMPLES$ @@ -178,14 +178,14 @@ executes a single background task defined by the codeblock passed with HB_IDLEADD() function. It also releases the CPU time slices for platforms that require it. - + Every call for this function evaluates different task in the order of task creation. There are no arguments passed during codeblock evaluation. - + This function can be safely called even if there are no background tasks defined. - + This function is automatically called from the INKEY() function. $STATUS$ R diff --git a/harbour/doc/en/macro.txt b/harbour/doc/en/macro.txt index 82965ac599..40301f7947 100644 --- a/harbour/doc/en/macro.txt +++ b/harbour/doc/en/macro.txt @@ -16,7 +16,7 @@ $DESCRIPTION$ Invoking the macro compiler: ============================== - + &variable or &( expression ) @@ -40,7 +40,7 @@ HB_SETMACRO( , [] ) --> $ARGUMENTS$ One of the HB_SM_* constants defined in set.ch. - + .T. to enable or .F. to disable a feature $RETURNS$ HB_SETMACRO() return the old state of requested feature. @@ -49,22 +49,22 @@ compiler. The Harbour is extending the macro features compared to an original set available in CA-Cl*pper. Enabling/disabling some of them allows to keep strict CA-Cl*pper compatibility. - + Available features are: HB_SM_HARBOUR - enables harbour extensions: operators: ++, --, +=, -=, *=, /=, ^= objects: assigments to an instance variable - + HB_SM_XBASE - enables other Xbase++ dialects extensions: expanding of expresions lists - + HB_SM_SHORTCUTS - enables optimized evaluation of logical operators (.and., .or.) - + HB_SM_PREPROC - enables preprocessing of commands This is meaningfull if Harbour is compiled with HB_MACRO_STATEMENTS flag - + $EXAMPLES$ INIT PROCEDURE IWANTCLIPPER() HB_SETMACRO( HB_SM_HARBOUR, .F. ) diff --git a/harbour/doc/en/memvar2.txt b/harbour/doc/en/memvar2.txt index 3febd2b8a4..447476cbc3 100644 --- a/harbour/doc/en/memvar2.txt +++ b/harbour/doc/en/memvar2.txt @@ -17,9 +17,9 @@ FIELD [, [in ] $ARGUMENTS$ A valid field name - + Additional field name - + An valid alias name $DESCRIPTION$ This command declares the names of fields (and and @@ -70,7 +70,7 @@ LOCAL [:= ] $ARGUMENTS$ Name of a memory variable or array. - + Value to be assinged to a variable or array $DESCRIPTION$ This command created a LOCAL memory variable or array. The name @@ -80,25 +80,25 @@ expression may be specified in and folling. Is Strong type compile mode is used, the Compiler will check if the value recived matchs the type specified in . - + LOCAL varibles are symbols generated at run time and are resolved at compile time. The visibility and life span of a LOCAL variable or array is limited to the function or procedure in which it is defined. - + No macro expansions are allowed in the LOCAL declaration statement. - + No Harbour command other then FUNCTION, PROCEDURE, PUBLIC, PRIVATE, PARAMETERS, MEMVAR, STATIC and FIELD, may precede the LOCAL command. - + LOCAL array reference may not be initialized (i.e., assigned values) on the same command line as the LOCAL command statement. This can be done later in the program. - + LOCAL variables and arrays are not affected by the RELEASE command. $EXAMPLES$ PROCEDURE Main() LOCAL n, lVar - + n := iif( lVar, "A", 3 ) n := 2 n := "a" @@ -142,7 +142,7 @@ those memory variables that do not contain any such explicit are affected by this command. Those memory variabls within macro expansions are not affected by this command. - + The MEMVAR declaration must apear before any executable commands;it is similat to the LOCAL,STATIC,FIELD,PARAMETERS,FUNCTION, and PROCEDURE commands statements. @@ -150,7 +150,7 @@ MEMVAR y AS NUMERIC PROCEDURE Main() LOCAL n, lVar - + n := iif( lVar, "A", 3 ) n := 2 n := "a" diff --git a/harbour/doc/en/readme.txt b/harbour/doc/en/readme.txt index 696834f639..7e82cb4b2d 100644 --- a/harbour/doc/en/readme.txt +++ b/harbour/doc/en/readme.txt @@ -13,36 +13,36 @@ HARBOUR Read me $DESCRIPTION$ The Harbour project - + ************************************************************************ * This file contains information on obtaining, installing, and using * * Harbour. Please read it *completely* before asking for help. * ************************************************************************ - + Harbour is a free implementation of an xBase language compiler. It is designed to be source code compatible with the CA-Cl*pper(r) compiler. That means that if you've got some code that would compile using CA-Cl*pper(r) then it should compile under Harbour. The Harbour-Project web page is: - + http://harbour-project.org/ - + Status and other information is always available from the web site. There is a Harbour mailing list. Harbour is still at a very early stage of development, so the mailing list is very much a Developers only list, although every body is welcome to join in the discussions. - + We would like you to join the Harbour development team. If you are interested you may suscribe to our mailing list and start contributing to this free public project. - + Please feel free to report all questions, ideas, suggestions, fixes, code, etc. you may need and want. With the help of all of you, the Harbour compiler and runtime libraries will become a reality very soon. - + What this distribution contains =============================== - + This distribution is a Source code only distribution. It does not contain any executable files. Executable versions of Harbour are available from the web site. Executable versions of Harbour DO NOT create runable @@ -51,53 +51,53 @@ in order to create a functioning program. Please test running Harbour against your CA-Cl*pper source code and report any problems that might occur. - + Very important: The preprocessor functionality is now working. - + Installation ------------ - + 1. Unzip with Harbour zip file using pkunzip or equivalent. - + E.G. pkunzip -d build72.zip - + This will create Harbour/ directory and all the relevant sub directories. - + 2. Compile Harbour using your C compiler. Make files for different platforms are included in the directory. - + --- COPYRIGHT --- - + What copyright information do we have - + --- LICENCE --- - + Information about the License for usage of Harbour is available in the file licence.txt (when we have a license) - + --- DISCLAIMER --- - + Participants of The Harbour Project assume no responsibility for errors or omissions in these materials. - + THESE MATERIALS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. - + Participants of The Harbour Project further do not warrant the accuracy or completeness of the code, information, text, output or any other items contained within these materials. Participants of The Harbour Project shall not be liable for any special, direct, indirect, incidental, or consequential damages, including without limitation, lost revenues or lost profits, which may result from the use or mis-use of these materials. - + The information in The Harbour Project is subject to change without notice and does not represent any future commitment by the participants of The Harbour Project. - + The Harbour Project - + $SEEALSO$ License $END$ diff --git a/harbour/doc/en/sayget.txt b/harbour/doc/en/sayget.txt index 256a642fdf..f929f6b76e 100644 --- a/harbour/doc/en/sayget.txt +++ b/harbour/doc/en/sayget.txt @@ -19,44 +19,44 @@ [VALID / RANGE ,] $ARGUMENTS$ The row coordinate. - + The column coordinate. - + Message to display. - + Character expression of PICTURE displayed. - + Color to be Used for the SAY expression. - + An variable/field name. - + Character expression of PICTURE to get. - + Logical expression to allow GET. - + Logical expression to validate GET input. - + Lower RANGE value. - + Upper RANGE value. - + Color string to be used for the GET expression. $DESCRIPTION$ This command adds a GET object to the reserved array variable named GETLIST[] and displays it to the screen. The field or variable to be added to the GET object is specified in and is displayed at row, column coordinate , . - + If the SAY clause is used will be displayed starting at ,, with the field variable displayed at ROW(), COL()+ 1. If , the picture template for the SAY expression , is used, all formatting rules contained will apply See the TRANSFORM I function for further information. - + If is specified, the PICTURE clause of will be used for the GET object and all formatting rules will apply. See the table below for GET formatting rules. - + If the WHEN clause is specified,when evaluates to a logical true (.T.) condition, the GET object will he activated otherwise the GET object will be skipped and no information will be obtained via @@ -64,7 +64,7 @@ true (.T.) or false ( F.) or a code block may be ,specified in This clause not activated until a READ command or READMODAL() function call is issued. - + If the VALID clause is specified and evaluates to it logical true (.T.) condition the current GET will be considered valid and the get operation will continue onto the next active GET object. If @@ -74,7 +74,7 @@ (.F.) or it code block may be specified in . This clause is not activated until a READ command or READMODAL( ) function call is issued. - + If the RANGE clause is specified instead of the VALID clause, the two inclusive range values for must be specified in and . Id is a date data type, and must @@ -83,9 +83,9 @@ RANGE test ,a message of OUT OF RANGE will appear in the SCOREBOARD area (row = 0, col = 60). The RANGE message may be turned off it the SET SCOREBOARD command or SET() function appropriately toggled. - + NOTE GET functions/formatting rules: - + @A Allows only alphabetic characters. @B Numbers will be left justified @@ -104,9 +104,9 @@ @( Displays negative numbers in parentheses with leading spaces. @) Displays negative numbers in parentheses without leading spaces.
- + GET templates/formatting rules: - + A Only alphabetic characters allowed. N Only alphabetic and numeric characters allowed @@ -123,7 +123,7 @@ . Position of decimal point. , Position of comma.
- + Format PICTURE functions may he grouped together as well as used in Conjunction with a PICTURE templates;however, a blank space must be included in the PICTURE string if there are both functions and @@ -167,13 +167,13 @@ @ , SAY [ PICTURE ] [COLOR ] $ARGUMENTS$ Row coordinate - + Column coordinate - + Value to display - + PICTURE format - + Color string $DESCRIPTION$ This command displays the contents of at row column @@ -181,7 +181,7 @@ in . If the current device is set to the printer, the output will go to the printer; the default is for all output to go to the screen. - + For a complete list of PICTURES templates and functions, see the @...GET command. $EXAMPLES$ @@ -200,7 +200,7 @@ $PLATFORMS$ All $FILES$ - + $SEEALSO$ @...GET,SET DEVICE,TRANSFORM() $END$ diff --git a/harbour/doc/en/string.txt b/harbour/doc/en/string.txt index 06d27e7cf2..46169f4675 100644 --- a/harbour/doc/en/string.txt +++ b/harbour/doc/en/string.txt @@ -236,7 +236,7 @@ the second expression, the function will return 0. The third and fourth parameters lets you indicate a starting and end offset to search in. $EXAMPLES$ - ? 'At( "cde", "abcdefgfedcba" ) = ' +; + ? 'At( "cde", "abcdefgfedcba" ) = ' + ; At( "cde", "abcsefgfedcba" ) $STATUS$ R @@ -279,7 +279,7 @@ of to the left. If the function is unable to find any occurrence of in , the return value is 0. $EXAMPLES$ - ? 'RAt( "cde", "abcdefgfedcba" ) = ' +; + ? 'RAt( "cde", "abcdefgfedcba" ) = ' + ; RAt( "cde", "abcsefgfedcba" ) $STATUS$ R @@ -451,7 +451,7 @@ Results of STR() with No Optional Arguments - le> + Expression Return Value Length Field Variable Field length plus decimals @@ -484,8 +484,8 @@ * If is specified but is omitted (no decimal places), the return value is rounded to an integer. $EXAMPLES$ - ? STR( 10, 6, 2 ) // " 10.00" - ? STR( -10, 8, 2 ) // " -10.00" + ? Str( 10, 6, 2 ) // " 10.00" + ? Str( -10, 8, 2 ) // " -10.00" $TESTS$ See the regression test suit for comprehensive tests. $STATUS$ @@ -647,7 +647,7 @@ ? LEN( "Harbour" ) // 7 ? LEN( { "One", "Two" } ) // 2 $TESTS$ - PROCEDURE Test() + PROCEDURE Main() LOCAL cName := "" ACCEPT "Enter your name: " TO cName ? LEN( cName ) @@ -687,7 +687,7 @@ $EXAMPLES$ ? EMPTY( "I'm not empty" ) // .F. $TESTS$ - PROCEDURE Test() + PROCEDURE Main() ? EMPTY( NIL ) // .T. ? EMPTY( 0 ) // .T. ? EMPTY( .F. ) // .T. diff --git a/harbour/doc/en/strotype.txt b/harbour/doc/en/strotype.txt index 0477fa83fa..46bca99ee4 100644 --- a/harbour/doc/en/strotype.txt +++ b/harbour/doc/en/strotype.txt @@ -16,41 +16,41 @@ $DESCRIPTION$ Strong Type Checking could also be described as "Compile-Time Type Checking". - + CA-Cl*pper generates a Run-Time Error ("Type Mismatch") at an attempt to perform some operations with the wrong type of Variable. - + Examples: - + LOCAL Var1 := "A" - + ? Var1 * 3 // Error here. - + @ Var1, 7 SAY 'Hello' // Error here. - + ? SubStr( "Hello", Var1 ) // Error here. - + The above 3 lines would all result in Run-Time Error, because Var1 is of type CHARACTER but the above lines used it as if it was of type NUMERIC. - + Using Strong Type Checking, or Compile-Time Type Checking, the above problem would have been discovered and reported in COMPILE-TIME, rather than waiting for the inevitable problem to be discovered when we finally execute the program. - + Strong Typed Languages allow the programmer to "tell" the compiler (declare) what is the type of a each Variable, so that the Compiler in return can warn the programmer, when ever such Declared (Strong Typed) Variable, is used in a context which is incompatible with its declared type. - + For instance, if we "told" the compiler that Var1 above is of type CHARACTER (LOCAL Var1 AS CHARACTER) the Harbour Compiler could, in return, warn us if we attempted to perform the calculation: - + Var1 * 3 - + because the Compiler knows we can't perform a multiplication of a Character. (we might allow it in some context, but this is beyond the scope of this discussion). Similarly we would have been warned @@ -58,14 +58,14 @@ 2nd operand of the SubStr() function SubStr( "Hello", Var1) ), because the Compiler knows that these operations require a NUMERIC rather than CHARACTER type. - + The above may save us lots of time, by pointing a problem, we can not escape, since such code will never perform correctly once executed. So rather than wait to the testing cycle, for such problems to be discovered, (and some times even later, after we may have distributed our applications) instead we may know of such problems as soon as we type HARBOUR ProgName -w3 - + Harbour also offers a hybrid mode, where it can report such type mismatch problems, even without requiring the programmer to declare the type of variables. This feature, is referred to as Adaptive Type @@ -78,7 +78,7 @@ another value. Therefore Harbour will "remember" that Var1 "adapted" type CHARACTER, and thus the subsequent multiplication Var1 * 3, will be reported as an error, as soon as you attempt to compile such code. - + The nice aspect of this hybrid mode, is that unlike Strong Typed Variables,you don't have to declare the type, so no code changes are need, the Type instead is assumed by implication (type of the @@ -88,12 +88,12 @@ will than protect us from using the Variable in an incompatible context, since the variable "adapted" this type as soon as we assigned a value which implies a type. - + While Adapted Type Checking may be fairly effective in reporting many common mistakes, to take full benefits of such Compile-Time checking, it is recommended to do declare the Type of Variables, when ever possible. - + The Harbour Strong Type features, also allows the declaration of the expected parameters (including optionals) of User Defined Functions, as well as their return Type. Similarly, you may declare the Type of diff --git a/harbour/doc/en/subcodes.txt b/harbour/doc/en/subcodes.txt index 0a07a787b1..7f1fa42341 100644 --- a/harbour/doc/en/subcodes.txt +++ b/harbour/doc/en/subcodes.txt @@ -13,15 +13,15 @@ Attempt to access nonexisting or hidden variable $DESCRIPTION$ The specified variable was not found. - + If it is a database field ensure that the required database is open. - + If it is a private or public variable then it must be first created using PRIVATE or PUBLIC statement. $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -39,7 +39,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -57,7 +57,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -75,7 +75,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -95,7 +95,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -115,7 +115,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -135,7 +135,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -155,7 +155,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -175,7 +175,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -195,7 +195,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -216,7 +216,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -236,7 +236,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -256,7 +256,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -276,7 +276,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -296,7 +296,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -316,7 +316,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -336,7 +336,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -356,7 +356,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -376,7 +376,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -396,7 +396,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -416,7 +416,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -436,7 +436,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -456,7 +456,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -476,7 +476,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -496,7 +496,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -512,13 +512,13 @@ $DESCRIPTION$ The arguments of '$' operator are not a strings. $EXAMPLES$ - + $$ - + $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -538,7 +538,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -558,7 +558,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -579,7 +579,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -600,7 +600,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -621,7 +621,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -642,7 +642,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -663,7 +663,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -684,7 +684,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -705,7 +705,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -726,7 +726,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -746,7 +746,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -766,7 +766,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -785,7 +785,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -804,7 +804,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -823,7 +823,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -844,7 +844,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -865,7 +865,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -886,7 +886,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -907,7 +907,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -928,7 +928,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -949,7 +949,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -970,7 +970,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -991,7 +991,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -1012,7 +1012,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -1033,7 +1033,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -1054,7 +1054,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -1074,7 +1074,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1095,7 +1095,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -1116,7 +1116,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -1139,7 +1139,7 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ @@ -1160,7 +1160,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1181,7 +1181,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1201,7 +1201,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1222,7 +1222,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1243,7 +1243,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1264,7 +1264,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1285,7 +1285,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1306,7 +1306,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1327,7 +1327,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1349,7 +1349,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1370,7 +1370,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1390,7 +1390,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1412,7 +1412,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1432,7 +1432,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1452,7 +1452,7 @@ $COMPLIANCE$ H $SEEALSO$ - + $END$ */ @@ -1472,6 +1472,6 @@ $COMPLIANCE$ C $SEEALSO$ - + $END$ */ diff --git a/harbour/doc/en/tbrowse.txt b/harbour/doc/en/tbrowse.txt index 6c6cc72b6f..9859be523b 100644 --- a/harbour/doc/en/tbrowse.txt +++ b/harbour/doc/en/tbrowse.txt @@ -15,11 +15,11 @@ TBROWSENew(,,,) --> $ARGUMENTS$ Top Row - + Top Left Column - + Bottom Row - + Bottom Right Column $RETURNS$ An new Browse Object @@ -29,145 +29,145 @@ To browse Database files use TBROWSEDB() function insted. $DATANOLINK$ :aColumns Array to hold all browse columns - + :autoLite Logical value to control highlighting - + :cargo User-definable variable - + :colorSpec Color table for the TBrowse display - + :colPos Current cursor column position - + :colSep Column separator character - + :footSep Footing separator character - + :freeze Number of columns to freeze - + :goBottomBlock Code block executed by TBrowse:goBottom() - + :goTopBlock Code block executed by TBrowse:goTop() - + :headSep Heading separator character - + :hitBottom Indicates the end of available data - + :hitTop Indicates the beginning of available data - + :leftVisible Indicates position of leftmost unfrozen column in display - + :nBottom Bottom row number for the TBrowse display - + :nLeft Leftmost column for the TBrowse display - + :nRight Rightmost column for the TBrowse display - + :nTop Top row number for the TBrowse display - + :rightVisible Indicates position of rightmost unfrozen column in display - + :rowCount Number of visible data rows in the TBrowse display - + :rowPos Current cursor row position - + :skipBlock Code block used to reposition data source - + :stable Indicates if the TBrowse object is stable - + :aRedraw Array of logical items indicating, is appropriate row need to be redraw - + :RelativePos Indicates record position relatively position of first record on the screen - + :lHeaders Internal variable which indicates whether there are column footers to paint - + :lFooters Internal variable which indicates whether there are column footers to paint - + :aRect The rectangle specified with ColorRect() - + :aRectColor The color positions to use in the rectangle specified with ColorRect() - + :aKeys Holds the Default movement keys $METHODSLINK$ AddColumn() Adds an new TBColumn object to the current Browse - + Applykey() Perform the Browse Key movement - + SetKey() Add an New key to the Keyboard dictionary $METHODSNOLINK$ New(nTop, nLeft, nBottom, nRight) Create an new Browse class and set the default values - + Down() Moves the cursor down one row - + End() Moves the cursor to the rightmost visible data column - + GoBottom() Repositions the data source to the bottom of file - + GoTop() Repositions the data source to the top of file - + Home() Moves the cursor to the leftmost visible data column - + Left() Moves the cursor left one column - + PageDown() Repositions the data source downward - + PageUp() Repositions the data source upward - + PanEnd() Moves the cursor to the rightmost data column - + PanHome() Moves the cursor to the leftmost visible data column - + PanLeft() Pans left without changing the cursor position - + PanRight() Pans right without changing the cursor position - + Right() Moves the cursor right one column - + Up() Moves the cursor up one row - + ColCount() Return the Current number of Columns - + ColorRect() Alters the color of a rectangular group of cells - + ColWidth( nColumn ) Returns the display width of a particular column - + Configure( nMode ) Reconfigures the internal settings of the TBrowse object nMode is an undocumented parameter in CA-Cl*pper - + LeftDetermine() Determine leftmost unfrozen column in display - + DeHilite() Dehighlights the current cell - + DelColumn( nPos ) Delete a column object from a browse - + ForceStable() Performs a full stabilization - + GetColumn( nColumn ) Gets a specific TBColumn object - + Hilite() Highlights the current cell - + InsColumn( nPos, oCol ) Insert a column object in a browse - + Invalidate() Forces entire redraw during next stabilization - + RefreshAll() Causes all data to be recalculated during the next stabilize - + RefreshCurrent() Causes the current row to be refilled and repainted on next stabilize - + SetColumn( nColumn, oCol ) Replaces one TBColumn object with another - + Stabilize() Performs incremental stabilization - + DispCell( nColumn, cColor ) Displays a single cell $EXAMPLES$ See tests/testbrw.prg @@ -200,7 +200,7 @@ SetKey([,]) --> bOldBlock $ARGUMENTS$ An valid inkey Code - + An optional action to associate to the inkey value. $RETURNS$ If an Keypress has it code block changes, it will return @@ -209,10 +209,10 @@ This method Get an optionaly set an code block that is associated to an inkey value. The table below show the default keypress/Code Block definitions - +
Inkey Value Code Block - + K_DOWN {| oB, nKey | oB:Down(), 0 } K_END {| oB, nKey | oB:End(), 0 } K_CTRL_PGDN {| oB, nKey | oB:GoBottom(), 0 } @@ -229,21 +229,21 @@ K_UP {| oB, nKey | oB:Up(), 0 } K_ESC {| oB, nKey | -1 }
- + The keys handlers can be queried,added and replace an removed from the internal keyboard dictionary. See the example. - + oTb:SETKEY( K_TAB, {| oTb, nKey | -1 } ) - + An default key handler can be declared by specifyin a value of 0 for . It associate code block will be evaluated each time TBrowse:Applykey() is called with an key value that is not contained in the dictionary. For example - + oTb:SetKey( 0, {| oTb, nKey | DefKeyHandler( otb, nkey } ) This call the a function named DefKeyHandler() when nKey is not contained in the dictionary. - + To remove an keypress/code block definition, specify NIL for oTb:SetKey( K_ESC, NIL ) $EXAMPLES$ @@ -267,7 +267,7 @@ $RETURNS$ Value returned from the evaluated Code Block See Table Below - + Value Meaning -1 User request for the browse lost input focus diff --git a/harbour/doc/en/var.txt b/harbour/doc/en/var.txt index 9aa7e068e0..f27c9055f4 100644 --- a/harbour/doc/en/var.txt +++ b/harbour/doc/en/var.txt @@ -144,14 +144,14 @@ RETURN - PROCEDURE Test() + PROCEDURE Main() PRIVATE mPrivate - mPrivate :="PRIVATE from Test()" - ? mPrivate //PRIVATE from TEST() + mPrivate := "PRIVATE from Main()" + ? mPrivate //PRIVATE from Main() RELEASE mPrivate ? mPrivate //NIL - mPrivate :="Again in Test()" + mPrivate := "Again in Main()" RETURN $STATUS$ @@ -840,7 +840,7 @@ $EXAMPLES$ See Test(s) $TESTS$ - PROCEDURE Test() + PROCEDURE Main() ? ValType( Array( 1 ) ) // "A" ? ValType( {|| 1 + 1 } ) // "B" ? ValType( "HARBOUR" ) // "C" @@ -900,12 +900,12 @@ $TESTS$ PROCEDURE Main() LOCAL cVar := "Test local" - PRIVATE nVar := 0 + PRIVATE m_nVar := 0 - Test( @cVar, @nVar, cVar, nVar ) + Test( @cVar, @m_nVar, cVar, m_nVar ) RETURN - PROCEDURE Test( Arg1, Arg2, Arg3, Arg4 ) + STATIC PROCEDURE Test( Arg1, Arg2, Arg3, Arg4 ) ? hb_isbyref( @Arg1 ) // .T. ? hb_isbyref( @Arg2 ) // .T. ? hb_isbyref( @Arg3 ) // .F. diff --git a/harbour/extras/gfspell/spell.prg b/harbour/extras/gfspell/spell.prg index 9ab90ba69b..62f9b8574e 100644 --- a/harbour/extras/gfspell/spell.prg +++ b/harbour/extras/gfspell/spell.prg @@ -2,37 +2,35 @@ * $Id$ */ -* Program...: SpellLib.prg -* Author....: Joseph D. Booth -* Copyright.: (C)1993, Joseph D. Booth, All Rights Reserved -* -* Purpose...: Library of functions to allow a Clipper program to -* spell check a string and to also work with individual -* words. -* -* SP_Add() - Add word to the dictionary -* SP_Cache() - Add word to spelling cache -* SP_Check() - Is word spelled correctly? -* SP_Clear() - Clear the spelling cache -* SP_Init() - Initialize the spelling dictionary -* SP_GetSet() - Get/Set global parameters -* SP_LoadAux() - Loads an auxiliary dictionary -* SP_Suggest() - Offer list of sound alike suggestions -* SP_Quick() - Offer list of suggested spellings -* SP_WildCard() - List of wildcard matches -* -* DBF2Dic() - Convert a DBF file to a DIC file -* Dic2DBF() - Convert a DIC file to a DBF file -* -**************************************************************************** +// Author....: Joseph D. Booth +// Copyright.: (C)1993, Joseph D. Booth, All Rights Reserved +// +// Purpose...: Library of functions to allow a Clipper program to +// spell check a string and to also work with individual +// words. +// +// SP_Add() - Add word to the dictionary +// SP_Cache() - Add word to spelling cache +// SP_Check() - Is word spelled correctly? +// SP_Clear() - Clear the spelling cache +// SP_Init() - Initialize the spelling dictionary +// SP_GetSet() - Get/Set global parameters +// SP_LoadAux() - Loads an auxiliary dictionary +// SP_Suggest() - Offer list of sound alike suggestions +// SP_Quick() - Offer list of suggested spellings +// SP_WildCard() - List of wildcard matches +// +// DBF2Dic() - Convert a DBF file to a DIC file +// Dic2DBF() - Convert a DIC file to a DBF file +// #include "fileio.ch" #xtranslate StoreWord( ) => Xform( ) #xtranslate ExtractWord( ) => Xunform( ) -#define NSIZE 26*26*6 -#define EACH_WORD 6 +#define NSIZE ( 26 * 26 * 6 ) +#define EACH_WORD 6 #define CRLF Chr( 13 ) + Chr( 10 ) #define FOUR_BYTES Chr( 0 ) + Chr( 0 ) + Chr( 0 ) + Chr( 0 ) #define MAX_STRING 40000 @@ -55,38 +53,40 @@ #define CHECK_RUNONS aGlobal[16] -* #define REDUCE_MEMORY_NEEDS +// #define REDUCE_MEMORY_NEEDS -THREAD STATIC aGlobal := { NIL,; - "",; - "",; - "DICT.DIC",; - "",; - NIL,; - .T.,; - .T.,; - .T.,; - .T.,; - "B",; // (M)etaphone, (A)lgorithmic, (B)oth - 2,; - 5,; - 1,; - "THES.DIC",; - .T. } +THREAD STATIC aGlobal := { ; + NIL,; + "",; + "",; + "DICT.DIC",; + "",; + NIL,; + .T.,; + .T.,; + .T.,; + .T.,; + "B",; // (M)etaphone, (A)lgorithmic, (B)oth + 2,; + 5,; + 1,; + "THES.DIC",; + .T. } -STATIC aContracts := { { "CAN'T" ,"CANNOT" },; - { "WON'T" ,"WILL NOT" },; - { "AREN'T" ,"ARE NOT" },; - { "AIN'T" ,"ARE NOT" },; - { "THEY'RE" ,"THEY ARE" },; - { "THEY'VE" ,"THEY HAVE" },; - { "IT'S" ,"IT IS" },; - { "I'LL" ,"I WILL" },; - { "I'D" ,"I WOULD" },; - { "DON'T" ,"DO NOT" } } +STATIC aContracts := { ; + { "CAN'T" ,"CANNOT" },; + { "WON'T" ,"WILL NOT" },; + { "AREN'T" ,"ARE NOT" },; + { "AIN'T" ,"ARE NOT" },; + { "THEY'RE" ,"THEY ARE" },; + { "THEY'VE" ,"THEY HAVE" },; + { "IT'S" ,"IT IS" },; + { "I'LL" ,"I WILL" },; + { "I'D" ,"I WOULD" },; + { "DON'T" ,"DO NOT" } } @@ -105,45 +105,47 @@ THREAD STATIC cOffsets // Notes: Does not check to see if the word already exists in the // dictionary. // -//////////////////////////// -function SP_Add(cWord) -LOCAL was_added := .F. // Was word written to dictionary? -LOCAL nAuxHandle // Dictionary file handle -LOCAL nWritten // Number of bytes written -// Initialize the spell checker and make sure -// an auxiliary dictionary name was specified +FUNCTION SP_Add( cWord ) -**DEBUG** -@24,30 SAY "At SP_ADD" + LOCAL was_added := .F. // Was word written to dictionary? + LOCAL nAuxHandle // Dictionary file handle + LOCAL nWritten // Number of bytes written -if SP_Init() .and. !empty( AUXILIARY_DICTIONARY ) - cWord := upper(alltrim(cWord)) + // Initialize the spell checker and make sure + // an auxiliary dictionary name was specified - // - // If the auxiliary dictionary does not exist, - // we will create it for the user - // + // *DEBUG** + @ 24, 30 SAY "At SP_ADD" - if file( AUXILIARY_DICTIONARY ) - nAuxHandle := fopen( AUXILIARY_DICTIONARY, FO_READWRITE + FO_DENYWRITE ) - else - nAuxHandle := fcreate( AUXILIARY_DICTIONARY ) - endif - if nAuxHandle >= 0 + IF SP_Init() .AND. !Empty( AUXILIARY_DICTIONARY ) + cWord := Upper( AllTrim( cWord ) ) - Fseek(nAuxHandle,0,FS_END) // Bottom of the file - nWritten := Fwrite(nAuxHandle,; // Write word into file - cWord+CRLF,len(cWord)+2) + // + // If the auxiliary dictionary does not exist, + // we will create it for the user + // - Fclose(nAuxHandle) // Close the file - SP_Cache(cWord) // Add word to cache + IF File( AUXILIARY_DICTIONARY ) + nAuxHandle := FOpen( AUXILIARY_DICTIONARY, FO_READWRITE + FO_DENYWRITE ) + ELSE + nAuxHandle := FCreate( AUXILIARY_DICTIONARY ) + ENDIF + IF nAuxHandle >= 0 + + FSeek( nAuxHandle, 0, FS_END ) // Bottom of the file + nWritten := FWrite( nAuxHandle, ; // Write word into file + cWord + CRLF, Len( cWord ) + 2 ) + + FClose( nAuxHandle ) // Close the file + SP_Cache( cWord ) // Add word to cache + + was_added := ( nWritten == Len( cWord ) + 2 ) + ENDIF + ENDIF + + RETURN was_added - was_added := (nWritten == len(cWord)+2) - endif -endif -return was_added -******************************************************************************* // // Function: Sp_cache() @@ -157,21 +159,22 @@ return was_added // // Notes: Check to see if the word already exists in the cache // -//////////////////////// -function Sp_cache(cWord) -LOCAL cTemp := "|"+upper(alltrim(cWord))+"|" -LOCAL lAdded := .F. +FUNCTION Sp_cache( cWord ) -**DEBUG** -@24,30 SAY "At SP_cache" + LOCAL cTemp := "|" + Upper( AllTrim( cWord ) ) + "|" + LOCAL lAdded := .F. + + // *DEBUG** + @ 24, 30 SAY "At SP_cache" + + IF ! cTemp $ CACHE_WORDS .AND. Len( CACHE_WORDS ) < MAX_STRING + CACHE_WORDS += cTemp + lAdded := .T. + ENDIF + + RETURN lAdded -if ! cTemp $ CACHE_WORDS .and. len(CACHE_WORDS) < MAX_STRING - CACHE_WORDS += cTemp - lAdded := .T. -endif -return lAdded -******************************************************************************* // // Function: Sp_check() @@ -189,108 +192,109 @@ return lAdded // Notes: // // -//////////////////////// -function SP_Check(cWord) -STATIC cBuf := "" -STATIC cLast +FUNCTION SP_Check( cWord ) + + STATIC cBuf := "" + STATIC cLast -STATIC nDicCount := 0 -STATIC nCacheCount := 0 -STATIC nBuffCount := 0 + STATIC nDicCount := 0 + STATIC nCacheCount := 0 + STATIC nBuffCount := 0 -LOCAL ok := .T. -LOCAL cLookup := upper(rtrim(cWord)) -LOCAL nRow -LOCAL nCol -LOCAL x -LOCAL y -LOCAL z := 4 -LOCAL cTemp + LOCAL ok := .T. + LOCAL cLookup := Upper( RTrim( cWord ) ) + LOCAL nRow + LOCAL nCol + LOCAL x + LOCAL y + LOCAL z := 4 + LOCAL cTemp -**DEBUG** -@24,30 SAY "At SP_init" + // *DEBUG** + @ 24, 30 SAY "At SP_init" -if sp_init() - if len(cLookup) == 1 .and. cLookup$"IA" - return .T. - endif - if len(cLookup) < MINIMUM_WORD_LENGTH - return .T. - endif - if right(cLookup,2)="'S" - cLookUp := substr(cLookup,1, len(cLookup)-2 ) - endif - cTemp := "|"+cLookup+"|" - if fat(cTemp, COMMON_WORDS) == 0 // Check the common words first - if fat(cTemp,CACHE_WORDS) == 0 // then check the cache words - ok := .F. - nRow := asc(substr(cLookup,1,1))-64 - nCol := asc(substr(cLookup,2,1))-64 - if (nRow>0 .and. nRow<=26) .and. (nCol>0 .and. nCol<=26) + IF sp_init() + IF Len( cLookup ) == 1 .AND. cLookup $ "IA" + RETURN .T. + ENDIF + IF Len( cLookup ) < MINIMUM_WORD_LENGTH + RETURN .T. + ENDIF + IF Right( cLookup, 2 ) = "'S" + cLookUp := SubStr( cLookup, 1, Len( cLookup ) -2 ) + ENDIF + cTemp := "|" + cLookup + "|" + IF fat( cTemp, COMMON_WORDS ) == 0 // Check the common words first + IF fat( cTemp, CACHE_WORDS ) == 0 // then check the cache words + ok := .F. + nRow := Asc( SubStr( cLookup, 1, 1 ) ) -64 + nCol := Asc( SubStr( cLookup, 2, 1 ) ) -64 + IF ( nRow > 0 .AND. nRow <= 26 ) .AND. ( nCol > 0 .AND. nCol <= 26 ) - #ifdef REDUCE_MEMORY_NEEDS +#ifdef REDUCE_MEMORY_NEEDS - cOffsets := space(6) - fseek(nHandle,((nRow-1)*156)+((nCol-1)*6+1)+5,FS_SET) - fread(nHandle,@cOffsets,6) - x := bin2l(substr(cOffsets,1,4)) - y := bin2w(substr(cOffsets,5,2)) + cOffsets := Space( 6 ) + FSeek( nHandle, ( ( nRow - 1 ) * 156 ) + ( ( nCol - 1 ) * 6 + 1 ) + 5, FS_SET ) + FRead( nHandle, @cOffsets, 6 ) + x := Bin2L( SubStr( cOffsets, 1, 4 ) ) + y := Bin2W( SubStr( cOffsets, 5, 2 ) ) - #else +#else - x := bin2l(substr(cOffsets,((nRow-1)*156)+((nCol-1)*EACH_WORD+1),4)) - y := bin2w(substr(cOffsets,((nRow-1)*156)+((nCol-1)*EACH_WORD+5),2)) + x := Bin2L( SubStr( cOffsets, ( ( nRow - 1 ) * 156 ) + ( ( nCol - 1 ) * EACH_WORD + 1 ), 4 ) ) + y := Bin2W( SubStr( cOffsets, ( ( nRow - 1 ) * 156 ) + ( ( nCol - 1 ) * EACH_WORD + 5 ), 2 ) ) - #endif +#endif - if !empty(x) - if !(cLast==substr(cLookup,1,2)) - cBuf := space(y) - fseek(nHandle,x,FS_SET) - fread(nHandle,@cBuf,y) - nDicCount++ - else - nBuffCount++ - endif - if len(cLookup)=3 - z := asc(substr(cLookup,3,1))-64 - ok := bit(cBuf,z) - elseif len(cLookup) < 3 - ok := bit(cBuf,27) - elseif y > 4 - cTemp := StoreWord(cLookup) - do while z < y - z := fat( cTemp, cBuf,z ) - if z < 6 - exit - elseif substr(cBuf,z-1,1) < Chr( 128 ) - z++ - else - exit - endif - enddo - ok := z > 4 .and. z 4 + cTemp := StoreWord( cLookup ) + DO WHILE z < y + z := fat( cTemp, cBuf, z ) + IF z < 6 + EXIT + ELSEIF SubStr( cBuf, z - 1, 1 ) < Chr( 128 ) + z++ + ELSE + EXIT + ENDIF + ENDDO + ok := z > 4 .AND. z < y + ENDIF + cLast := SubStr( cLookup, 1, 2 ) + ENDIF + ENDIF + ELSE + nCacheCount++ + ENDIF + ELSE nCacheCount++ - endif - else - nCacheCount++ - endif -else - ok := .F. -endif -if !ok .and. EXTRA_CODE_BLOCK != NIL - ok := eval( EXTRA_CODE_BLOCK,cWord ) -endif -return ok -******************************************************************************* + ENDIF + ELSE + ok := .F. + ENDIF + IF !ok .AND. EXTRA_CODE_BLOCK != NIL + ok := Eval( EXTRA_CODE_BLOCK, cWord ) + ENDIF + + RETURN ok + // // Function: Sp_GetBuf() @@ -299,28 +303,30 @@ return ok // Arguments: - First two letters // Returns: cString - Buffer string from DIC file // -//////////////////////// -STATIC function sp_GetBuf(cLetters) -LOCAL x -LOCAL y -LOCAL cBuf := "" -LOCAL nRow := asc(substr(cLetters,1,1))-64 -LOCAL nCol := asc(substr(cLetters,2,1))-64 -**DEBUG** -@24,30 SAY "At SP_getbuf" +STATIC FUNCTION sp_GetBuf( cLetters ) + + LOCAL x + LOCAL y + LOCAL cBuf := "" + LOCAL nRow := Asc( SubStr( cLetters, 1, 1 ) ) -64 + LOCAL nCol := Asc( SubStr( cLetters, 2, 1 ) ) -64 + + // *DEBUG** + @ 24, 30 SAY "At SP_getbuf" + + IF ( nRow > 0 .AND. nRow <= 26 ) .AND. ( nCol > 0 .AND. nCol <= 26 ) + x := Bin2L( SubStr( cOffsets, ( ( nRow - 1 ) * 156 ) + ( ( nCol - 1 ) * EACH_WORD + 1 ), 4 ) ) + IF !Empty( x ) + y := Bin2W( SubStr( cOffsets, ( ( nRow - 1 ) * 156 ) + ( ( nCol - 1 ) * EACH_WORD + 5 ), 2 ) ) + cBuf := Space( y ) + FSeek( nHandle, x + 4, FS_SET ) + FRead( nHandle, @cBuf, y - 4 ) + ENDIF + ENDIF + + RETURN cBuf -if (nRow>0 .and. nRow<=26) .and. (nCol>0 .and. nCol<=26) - x := bin2l(substr(cOffsets,((nRow-1)*156)+((nCol-1)*EACH_WORD+1),4)) - if !empty(x) - y := bin2w(substr(cOffsets,((nRow-1)*156)+((nCol-1)*EACH_WORD+5),2)) - cBuf := space(y) - fseek(nHandle,x+4,FS_SET) - fread(nHandle,@cBuf,y-4) - endif -endif -return cBuf -****************************************************************************** // // Function: Sp_clear() @@ -331,15 +337,16 @@ return cBuf // // Static: CACHE_WORDS - String of cache words // -//////////////////////// -function sp_clear -**DEBUG** -@24,30 SAY "At SP_clear" +FUNCTION sp_clear + + // *DEBUG** + @ 24, 30 SAY "At SP_clear" + + CACHE_WORDS := "" + + RETURN NIL -CACHE_WORDS := "" -return NIL -****************************************************************************** // Function: Sp_GetSet() // Purpose: To get/set a parameter for the spell check function @@ -351,21 +358,23 @@ return NIL // FALSE if an error occurs, usually network lock // problem // -////////////////////////////////////// -function Sp_GetSet(nWhich,xNewSetting) -LOCAL xOld := NIL -**DEBUG** -@24,30 SAY "At SP_getset" +FUNCTION Sp_GetSet( nWhich, xNewSetting ) + + LOCAL xOld := NIL + + // *DEBUG** + @ 24, 30 SAY "At SP_getset" + + IF nWhich != NIL .AND. ( nWhich > 0 .AND. nWhich <= Len( aGlobal ) ) + xOld := aGlobal[ nWhich ] + IF ValType( xNewSetting ) == ValType( xOld ) + aGlobal[ nWhich ] := xNewSetting + ENDIF + ENDIF + + RETURN xOld -if nWhich != NIL .and. (nWhich>0 .and. nWhich<=len(aGlobal)) - xOld := aGlobal[nWhich] - if valtype(xNewSetting) == valtype(xOld) - aGlobal[nWhich] := xNewSetting - endif -endif -return xOld -****************************************************************************** // Function: Sp_LoadAux() // Purpose: To load an auxiliary dictionary of words @@ -377,39 +386,41 @@ return xOld // // // -////////////////////////////////////// -function Sp_LoadAux(cFile) -LOCAL is_ok := .F. -LOCAL x := 0 -LOCAL cStr := "" -LOCAL nSize -**DEBUG** -@24,30 SAY "At SP_loadaux" +FUNCTION Sp_LoadAux( cFile ) -if !empty(cFile) - if file(cFile) - x := fopen(cFile, FO_READ + FO_DENYNONE ) - else - x := fcreate(cFile) - endif - SP_GetSet(5,cFile) + LOCAL is_ok := .F. + LOCAL x := 0 + LOCAL cStr := "" + LOCAL nSize + + // *DEBUG** + @ 24, 30 SAY "At SP_loadaux" + + IF !Empty( cFile ) + IF File( cFile ) + x := FOpen( cFile, FO_READ + FO_DENYNONE ) + ELSE + x := FCreate( cFile ) + ENDIF + SP_GetSet( 5, cFile ) + + IF x > 0 + nSize := FSeek( x, 0, FS_END ) + IF nSize < MAX_STRING + cStr := Space( nSize ) + FSeek( x, 0, FS_SET ) + FRead( x, @cStr, nSize ) + cStr := "|" + StrTran( cStr, CRLF, "|" ) + CACHE_WORDS += Upper( cStr ) + is_ok := .T. + ENDIF + FClose( x ) + ENDIF + ENDIF + + RETURN is_ok - if x > 0 - nSize := fseek(x,0,FS_END) - if nSize < MAX_STRING - cStr := space(nSize) - fseek(x,0,FS_SET) - fread(x,@cStr,nSize) - cStr := "|"+strtran(cStr,CRLF,"|") - CACHE_WORDS += upper(cStr) - is_ok := .T. - endif - fclose(x) - endif -endif -return is_ok -****************************************************************************** // // Function: Sp_Suggest() @@ -419,647 +430,637 @@ return is_ok // lInclude - Should word be included in list? // Returns: aSuggest_ - List of suggested words // -/////////////////////////////////// -function Sp_Suggest(cWord,lInclude) -STATIC aParts_ := { {"A" ,{"AI","AO","AU","AY","EA","EI","EIGH","ET","EY","E","I","O"}},; - {"AIR" ,{"ARE"}},; - {"AIT" ,{"ATE"}},; - {"C" ,{"CK"}},; - {"CH" ,{"TCH","TI","TU"}},; - {"CKS" ,{"X"}},; - {"D" ,{"ED"}},; - {"E" ,{"A","AE","AI","AY","EA","EI","EO","IE","I","U","O"}},; - {"EM" ,{"TEM"}},; - {"ER" ,{"OUR","RE","URE","YR"}},; - {"ERE" ,{"EIR","EAR","IER"}},; - {"F" ,{"GH","LF","PH","G"}},; - {"FIZ" ,{"PHYS"}},; - {"G" ,{"GH","GU","GUE"}},; - {"GZ" ,{"X"}},; - {"H" ,{"WH"}},; - {"I" ,{"A","E","EE","IA","IE","O","U","UI","Y","YE","UY","EI","IGH"}},; - {"IS" ,{"US","ACE","ICE"}},; - {"ISE" ,{"IZE"}},; - {"J" ,{"D","DG","DI","DJ","G","GG"}},; - {"K" ,{"C","CC","CH","CK","CQU","CU","LK","Q","QU","QUE"}},; - {"KW" ,{"QU"}},; - {"L" ,{"SL"}},; - {"LE" ,{"TLE","AL"}},; - {"M" ,{"CHM","GM","LM","MB","MN","N"}},; - {"N" ,{"M","PN","GN","KN","MN"}},; - {"NG" ,{"N","NGUE"}},; - {"O" ,{"AU","EAU","EO","EW","OA","OE","OH","OU","OUGH","OW","A","AH","AW","UO","E"}},; - {"OE" ,{"OWE","OUGH"}},; - {"OO" ,{"O","EU","EW","OE","OU","OUGH","U","UE","UI"}},; - {"OU" ,{"OUGH","OW"}},; - {"PER" ,{"PRO","PRI","PRA","PRU"}},; - {"PRE" ,{"PRO","PRI","PRA","PRU"}},; - {"R" ,{"RH","WR"}},; - {"S" ,{"C","CE","PS","SC","SCH"}},; - {"SH" ,{"CE","CH","CI","S","SCH","SCI","SE","SI","SS","SSI","TI"}},; - {"SI" ,{"PSY","CY"}},; - {"T" ,{"ED","GHT","PT","TH"}},; - {"TION" ,{"SION","CION","CEAN","CIAN"}},; - {"TIOUS",{"SEOUS"}},; - {"TURE" ,{"TEUR"}},; - {"U" ,{"O","OE","OO","OU","EUA","EU","EUE","EW","IEU","IEW","UE","UI","YOU","YU"}},; - {"UR" ,{"EAR","ER","IR","YR"}},; - {"V" ,{"F","LV","PH"}},; - {"W" ,{"O","U","WH"}},; - {"X" ,{"CKS","GZ","K"}},; - {"Y" ,{"I","J","IE","EI"}},; - {"Z" ,{"S","SC","SS","X","GE","SI","ZI"}},; - {"ZI" ,{"XY"}} } +FUNCTION Sp_Suggest( cWord, lInclude ) -STATIC aEnds := { "ED","ER","ING","LY","AL","FUL","NESS","MENT","IVE" } -STATIC aBegs := { "UN","IN","DIS","MIS","EN","WEL","AL" } + STATIC aParts_ := { ; + {"A" , { "AI", "AO", "AU", "AY", "EA", "EI", "EIGH", "ET", "EY", "E", "I", "O" } }, ; + {"AIR" , { "ARE" } }, ; + {"AIT" , { "ATE" } }, ; + {"C" , { "CK" } }, ; + {"CH" , { "TCH", "TI", "TU" } }, ; + {"CKS" , { "X" } }, ; + {"D" , { "ED" } }, ; + {"E" , { "A", "AE", "AI", "AY", "EA", "EI", "EO", "IE", "I", "U", "O" } }, ; + {"EM" , { "TEM" } }, ; + {"ER" , { "OUR", "RE", "URE", "YR" } }, ; + {"ERE" , { "EIR", "EAR", "IER" } }, ; + {"F" , { "GH", "LF", "PH", "G" } }, ; + {"FIZ" , { "PHYS" } }, ; + {"G" , { "GH", "GU", "GUE" } }, ; + {"GZ" , { "X" } }, ; + {"H" , { "WH" } }, ; + {"I" , { "A", "E", "EE", "IA", "IE", "O", "U", "UI", "Y", "YE", "UY", "EI", "IGH" } }, ; + {"IS" , { "US", "ACE", "ICE" } }, ; + {"ISE" , { "IZE" } }, ; + {"J" , { "D", "DG", "DI", "DJ", "G", "GG" } }, ; + {"K" , { "C", "CC", "CH", "CK", "CQU", "CU", "LK", "Q", "QU", "QUE" } }, ; + {"KW" , { "QU" } }, ; + {"L" , { "SL" } }, ; + {"LE" , { "TLE", "AL" } }, ; + {"M" , { "CHM", "GM", "LM", "MB", "MN", "N" } }, ; + {"N" , { "M", "PN", "GN", "KN", "MN" } }, ; + {"NG" , { "N", "NGUE" } }, ; + {"O" , { "AU", "EAU", "EO", "EW", "OA", "OE", "OH", "OU", "OUGH", "OW", "A", "AH", "AW", "UO", "E" } }, ; + {"OE" , { "OWE", "OUGH" } }, ; + {"OO" , { "O", "EU", "EW", "OE", "OU", "OUGH", "U", "UE", "UI" } }, ; + {"OU" , { "OUGH", "OW" } }, ; + {"PER" , { "PRO", "PRI", "PRA", "PRU" } }, ; + {"PRE" , { "PRO", "PRI", "PRA", "PRU" } }, ; + {"R" , { "RH", "WR" } }, ; + {"S" , { "C", "CE", "PS", "SC", "SCH" } }, ; + {"SH" , { "CE", "CH", "CI", "S", "SCH", "SCI", "SE", "SI", "SS", "SSI", "TI" } }, ; + {"SI" , { "PSY", "CY" } }, ; + {"T" , { "ED", "GHT", "PT", "TH" } }, ; + {"TION" , { "SION", "CION", "CEAN", "CIAN" } }, ; + {"TIOUS", { "SEOUS" } }, ; + {"TURE" , { "TEUR" } }, ; + {"U" , { "O", "OE", "OO", "OU", "EUA", "EU", "EUE", "EW", "IEU", "IEW", "UE", "UI", "YOU", "YU" } }, ; + {"UR" , { "EAR", "ER", "IR", "YR" } }, ; + {"V" , { "F", "LV", "PH" } }, ; + {"W" , { "O", "U", "WH" } }, ; + {"X" , { "CKS", "GZ", "K" } }, ; + {"Y" , { "I", "J", "IE", "EI" } }, ; + {"Z" , { "S", "SC", "SS", "X", "GE", "SI", "ZI" } }, ; + {"ZI" , { "XY"} } } -LOCAL jj,kk,zz,ii -LOCAL cHold -LOCAL aRet_ := {} // List of suggested words -LOCAL cTemp -LOCAL nSugg -LOCAL nSize := len(aParts_) -LOCAL nSuffix := len(aEnds) -LOCAL cMeta -LOCAL cFirst -LOCAL cKey -LOCAL arr_ + STATIC aEnds := { "ED", "ER", "ING", "LY", "AL", "FUL", "NESS", "MENT", "IVE" } + STATIC aBegs := { "UN", "IN", "DIS", "MIS", "EN", "WEL", "AL" } -**DEBUG** -@24,30 SAY "At SP_suggest" + LOCAL jj, kk, zz, ii + LOCAL cHold + LOCAL aRet_ := {} // List of suggested words + LOCAL cTemp + LOCAL nSugg + LOCAL nSize := Len( aParts_ ) + LOCAL nSuffix := Len( aEnds ) + LOCAL cMeta + LOCAL cFirst + LOCAL cKey + LOCAL arr_ -cWord := upper(rtrim(cWord)) -zz := len(cWord) + // *DEBUG** + @ 24, 30 SAY "At SP_suggest" -if zz =1 // Don't offer suggestions for - return aRet_ // single letter words -endif + cWord := Upper( RTrim( cWord ) ) + zz := Len( cWord ) -if lInclude == NIL ; lInclude := .F. ; endif + IF zz = 1 // Don't offer suggestions for + RETURN aRet_ // single letter words + ENDIF -// -// Should the current word be included? -// -////////////////////////////////// -if Sp_Check(cWord) - Aadd(aRet_,"A0AA"+cWord) -endif - -if "'" $ cWord - cHold := SP_Expand(cWord) - if !empty(cHold) - Aadd(aRet_,"A1AA"+cHold) - endif -endif - -if CHECK_RUNONS - arr_ := SP_Split( cWord ) - for jj := 1 to len(arr_) - Aadd(aRet_,"A1AA"+arr_[jj] ) - next -endif - -if SUGGEST_PREFERENCE $ "AB" + IF lInclude == NIL ; lInclude := .F. ; ENDIF // - // Step One - Do letter doubling + // Should the current word be included? // - ////////////////////////////////// - for jj := 2 to zz - if substr(cWord,jj,1)$"BCDEFGKLMNOPRSTZ" - cHold := left(cWord,jj)+substr(cWord,jj, 1)+; - substr(cWord,jj+1) + + IF Sp_Check( cWord ) + AAdd( aRet_, "A0AA" + cWord ) + ENDIF + + IF "'" $ cWord + cHold := SP_Expand( cWord ) + IF !Empty( cHold ) + AAdd( aRet_, "A1AA" + cHold ) + ENDIF + ENDIF + + IF CHECK_RUNONS + arr_ := SP_Split( cWord ) + FOR jj := 1 TO Len( arr_ ) + AAdd( aRet_, "A1AA" + arr_[ jj ] ) + NEXT + ENDIF + + IF SUGGEST_PREFERENCE $ "AB" + + // + // Step One - Do letter doubling + // + + FOR jj := 2 TO zz + IF SubStr( cWord, jj, 1 ) $ "BCDEFGKLMNOPRSTZ" + cHold := Left( cWord, jj ) + SubStr( cWord, jj, 1 ) + ; + SubStr( cWord, jj + 1 ) + // + // If the word is not already in the list, then check + // to see if it is a valid word. + // + + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cHold } ) == 0 .AND. Sp_Check( cHold ) + AAdd( aRet_, "B" + SP_Rate( cHold, cWord ) + cHold ) + ENDIF + ENDIF + NEXT + + // + // Step Two - Remove extra letters + // + + FOR jj := 1 TO zz + cHold := Left( cWord, jj - 1 ) + SubStr( cWord, jj + 1 ) // // If the word is not already in the list, then check // to see if it is a valid word. // - ////////////////////////////////////////// - if ascan(aRet_,{ |xx| substr(xx,5)==cHold}) == 0 .and. Sp_Check(cHold) - Aadd(aRet_,"B"+SP_Rate(cHold,cWord)+cHold) - endif - endif - next - // - // Step Two - Remove extra letters - // - ////////////////////////////////// - for jj := 1 to zz - cHold := left(cWord,jj-1)+substr(cWord,jj+1) + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cHold } ) == 0 .AND. Sp_Check( cHold ) + AAdd( aRet_, "B" + SP_Rate( cHold, cWord ) + cHold ) + ENDIF + NEXT + // - // If the word is not already in the list, then check - // to see if it is a valid word. + // Step Three - Transpose the letters // - ////////////////////////////////////////// - if ascan(aRet_,{ |xx| substr(xx,5)==cHold}) == 0 .and. Sp_Check(cHold) - Aadd(aRet_,"B"+SP_Rate(cHold,cWord)+cHold) - endif - next - - // - // Step Three - Transpose the letters - // - ////////////////////////// - for jj := 2 to zz - cHold := left(cWord,jj-2)+substr(cWord,jj, 1)+; - substr(cWord,jj-1,1)+substr(cWord,jj+1) - if ascan(aRet_,{ |xx| substr(xx,5)==cHold}) == 0 .and. Sp_Check(cHold) - Aadd(aRet_,"B"+SP_Rate(cHold,cWord)+cHold) - endif - next - - // - // Step Four - Try adding a silent E to the end - // - ////////////////// - - cHold := cWord+"E" - if ascan(aRet_,{ |xx| substr(xx,5)==cHold}) == 0 .and. Sp_Check(cHold) - Aadd(aRet_,"B"+SP_Rate(cHold,cWord)+cHold) - endif - - // - // Step Five - Do sound alike substitutions - // - ////////////////////////////////// - for jj := 1 to nSize - if aParts_[jj,1]$cWord - if aParts_[jj,1]$"AEIOUT" - ii := 0 - do while (ii := fat(aParts_[jj,1],cWord,ii))>0 - for kk := 1 to len(aParts_[jj,2]) - cHold := substr(cWord,1,ii-1)+aParts_[jj,2,kk]+substr(cWord,ii+1) - if ascan(aRet_,{ |xx| substr(xx,5)==cHold}) == 0 .and. Sp_Check(cHold) - Aadd(aRet_,"B"+SP_Rate(cHold,cWord)+cHold) - endif - next - ii++ - enddo - else - for kk := 1 to len(aParts_[jj,2]) - cHold := strtran(cWord,aParts_[jj,1],aParts_[jj,2,kk]) - if ascan(aRet_,{ |xx| substr(xx,5)==cHold}) == 0 .and. Sp_Check(cHold) - Aadd(aRet_,"B"+SP_Rate(cHold,cWord)+cHold) - endif - next - endif - endif - next - nSugg := len(aRet_) - - // - // At this point, we have a list of words in aRet_, which now need to - // be checked for suffixes, prefixes, and plurals. - // - - for jj := 1 to nSugg - cHold := rtrim(substr(aRet_[jj],5)) // Extract the word - zz := len(cHold) // - // Check suffixes + FOR jj := 2 TO zz + cHold := Left( cWord, jj - 2 ) + SubStr( cWord, jj, 1 ) + ; + SubStr( cWord, jj - 1, 1 ) + SubStr( cWord, jj + 1 ) + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cHold } ) == 0 .AND. Sp_Check( cHold ) + AAdd( aRet_, "B" + SP_Rate( cHold, cWord ) + cHold ) + ENDIF + NEXT + + // + // Step Four - Try adding a silent E to the end // - //////////////// - if ADD_SUFFIXES - for kk := 1 to nSuffix - cTemp := cHold+aEnds[kk] - if ascan(aRet_,{ |xx| substr(xx,5)==cTemp}) == 0 .and. ; - Sp_Check(cTemp) - Aadd( aRet_,"C"+SP_Rate(cTemp,cWord)+cTemp ) - endif - next - // - // Try doubling the last letter - // - ////////// - for kk := 1 to nSuffix - cTemp := cHold+substr(cHold,zz,1)+aEnds[kk] - if ascan(aRet_,{ |xx| substr(xx,5)==cTemp}) == 0 .and. ; - SP_Check( cTemp ) - Aadd( aRet_,"C"+SP_Rate(cTemp,cWord)+cTemp ) - endif - next - // - // Accomodate words ending in C - // - ////////// - if substr(cHold,-1,1)=="C" - for kk := 1 to nSuffix - cTemp := cHold+"K"+aEnds[kk] - if ascan(aRet_,{ |xx| substr(xx,5)==cTemp}) == 0 .and. ; - SP_Check( cTemp ) - Aadd( aRet_,"C"+SP_Rate(cTemp,cWord)+cTemp ) - endif - next - endif - // - // Accomodate words ending in ND - // - ////////// - if substr(cHold,-2,2)=="ND" - cTemp := substr(cHold,1,zz-1)+"SE" - if ascan(aRet_,{ |xx| substr(xx,5)==cTemp}) == 0 .and. ; - SP_Check( cTemp ) - Aadd( aRet_,"C"+SP_Rate(cTemp,cWord)+cTemp ) - endif - for kk := 1 to nSuffix - cTemp := substr(cHold,1,zz-1)+"SE"+aEnds[kk] - if ascan(aRet_,{ |xx| substr(xx,5)==cTemp}) == 0 .and. ; - SP_Check( cTemp ) - Aadd( aRet_,"C"+SP_Rate(cTemp,cWord)+cTemp ) - endif - cTemp := substr(cHold,1,zz-1)+"S"+aEnds[kk] - if ascan(aRet_,{ |xx| substr(xx,5)==cTemp}) == 0 .and. ; - SP_Check( cTemp ) - Aadd( aRet_,"C"+SP_Rate(cTemp,cWord)+cTemp ) - endif - next - endif - // - // Words ending in E, remove the E and try - // - /////////////////////////////////////// - if substr(cHold,zz,1)=="E" - for kk := 1 to nSuffix - cTemp := substr(cHold,1,zz-1)+aEnds[kk] - if ascan(aRet_,{ |xx| substr(xx,5)==cTemp}) == 0 .and. ; - SP_Check( cTemp ) - Aadd( aRet_,"C"+SP_Rate(cTemp,cWord)+cTemp ) - endif - next - endif - endif - if ADD_PREFIXES - for kk := 1 to 7 - cTemp := aBegs[kk]+cHold - if ascan(aRet_,{ |xx| substr(xx,5)==cTemp}) == 0 .and. ; - SP_Check( cTemp ) - Aadd( aRet_,"C"+SP_Rate(cTemp,cWord)+cTemp ) - endif - next - endif - if ADD_PLURALS - cTemp := cHold+"S" - if ascan(aRet_,{ |xx| substr(xx,5)==cTemp}) == 0 .and. ; - SP_Check(cTemp) - Aadd( aRet_,"C"+SP_Rate(cTemp,cWord)+cTemp ) - endif + cHold := cWord + "E" + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cHold } ) == 0 .AND. Sp_Check( cHold ) + AAdd( aRet_, "B" + SP_Rate( cHold, cWord ) + cHold ) + ENDIF + + // + // Step Five - Do sound alike substitutions + // + + FOR jj := 1 TO nSize + IF aParts_[ jj, 1 ] $ cWord + IF aParts_[ jj, 1 ] $ "AEIOUT" + ii := 0 + DO WHILE ( ii := fat( aParts_[ jj, 1 ], cWord, ii ) ) > 0 + FOR kk := 1 TO Len( aParts_[ jj, 2 ] ) + cHold := SubStr( cWord, 1, ii - 1 ) + aParts_[ jj, 2, kk ] + SubStr( cWord, ii + 1 ) + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cHold } ) == 0 .AND. Sp_Check( cHold ) + AAdd( aRet_, "B" + SP_Rate( cHold, cWord ) + cHold ) + ENDIF + NEXT + ii++ + ENDDO + ELSE + FOR kk := 1 TO Len( aParts_[ jj, 2 ] ) + cHold := StrTran( cWord, aParts_[ jj, 1 ], aParts_[ jj, 2, kk ] ) + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cHold } ) == 0 .AND. Sp_Check( cHold ) + AAdd( aRet_, "B" + SP_Rate( cHold, cWord ) + cHold ) + ENDIF + NEXT + ENDIF + ENDIF + NEXT + nSugg := Len( aRet_ ) + + // + // At this point, we have a list of words in aRet_, which now need to + // be checked for suffixes, prefixes, and plurals. + // + + FOR jj := 1 TO nSugg + cHold := RTrim( SubStr( aRet_[ jj ], 5 ) ) // Extract the word + zz := Len( cHold ) + // + // Check suffixes + // + // + IF ADD_SUFFIXES + FOR kk := 1 TO nSuffix + cTemp := cHold + aEnds[ kk ] + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cTemp } ) == 0 .AND. ; + Sp_Check( cTemp ) + AAdd( aRet_, "C" + SP_Rate( cTemp, cWord ) + cTemp ) + ENDIF + NEXT + // + // Try doubling the last letter + // + + FOR kk := 1 TO nSuffix + cTemp := cHold + SubStr( cHold, zz, 1 ) + aEnds[ kk ] + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cTemp } ) == 0 .AND. ; + SP_Check( cTemp ) + AAdd( aRet_, "C" + SP_Rate( cTemp, cWord ) + cTemp ) + ENDIF + NEXT + // + // Accomodate words ending in C + // + + IF SubStr( cHold, -1, 1 ) == "C" + FOR kk := 1 TO nSuffix + cTemp := cHold + "K" + aEnds[ kk ] + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cTemp } ) == 0 .AND. ; + SP_Check( cTemp ) + AAdd( aRet_, "C" + SP_Rate( cTemp, cWord ) + cTemp ) + ENDIF + NEXT + ENDIF + // + // Accomodate words ending in ND + // + + IF SubStr( cHold, -2, 2 ) == "ND" + cTemp := SubStr( cHold, 1, zz - 1 ) + "SE" + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cTemp } ) == 0 .AND. ; + SP_Check( cTemp ) + AAdd( aRet_, "C" + SP_Rate( cTemp, cWord ) + cTemp ) + ENDIF + FOR kk := 1 TO nSuffix + cTemp := SubStr( cHold, 1, zz - 1 ) + "SE" + aEnds[ kk ] + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cTemp } ) == 0 .AND. ; + SP_Check( cTemp ) + AAdd( aRet_, "C" + SP_Rate( cTemp, cWord ) + cTemp ) + ENDIF + cTemp := SubStr( cHold, 1, zz - 1 ) + "S" + aEnds[ kk ] + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cTemp } ) == 0 .AND. ; + SP_Check( cTemp ) + AAdd( aRet_, "C" + SP_Rate( cTemp, cWord ) + cTemp ) + ENDIF + NEXT + ENDIF + // + // Words ending in E, remove the E and try + // + + IF SubStr( cHold, zz, 1 ) == "E" + FOR kk := 1 TO nSuffix + cTemp := SubStr( cHold, 1, zz - 1 ) + aEnds[ kk ] + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cTemp } ) == 0 .AND. ; + SP_Check( cTemp ) + AAdd( aRet_, "C" + SP_Rate( cTemp, cWord ) + cTemp ) + ENDIF + NEXT + ENDIF + ENDIF + + IF ADD_PREFIXES + FOR kk := 1 TO 7 + cTemp := aBegs[ kk ] + cHold + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cTemp } ) == 0 .AND. ; + SP_Check( cTemp ) + AAdd( aRet_, "C" + SP_Rate( cTemp, cWord ) + cTemp ) + ENDIF + NEXT + ENDIF + + IF ADD_PLURALS + cTemp := cHold + "S" + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cTemp } ) == 0 .AND. ; + SP_Check( cTemp ) + AAdd( aRet_, "C" + SP_Rate( cTemp, cWord ) + cTemp ) + ENDIF + + IF SubStr( cHold, zz, 1 ) == "Y" + cTemp := SubStr( cHold, 1, zz - 1 ) + "IES" + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cTemp } ) == 0 .AND. ; + SP_Check( cTemp ) + AAdd( aRet_, "C" + SP_Rate( cTemp, cWord ) + cTemp ) + ENDIF + ELSEIF SubStr( cHold, zz, 1 ) == "F" + cTemp := SubStr( cHold, 1, zz - 1 ) + "VES" + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cTemp } ) == 0 .AND. ; + SP_Check( cTemp ) + AAdd( aRet_, "C" + SP_Rate( cTemp, cWord ) + cTemp ) + ENDIF + ELSEIF SubStr( cHold, zz, 1 ) == "O" + cTemp := cHold + "ES" + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cTemp } ) == 0 .AND. ; + SP_Check( cTemp ) + AAdd( aRet_, "C" + SP_Rate( cTemp, cWord ) + cTemp ) + ENDIF + ENDIF + ENDIF + NEXT + ENDIF + + // + // Check metaphone matches, only if SUGGEST_PREFERENCE is metafone or both, + // because this search can slow things down a bit + // + + IF SUGGEST_PREFERENCE $ "MB" + IF METAPHONE_SIZE == 0 + zz := Min( 5, Len( cWord ) ) + IF zz < 3 + zz := 3 + ENDIF + ELSE + zz := METAPHONE_SIZE + ENDIF + cTemp := SP_GetBuf( cWord ) + ii := Len( cTemp ) + cMeta := C_Metafone( cWord, zz ) + zz := Len( cMeta ) + cFirst := SubStr( cWord, 1, 2 ) + + IF ii > 0 + + IF SubStr( cMeta, 2, 1 ) >= "N" + + kk := ii - 5 + jj := ii - 4 + + DO WHILE kk > 0 + IF Asc( SubStr( cTemp, kk, 1 ) ) >= 128 // End of word + cHold := cFirst + xUnForm( SubStr( cTemp, kk + 1, jj - kk ) ) + cKey := c_metafone( cHold, zz ) + IF cMeta == c_Metafone( cHold, zz ) + IF MAX_DIFFERENCE < 0 .OR. Abs( Len( cWord ) -Len( cHold ) ) <= MAX_DIFFERENCE + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cHold } ) == 0 + AAdd( aRet_, "B" + SP_Rate( cHold, cWord ) + cHold ) + ENDIF + ENDIF + ELSEIF cKey < cMeta + EXIT + ENDIF + jj := kk + ENDIF + kk-- + ENDDO + + + ELSE + kk := 1 + jj := 1 + + DO WHILE kk < ii + IF Asc( SubStr( cTemp, kk, 1 ) ) >= 128 // End of word + cHold := cFirst + xUnForm( SubStr( cTemp, jj, kk - jj + 1 ) ) + cKey := c_metafone( cHold, zz ) + IF cMeta == c_Metafone( cHold, zz ) + IF MAX_DIFFERENCE < 0 .OR. Abs( Len( cWord ) -Len( cHold ) ) <= MAX_DIFFERENCE + IF AScan( aRet_, {|xx| SubStr( xx, 5 ) == cHold } ) == 0 + AAdd( aRet_, "B" + SP_Rate( cHold, cWord ) + cHold ) + ENDIF + ENDIF + ELSEIF cKey > cMeta + EXIT + ENDIF + jj := kk + 1 + ENDIF + kk++ + ENDDO + ENDIF + + ENDIF + ENDIF + + + nSugg := Len( aRet_ ) + IF nSugg > 1 .AND. SORT_SUGGESTIONS + ASort( aRet_ ) + ENDIF + + FOR kk := 1 TO nSugg + aRet_[ kk ] := SubStr( aRet_[ kk ], 5 ) + NEXT + + RETURN aRet_ + + +// * +// * Function: Sp_Quick() +// * Purpose: To return an array of quick spellings +// * Syntax: aSuggest := Sp_Quick( cWord ) +// * Arguments: cWord - Word to look for suggestions for +// * Returns: aSuggest - List of suggested words +// * + +FUNCTION Sp_Quick( cWord ) + + STATIC aTryThese := { ; + "AI$AO$AU$AY$EA$EI$EIGH$ET$EY$E$O$", ; + "A$AE$AI$AY$EA$EI$EO$IE$U$O$", ; + "A$E$EE$IA$IE$O$U$UI$Y$YE$UY$EI$IGH$", ; + "AU$EAU$EO$EW$OA$OE$OH$OU$OUGH$OW$A$AH$AW$UO$E$", ; + "O$OE$OO$OU$EUA$EU$EUE$EW$IEU$IEW$UE$UI$YOU$YU$", ; + "ED$GHT$PT$TH$" } + + LOCAL ii := 0 + LOCAL nOld, jj, kk + LOCAL zz := Len( cWord ) + LOCAL arr_ := {} + LOCAL cHold, ll, cTemp + + // *DEBUG** + @ 24, 30 SAY "At SP_quick" + + cWord := Upper( RTrim( cWord ) ) + + IF zz < 3 // Don't offer suggestions for + RETURN {} // one or two letter words + ENDIF + + + // * + // * Step One - Do letter doubling + // * + + FOR jj := 2 TO zz + IF SubStr( cWord, jj, 1 ) $ "BCDEFGKLMNOPRSTZ" + cHold := Left( cWord, jj ) + SubStr( cWord, jj, 1 ) + ; + SubStr( cWord, jj + 1 ) + // * + // * If the word is not already in the list, then check + // * to see if it is a valid word. + // * + + IF AScan( arr_, cHold ) == 0 .AND. Sp_Check( cHold ) + AAdd( arr_, cHold ) + ENDIF + ENDIF + NEXT + + // * + // * Step Two - Remove extra letters + // * + + FOR jj := 1 TO zz + cHold := Left( cWord, jj - 1 ) + SubStr( cWord, jj + 1 ) + // * + // * If the word is not already in the list, then check + // * to see if it is a valid word. + // * + + IF AScan( arr_, cHold ) == 0 .AND. Sp_Check( cHold ) + AAdd( arr_, cHold ) + ENDIF + NEXT + + // * + // * Step Three - Transpose the letters + // * + + FOR jj := 2 TO zz + cHold := Left( cWord, jj - 2 ) + SubStr( cWord, jj, 1 ) + ; + SubStr( cWord, jj - 1, 1 ) + SubStr( cWord, jj + 1 ) + IF AScan( arr_, cHold ) == 0 .AND. Sp_Check( cHold ) + AAdd( arr_, cHold ) + ENDIF + NEXT + + // * + // * Step Four - Try adding a silent E to the end + // * + + + cHold := cWord + "E" + IF AScan( arr_, cHold ) == 0 .AND. Sp_Check( cHold ) + AAdd( arr_, cHold ) + ENDIF + + // * + // * Step Five - Do sound alike substitutions + // * + + + + FOR jj := 1 TO 6 + IF SubStr( "AEIOUT", jj, 1 ) $ cWord + ii := fat( SubStr( "AEIOUT", jj, 1 ), cWord, ii ) + nold := 1 + DO WHILE ii > 0 + FOR kk := 1 TO chrcount( "$", aTryThese[ jj ] ) + ll := fat( "$", aTryThese[ jj ], nOld ) + cTemp := SubStr( aTryThese[ jj ], nOld, ll - nOld ) + nOld := ll + 1 + cHold := SubStr( cWord, 1, ii - 1 ) + cTemp + SubStr( cWord, ii + 1 ) + IF AScan( arr_, cHold ) == 0 .AND. Sp_Check( cHold ) + AAdd( arr_, cHold ) + ENDIF + NEXT + ii++ + ii := fat( SubStr( "AEIOUT", jj, 1 ), cWord, ii ) + ENDDO + ENDIF + NEXT + + RETURN arr_ + +STATIC FUNCTION ChrCount( cChar, cString ) + + // *DEBUG** + @ 24, 30 SAY "At ChrCount" + + RETURN Len( cString ) -Len( StrTran( cString, cChar ) ) + +FUNCTION Sp_Split( cWord ) + + LOCAL arr_ := {} + LOCAL x + LOCAL cWord1 + LOCAL cWord2 + + // *DEBUG** + @ 24, 30 SAY "At SP_split" + + FOR x := 2 TO Len( cWord ) + cWord1 := Left( cWord, x - 1 ) + cWord2 := SubStr( cWord, x ) + IF Len( cWord1 ) > 1 .AND. Len( cWord2 ) > 1 + IF SP_Check( cWord1 ) .AND. SP_Check( cWord2 ) + AAdd( arr_, cWord1 + ' ' + cWord2 ) + ENDIF + ENDIF + NEXT + + RETURN arr_ + +FUNCTION SP_Expand( cWord ) + + LOCAL x + LOCAL cExpand + + // *DEBUG** + @ 24, 30 SAY "At SP_expand" + + cWord := Upper( AllTrim( cWord ) ) + x := AScan( aContracts, {|jj| jj[ 1 ] = cWord } ) + IF x > 0 + cExpand := aContracts[ x, 2 ] + ENDIF + + RETURN cExpand + + - if substr(cHold,zz,1)=="Y" - cTemp := substr(cHold,1,zz-1)+"IES" - if ascan(aRet_,{ |xx| substr(xx,5)==cTemp}) == 0 .and. ; - SP_Check(cTemp) - Aadd( aRet_,"C"+SP_Rate(cTemp,cWord)+cTemp ) - endif - elseif substr(cHold,zz,1)=="F" - cTemp := substr(cHold,1,zz-1)+"VES" - if ascan(aRet_,{ |xx| substr(xx,5)==cTemp}) == 0 .and. ; - SP_Check(cTemp) - Aadd( aRet_,"C"+SP_Rate(cTemp,cWord)+cTemp ) - endif - elseif substr(cHold,zz,1)=="O" - cTemp := cHold+"ES" - if ascan(aRet_,{ |xx| substr(xx,5)==cTemp}) == 0 .and. ; - SP_Check(cTemp) - Aadd( aRet_,"C"+SP_Rate(cTemp,cWord)+cTemp ) - endif - endif - endif - next -endif // -// Check metaphone matches, only if SUGGEST_PREFERENCE is metafone or both, -// because this search can slow things down a bit +// Function: Sp_WildCard() +// Purpose: To return an array of wildcard matches +// Syntax: aSuggest := Sp_WildCard( cPattern ) +// Arguments: cPattern - Pattern to match using * or ?'s +// Returns: aSuggest - List of matching words // -//////////////////////////// -if SUGGEST_PREFERENCE $ "MB" - if METAPHONE_SIZE == 0 - zz := min( 5,len(cWord)) - if zz < 3 - zz := 3 - endif - else - zz := METAPHONE_SIZE - endif - cTemp := SP_GetBuf(cWord) - ii := len(cTemp) - cMeta := C_Metafone(cWord,zz) - zz := len(cMeta) - cFirst := substr(cWord,1,2) - if ii > 0 +FUNCTION Sp_Wildcard( cPattern ) - if substr(cMeta,2,1) >= "N" + LOCAL cTemp + LOCAL ii, kk, jj, cFirst, cHold, x, z + LOCAL arr_ := {} + LOCAL nStart, nEnd - kk := ii-5 - jj := ii-4 + // *DEBUG** + @ 24, 30 SAY "At SP_wildcard" - do while kk > 0 - if asc(substr(cTemp,kk,1)) >= 128 // End of word - cHold := cFirst+xUnForm(substr(cTemp,kk+1,jj-kk)) - cKey := c_metafone(cHold,zz) - if cMeta == c_Metafone(cHold,zz) - if MAX_DIFFERENCE < 0 .or. abs(len(cWord)-len(cHold)) <= MAX_DIFFERENCE - if ascan(aRet_,{ |xx| substr(xx,5)==cHold}) == 0 - Aadd( aRet_,"B"+SP_Rate(cHold,cWord)+cHold ) - endif - endif - elseif cKey < cMeta - exit - endif - jj := kk - endif - kk-- - enddo + cPattern := Upper( cPattern ) + + IF SP_Init() + x := fat( "*", cPattern ) + IF x == 0 + x := fat( "?", cPattern ) + ENDIF + IF x == 1 // Can't handle wildcards in first position + RETURN arr_ + ENDIF + IF x == 2 + nStart := 1 + nEnd := 26 + ELSE + nStart := Asc( SubStr( cPattern, 2, 1 ) ) -64 + nEnd := nStart + ENDIF - else - kk := 1 - jj := 1 + FOR z := nStart TO nEnd + cTemp := SP_GetBuf( SubStr( cPattern, 1, 1 ) + Chr( z + 64 ) ) + ii := Len( cTemp ) + cFirst := SubStr( cPattern, 1, 1 ) + Chr( z + 64 ) - do while kk < ii - if asc(substr(cTemp,kk,1)) >= 128 // End of word - cHold := cFirst+xUnForm(substr(cTemp,jj,kk-jj+1)) - cKey := c_metafone(cHold,zz) - if cMeta == c_Metafone(cHold,zz) - if MAX_DIFFERENCE < 0 .or. abs(len(cWord)-len(cHold)) <= MAX_DIFFERENCE - if ascan(aRet_,{ |xx| substr(xx,5)==cHold}) == 0 - Aadd( aRet_,"B"+SP_Rate(cHold,cWord)+cHold ) - endif - endif - elseif cKey > cMeta - exit - endif - jj := kk+1 - endif - kk++ - enddo - endif + IF ii > 0 + kk := 1 + jj := 1 + DO WHILE kk < ii + IF Asc( SubStr( cTemp, kk, 1 ) ) >= 128 // End of word + cHold := cFirst + xUnForm( SubStr( cTemp, jj, kk - jj + 1 ) ) + IF WildCard( cPattern, cHold ) + AAdd( arr_, cHold ) + ENDIF + jj := kk + 1 + ENDIF + kk++ + ENDDO + ENDIF + NEXT + ENDIF - endif -endif - - -nSugg := len(aRet_) -if nSugg > 1 .and. SORT_SUGGESTIONS - Asort(aRet_) -endif - -for kk := 1 to nSugg - aRet_[kk] := substr(aRet_[kk],5) -next - -return aRet_ -******************************************************************************* - -** -** Function: Sp_Quick() -** Purpose: To return an array of quick spellings -** Syntax: aSuggest := Sp_Quick( cWord ) -** Arguments: cWord - Word to look for suggestions for -** Returns: aSuggest - List of suggested words -** -****************************************************************************** -function Sp_Quick( cWord ) - -STATIC aTryThese := { "AI$AO$AU$AY$EA$EI$EIGH$ET$EY$E$O$",; - "A$AE$AI$AY$EA$EI$EO$IE$U$O$",; - "A$E$EE$IA$IE$O$U$UI$Y$YE$UY$EI$IGH$",; - "AU$EAU$EO$EW$OA$OE$OH$OU$OUGH$OW$A$AH$AW$UO$E$",; - "O$OE$OO$OU$EUA$EU$EUE$EW$IEU$IEW$UE$UI$YOU$YU$",; - "ED$GHT$PT$TH$" } - -LOCAL ii := 0 -LOCAL nOld,jj,kk -LOCAL zz := len(cWord) -LOCAL arr_ := {} -LOCAL cHold,ll,cTemp - -**DEBUG** -@24,30 SAY "At SP_quick" - -cWord := upper(rtrim(cWord)) - -if zz < 3 && Don't offer suggestions for - return {} && one or two letter words -endif - - -** -** Step One - Do letter doubling -** -********************************** -for jj := 2 to zz - if substr(cWord,jj,1)$"BCDEFGKLMNOPRSTZ" - cHold := left(cWord,jj)+substr(cWord,jj, 1)+; - substr(cWord,jj+1) - ** - ** If the word is not already in the list, then check - ** to see if it is a valid word. - ** - ****************************************** - if ascan(arr_,cHold) == 0 .and. Sp_Check(cHold) - Aadd(arr_,cHold) - endif - endif -next - -** -** Step Two - Remove extra letters -** -********************************** -for jj := 1 to zz - cHold := left(cWord,jj-1)+substr(cWord,jj+1) - ** - ** If the word is not already in the list, then check - ** to see if it is a valid word. - ** - ****************************************** - if ascan(arr_,cHold) == 0 .and. Sp_Check(cHold) - Aadd(arr_,cHold) - endif -next - -** -** Step Three - Transpose the letters -** -************************** -for jj := 2 to zz - cHold := left(cWord,jj-2)+substr(cWord,jj, 1)+; - substr(cWord,jj-1,1)+substr(cWord,jj+1) - if ascan(arr_,cHold) == 0 .and. Sp_Check(cHold) - Aadd(arr_,cHold) - endif -next - -** -** Step Four - Try adding a silent E to the end -** -****************** - -cHold := cWord+"E" -if ascan(arr_,cHold) == 0 .and. Sp_Check(cHold) - Aadd(arr_,cHold) -endif - -** -** Step Five - Do sound alike substitutions -** -********************************** - - -for jj := 1 to 6 - if substr("AEIOUT",jj,1)$cWord - ii := fat(substr("AEIOUT",jj,1),cWord,ii) - nold := 1 - do while ii > 0 - for kk := 1 to chrcount("$",aTryThese[jj]) - ll := fat("$",aTryThese[jj],nOld) - cTemp := substr(aTryThese[jj],nOld,ll-nOld) - nOld := ll +1 - cHold := substr(cWord,1,ii-1)+cTemp+substr(cWord,ii+1) - if ascan(arr_,cHold) == 0 .and. Sp_Check(cHold) - Aadd(arr_,cHold) - endif - next - ii++ - ii := fat(substr("AEIOUT",jj,1),cWord,ii) - enddo - endif -next - -return arr_ - -STATIC function ChrCount(cChar,cString) - -**DEBUG** -@24,30 SAY "At ChrCount" - -return len(cString)-len(strTran(cString,cChar)) - -** -** Function: Sp_Split() -** Purpose: -** Syntax: -** Arguments: -** Returns: -** -****************************************************************************** -function Sp_Split( cWord ) -LOCAL arr_ := {} -LOCAL x -LOCAL cWord1 -LOCAL cWord2 - -**DEBUG** -@24,30 SAY "At SP_split" - -for x := 2 to len(cWord) - cWord1 := left(cWord,x-1) - cWord2 := substr(cWord,x) - if len(cWord1) > 1 .and. len(cWord2) > 1 - if SP_Check(cWord1) .and. SP_Check(cWord2) - Aadd(arr_,cWord1+' '+cWord2) - endif - endif -next -return arr_ -****************************************************************************** - - -** -** Function: Sp_Expand() -** Purpose: -** Syntax: -** Arguments: -** Returns: -** -****************************************************************************** -function SP_Expand(cWord) -LOCAL x -LOCAL cExpand - -**DEBUG** -@24,30 SAY "At SP_expand" - -cWord := upper(alltrim(cWord)) -x := ascan( aContracts, { |jj|jj[1]=cWord } ) -if x > 0 - cExpand := aContracts[x,2] -endif -return cExpand -****************************************************************************** + RETURN arr_ -** -** Function: Sp_WildCard() -** Purpose: To return an array of wildcard matches -** Syntax: aSuggest := Sp_WildCard( cPattern ) -** Arguments: cPattern - Pattern to match using * or ?'s -** Returns: aSuggest - List of matching words -** -****************************************************************************** -function Sp_Wildcard( cPattern ) -LOCAL cTemp -LOCAL ii,kk,jj,cFirst,cHold,x,z -LOCAL arr_ := {} -LOCAL nStart,nEnd -**DEBUG** -@24,30 SAY "At SP_wildcard" +// The following functions are internal and should not be modified. * -cPattern := upper(cPattern) - -if SP_Init() - x := fat("*",cPattern) - if x == 0 - x := fat("?",cPattern) - endif - if x == 1 // Can't handle wildcards in first position - return arr_ - endif - if x == 2 - nStart := 1 - nEnd := 26 - else - nStart := asc(substr(cPattern,2,1))-64 - nEnd := nStart - endif - - - for z := nStart to nEnd - cTemp := SP_GetBuf(substr(cPattern,1,1)+chr( z + 64 ) ) - ii := len(cTemp) - cFirst := substr(cPattern,1,1)+chr( z + 64 ) - - if ii > 0 - kk := 1 - jj := 1 - do while kk < ii - if asc(substr(cTemp,kk,1)) >= 128 // End of word - cHold := cFirst+xUnForm(substr(cTemp,jj,kk-jj+1)) - if WildCard(cPattern,cHold) - Aadd( arr_,cHold ) - endif - jj := kk+1 - endif - kk++ - enddo - endif - next -endif -return arr_ - - - -****************************************************************************** -* The following functions are internal and should not be modified. * -****************************************************************************** // Function: SP_Init() // Purpose: Internal function to initialize the dictionary @@ -1068,75 +1069,76 @@ return arr_ // // Notes: // -//////////////////////////// -function Sp_init -LOCAL isok := .T. -LOCAL cBuf -LOCAL i -LOCAL j -LOCAL nOther := 0 -LOCAL cOther := "" -LOCAL nFileSize -**DEBUG** -@24,30 SAY "At SP_init" +FUNCTION Sp_init -if cOffsets == NIL - isok := .F. - nHandle := fopen(DICTIONARY_PATH+DICTIONARY_NAME, FO_READ + FO_DENYWRITE ) - if nHandle > 0 + LOCAL isok := .T. + LOCAL cBuf + LOCAL i + LOCAL j + LOCAL nOther := 0 + LOCAL cOther := "" + LOCAL nFileSize - #ifdef REDUCE_MEMORY_NEEDS + // *DEBUG** + @ 24, 30 SAY "At SP_init" - cBuf := space(6) - fread(nHandle,@cBuf,6) + IF cOffsets == NIL + isok := .F. + nHandle := FOpen( DICTIONARY_PATH + DICTIONARY_NAME, FO_READ + FO_DENYWRITE ) + IF nHandle > 0 - #else +#ifdef REDUCE_MEMORY_NEEDS - cBuf := space(NSIZE+6) - fread(nHandle,@cBuf,NSIZE+6) + cBuf := Space( 6 ) + FRead( nHandle, @cBuf, 6 ) - #endif +#else - if substr(cBuf,1,2)=="JJ" - nOther := bin2l(substr(cBuf,3,4)) + cBuf := Space( NSIZE + 6 ) + FRead( nHandle, @cBuf, NSIZE + 6 ) - #ifndef REDUCE_MEMORY_NEEDS +#endif - cOffSets := substr(cBuf,7) + IF SubStr( cBuf, 1, 2 ) == "JJ" + nOther := Bin2L( SubStr( cBuf, 3, 4 ) ) - #endif +#ifndef REDUCE_MEMORY_NEEDS - nFileSize := fseek(nHandle,0,FS_END) - if nFileSize-nOther > 0 - cOther := space(nFileSize-nOther) - fseek(nHandle,nOther,FS_SET) - fread(nHandle,@cOther,(nFileSize-nOther)) - endif - aGlobal[2] += cOther - isok := .T. - endif - if !empty( AUXILIARY_DICTIONARY ) - SP_LoadAux( AUXILIARY_DICTIONARY ) - endif - endif - if aGlobal[1] == NIL - SP_Common() - endif + cOffSets := SubStr( cBuf, 7 ) -** Thesaurus comented out as not needed -* if !empty( THESAURUS_NAME ) -* if file( DICTIONARY_PATH+THESAURUS_NAME ) -* SP_OpenThes( DICTIONARY_PATH+THESAURUS_NAME ) -* elseif file( THESAURUS_NAME ) -* SP_OpenThes( THESAURUS_NAME ) -* endif -* endif +#endif -endif + nFileSize := FSeek( nHandle, 0, FS_END ) + IF nFileSize - nOther > 0 + cOther := Space( nFileSize - nOther ) + FSeek( nHandle, nOther, FS_SET ) + FRead( nHandle, @cOther, ( nFileSize - nOther ) ) + ENDIF + aGlobal[ 2 ] += cOther + isok := .T. + ENDIF + IF !Empty( AUXILIARY_DICTIONARY ) + SP_LoadAux( AUXILIARY_DICTIONARY ) + ENDIF + ENDIF + IF aGlobal[ 1 ] == NIL + SP_Common() + ENDIF + + // * Thesaurus comented out as not needed + // if !empty( THESAURUS_NAME ) + // if file( DICTIONARY_PATH+THESAURUS_NAME ) + // SP_OpenThes( DICTIONARY_PATH+THESAURUS_NAME ) + // elseif file( THESAURUS_NAME ) + // SP_OpenThes( THESAURUS_NAME ) + // endif + // endif + + ENDIF + + RETURN isok -return isok -****************************************************************************** // @@ -1155,155 +1157,156 @@ return isok // // Calls: // -////////////////////////////////// -function DBF2Dic(cDbf,cDictionary,lTalk) -LOCAL nStatus := 0 // Status code -LOCAL i // Loop counters -LOCAL j -LOCAL x -LOCAL nH // File handle -LOCAL nWhere -LOCAL temp -LOCAL cBits -LOCAL cSave -LOCAL nSize -LOCAL cOther := "" -LOCAL nCurRec := 0 +FUNCTION DBF2Dic( cDbf, cDictionary, lTalk ) -// -// DEFAULT name for dictionary file -// -////////////////////////////////////// -**DEBUG** -@24,30 SAY "At DBF2DIC" + LOCAL nStatus := 0 // Status code + LOCAL i // Loop counters + LOCAL j + LOCAL x + LOCAL nH // File handle + LOCAL nWhere + LOCAL temp + LOCAL cBits + LOCAL cSave + LOCAL nSize + LOCAL cOther := "" + LOCAL nCurRec := 0 -if cDictionary == NIL - cDictionary := "DICT.DIC" -endif - -if lTalk == NIL - lTalk := .F. -endif - - -// -// See if the DBF file exists -// -////////////////////////////////////// -if ! "."$cDBF - cDBF += ".DBF" -endif - -if !file( cDBF ) - return -1 -endif - -use (cDbf) alias DICT new -if fieldpos("WORD") == 0 - use - return -2 -endif - -if lTalk - - cSave := SaveScreen(8,30,11,48) - hb_DispBox(8,30,11,48,,"W+/R") - @ 8,33 say " Creating DIC " color "W+/R" - @ 9,31 say " Indexing words " color "W/R" - @ 10,31 say " " color "W/R" - - nSize := DICT->(lastrec()) - -endif - -index on substr(DICT->word,1,2)+padr(c_metafone(alltrim(DICT->word),5),6) to $$temp -go top - - -if lTalk - @ 9,31 say "Percent " color "W/R" - @ 10,31 say "Complete: " color "W/R" -endif - -// -// Create the dictionary file -// -////////////////////////////////////// - && ADDED - 02/08/96 - JAMES -IF nHandle > 0 && Is dictionary already open? - FCLOSE(nHandle) && Yes, close it - nHandle := 0 -ENDIF && END OF ADDITION - -nH := fcreate(cDictionary) - -if nH >= 0 // - // Write out enough bytes to hold the index information + // DEFAULT name for dictionary file // - ///////////////////////////////////////////////////////////////////////// - fwrite(nH,"JJ"+l2bin(NSIZE+4)+replicate(chr( 0 ),NSIZE)+space(10),NSIZE+16) - for i := 1 to 26 - do while substr(DICT->word,1,1)==chr( i + 64 ) .and. !eof() - for j := 1 to 26 - temp := "" - cBits := FOUR_BYTES - do while !isAlpha(substr(DICT->word,2,1)) .and. !eof() - if len(alltrim(DICT->word)) > 0 - cOther += "|"+alltrim(DICT->word) - endif - skip +1 - enddo - do while substr(DICT->word,2,1)==chr( j + 64 ) .and. !eof() - if len(rtrim(DICT->word))=3 - Bit(cBits,asc(substr(DICT->word,3,1))-64,.T.) - elseif len(rtrim(DICT->word))==2 - Bit(cBits,27,.T.) - else - temp += StoreWord(rtrim(DICT->word)) - endif - skip +1 - if lTalk - nCurRec++ - @ 10,41 say (nCurRec/nSize) * 100 picture "999.9%" color "W+/R" - endif - enddo - if !empty(temp) .or. cBits != FOUR_BYTES + // *DEBUG** + @ 24, 30 SAY "At DBF2DIC" - nWhere := fseek(nH,0,FS_END) + IF cDictionary == NIL + cDictionary := "DICT.DIC" + ENDIF - Fseek(nH,((i-1)*26*EACH_WORD)+((j-1)*EACH_WORD)+6) - Fwrite(nH,l2bin(nWhere)+i2bin(len(temp)+4),EACH_WORD) - Fseek(nH,0,FS_END) - Fwrite(nH,cBits+temp,len(temp)+4) - endif - next - enddo - next - j := fseek(nH,0,FS_END) - fseek(nH,2,FS_SET) - fwrite(nH,l2bin(j),4) - if !empty(cOther) - fseek(nH,j,FS_SET) - cOther += "|" - fwrite(nH,cOther,len(cOther)) - endif - fclose(nH) -else - nStatus := nH -endif + IF lTalk == NIL + lTalk := .F. + ENDIF -if lTalk - RestScreen(8,30,11,48,cSave) -endif -select DICT -use -// ferase("$$TEMP"+indexext()) -return nStatus -******************************************************************************* + // + // See if the DBF file exists + // + + IF ! "." $ cDBF + cDBF += ".DBF" + ENDIF + + IF !File( cDBF ) + RETURN -1 + ENDIF + + USE ( cDbf ) ALIAS DICT new + IF FieldPos( "WORD" ) == 0 + USE + RETURN -2 + ENDIF + + IF lTalk + + cSave := SaveScreen( 8, 30, 11, 48 ) + hb_DispBox( 8, 30, 11, 48,, "W+/R" ) + @ 8, 33 SAY " Creating DIC " COLOR "W+/R" + @ 9, 31 SAY " Indexing words " COLOR "W/R" + @ 10, 31 SAY " " COLOR "W/R" + + nSize := DICT->( LastRec() ) + + ENDIF + + INDEX ON SubStr( DICT->word, 1, 2 ) + PadR( c_metafone( AllTrim( DICT->word ), 5 ), 6 ) to $$ temp + GO TOP + + + IF lTalk + @ 9, 31 SAY "Percent " COLOR "W/R" + @ 10, 31 SAY "Complete: " COLOR "W/R" + ENDIF + + // + // Create the dictionary file + // + + // ADDED - 02/08/96 - JAMES + IF nHandle > 0 // Is dictionary already open? + FClose( nHandle ) // Yes, close it + nHandle := 0 + ENDIF // END OF ADDITION + + nH := FCreate( cDictionary ) + + IF nH >= 0 + // + // Write out enough bytes to hold the index information + // + + FWrite( nH, "JJ" + L2Bin( NSIZE + 4 ) + Replicate( Chr( 0 ), NSIZE ) + Space( 10 ), NSIZE + 16 ) + + FOR i := 1 TO 26 + DO WHILE SubStr( DICT->word, 1, 1 ) == Chr( i + 64 ) .AND. !Eof() + FOR j := 1 TO 26 + temp := "" + cBits := FOUR_BYTES + DO WHILE !IsAlpha( SubStr( DICT->word, 2, 1 ) ) .AND. !Eof() + IF Len( AllTrim( DICT->word ) ) > 0 + cOther += "|" + AllTrim( DICT->word ) + ENDIF + skip + 1 + ENDDO + DO WHILE SubStr( DICT->word, 2, 1 ) == Chr( j + 64 ) .AND. !Eof() + IF Len( RTrim( DICT->word ) ) = 3 + Bit( cBits, Asc( SubStr( DICT->word, 3, 1 ) ) -64, .T. ) + ELSEIF Len( RTrim( DICT->word ) ) == 2 + Bit( cBits, 27, .T. ) + ELSE + temp += StoreWord( RTrim( DICT->word ) ) + ENDIF + skip + 1 + IF lTalk + nCurRec++ + @ 10, 41 say ( nCurRec / nSize ) * 100 PICTURE "999.9%" COLOR "W+/R" + ENDIF + ENDDO + IF !Empty( temp ) .OR. cBits != FOUR_BYTES + + nWhere := FSeek( nH, 0, FS_END ) + + FSeek( nH, ( ( i - 1 ) * 26 * EACH_WORD ) + ( ( j - 1 ) * EACH_WORD ) + 6 ) + FWrite( nH, L2Bin( nWhere ) + I2Bin( Len( temp ) + 4 ), EACH_WORD ) + FSeek( nH, 0, FS_END ) + FWrite( nH, cBits + temp, Len( temp ) + 4 ) + ENDIF + NEXT + ENDDO + NEXT + j := FSeek( nH, 0, FS_END ) + FSeek( nH, 2, FS_SET ) + FWrite( nH, L2Bin( j ), 4 ) + IF !Empty( cOther ) + FSeek( nH, j, FS_SET ) + cOther += "|" + FWrite( nH, cOther, Len( cOther ) ) + ENDIF + FClose( nH ) + ELSE + nStatus := nH + ENDIF + + IF lTalk + RestScreen( 8, 30, 11, 48, cSave ) + ENDIF + + SELECT DICT + USE + // ferase("$$TEMP"+indexext()) + + RETURN nStatus + // // Function: Dic2DBF() @@ -1320,143 +1323,144 @@ return nStatus // // Calls: // -////////////////////////////////// -function DIC2DBF(cDictionary,cDBF,lTalk) -LOCAL nStatus := 0 // Status code -LOCAL i // Loop counters -LOCAL j -LOCAL x,y,z -LOCAL temp -LOCAL cBuf -LOCAL cWord -LOCAL cSave -LOCAL nSize +FUNCTION DIC2DBF( cDictionary, cDBF, lTalk ) -**DEBUG** -@24,30 SAY "At DIC2DBF" + LOCAL nStatus := 0 // Status code + LOCAL i // Loop counters + LOCAL j + LOCAL x, y, z + LOCAL temp + LOCAL cBuf + LOCAL cWord + LOCAL cSave + LOCAL nSize + // *DEBUG** + @ 24, 30 SAY "At DIC2DBF" + + // + // DEFAULT name for dictionary file + // + + IF cDictionary == NIL + cDictionary := "DICT.DIC" + ENDIF + + IF lTalk == NIL + lTalk := .F. + ENDIF + + IF !File( cDictionary ) + RETURN -1 + ENDIF + + DICTIONARY_NAME := cDictionary + + // + // Read the dictionary file + // + + IF !SP_Init() + RETURN -2 + ENDIF + // + // See if the DBF file exists + // + + IF ! "." $ cDBF + cDBF += ".DBF" + ENDIF + + dbCreate( cDbf, { { "WORD", "C", 25, 0 } } ) + + USE ( cDbf ) ALIAS DICT new + + IF lTalk + cSave := SaveScreen( 8, 30, 12, 48 ) + hb_DispBox( 8, 30, 12, 48,, "W+/R" ) + @ 8, 34 SAY " Creating DBF " COLOR "W+/R" + @ 9, 31 SAY "Percent " COLOR "W/R" + @ 10, 31 SAY "Complete: " COLOR "W/R" + @ 11, 31 SAY " Record: " COLOR "W/R" + + temp := Directory( cDictionary ) + nSize := temp[ 1, 2 ] + + ENDIF + + + j := 2 + + FOR i := 2 TO Len( CACHE_WORDS ) + IF SubStr( CACHE_WORDS, i, 1 ) == "|" + APPEND BLANK + REPLACE DICT->word WITH SubStr( CACHE_WORDS, j, i - j ) + j := i + 1 + ENDIF + NEXT + + + FOR i := 1 TO 26 + FOR j := 1 TO 26 + temp := Chr( i + 64 ) + Chr( j + 64 ) + x := Bin2L( SubStr( cOffsets, ( ( i - 1 ) * 156 ) + ( ( j - 1 ) * EACH_WORD + 1 ), 4 ) ) + IF !Empty( x ) + y := Bin2W( SubStr( cOffsets, ( ( i - 1 ) * 156 ) + ( ( j - 1 ) * EACH_WORD + 5 ), 2 ) ) + + IF lTalk + @ 10, 43 say ( x / nSize ) * 100 PICTURE "999%" COLOR "W+/R" + @ 11, 41 SAY LastRec() PICTURE "99,999" COLOR "W+/R" + ENDIF + + cBuf := Space( y ) + FSeek( nHandle, x, FS_SET ) + FRead( nHandle, @cBuf, y ) + FOR z := 1 TO 26 + IF bit( cBuf, z ) + APPEND BLANK + REPLACE DICT->word WITH temp + Chr( z + 64 ) + ENDIF + NEXT + IF bit( cBuf, 27 ) + APPEND BLANK + REPLACE DICT->word WITH temp + ENDIF + cBuf := SubStr( cBuf, 5 ) + z := 1 + DO WHILE !Empty( cBuf ) + IF SubStr( cBuf, z, 1 ) >= Chr( 128 ) + cWord := SubStr( cBuf, 1, z ) + APPEND BLANK + REPLACE DICT->word WITH temp + ExtractWord( cWord ) + cWord := "" + cBuf := SubStr( cBuf, z + 1 ) + z := 1 + + IF lTalk + @ 11, 41 SAY LastRec() PICTURE "99,999" COLOR "W+/R" + ENDIF + + ELSE + z++ + ENDIF + ENDDO + IF !Empty( cWord ) + ENDIF + cWord := "" + ENDIF + NEXT + NEXT + + IF lTalk + RestScreen( 8, 30, 12, 48, cSave ) + ENDIF + + SELECT DICT + USE + + RETURN nStatus // -// DEFAULT name for dictionary file -// -////////////////////////////////////// -if cDictionary == NIL - cDictionary := "DICT.DIC" -endif - -if lTalk == NIL - lTalk := .F. -endif - -if !file(cDictionary) - return -1 -endif - -DICTIONARY_NAME := cDictionary - -// -// Read the dictionary file -// -////////////////////////////////////// -if !SP_Init() - return -2 -endif -// -// See if the DBF file exists -// -////////////////////////////////////// -if ! "."$cDBF - cDBF += ".DBF" -endif - -dbcreate( cDbf,{ {"WORD","C",25,0} } ) - -use (cDbf) alias DICT new - -if lTalk - cSave := SaveScreen(8,30,12,48) - hb_DispBox(8,30,12,48,,"W+/R") - @ 8,34 say " Creating DBF " color "W+/R" - @ 9,31 say "Percent " color "W/R" - @ 10,31 say "Complete: " color "W/R" - @ 11,31 say " Record: " color "W/R" - - temp := directory(cDictionary) - nSize := temp[1,2] - -endif - - -j := 2 - -for i := 2 to len(CACHE_WORDS) - if substr(CACHE_WORDS,i,1)=="|" - append blank - replace DICT->word with substr(CACHE_WORDS,j,i-j) - j := i +1 - endif -next - - -for i := 1 to 26 - for j := 1 to 26 - temp := chr( i + 64 )+chr( j + 64 ) - x := bin2l(substr(cOffsets,((i-1)*156)+((j-1)*EACH_WORD+1),4)) - if !empty(x) - y := bin2w(substr(cOffsets,((i-1)*156)+((j-1)*EACH_WORD+5),2)) - - if lTalk - @ 10,43 say (x/nSize) * 100 picture "999%" color "W+/R" - @ 11,41 say lastrec() picture "99,999" color "W+/R" - endif - - cBuf := space(y) - fseek(nHandle,x,FS_SET) - fread(nHandle,@cBuf,y) - for z := 1 to 26 - if bit(cBuf,z) - append blank - replace DICT->word with temp+chr( z + 64 ) - endif - next - if bit(cBuf,27) - append blank - replace DICT->word with temp - endif - cBuf := substr(cBuf,5) - z := 1 - do while !empty(cBuf) - if substr(cBuf,z,1)>=Chr( 128 ) - cWord := substr(cBuf,1,z) - append blank - replace DICT->word with temp+ExtractWord(cWord) - cWord := "" - cBuf := substr(cBuf,z+1) - z := 1 - - if lTalk - @ 11,41 say lastrec() picture "99,999" color "W+/R" - endif - - else - z++ - endif - enddo - if !empty(cWord) - endif - cWord := "" - endif - next -next - -if lTalk - RestScreen(8,30,12,48,cSave) -endif - -select DICT -use -return nStatus -******************************************************************************** // Function: SP_Common() // Purpose: Loads the COMMON word static array element @@ -1468,186 +1472,193 @@ return nStatus // used English words. They are stored in RAM to prevent a // dictionary lookup for 70-80% of the words. // -/////////////////////////// -STATIC function SP_common +// +STATIC FUNCTION SP_common -#ifDef REDUCE_MEMORY_NEEDS +#ifdef REDUCE_MEMORY_NEEDS -aGlobal_[1] := "|THE|OF|AND|TO|A|IN|THAT|FOR|IS|WAS|IT|HE|I|AS"+; - "|WITH|ON|HIS|BE|AT|BY|NOT|THIS|HAD|HAVE|YOU|BUT"+; - "|FROM|ARE|OR|WHICH|AN|THEY|WILL|ONE|WERE|ALL|WE"+; - "|HER|SHE|WOULD|THERE|HAS|BEEN|HIM|THEIR|IF|WHEN"+; - "|SO|MORE|NO|WHO|YOUR|OUT|MY|I'VE|I'D|I'LL|CAN'T|" + aGlobal_[ 1 ] := ; + "|THE|OF|AND|TO|A|IN|THAT|FOR|IS|WAS|IT|HE|I|AS" + ; + "|WITH|ON|HIS|BE|AT|BY|NOT|THIS|HAD|HAVE|YOU|BUT" + ; + "|FROM|ARE|OR|WHICH|AN|THEY|WILL|ONE|WERE|ALL|WE" + ; + "|HER|SHE|WOULD|THERE|HAS|BEEN|HIM|THEIR|IF|WHEN" + ; + "|SO|MORE|NO|WHO|YOUR|OUT|MY|I'VE|I'D|I'LL|CAN'T|" #else -aGlobal[1] := "|THE|OF|AND|TO|A|IN|THAT|FOR|IS|WAS|IT|HE|I|AS|WITH|ON|HIS|BE|AT|BY"+; - "|NOT|THIS|HAD|HAVE|YOU|BUT|FROM|ARE|OR|WHICH|AN|THEY|WILL|ONE|WERE|ALL"+; - "|WE|HER|SHE|WOULD|THERE|HAS|BEEN|HIM|THEIR|IF|WHEN|SO|MORE|NO|WHO|YOUR"+; - "|OUT|MY|WHAT|UP|CAN|THEM|ABOUT|INTO|ITS|TIME|SOME|THAN|ME|OTHER|ONLY|NEW"+; - "|COULD|SAID|ANY|THESE|MAY|TWO|THEN|DO|FIRST|NOW|MAN|SUCH|VERY|LIKE|OVER"+; - "|OUR|EVEN|MOST|AFTER|MADE|ALSO|DID|MANY|SHOULD|BEFORE|MUST|THROUGH|YEARS"+; - "|WHERE|MUCH|WAY|WELL|DOWN|GOOD|BECAUSE|HERE|EACH|THOSE|PEOPLE|STATE|HOW"+; - "|TOO|LITTLE|WORLD|LAST|WORK|STILL|BACK|OWN|SEE|MEN|LONG|GET|JUST|GO|HOUSE"+; - "|BETWEEN|BOTH|LIFE|BEING|UNDER|YEAR|NEVER|DAY|SAME|ANOTHER|KNOW|WHILE|MIGHT"+; - "|US|GREAT|OLD|OFF|COME|AGAINST|SINCE|CAME|RIGHT|TAKE|USED|THREE|SMALL|MAKE"+; - "|STATES|HIMSELF|FEW|DURING|WITHOUT|AGAIN|PLACE|AROUND|HOWEVER|HOME|FOUND"+; - "|SAY|WHOSE|THOUGHT|NIGHT|DEAR|ONCE|WENT|GENERAL|HIGH|UPON|SCHOOL|EVERY|PART"+; - "|DON'T|DOES|GOT|UNITED|LEFT|NUMBER|COURSE|WAR|GOING|UNTIL|ALWAYS|AWAY"+; - "|SOMETHING|FACT|THOUGH|WATER|LESS|PUBLIC|PUT|THINK|ALMOST|HAND|ENOUGH|FAR"+; - "|TOOK|YET|GOVERNMENT|SYSTEM|BETTER|EYES|SET|TOLD|NOTHING|PRESIDENT|END"+; - "|HEAD|WHY|CALLED|DIDN'T|FIND|LOOK|ASKED|LATER|POINT|NEXT|PROGRAM|KNEW|CITY"+; - "|BUSINESS|GIVE|GROUP|TOWARD|YOUNG|DAYS|LET|ROOM|WITHIN|CHILDREN|SIDE|SOCIAL"+; - "|GIVEN|ORDER|PRESENT|SEVERAL|NATIONAL|USE|RATHER|SECOND|FACE|PER|POSSIBLE"+; - "|AMONG|FORM|IMPORTANT|OFTEN|THINGS|LOOKED|EARLY|WHITE|BECOME|CASE|SEND"+; - "|BIG|LARGE|NEED|FOUR|FELT|ALONG|GOD|SAW|BEST|CHURCH|EVER|LEAST|POWER"+; - "|DEVELOPMENT|LIGHT|THING|FAMILY|INTEREST|SEEMED|WANT|TODAY|MEMBERS|MIND"+; - "|COUNTRY|AREA|OTHERS|TURNED|ALTHOUGH|DONE|OPEN|SERVICE|CERTAIN|KIND|PROBLEM"+; - "|BEGAN|DIFFERENT|DOOR|THUS|HELP|MEANS|SENSE|WHOLE|MATTER|PERHAPS|ITSELF"+; - "|IT'S|TIMES|HUMAN|LAW|LINE|ABOVE|NAME|EXAMPLE|COMPANY|HANDS|LOCAL|SHOW"+; - "|BODY|FIVE|HISTORY|WHETHER|GAVE|EITHER|ACROSS|ACT|ACTION|FEET|ANYTHING"+; - "|PAST|QUITE|TAKEN|HAVING|SEEN|DEATH|EXPERIENCE|HALF|REALLY|WEEK|WORDS"+; - "|CAR|FIELD|MONEY|WORD|ALREADY|THEMSELVES|INFORMATION|I'M|TELL|CLOSE"+; - "|COLLEGE|PERIOD|SHALL|TOGETHER|HELD|KEEP|SURE|PROBABLY|FREE|REAL|BEHIND"+; - "|SEEMS|CANNOT|POLITICAL|AIR|QUESTION|OFFICE|WOMAN|BROUGHT|MAJOR|MOTHER"+; - "|SPECIAL|HEARD|PROBLEMS|AGO|BECAME|AVAILABLE|FEDERAL|MOMENT|STUDY"+; - "|KNOWN|RESULT|STREET|BOY|ECONOMIC|CHANGE|POSITION|REASON|SOUTH|BOARD"+; - "|INDIVIDUAL|JOB|SOCIETY|AREAS|WEST|SPACE|TURN|LOVE|COMMUNITY|TOWN|TRUE"+; - "|COURT|FORCE|FULL|SEEM|AGE|AM|COST|WIFE|FUTURE|VOICE|WANTED|CAN'T|DEPARTMENT"+; - "|USE|CENTER|COMMON|CONTROL|NECESSARY|POLICY|FOLLOWING|FRONTSOMETIMES|FATHER"+; - "|GIRL|SIX|WOMEN|CLEAR|MILITARY|FURTHER|ABLE|FIGURE|LAND|FEEL|MUSIC|PARTY"+; - "|PROVIDE|CENTURY|EDUCATION|UNIVERSITY|CHILD|EFFECT|STUDENTS|RUN|SHORT"+; - "|STOOD|MORNING|TOTAL|OUTSIDE|ART|RATE|SAYS|YOU'RE|CLASS|TYPE|EVIDENCE"+; - "|EXCEPT|LEAVE|MILLION|MISS|NORTH|PLAN|SOUND|THEREFORE|TOP|USUALLY|BLACK"+; - "|HARD|SCHOOLS|STRONG|BELIEVE|PLAY|VARIOUS|SURFACE|MAKING|MEAN|SOON|VALUE"+; - "|LINES|MODERN|NEAR|TABLE|PRIVATE|RED|ROAD|TAX|ALONE|MINUTES|PERSONAL|PROCESS"+; - "|SITUATION|THAT'S|GONE|IDEA|INCREASE|NOR|PEACE|SECTION|LIVING|STARTED|BOOK"+; - "|LONGER|CUT|FINALLY|NATURE|SECRETARY|MONTHS|THIRD|CALL|COMPLETE|GREATER" + aGlobal[ 1 ] := ; + "|THE|OF|AND|TO|A|IN|THAT|FOR|IS|WAS|IT|HE|I|AS|WITH|ON|HIS|BE|AT|BY" + ; + "|NOT|THIS|HAD|HAVE|YOU|BUT|FROM|ARE|OR|WHICH|AN|THEY|WILL|ONE|WERE|ALL" + ; + "|WE|HER|SHE|WOULD|THERE|HAS|BEEN|HIM|THEIR|IF|WHEN|SO|MORE|NO|WHO|YOUR" + ; + "|OUT|MY|WHAT|UP|CAN|THEM|ABOUT|INTO|ITS|TIME|SOME|THAN|ME|OTHER|ONLY|NEW" + ; + "|COULD|SAID|ANY|THESE|MAY|TWO|THEN|DO|FIRST|NOW|MAN|SUCH|VERY|LIKE|OVER" + ; + "|OUR|EVEN|MOST|AFTER|MADE|ALSO|DID|MANY|SHOULD|BEFORE|MUST|THROUGH|YEARS" + ; + "|WHERE|MUCH|WAY|WELL|DOWN|GOOD|BECAUSE|HERE|EACH|THOSE|PEOPLE|STATE|HOW" + ; + "|TOO|LITTLE|WORLD|LAST|WORK|STILL|BACK|OWN|SEE|MEN|LONG|GET|JUST|GO|HOUSE" + ; + "|BETWEEN|BOTH|LIFE|BEING|UNDER|YEAR|NEVER|DAY|SAME|ANOTHER|KNOW|WHILE|MIGHT" + ; + "|US|GREAT|OLD|OFF|COME|AGAINST|SINCE|CAME|RIGHT|TAKE|USED|THREE|SMALL|MAKE" + ; + "|STATES|HIMSELF|FEW|DURING|WITHOUT|AGAIN|PLACE|AROUND|HOWEVER|HOME|FOUND" + ; + "|SAY|WHOSE|THOUGHT|NIGHT|DEAR|ONCE|WENT|GENERAL|HIGH|UPON|SCHOOL|EVERY|PART" + ; + "|DON'T|DOES|GOT|UNITED|LEFT|NUMBER|COURSE|WAR|GOING|UNTIL|ALWAYS|AWAY" + ; + "|SOMETHING|FACT|THOUGH|WATER|LESS|PUBLIC|PUT|THINK|ALMOST|HAND|ENOUGH|FAR" + ; + "|TOOK|YET|GOVERNMENT|SYSTEM|BETTER|EYES|SET|TOLD|NOTHING|PRESIDENT|END" + ; + "|HEAD|WHY|CALLED|DIDN'T|FIND|LOOK|ASKED|LATER|POINT|NEXT|PROGRAM|KNEW|CITY" + ; + "|BUSINESS|GIVE|GROUP|TOWARD|YOUNG|DAYS|LET|ROOM|WITHIN|CHILDREN|SIDE|SOCIAL" + ; + "|GIVEN|ORDER|PRESENT|SEVERAL|NATIONAL|USE|RATHER|SECOND|FACE|PER|POSSIBLE" + ; + "|AMONG|FORM|IMPORTANT|OFTEN|THINGS|LOOKED|EARLY|WHITE|BECOME|CASE|SEND" + ; + "|BIG|LARGE|NEED|FOUR|FELT|ALONG|GOD|SAW|BEST|CHURCH|EVER|LEAST|POWER" + ; + "|DEVELOPMENT|LIGHT|THING|FAMILY|INTEREST|SEEMED|WANT|TODAY|MEMBERS|MIND" + ; + "|COUNTRY|AREA|OTHERS|TURNED|ALTHOUGH|DONE|OPEN|SERVICE|CERTAIN|KIND|PROBLEM" + ; + "|BEGAN|DIFFERENT|DOOR|THUS|HELP|MEANS|SENSE|WHOLE|MATTER|PERHAPS|ITSELF" + ; + "|IT'S|TIMES|HUMAN|LAW|LINE|ABOVE|NAME|EXAMPLE|COMPANY|HANDS|LOCAL|SHOW" + ; + "|BODY|FIVE|HISTORY|WHETHER|GAVE|EITHER|ACROSS|ACT|ACTION|FEET|ANYTHING" + ; + "|PAST|QUITE|TAKEN|HAVING|SEEN|DEATH|EXPERIENCE|HALF|REALLY|WEEK|WORDS" + ; + "|CAR|FIELD|MONEY|WORD|ALREADY|THEMSELVES|INFORMATION|I'M|TELL|CLOSE" + ; + "|COLLEGE|PERIOD|SHALL|TOGETHER|HELD|KEEP|SURE|PROBABLY|FREE|REAL|BEHIND" + ; + "|SEEMS|CANNOT|POLITICAL|AIR|QUESTION|OFFICE|WOMAN|BROUGHT|MAJOR|MOTHER" + ; + "|SPECIAL|HEARD|PROBLEMS|AGO|BECAME|AVAILABLE|FEDERAL|MOMENT|STUDY" + ; + "|KNOWN|RESULT|STREET|BOY|ECONOMIC|CHANGE|POSITION|REASON|SOUTH|BOARD" + ; + "|INDIVIDUAL|JOB|SOCIETY|AREAS|WEST|SPACE|TURN|LOVE|COMMUNITY|TOWN|TRUE" + ; + "|COURT|FORCE|FULL|SEEM|AGE|AM|COST|WIFE|FUTURE|VOICE|WANTED|CAN'T|DEPARTMENT" + ; + "|USE|CENTER|COMMON|CONTROL|NECESSARY|POLICY|FOLLOWING|FRONTSOMETIMES|FATHER" + ; + "|GIRL|SIX|WOMEN|CLEAR|MILITARY|FURTHER|ABLE|FIGURE|LAND|FEEL|MUSIC|PARTY" + ; + "|PROVIDE|CENTURY|EDUCATION|UNIVERSITY|CHILD|EFFECT|STUDENTS|RUN|SHORT" + ; + "|STOOD|MORNING|TOTAL|OUTSIDE|ART|RATE|SAYS|YOU'RE|CLASS|TYPE|EVIDENCE" + ; + "|EXCEPT|LEAVE|MILLION|MISS|NORTH|PLAN|SOUND|THEREFORE|TOP|USUALLY|BLACK" + ; + "|HARD|SCHOOLS|STRONG|BELIEVE|PLAY|VARIOUS|SURFACE|MAKING|MEAN|SOON|VALUE" + ; + "|LINES|MODERN|NEAR|TABLE|PRIVATE|RED|ROAD|TAX|ALONE|MINUTES|PERSONAL|PROCESS" + ; + "|SITUATION|THAT'S|GONE|IDEA|INCREASE|NOR|PEACE|SECTION|LIVING|STARTED|BOOK" + ; + "|LONGER|CUT|FINALLY|NATURE|SECRETARY|MONTHS|THIRD|CALL|COMPLETE|GREATER" -aGlobal[1] += "|EXPECTED|FIRE|NEEDED|KEPT|VALUES|VIEW|BASIS|DARK|EVERYTHING|PRESSURE"+; - "|GROUND|EAST|RECENT|REQUIRED|SPIRIT|UNION|HOPE|I'LL|MOVED|NATIONS|WROTE"+; - "|CONDITIONS|RETURN|SUPPORT|ATTENTION|LATE|PARTICULAR|BROWN|COSTS|ELSE|NATION"+; - "|BEYOND|COULDN'T|FORCES|HOURS|NUCLEAR|PERSON|TAKING|COMING|DEAD|INSIDE|LOW"+; - "|MATERIAL|REPORT|STAGE|ADDED|AMOUNT|BASIC|DATA|FEELING|FOLLOWED|HEART|INSTEAD"+; - "|LOOKING|LOST|MILES|PAY|SINGLE|COLD|HUNDRED|INCLUDING|INDUSTRY|MOVE|RESEARCH"+; - "|SHOWN|BRIDGE|DEVELOPED|SIMPLY|TRIED|HOLD|REACHED|SHARE|SORT|COMMITTEE|DEFENSE"+; - "|EQUIPMENT|ISLAND|SENDING|ACTUALLY|EARTH|BEGINNING|RELIGIOUS|RIVER|TEN|CENTRAL"+; - "|DOING|GETTING|LETTER|RECEIVED|REST|TERMS|TRYING|CARE|FRIENDS|INDEED|MEDICAL"+; - "|PICTURE|DIFFICULT|FINE|SIMPLE|STATUS|SUBJECT|BUILDING|ESPECIALLY|HIGHER|RANGE"+; - "|WALL|BRING|MEETING|WALKED|CENT|FLOOR|FOREIGN|NEEDS|PAPER|PASSED|SIMILAR"+; - "|FINAL|NATURAL|PROPERTY|TRAINING|COUNTY|GROWTH|HOT|INTERNATIONAL|LIVE"+; - "|MARKET|POLICE|START|TALK|WASN'T|WRITTEN|BOOKS|ANSWER|CONGRESS|HEAR|PRIMARY"+; - "|STORY|SUDDENLY|CONSIDERED|COUNTRIES|HALL|ISSUE|LIKELY|PARTICULARLY|TRULY"+; - "|WORKING|EFFORT|SAT|ENTIRE|HAPPENED|LABOR|PURPOSE|RESULTS|CASES|DIFFERENCE"+; - "|HAIR|PRODUCTION|STAND|I'VE|I'D|WON'T|" + aGlobal[ 1 ] += ; + "|EXPECTED|FIRE|NEEDED|KEPT|VALUES|VIEW|BASIS|DARK|EVERYTHING|PRESSURE" + ; + "|GROUND|EAST|RECENT|REQUIRED|SPIRIT|UNION|HOPE|I'LL|MOVED|NATIONS|WROTE" + ; + "|CONDITIONS|RETURN|SUPPORT|ATTENTION|LATE|PARTICULAR|BROWN|COSTS|ELSE|NATION" + ; + "|BEYOND|COULDN'T|FORCES|HOURS|NUCLEAR|PERSON|TAKING|COMING|DEAD|INSIDE|LOW" + ; + "|MATERIAL|REPORT|STAGE|ADDED|AMOUNT|BASIC|DATA|FEELING|FOLLOWED|HEART|INSTEAD" + ; + "|LOOKING|LOST|MILES|PAY|SINGLE|COLD|HUNDRED|INCLUDING|INDUSTRY|MOVE|RESEARCH" + ; + "|SHOWN|BRIDGE|DEVELOPED|SIMPLY|TRIED|HOLD|REACHED|SHARE|SORT|COMMITTEE|DEFENSE" + ; + "|EQUIPMENT|ISLAND|SENDING|ACTUALLY|EARTH|BEGINNING|RELIGIOUS|RIVER|TEN|CENTRAL" + ; + "|DOING|GETTING|LETTER|RECEIVED|REST|TERMS|TRYING|CARE|FRIENDS|INDEED|MEDICAL" + ; + "|PICTURE|DIFFICULT|FINE|SIMPLE|STATUS|SUBJECT|BUILDING|ESPECIALLY|HIGHER|RANGE" + ; + "|WALL|BRING|MEETING|WALKED|CENT|FLOOR|FOREIGN|NEEDS|PAPER|PASSED|SIMILAR" + ; + "|FINAL|NATURAL|PROPERTY|TRAINING|COUNTY|GROWTH|HOT|INTERNATIONAL|LIVE" + ; + "|MARKET|POLICE|START|TALK|WASN'T|WRITTEN|BOOKS|ANSWER|CONGRESS|HEAR|PRIMARY" + ; + "|STORY|SUDDENLY|CONSIDERED|COUNTRIES|HALL|ISSUE|LIKELY|PARTICULARLY|TRULY" + ; + "|WORKING|EFFORT|SAT|ENTIRE|HAPPENED|LABOR|PURPOSE|RESULTS|CASES|DIFFERENCE" + ; + "|HAIR|PRODUCTION|STAND|I'VE|I'D|WON'T|" #endif -**DEBUG** -@24,30 SAY "At SP_common" + // *DEBUG** + @ 24, 30 SAY "At SP_common" -return NIL -****************************************************************************** + RETURN NIL -function WildCard(cPattern,cString) -LOCAL lMatch := .F. -LOCAL x := at("*",cPattern) -LOCAL cBefore -LOCAL cAfter -LOCAL y -LOCAL nStrSize,nPatSize -**DEBUG** -@24,30 SAY "At wildcard" +FUNCTION WildCard( cPattern, cString ) -cString := upper(alltrim(cString)) + LOCAL lMatch := .F. + LOCAL x := At( "*", cPattern ) + LOCAL cBefore + LOCAL cAfter + LOCAL y + LOCAL nStrSize, nPatSize -if cPattern == "*" - return .T. -endif -// -// Do a * match -// -if x > 0 - cBefore := upper(substr(cPattern,1,x-1)) - cAfter := upper(substr(cPattern,x+1)) - do case - case empty(cBefore) - lMatch := right(cString,len(cAfter))==cAfter - case empty(cAfter) - lMatch := left(cString,len(cBefore))==cBefore - otherwise - lMatch := ( left(cString,len(cBefore))==cBefore ) .and. ; - right(cString,len(cAfter))==cAfter - endcase -else - x := at("?",cPattern) - if x > 0 - nPatSize := len(cPattern) - nStrSize := len(cString) - if nPatSize == nStrSize - lMatch := .T. - for y := 1 to nPatSize - if !(substr(cPattern,y,1)=="?") .and. ; - !(substr(cPattern,y,1)== substr(cString,y,1)) + // *DEBUG** + @ 24, 30 SAY "At wildcard" + + cString := Upper( AllTrim( cString ) ) + + IF cPattern == "*" + RETURN .T. + ENDIF + // + // Do a * match + // + IF x > 0 + cBefore := Upper( SubStr( cPattern, 1, x - 1 ) ) + cAfter := Upper( SubStr( cPattern, x + 1 ) ) + DO CASE + CASE Empty( cBefore ) + lMatch := Right( cString, Len( cAfter ) ) == cAfter + CASE Empty( cAfter ) + lMatch := Left( cString, Len( cBefore ) ) == cBefore + OTHERWISE + lMatch := ( Left( cString, Len( cBefore ) ) == cBefore ) .AND. ; + Right( cString, Len( cAfter ) ) == cAfter + ENDCASE + ELSE + x := At( "?", cPattern ) + IF x > 0 + nPatSize := Len( cPattern ) + nStrSize := Len( cString ) + IF nPatSize == nStrSize + lMatch := .T. + FOR y := 1 TO nPatSize + IF !( SubStr( cPattern, y, 1 ) == "?" ) .AND. ; + !( SubStr( cPattern, y, 1 ) == SubStr( cString, y, 1 ) ) lMatch := .F. - exit - endif - next - endif - else - lMatch := upper(cPattern)=upper(cString) - endif -endif -return lMatch -****************************************************************************** + EXIT + ENDIF + NEXT + ENDIF + ELSE + lMatch := Upper( cPattern ) = Upper( cString ) + ENDIF + ENDIF + + RETURN lMatch + #ifndef CLIP52 -function aWords(cLine) -LOCAL aWords_ := {} -LOCAL nSize := len(rtrim(cLine)) -LOCAL x,y,z -LOCAL cWord := "" -LOCAL nOffset +FUNCTION aWords( cLine ) -**DEBUG** -@24,30 SAY "At clip52" + LOCAL aWords_ := {} + LOCAL nSize := Len( RTrim( cLine ) ) + LOCAL x, y, z + LOCAL cWord := "" + LOCAL nOffset -z := 0 -do while z <= nSize - z++ - y := asc(substr(cLine,z,1)) - if y >=48 .and. ! chr( y ) $ ":;<=>?@[\^]_`{|}~" - nOffset := z - cWord := chr( y ) - z++ - y := asc(substr(cLine,z,1)) - while ( y >=48 .and. ! chr( y ) $ ":;<=>?@[\^]_`{|}~" ) .or. y == 39 - cWord += chr( y ) - z++ - if z > nSize - exit - endif - y := asc(substr(cLine,z,1)) - enddo - Aadd(aWords_,{cWord,nOffset}) - endif -enddo -return aWords_ + // *DEBUG** + @ 24, 30 SAY "At clip52" + + z := 0 + DO WHILE z <= nSize + z++ + y := Asc( SubStr( cLine, z, 1 ) ) + IF y >= 48 .AND. ! Chr( y ) $ ":;<=>?@[\^]_`{|}~" + nOffset := z + cWord := Chr( y ) + z++ + y := Asc( SubStr( cLine, z, 1 ) ) + WHILE ( y >= 48 .AND. ! Chr( y ) $ ":;<=>?@[\^]_`{|}~" ) .OR. y == 39 + cWord += Chr( y ) + z++ + IF z > nSize + EXIT + ENDIF + y := Asc( SubStr( cLine, z, 1 ) ) + ENDDO + AAdd( aWords_, { cWord, nOffset } ) + ENDIF + ENDDO + + RETURN aWords_ #endif -* Find an occurrence of 'f_str' in 'l_str' starting from position 'f_rom' -FUNCTION FAT(f_str, l_str, f_rom) +// Find an occurrence of 'f_str' in 'l_str' starting from position 'f_rom' +FUNCTION FAT( f_str, l_str, f_rom ) -LOCAL ret_val + LOCAL ret_val -**DEBUG** -@24,30 SAY "At FAT" + // *DEBUG** + @ 24, 30 SAY "At FAT" -IF PCOUNT() < 3 && Is f_rom passed? - f_rom := 1 -ENDIF + IF PCount() < 3 // Is f_rom passed? + f_rom := 1 + ENDIF -ret_val := AT(f_str, SUBSTR(l_str, f_rom)) + ret_val := At( f_str, SubStr( l_str, f_rom ) ) -RETURN ret_val + RETURN ret_val diff --git a/harbour/extras/gfspell/spellc.c b/harbour/extras/gfspell/spellc.c index 4d3f7693f9..da4a33e896 100644 --- a/harbour/extras/gfspell/spellc.c +++ b/harbour/extras/gfspell/spellc.c @@ -3,11 +3,11 @@ */ // #define _CLIPDEFS_H // Don't redefine basic types - #include "extend.h" +#include "extend.h" // #include "hbapi.h" - #include "hbapifs.h" - #include "extend.api" - #include "hbundoc.api" +#include "hbapifs.h" +#include "extend.api" +#include "hbundoc.api" typedef char uchar; typedef unsigned int uint; @@ -19,8 +19,8 @@ typedef unsigned int uint; //Org extern cdecl int _bscan( uchar *, int, uchar ); //Org extern cdecl int _bcmp( uchar *, uchar *, int ); -uchar * cSearch = "INEDTIERESTEON"; -uchar * cRepl = "[\\]^_`a"; +uchar * cSearch = "INEDTIERESTEON"; +uchar * cRepl = "[\\]^_`a"; @@ -34,13 +34,13 @@ uchar * cRepl = "[\\]^_`a"; //////////////////////////// HB_FUNC( XFORM ) { - uchar cRet[ 128 ]; - uchar * cPtr; - int iRetLen = 0; - const uchar * cWord; - int iWordLen; - int x; - uint iKey; + uchar cRet[ 128 ]; + uchar * cPtr; + int iRetLen = 0; + const uchar * cWord; + int iWordLen; + int x; + uint iKey; cWord = _parc( 1 ) + 2; iWordLen = _parclen( 1 ) - 2; @@ -66,8 +66,8 @@ HB_FUNC( XFORM ) } } iWordLen--; - cWord += 2; - *cPtr++ = *( cRepl + ( x >> 1 ) ); + cWord += 2; + *cPtr++ = *( cRepl + ( x >> 1 ) ); break; } @@ -101,13 +101,13 @@ HB_FUNC( XFORM ) //////////////////////////// HB_FUNC( XUNFORM ) { - uchar cRet[ 128 ]; - uchar * cPtr; - int iRetLen = 0; - uchar c; - const uchar * cWord; - int iWordLen; - int x; + uchar cRet[ 128 ]; + uchar * cPtr; + int iRetLen = 0; + uchar c; + const uchar * cWord; + int iWordLen; + int x; cWord = _parc( 1 ); iWordLen = _parclen( 1 ); @@ -133,14 +133,14 @@ HB_FUNC( XUNFORM ) *cPtr++ = 'I'; *cPtr++ = 'N'; *cPtr++ = 'G'; - iRetLen += 2; + iRetLen += 2; } } else if( iRetLen < 128 ) { - x = x << 1; - *cPtr++ = *( cSearch + x++ ); - *cPtr++ = *( cSearch + x ); + x = x << 1; + *cPtr++ = *( cSearch + x++ ); + *cPtr++ = *( cSearch + x ); iRetLen++; } } @@ -175,14 +175,14 @@ HB_FUNC( XUNFORM ) //////////////////////////// HB_FUNC( SP_RATE ) { - const uchar * cFound; - int nFound; - const uchar * cWord; - int nWord; - int nMinLen; - int x; - int lim; - uchar * cRating = "nZZ"; + const uchar * cFound; + int nFound; + const uchar * cWord; + int nWord; + int nMinLen; + int x; + int lim; + uchar * cRating = "nZZ"; cFound = _parc( 1 ); nFound = _parclen( 1 ); @@ -200,8 +200,8 @@ HB_FUNC( SP_RATE ) *( cRating + 1 ) = 'A' - 1 + lim - x; } - cFound = cFound + nFound - 1; - cWord = cWord + nWord - 1; + cFound = cFound + nFound - 1; + cWord = cWord + nWord - 1; for( x = 0; x < lim; x++ ) { @@ -225,13 +225,13 @@ HB_FUNC( SP_RATE ) * Program Name: test.c * Author: Clayton Neff * Copyright (c) 1992 by CoN Computer Consultants - **----------------------------------------------------------------------------- + * ----------------------------------------------------------------------------- * Created: 8/23/1992 at 16:47 * - **............................................................................. + * ............................................................................. * Revision: 1.0 Last Revised: 8/23/1992 at 16:47 * Description: Original Creation. - **............................................................................. + * ............................................................................. *---------------------------- ALL RIGHTS RESERVED ----------------------------*/ // #include "extend.h" @@ -242,43 +242,43 @@ HB_FUNC( SP_RATE ) HB_FUNC( C_METAFONE ) { - char * sReturn; /* Pointer to the return string. */ - const char * sMeta; /* Pointer to the passed string. */ - unsigned int iRetLen; /* Length of the return string. */ - unsigned int iStrLen; /* Length of the passed string. */ - unsigned int iRetPtr; /* Pointer into the return string. */ - unsigned int iStrPtr; /* Pointer into the passed string. */ + char * sReturn; /* Pointer to the return string. */ + const char * sMeta; /* Pointer to the passed string. */ + unsigned int iRetLen; /* Length of the return string. */ + unsigned int iStrLen; /* Length of the passed string. */ + unsigned int iRetPtr; /* Pointer into the return string. */ + unsigned int iStrPtr; /* Pointer into the passed string. */ /* If no string was passed then return an empty string. */ if( PCOUNT == 0 ) { //Org sMeta = _xalloc( 1 ) ; - sMeta = hb_xgrab( 1 ); - sMeta[ 1 ] = '\0'; - iStrLen = 0; - iRetLen = 4; + sMeta = hb_xgrab( 1 ); + sMeta[ 1 ] = '\0'; + iStrLen = 0; + iRetLen = 4; } /* If no return lenght was passed, default to 4. */ else if( PCOUNT == 1 ) { - sMeta = _parc( 1 ); - iStrLen = _parclen( 1 ); - iRetLen = 4; + sMeta = _parc( 1 ); + iStrLen = _parclen( 1 ); + iRetLen = 4; } else { - sMeta = _parc( 1 ); - iStrLen = _parclen( 1 ); - iRetLen = _parni( 2 ); + sMeta = _parc( 1 ); + iStrLen = _parclen( 1 ); + iRetLen = _parni( 2 ); } /* Set up the buffer to hold the return string. Be sure to make it 1 character longer than needed so there is space for the null terminator. */ //Org sReturn = _xalloc( iRetLen + 1 ) ; - sReturn = hb_xgrab( iRetLen + 1 ); - iRetPtr = 0; - iStrPtr = 0; + sReturn = hb_xgrab( iRetLen + 1 ); + iRetPtr = 0; + iStrPtr = 0; /* Handle the special prefixes. */ switch( sMeta[ iStrPtr ] ) @@ -298,7 +298,7 @@ HB_FUNC( C_METAFONE ) /* Put in the first return character and increment the pointer. */ sReturn[ iRetPtr++ ] = 'N'; - iStrPtr += 2; + iStrPtr += 2; } break; @@ -309,7 +309,7 @@ HB_FUNC( C_METAFONE ) /* Put in the first return character and increment the pointer. */ sReturn[ iRetPtr++ ] = 'E'; - iStrPtr += 2; + iStrPtr += 2; } break; @@ -329,7 +329,7 @@ HB_FUNC( C_METAFONE ) { /* Put in the first return character and increment the pointer. */ sReturn[ iRetPtr++ ] = 'R'; - iStrPtr += 2; + iStrPtr += 2; } /* WHO->H */ else if( ( sMeta[ iStrPtr + 1 ] == 'H' ) && @@ -337,14 +337,14 @@ HB_FUNC( C_METAFONE ) { /* Put in the first return character and increment the pointer. */ sReturn[ iRetPtr++ ] = 'H'; - iStrPtr += 3; + iStrPtr += 3; } /* WH->W */ else if( sMeta[ iStrPtr + 1 ] == 'H' ) { /* Put in the first return character and increment the pointer. */ sReturn[ iRetPtr++ ] = 'W'; - iStrPtr += 2; + iStrPtr += 2; } break; @@ -357,7 +357,7 @@ HB_FUNC( C_METAFONE ) /* Put in the first return characters and increment the pointer. */ sReturn[ iRetPtr++ ] = 'M'; sReturn[ iRetPtr++ ] = 'K'; - iStrPtr += ( sMeta[ iStrPtr + 2 ] == 'G' ) ? 3 : 2; + iStrPtr += ( sMeta[ iStrPtr + 2 ] == 'G' ) ? 3 : 2; } /* MACH->MX */ else if( ( sMeta[ iStrPtr + 1 ] == 'A' ) && @@ -367,7 +367,7 @@ HB_FUNC( C_METAFONE ) /* Put in the first return characters and increment the pointer. */ sReturn[ iRetPtr++ ] = 'M'; sReturn[ iRetPtr++ ] = 'X'; - iStrPtr += 4; + iStrPtr += 4; } /* MACG->MK or MAC->MK */ else if( ( sMeta[ iStrPtr + 1 ] == 'A' ) && @@ -376,7 +376,7 @@ HB_FUNC( C_METAFONE ) /* Put in the first return characters and increment the pointer. */ sReturn[ iRetPtr++ ] = 'M'; sReturn[ iRetPtr++ ] = 'K'; - iStrPtr += ( sMeta[ iStrPtr + 3 ] == 'G' ) ? 4 : 3; + iStrPtr += ( sMeta[ iStrPtr + 3 ] == 'G' ) ? 4 : 3; } break; @@ -387,14 +387,14 @@ HB_FUNC( C_METAFONE ) /* Put in the first return character and increment the pointer. */ sReturn[ iRetPtr++ ] = 'N'; - iStrPtr += 2; + iStrPtr += 2; } else if( sMeta[ iStrPtr + 1 ] == 'I' ) { /* Put in the first return character and increment the pointer. */ sReturn[ iRetPtr++ ] = 'K'; - iStrPtr += 2; + iStrPtr += 2; } break; @@ -431,7 +431,7 @@ HB_FUNC( C_METAFONE ) ( sMeta[ iStrPtr + 3 ] == 'H' ) ) { sReturn[ iRetPtr++ ] = 'X'; - iStrPtr += 3; + iStrPtr += 3; } iStrPtr++; break; @@ -474,7 +474,7 @@ HB_FUNC( C_METAFONE ) ( sMeta[ iStrPtr + 2 ] == 'Y' ) ) { sReturn[ iRetPtr++ ] = 'J'; - iStrPtr += 3; + iStrPtr += 3; } /* If not one of those three, transform to T. */ else @@ -505,7 +505,7 @@ HB_FUNC( C_METAFONE ) ! ( sMeta[ iStrPtr - 1 ] == 'G' ) ) { sReturn[ iRetPtr++ ] = 'J'; - iStrPtr += 2; + iStrPtr += 2; } /* vGHT -> T or vGH, vGHTH -> W leaving TH to be processed. */ else if( ( sMeta[ iStrPtr + 1 ] == 'H' ) && @@ -519,7 +519,7 @@ HB_FUNC( C_METAFONE ) ! ( sMeta[ iStrPtr + 3 ] == 'H' ) ) { sReturn[ iRetPtr++ ] = 'T'; - iStrPtr += 3; + iStrPtr += 3; } else { @@ -528,12 +528,12 @@ HB_FUNC( C_METAFONE ) ( sMeta[ iStrPtr - 1 ] == 'U' ) ) { sReturn[ iRetPtr++ ] = 'F'; - iStrPtr += 2; + iStrPtr += 2; } else { sReturn[ iRetPtr++ ] = 'W'; - iStrPtr += 2; + iStrPtr += 2; } } } @@ -546,13 +546,13 @@ HB_FUNC( C_METAFONE ) ( sMeta[ iStrPtr + 2 ] == 'U' ) ) ) { sReturn[ iRetPtr++ ] = 'K'; - iStrPtr += 2; + iStrPtr += 2; } /* GN -> N */ else if( sMeta[ iStrPtr + 1 ] == 'N' ) { sReturn[ iRetPtr++ ] = 'N'; - iStrPtr += 2; + iStrPtr += 2; } /* The suffix NG is skipped. */ else if( ( ( iStrPtr == iStrLen - 1 ) || @@ -583,7 +583,7 @@ HB_FUNC( C_METAFONE ) if( sMeta[ iStrPtr + 1 ] == 'H' ) { sReturn[ iRetPtr++ ] = 'F'; - iStrPtr += 2; + iStrPtr += 2; } else sReturn[ iRetPtr++ ] = sMeta[ iStrPtr++ ]; @@ -609,7 +609,7 @@ HB_FUNC( C_METAFONE ) { sReturn[ iRetPtr++ ] = 'S'; sReturn[ iRetPtr++ ] = 'K'; - iStrPtr += 3; + iStrPtr += 3; } /* SIO, SIA, SH -> X */ else if( ( ( sMeta[ iStrPtr + 1 ] == 'I' ) && @@ -618,7 +618,7 @@ HB_FUNC( C_METAFONE ) ( sMeta[ iStrPtr + 1 ] == 'H' ) ) { sReturn[ iRetPtr++ ] = 'X'; - iStrPtr += ( sMeta[ iStrPtr + 1 ] == 'H' ) ? 2 : 3; + iStrPtr += ( sMeta[ iStrPtr + 1 ] == 'H' ) ? 2 : 3; } /* SCE, SCI, SCY -> S */ else if( sMeta[ iStrPtr + 1 ] == 'C' ) @@ -628,7 +628,7 @@ HB_FUNC( C_METAFONE ) ( sMeta[ iStrPtr + 2 ] == 'Y' ) ) { sReturn[ iRetPtr++ ] = 'S'; - iStrPtr += 3; + iStrPtr += 3; } /* If not one of those three, just copy it over. */ else @@ -657,13 +657,13 @@ HB_FUNC( C_METAFONE ) ( sMeta[ iStrPtr + 2 ] == 'H' ) ) ) { sReturn[ iRetPtr++ ] = 'X'; - iStrPtr += 3; + iStrPtr += 3; } /* TH -> 0 */ else if( sMeta[ iStrPtr + 1 ] == 'H' ) { sReturn[ iRetPtr++ ] = '0'; - iStrPtr += 2; + iStrPtr += 2; } /* Copy the letter over. */ else @@ -699,7 +699,7 @@ HB_FUNC( C_METAFONE ) { sReturn[ iRetPtr++ ] = 'S'; sReturn[ iRetPtr++ ] = 'K'; - iStrPtr += 3; + iStrPtr += 3; } /* SIO, SIA, SH -> X */ else if( ( ( sMeta[ iStrPtr + 1 ] == 'I' ) && @@ -708,7 +708,7 @@ HB_FUNC( C_METAFONE ) ( sMeta[ iStrPtr + 1 ] == 'H' ) ) { sReturn[ iRetPtr++ ] = 'X'; - iStrPtr += ( sMeta[ iStrPtr + 1 ] == 'H' ) ? 2 : 3; + iStrPtr += ( sMeta[ iStrPtr + 1 ] == 'H' ) ? 2 : 3; } /* SCE, SCI, SCY -> S */ else if( sMeta[ iStrPtr + 1 ] == 'C' ) @@ -718,7 +718,7 @@ HB_FUNC( C_METAFONE ) ( sMeta[ iStrPtr + 2 ] == 'Y' ) ) { sReturn[ iRetPtr++ ] = 'S'; - iStrPtr += 3; + iStrPtr += 3; } /* If not one of those three, just copy it over. */ else @@ -755,7 +755,7 @@ HB_FUNC( C_METAFONE ) ( sMeta[ iStrPtr + 2 ] == 'A' ) ) ) { sReturn[ iRetPtr++ ] = 'X'; - iStrPtr += ( sMeta[ iStrPtr + 1 ] == 'I' ) ? 3 : 2; + iStrPtr += ( sMeta[ iStrPtr + 1 ] == 'I' ) ? 3 : 2; } /* CE, CI, CY -> S */ else if( ( sMeta[ iStrPtr + 1 ] == 'E' ) || @@ -763,7 +763,7 @@ HB_FUNC( C_METAFONE ) ( sMeta[ iStrPtr + 1 ] == 'Y' ) ) { sReturn[ iRetPtr++ ] = 'S'; - iStrPtr += 2; + iStrPtr += 2; } /* CK - Skip. */ else if( sMeta[ iStrPtr + 1 ] == 'K' ) @@ -852,18 +852,18 @@ HB_FUNC( C_METAFONE ) HB_FUNC( BIT ) { - unsigned char mask; - const unsigned char * ptr; - unsigned int loc, - offset = _parni( 2 ) - 1, - res = 0; + unsigned char mask; + const unsigned char * ptr; + unsigned int loc, + offset = _parni( 2 ) - 1, + res = 0; loc = offset / 8; if( loc < _parclen( 1 ) ) { - ptr = _parc( 1 ) + loc; - loc = offset % 8; - res = *ptr << loc & 0x80; + ptr = _parc( 1 ) + loc; + loc = offset % 8; + res = *ptr << loc & 0x80; if( PCOUNT > 2 ) { @@ -910,16 +910,16 @@ static int WordSep( unsigned char c ) --------------------------------------------------*/ HB_FUNC( SP_LINE ) { - int nArgs = PCOUNT; - BOOL bLineBreak = FALSE; - int nCount = 0; - int nWrap = 0; - unsigned int nOffset = 0; - const BYTEP cIn; - BYTEP p; - BYTE cTest; - int nLineLen; - unsigned int nStop; + int nArgs = PCOUNT; + BOOL bLineBreak = FALSE; + int nCount = 0; + int nWrap = 0; + unsigned int nOffset = 0; + const BYTEP cIn; + BYTEP p; + BYTE cTest; + int nLineLen; + unsigned int nStop; if( nArgs > 0 && ISCHAR( 1 ) ) { @@ -974,8 +974,4 @@ HB_FUNC( SP_LINE ) if( ISBYREF( 2 ) ) // Change reference val _stornl( nOffset, 2 ); - - } - -// ** End of SP_LINE ** diff --git a/harbour/extras/gtwvw/tests/cbtest1.prg b/harbour/extras/gtwvw/tests/cbtest1.prg index 3785b940ed..8a7b9e9951 100644 --- a/harbour/extras/gtwvw/tests/cbtest1.prg +++ b/harbour/extras/gtwvw/tests/cbtest1.prg @@ -45,7 +45,7 @@ PROCEDURE Main() WVW_pbSetFont( NIL, "Arial", 16 ) nMaxWidth := 0 - AEval( s_aAnswers, {| x | nMaxWIdth := Max( nMaxWidth,Len(x ) ) } ) + AEval( s_aAnswers, {| x | nMaxWIdth := Max( nMaxWidth, Len( x ) ) } ) SetMode( 11, nMaxWidth + 1 + 10 + 2 ) @@ -87,7 +87,7 @@ PROCEDURE Main() wvw_cbSetFocus( NIL, nCBid ) CASE nPos == 2 wvw_pbSetFocus( NIL, nPBid ) - wvw_pbSetStyle( NIL, nPBid, 1 ) //BS_DEFPUSHBUTTON + wvw_pbSetStyle( NIL, nPBid, 1 ) // BS_DEFPUSHBUTTON ENDCASE ENDDO @@ -99,21 +99,21 @@ PROCEDURE Main() Inkey( 0 ) SetCursor( nCursor ) - RETURN //main + RETURN // main STATIC FUNCTION CBhandler( nWinNum, nId, nEvent, nIndex, nPBid ) DO CASE - CASE nEvent == 3 //CBN_SETFOCUS + CASE nEvent == 3 // CBN_SETFOCUS // none - CASE nEvent == 4 //CBN_KILLFOCUS + CASE nEvent == 4 // CBN_KILLFOCUS // none IF nIndex == 0 wvw_pbEnable( nWinNum, nPBid, .T. ) ELSE wvw_pbEnable( nWinNum, nPBid, .F. ) ENDIF - CASE nEvent == 1 //CBN_SELCHANGE + CASE nEvent == 1 // CBN_SELCHANGE IF !wvw_cbIsDropped( nWinNum, nId ) // nIndex is 0-based IF nIndex == 0 diff --git a/harbour/extras/gtwvw/tests/cbtest6.prg b/harbour/extras/gtwvw/tests/cbtest6.prg index 86a2a5079d..3064a668ee 100644 --- a/harbour/extras/gtwvw/tests/cbtest6.prg +++ b/harbour/extras/gtwvw/tests/cbtest6.prg @@ -56,19 +56,19 @@ PROCEDURE Main() LOCAL getlist := {} LOCAL mname := PadR( "Budyanto Dj.", 30 ), msex := "MALE", mage := 17, mstat := "married" - LOCAL __nCBid__, __temp__ //these two are temporary var required by CB get creation + LOCAL __nCBid__, __temp__ // these two are temporary var required by CB get creation WVW_SetCodePage( NIL, 255 ) WVW_SetLineSpacing( NIL, 4 ) WVW_SetLSpaceColor( NIL, 0 ) - WVW_cbSetFont( NIL, "Arial", 14 ) //std: 20-2 + WVW_cbSetFont( NIL, "Arial", 14 ) // std: 20-2 // Set( _SET_TRACESTACK, 0 ) // wvw_setmousemove( , .T. ) CLS - // reset combobox list: + // reset combobox list: s_aComboList := {} @ 0, 0 SAY "Name :" GET mname PICT "@K" @@ -80,7 +80,7 @@ PROCEDURE Main() READ // disable all comboboxes: - AEval( s_aComboList, {| x | wvw_cbenable( NIL, x[1], .F. ) } ) + AEval( s_aComboList, {| x | wvw_cbenable( NIL, x[ 1 ], .F. ) } ) DevPos( 5, 0 ) ? "name: '" + mname + "'" @@ -133,11 +133,11 @@ FUNCTION CBhandler( nWinNum, nId, nEvent, nIndex, cVar, GetList ) IF Empty( GetList ) MyAlert( "Bad practice: you left an active combobox, but READ already ended" ) - RETURN NIL//ignore this event + RETURN NIL // ignore this event ENDIF DO CASE - CASE nEvent == 3 //CBN_SETFOCUS + CASE nEvent == 3 // CBN_SETFOCUS i := AScan( GetList, {| x | x:Name == cVar } ) IF i > 0 /* !oGet:HasFocus means @@ -169,22 +169,22 @@ FUNCTION CBhandler( nWinNum, nId, nEvent, nIndex, cVar, GetList ) */ SetWinFocus( nWinNum ) - MSetPos( GetList[i]:row, GetList[i]:col + 1 ) + MSetPos( GetList[ i ]:row, GetList[ i ]:col + 1 ) hb_keyPut( K_LBUTTONDOWN ) - ENDIF //oGet:HasFocus + ENDIF // oGet:HasFocus - ELSE //i==0 + ELSE // i==0 /* there's no GET object beneath the combobox. * This must be a combobox living in the wild. * Do what you want with it, we do nothing here. */ ENDIF - CASE nEvent == 4 //CBN_KILLFOCUS + CASE nEvent == 4 // CBN_KILLFOCUS // put current content of combobox into GET variable beneath it. cCurSel := wvw_cbGetCurText( nWinNum, nId ) oGet:varput( cCurSel ) - oGet:display() //this is optional + oGet:display() // this is optional ENDCASE @@ -250,13 +250,13 @@ FUNCTION CBreader( oGet ) ENDIF ELSEIF HB_ISBLOCK( bKeyBlock := SetKey( nKey ) ) - oGetList:GetDoSetKey( bKeyBlock ) //eval(bKeyBlock) + oGetList:GetDoSetKey( bKeyBlock ) // eval(bKeyBlock) oGet:exitState := GE_NOEXIT ENDIF IF oGet:exitState != GE_NOEXIT - SetWinFocus( NIL ) //assume current window + SetWinFocus( NIL ) // assume current window oGet:killfocus() ENDIF @@ -267,8 +267,9 @@ FUNCTION CBreader( oGet ) STATIC FUNCTION MoveToGet( GetList, nPos ) LOCAL i - LOCAL oGetList := __GetListActive( ) + LOCAL oGetList := __GetListActive() LOCAL oGet + // leave current active get oGet := GetActive() @@ -277,7 +278,7 @@ STATIC FUNCTION MoveToGet( GetList, nPos ) IF GetPostValidate( oGet ) oGet:updatebuffer() ELSE - //oGet:undo() + // oGet:undo() RETURN .F. ENDIF ENDIF @@ -295,6 +296,7 @@ STATIC FUNCTION MoveToGet( GetList, nPos ) STATIC FUNCTION SetWinFocus( nWinNum ) LOCAL hWnd := wvw_getWindowHandle( nWinNum ) + WIN_SETFOCUS( hWnd ) RETURN NIL diff --git a/harbour/extras/gtwvw/tests/drawimg.prg b/harbour/extras/gtwvw/tests/drawimg.prg index c4af4f67d8..af435da27a 100644 --- a/harbour/extras/gtwvw/tests/drawimg.prg +++ b/harbour/extras/gtwvw/tests/drawimg.prg @@ -36,7 +36,7 @@ #include "setcurs.ch" #include "hbclass.ch" -//WPAINTOBJ types +// WPAINTOBJ types #define WPAINTOBJ_LABEL 1 #define WPAINTOBJ_SHADEDRECT 2 #define WPAINTOBJ_TEXTBOX 3 @@ -61,16 +61,16 @@ #define WPAINTOBJ_LINEEX 22 #define WPAINTOBJ_OUTLINEEX 23 -//WCTRLOBJ types +// WCTRLOBJ types #define WCTRLOBJ_PUSHBUTTON 1001 #define WCTRLOBJ_VSCROLLBAR 1002 #define WCTRLOBJ_HSCROLLBAR 1003 #define WCTRLOBJ_COMBOBOX 1004 -//OBJECT OPERATION -#define WOBJ_ADD_OVERWRITE 1 //overwrite if exists -#define WOBJ_ADD_APPEND 2 //append even if exists (the same id can coexist) -#define WOBJ_ADD_NEWONLY 3 //cancel if exists +// OBJECT OPERATION +#define WOBJ_ADD_OVERWRITE 1 // overwrite if exists +#define WOBJ_ADD_APPEND 2 // append even if exists (the same id can coexist) +#define WOBJ_ADD_NEWONLY 3 // cancel if exists STATIC s_aPObjList := {} @@ -113,7 +113,7 @@ PROCEDURE Main() cpict := AllTrim( cpict ) - //wvw_loadpicture( 1, cpict ) //20060707 + // wvw_loadpicture( 1, cpict ) //20060707 SetCursor( SC_NONE ) DispBegin() @@ -151,23 +151,23 @@ PROCEDURE Main() // delete all image objects wg_DelWPaintObj( 0, WPAINTOBJ_IMAGE, NIL ) - ENDDO //while .T. + ENDDO // WHILE .T. SetCursor( SC_NORMAL ) RETURN -//************** simple wpaint organizer ******* +// ************** simple wpaint organizer ******* /*********************************************************/ CREATE CLASS wGUIObj - VAR nWinNum //parent window's number - VAR lVisible //is the object visible - VAR nType //Type - VAR cId //Id - VAR nRow1, nCol1, nRow2, nCol2 //mouse object region - VAR aOffTLBR //offset in pixels + VAR nWinNum // parent window's number + VAR lVisible // is the object visible + VAR nType // Type + VAR cId // Id + VAR nRow1, nCol1, nRow2, nCol2 // mouse object region + VAR aOffTLBR // offset in pixels ENDCLASS @@ -229,7 +229,7 @@ METHOD Draw() CLASS wPaintObj // lBoxErrMessage() ENDCASE - RETURN NIL //DRAW() + RETURN NIL // DRAW() // undraw the object // normally this is called with ::lVisible == .F., @@ -261,7 +261,7 @@ METHOD Undraw() CLASS wPaintObj RestScreen( nRow1, nCol1, nRow2, nCol2, cScreen ) DispEnd() - RETURN NIL //undraw() + RETURN NIL // undraw() METHOD Hide() CLASS wPaintObj @@ -286,6 +286,7 @@ METHOD Show() CLASS wPaintObj FUNCTION wg_ResetWPaintObj( nWinNum, nObjNum, lStrict ) LOCAL i + hb_default( @nObjNum, 0 ) hb_default( @lStrict, .F. ) @@ -302,7 +303,8 @@ FUNCTION wg_ResetWPaintObj( nWinNum, nObjNum, lStrict ) FUNCTION wg_AddWPaintObj( nWinNum, oWPaint, lStrict, nOperation ) LOCAL i - LOCAL nLen, aRect //20050720 + LOCAL nLen, aRect // 20050720 + hb_default( @lStrict, .F. ) hb_default( @nOperation, WOBJ_ADD_OVERWRITE ) @@ -317,8 +319,8 @@ FUNCTION wg_AddWPaintObj( nWinNum, oWPaint, lStrict, nOperation ) IF i > 0 // so we are about to overwrite now... - //::Hide() is ideal, but it can be slow - //let's do it only of user want strict/perfect operation + // ::Hide() is ideal, but it can be slow + // let's do it only of user want strict/perfect operation IF lStrict s_aPObjList[ nWinNum + 1 ][ i ]:Hide() ELSE @@ -335,12 +337,12 @@ FUNCTION wg_AddWPaintObj( nWinNum, oWPaint, lStrict, nOperation ) oWPaint:draw() ENDIF - RETURN oWPaint:cId //20040811 was .T. + RETURN oWPaint:cId // 20040811 was .T. // deletes a WPaint object oWPaint from window nWinNum // returns number of object deleted. // -//NOTE: if cId is NIL, delete all object of type nType +// NOTE: if cId is NIL, delete all object of type nType FUNCTION wg_DelWPaintObj( nWinNum, nType, cId, lStrict ) LOCAL i diff --git a/harbour/extras/gtwvw/tests/ebtest7.prg b/harbour/extras/gtwvw/tests/ebtest7.prg index 379db07249..886e1f2081 100644 --- a/harbour/extras/gtwvw/tests/ebtest7.prg +++ b/harbour/extras/gtwvw/tests/ebtest7.prg @@ -35,11 +35,11 @@ ; => AddEBGet( aEBGets, , , @, <"var">, {| x | := x },
" //+ hb_eol() + cSection += "
" // + hb_eol() lLastPreformatted := lPreformatted lPreformatted := .T. ELSEIF AllTrim( cBuffer ) == "
" @@ -703,6 +708,7 @@ STATIC FUNCTION FReadSection( aHandle, cSectionName, cSection, o ) RETURN .T. STATIC PROCEDURE FileEval( acFile, bBlock, nMaxLine ) + LOCAL aHandle := { 0, 0 } LOCAL cBuffer LOCAL lCloseFile := .F. @@ -735,6 +741,7 @@ STATIC PROCEDURE FileEval( acFile, bBlock, nMaxLine ) RETURN STATIC FUNCTION FReadLn( aHandle, cBuffer, nMaxLine ) + STATIC s_aEOL := { Chr( 13 ) + Chr( 10 ), Chr( 10 ), Chr( 13 ) } LOCAL cLine, nSavePos, nEol, nNumRead, nLenEol, idx @@ -748,10 +755,10 @@ STATIC FUNCTION FReadLn( aHandle, cBuffer, nMaxLine ) cLine := hb_BLeft( cLine, nNumRead ) nEol := 0 - FOR idx := 1 To Len( s_aEOL ) + FOR idx := 1 TO Len( s_aEOL ) IF ( nEol := At( s_aEOL[ idx ], cLine ) ) > 0 nLenEol := hb_BLen( s_aEOL[ idx ] ) - 1 - Exit + EXIT ENDIF NEXT @@ -767,6 +774,7 @@ STATIC FUNCTION FReadLn( aHandle, cBuffer, nMaxLine ) RETURN nNumRead != 0 FUNCTION Decode( cType, hsBlock, cKey ) + LOCAL cCode LOCAL cResult LOCAL idx @@ -875,6 +883,7 @@ FUNCTION Decode( cType, hsBlock, cKey ) RETURN /* cType + "=" + */cCode PROCEDURE ShowSubHelp( xLine, nMode, nIndent, n ) + LOCAL cIndent := Space( nIndent ) IF xLine != NIL @@ -894,7 +903,7 @@ PROCEDURE ShowSubHelp( xLine, nMode, nIndent, n ) OTHERWISE DO CASE CASE nMode == 1 ; OutStd( cIndent + xLine ) ; OutStd( hb_eol() ) - CASE nMode == 2 ; OutStd( iif( n > 1, ", ", "") + xLine ) + CASE nMode == 2 ; OutStd( iif( n > 1, ", ", "" ) + xLine ) OTHERWISE ; OutStd( "(" + hb_ntos( nMode ) + ") " ) ; OutStd( xLine ) ; OutStd( hb_eol() ) ENDCASE ENDCASE @@ -906,6 +915,7 @@ STATIC FUNCTION HBRawVersion() RETURN StrTran( Version(), "Harbour " ) PROCEDURE ShowHelp( cExtraMessage, aArgs ) + LOCAL nMode := 1 #define OnOrOff( b ) iif( b, "excluded", "included" ) @@ -988,6 +998,7 @@ PROCEDURE ShowHelp( cExtraMessage, aArgs ) RETURN FUNCTION Parse( cVar, xDelimiter ) + LOCAL cResult LOCAL idx @@ -1007,6 +1018,7 @@ FUNCTION Parse( cVar, xDelimiter ) RETURN cResult FUNCTION Join( aVar, cDelimiter ) + LOCAL cResult := "" AEval( aVar, {| c, n | cResult += iif( n > 1, cDelimiter, "" ) + c } ) @@ -1014,12 +1026,15 @@ FUNCTION Join( aVar, cDelimiter ) RETURN cResult STATIC PROCEDURE AddErrorCondition( cFile, cMessage, nLine ) + IF p_hsSwitches[ "immediate-errors" ] OutStd( cFile + ":" + hb_ntos( nLine ) + ": " + cMessage + hb_eol() ) ENDIF + RETURN FUNCTION Indent( cText, nLeftMargin, nWidth, lRaw ) + LOCAL cResult := "" LOCAL idx LOCAL cLine diff --git a/harbour/extras/hbdoc/tmplates.prg b/harbour/extras/hbdoc/tmplates.prg index b7d46fbf68..f2666a579f 100644 --- a/harbour/extras/hbdoc/tmplates.prg +++ b/harbour/extras/hbdoc/tmplates.prg @@ -141,9 +141,11 @@ CREATE CLASS Entry VAR sourcefileversion_ AS STRING VAR uid_ AS STRING CLASS VAR uid__ AS INTEGER INIT 0 + ENDCLASS METHOD New( cType ) CLASS Entry + ::uid_ := hb_ntos( ++::uid__ ) IF ! __objHasData( self, self:Fields[ 1 ][ 1 ] ) AEval( self:Fields, {| a | __objAddData( self, a[ 1 ] ) } ) @@ -151,9 +153,11 @@ METHOD New( cType ) CLASS Entry IF cType != NIL self:Group := self:Templates[ AScan( self:Templates, {| a | Upper( a[ 1 ] ) == Upper( cType ) } ) ][ 2 ] ENDIF + RETURN self METHOD IsField( c, nType ) CLASS Entry + LOCAL idx LOCAL lResult @@ -172,6 +176,7 @@ METHOD IsTemplate( cType ) CLASS Entry RETURN AScan( self:Templates, {| a | Upper( a[ 1 ] ) == Upper( cType ) } ) > 0 METHOD SetTemplate( cTemplate ) CLASS Entry + LOCAL aData := Array( Len( self:Fields ) ) LOCAL idx @@ -184,17 +189,20 @@ METHOD SetTemplate( cTemplate ) CLASS Entry ENDIF NEXT __objSetValueList( self, aData ) + RETURN self METHOD IsConstraint( cSectionName, cSection ) CLASS Entry + LOCAL lResult LOCAL idx := AScan( self:Fields, {| a | a[ 1 ] == cSectionName } ) IF hb_bitAnd( self:Group[ idx ], hb_bitAnd( TPL_REQUIRED, TPL_OPTIONAL ) ) == 0 lResult := .T. ELSEIF Type( "p_a" + cSectionName ) == "A" - lResult := hb_AScan( &( "p_a" + cSectionName ), cSection, , , .T. ) .OR. ; - hb_AScan( &( "p_a" + cSectionName ), Parse( cSection, "," ), , , .T. ) + lResult := ; + hb_AScan( &( "p_a" + cSectionName ), cSection, , , .T. ) .OR. ; + hb_AScan( &( "p_a" + cSectionName ), Parse( cSection, "," ), , , .T. ) ELSE lResult := .T. ENDIF @@ -202,6 +210,7 @@ METHOD IsConstraint( cSectionName, cSection ) CLASS Entry RETURN lResult METHOD IsComplete( cIncompleteFielsList ) CLASS Entry + LOCAL lResult := .T. LOCAL idx @@ -214,7 +223,7 @@ METHOD IsComplete( cIncompleteFielsList ) CLASS Entry ENDIF NEXT - cIncompleteFielsList := SUBSTR( cIncompleteFielsList, 2 ) + cIncompleteFielsList := SubStr( cIncompleteFielsList, 2 ) RETURN lResult @@ -240,6 +249,7 @@ METHOD SubcategoryIndex( cCategory, cSubcategory ) CLASS Entry RETURN hb_AScan( p_aCategories[ ::CategoryIndex( cCategory ) ][ 2 ], cSubcategory, , , .T. ) PROCEDURE init_Templates() + LOCAL idx LOCAL aSubCategories := { ; "Application", ; @@ -358,6 +368,7 @@ PROCEDURE init_Templates() PROCEDURE ShowTemplatesHelp( cTemplate, cDelimiter ) + LOCAL o := Entry():New() LOCAL idxTemplates, nFrom := 1, nTo := Len( o:Templates ) LOCAL idx @@ -376,9 +387,9 @@ PROCEDURE ShowTemplatesHelp( cTemplate, cDelimiter ) ! Empty( o:Templates[ idxTemplates ][ 1 ] ) .AND. ; !( o:Templates[ idxTemplates ][ 1 ] == "Template" ) - //~ IF nFrom != nTo - //~ ShowSubHelp( o:Templates[ idxTemplates ][ 1 ], 1, 0 ) - //~ ENDIF + // ~ IF nFrom != nTo + // ~ ShowSubHelp( o:Templates[ idxTemplates ][ 1 ], 1, 0 ) + // ~ ENDIF o:SetTemplate( o:Templates[ idxTemplates ][ 1 ] ) @@ -400,6 +411,7 @@ PROCEDURE ShowTemplatesHelp( cTemplate, cDelimiter ) RETURN PROCEDURE ShowComplianceHelp() + LOCAL idx FOR idx := 1 TO Len( p_aCompliance ) @@ -411,6 +423,7 @@ PROCEDURE ShowComplianceHelp() RETURN PROCEDURE ShowPlatformsHelp + LOCAL idx FOR idx := 1 TO Len( p_aPlatforms ) diff --git a/harbour/extras/hbvpdf/hbvpdf.prg b/harbour/extras/hbvpdf/hbvpdf.prg index 7e8c08e6af..de4b82a37a 100644 --- a/harbour/extras/hbvpdf/hbvpdf.prg +++ b/harbour/extras/hbvpdf/hbvpdf.prg @@ -11,39 +11,40 @@ THREAD STATIC t_aReport // --------------- -function pdfInit() +FUNCTION pdfInit() -t_aReport := array( PARAMLEN ) + t_aReport := Array( PARAMLEN ) -return t_aReport + RETURN t_aReport // ------------------------- -function pdfWidth( _nWidth ) +FUNCTION pdfWidth( _nWidth ) -t_aReport[ REPORTWIDTH ] := _nWidth + t_aReport[ REPORTWIDTH ] := _nWidth -return nil + RETURN NIL // -------------------------- -function pdfTextWidth( cStr ) +FUNCTION pdfTextWidth( cStr ) -return pdfLen( cStr ) / 25.4 + RETURN pdfLen( cStr ) / 25.4 // ---------------------------------------------------------- -function pdfAtSay( cString, nRow, nCol, cUnits, lExact, cId ) -local _nFont, lReverse, nAt +FUNCTION pdfAtSay( cString, nRow, nCol, cUnits, lExact, cId ) -__defaultNIL( @nRow, t_aReport[ REPORTLINE ] ) -__defaultNIL( @cUnits, "R" ) -__defaultNIL( @lExact, .F. ) -__defaultNIL( @cId, "" ) + LOCAL _nFont, lReverse, nAt + + __defaultNIL( @nRow, t_aReport[ REPORTLINE ] ) + __defaultNIL( @cUnits, "R" ) + __defaultNIL( @lExact, .F. ) + __defaultNIL( @cId, "" ) IF t_aReport[ HEADEREDIT ] - return pdfHeader( "PDFATSAY", cId, { cString, nRow, nCol, cUnits, lExact } ) + RETURN pdfHeader( "PDFATSAY", cId, { cString, nRow, nCol, cUnits, lExact } ) ENDIF - IF ( nAt := at( "#pagenumber#", cString ) ) > 0 - cString := left( cString, nAt - 1 ) + hb_ntos( pdfPageNumber() ) + substr( cString, nAt + 12 ) + IF ( nAt := At( "#pagenumber#", cString ) ) > 0 + cString := Left( cString, nAt - 1 ) + hb_ntos( pdfPageNumber() ) + SubStr( cString, nAt + 12 ) ENDIF lReverse := .F. @@ -57,210 +58,241 @@ __defaultNIL( @cId, "" ) ENDIF nRow := pdfR2D( nRow ) nCol := pdfM2X( t_aReport[ PDFLEFT ] ) + ; - nCol * 100.00 / t_aReport[ REPORTWIDTH ] * ; - ( t_aReport[ PAGEX ] - pdfM2X( t_aReport[ PDFLEFT ] ) * 2 - 9.0 ) / 100.00 + nCol * 100.00 / t_aReport[ REPORTWIDTH ] * ; + ( t_aReport[ PAGEX ] - pdfM2X( t_aReport[ PDFLEFT ] ) * 2 - 9.0 ) / 100.00 ENDIF - IF !empty( cString ) + IF !Empty( cString ) cString := pdfStringB( cString ) - IF right( cString, 1 ) == Chr( 255 ) //reverse - cString := left( cString, len( cString ) - 1 ) - pdfBox( t_aReport[ PAGEY ] - nRow - t_aReport[ FONTSIZE ] + 2.0, nCol, t_aReport[ PAGEY ] - nRow + 2.0, nCol + pdfM2X( pdfLen( cString )) + 1,,100, "D") + IF Right( cString, 1 ) == Chr( 255 ) // reverse + cString := Left( cString, Len( cString ) - 1 ) + pdfBox( t_aReport[ PAGEY ] - nRow - t_aReport[ FONTSIZE ] + 2.0, nCol, t_aReport[ PAGEY ] - nRow + 2.0, nCol + pdfM2X( pdfLen( cString ) ) + 1,, 100, "D" ) t_aReport[ PAGEBUFFER ] += " 1 g " lReverse := .T. - ELSEIF right( cString, 1 ) == Chr( 254 ) //underline - cString := left( cString, len( cString ) - 1 ) - pdfBox( t_aReport[ PAGEY ] - nRow + 0.5, nCol, t_aReport[ PAGEY ] - nRow + 1, nCol + pdfM2X( pdfLen( cString )) + 1,,100, "D") + ELSEIF Right( cString, 1 ) == Chr( 254 ) // underline + cString := Left( cString, Len( cString ) - 1 ) + pdfBox( t_aReport[ PAGEY ] - nRow + 0.5, nCol, t_aReport[ PAGEY ] - nRow + 1, nCol + pdfM2X( pdfLen( cString ) ) + 1,, 100, "D" ) ENDIF // version 0.01 - IF ( nAt := at( Chr( 253 ), cString )) > 0 // some color text inside + IF ( nAt := At( Chr( 253 ), cString ) ) > 0 // some color text inside t_aReport[ PAGEBUFFER ] += CRLF + ; - Chr_RGB( substr( cString, nAt + 1, 1 )) + " " + ; - Chr_RGB( substr( cString, nAt + 2, 1 )) + " " + ; - Chr_RGB( substr( cString, nAt + 3, 1 )) + " rg " - cString := stuff( cString, nAt, 4, "") + Chr_RGB( SubStr( cString, nAt + 1, 1 ) ) + " " + ; + Chr_RGB( SubStr( cString, nAt + 2, 1 ) ) + " " + ; + Chr_RGB( SubStr( cString, nAt + 3, 1 ) ) + " rg " + cString := Stuff( cString, nAt, 4, "" ) ENDIF // version 0.01 - _nFont := ascan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ FONTNAME ]} ) + _nFont := AScan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ FONTNAME ] } ) IF !( t_aReport[ FONTNAME ] == t_aReport[ FONTNAMEPREV ] ) t_aReport[ FONTNAMEPREV ] := t_aReport[ FONTNAME ] - t_aReport[ PAGEBUFFER ] += CRLF + "BT /Fo" + hb_ntos( _nFont ) + " " + ltrim(transform( t_aReport[ FONTSIZE ], "999.99")) + " Tf " + ltrim(transform( nCol, "9999.99" )) + " " + ltrim(transform( nRow, "9999.99" )) + " Td (" + cString + ") Tj ET" + t_aReport[ PAGEBUFFER ] += CRLF + "BT /Fo" + hb_ntos( _nFont ) + " " + LTrim( Transform( t_aReport[ FONTSIZE ], "999.99" ) ) + " Tf " + LTrim( Transform( nCol, "9999.99" ) ) + " " + LTrim( Transform( nRow, "9999.99" ) ) + " Td (" + cString + ") Tj ET" ELSEIF t_aReport[ FONTSIZE ] != t_aReport[ FONTSIZEPREV ] t_aReport[ FONTSIZEPREV ] := t_aReport[ FONTSIZE ] - t_aReport[ PAGEBUFFER ] += CRLF + "BT /Fo" + hb_ntos( _nFont ) + " " + ltrim(transform( t_aReport[ FONTSIZE ], "999.99")) + " Tf " + ltrim(transform( nCol, "9999.99" )) + " " + ltrim(transform( nRow, "9999.99" )) + " Td (" + cString + ") Tj ET" + t_aReport[ PAGEBUFFER ] += CRLF + "BT /Fo" + hb_ntos( _nFont ) + " " + LTrim( Transform( t_aReport[ FONTSIZE ], "999.99" ) ) + " Tf " + LTrim( Transform( nCol, "9999.99" ) ) + " " + LTrim( Transform( nRow, "9999.99" ) ) + " Td (" + cString + ") Tj ET" ELSE - t_aReport[ PAGEBUFFER ] += CRLF + "BT " + ltrim(transform( nCol, "9999.99" )) + " " + ltrim(transform( nRow, "9999.99" )) + " Td (" + cString + ") Tj ET" + t_aReport[ PAGEBUFFER ] += CRLF + "BT " + LTrim( Transform( nCol, "9999.99" ) ) + " " + LTrim( Transform( nRow, "9999.99" ) ) + " Td (" + cString + ") Tj ET" ENDIF IF lReverse t_aReport[ PAGEBUFFER ] += " 0 g " ENDIF ENDIF -return nil + + RETURN NIL // --------------- -function pdfBold() - IF pdfGetFontInfo("NAME") == "Times" +FUNCTION pdfBold() + + IF pdfGetFontInfo( "NAME" ) == "Times" t_aReport[ FONTNAME ] := 2 - ELSEIF pdfGetFontInfo("NAME") == "Helvetica" + ELSEIF pdfGetFontInfo( "NAME" ) == "Helvetica" t_aReport[ FONTNAME ] := 6 ELSE t_aReport[ FONTNAME ] := 10 // Courier // 0.04 ENDIF - aadd( t_aReport[ PAGEFONTS ], t_aReport[ FONTNAME ] ) - IF ascan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ FONTNAME ] } ) == 0 - aadd( t_aReport[ FONTS ], { t_aReport[ FONTNAME ], ++t_aReport[ NEXTOBJ ] } ) + AAdd( t_aReport[ PAGEFONTS ], t_aReport[ FONTNAME ] ) + IF AScan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ FONTNAME ] } ) == 0 + AAdd( t_aReport[ FONTS ], { t_aReport[ FONTNAME ], ++t_aReport[ NEXTOBJ ] } ) ENDIF -return nil + + RETURN NIL // --------------------- -function pdfBoldItalic() - IF pdfGetFontInfo("NAME") == "Times" +FUNCTION pdfBoldItalic() + + IF pdfGetFontInfo( "NAME" ) == "Times" t_aReport[ FONTNAME ] := 4 - ELSEIF pdfGetFontInfo("NAME") == "Helvetica" + ELSEIF pdfGetFontInfo( "NAME" ) == "Helvetica" t_aReport[ FONTNAME ] := 8 ELSE t_aReport[ FONTNAME ] := 12 // 0.04 ENDIF - aadd( t_aReport[ PAGEFONTS ], t_aReport[ FONTNAME ] ) - IF ascan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ FONTNAME ] } ) == 0 - aadd( t_aReport[ FONTS ], { t_aReport[ FONTNAME ], ++t_aReport[ NEXTOBJ ] } ) + AAdd( t_aReport[ PAGEFONTS ], t_aReport[ FONTNAME ] ) + IF AScan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ FONTNAME ] } ) == 0 + AAdd( t_aReport[ FONTS ], { t_aReport[ FONTNAME ], ++t_aReport[ NEXTOBJ ] } ) ENDIF -return nil + + RETURN NIL // ------------------------------------------------ -function pdfBookAdd( cTitle, nLevel, nPage, nLine ) - aadd( t_aReport[ BOOKMARK ], { nLevel, alltrim( cTitle ), 0, 0, 0, 0, 0, 0, nPage, iif( nLevel == 1, t_aReport[ PAGEY ], t_aReport[ PAGEY ] - nLine * 72 / t_aReport[ LPI ] ) }) -return Nil +FUNCTION pdfBookAdd( cTitle, nLevel, nPage, nLine ) + + AAdd( t_aReport[ BOOKMARK ], { nLevel, AllTrim( cTitle ), 0, 0, 0, 0, 0, 0, nPage, iif( nLevel == 1, t_aReport[ PAGEY ], t_aReport[ PAGEY ] - nLine * 72 / t_aReport[ LPI ] ) } ) + + RETURN NIL // --------------------- -function pdfBookClose( ) +FUNCTION pdfBookClose() + t_aReport[ BOOKMARK ] := nil -return Nil + + RETURN NIL // ---------------------------------------------- -static function pdfBookCount( nRecno, nCurLevel ) -local nTempLevel, nCount := 0, nLen := len( t_aReport[ BOOKMARK ] ) +STATIC FUNCTION pdfBookCount( nRecno, nCurLevel ) + + LOCAL nTempLevel, nCount := 0, nLen := Len( t_aReport[ BOOKMARK ] ) + ++nRecno - while nRecno <= nLen + WHILE nRecno <= nLen nTempLevel := t_aReport[ BOOKMARK ][ nRecno ][ BOOKLEVEL ] IF nTempLevel <= nCurLevel - exit + EXIT ELSE IF nCurLevel + 1 == nTempLevel ++nCount ENDIF ENDIF ++nRecno - enddo -return -1 * nCount + ENDDO + + RETURN -1 * nCount // ---------------------------------------------------- -static function pdfBookFirst( nRecno, nCurLevel, nObj ) -local nFirst := 0, nLen := len( t_aReport[ BOOKMARK ] ) +STATIC FUNCTION pdfBookFirst( nRecno, nCurLevel, nObj ) + + LOCAL nFirst := 0, nLen := Len( t_aReport[ BOOKMARK ] ) + ++nRecno IF nRecno <= nLen IF nCurLevel + 1 == t_aReport[ BOOKMARK ][ nRecno ][ BOOKLEVEL ] nFirst := nRecno ENDIF ENDIF -return iif( nFirst == 0, nFirst, nObj + nFirst ) + + RETURN iif( nFirst == 0, nFirst, nObj + nFirst ) // --------------------------------------------------- -static function pdfBookLast( nRecno, nCurLevel, nObj ) -local nLast := 0, nLen := len( t_aReport[ BOOKMARK ] ) +STATIC FUNCTION pdfBookLast( nRecno, nCurLevel, nObj ) + + LOCAL nLast := 0, nLen := Len( t_aReport[ BOOKMARK ] ) + ++nRecno IF nRecno <= nLen IF nCurLevel + 1 == t_aReport[ BOOKMARK ][ nRecno ][ BOOKLEVEL ] - while nRecno <= nLen .and. nCurLevel + 1 <= t_aReport[ BOOKMARK ][ nRecno ][ BOOKLEVEL ] + WHILE nRecno <= nLen .AND. nCurLevel + 1 <= t_aReport[ BOOKMARK ][ nRecno ][ BOOKLEVEL ] IF nCurLevel + 1 == t_aReport[ BOOKMARK ][ nRecno ][ BOOKLEVEL ] nLast := nRecno ENDIF ++nRecno - enddo + ENDDO ENDIF ENDIF -return iif( nLast == 0, nLast, nObj + nLast ) + + RETURN iif( nLast == 0, nLast, nObj + nLast ) // --------------------------------------------------- -static function pdfBookNext( nRecno, nCurLevel, nObj ) -local nTempLevel, nNext := 0, nLen := len( t_aReport[ BOOKMARK ] ) +STATIC FUNCTION pdfBookNext( nRecno, nCurLevel, nObj ) + + LOCAL nTempLevel, nNext := 0, nLen := Len( t_aReport[ BOOKMARK ] ) + ++nRecno - while nRecno <= nLen + WHILE nRecno <= nLen nTempLevel := t_aReport[ BOOKMARK ][ nRecno ][ BOOKLEVEL ] IF nCurLevel > nTempLevel - exit + EXIT ELSEIF nCurLevel == nTempLevel nNext := nRecno - exit + EXIT ELSE // keep going ENDIF ++nRecno - enddo -return iif( nNext == 0, nNext, nObj + nNext ) + ENDDO + + RETURN iif( nNext == 0, nNext, nObj + nNext ) // -------------------- -function pdfBookOpen( ) +FUNCTION pdfBookOpen() + t_aReport[ BOOKMARK ] := {} -return Nil + + RETURN NIL // ----------------------------------------------------- -static function pdfBookParent( nRecno, nCurLevel, nObj ) -local nTempLevel -local nParent := 0 +STATIC FUNCTION pdfBookParent( nRecno, nCurLevel, nObj ) + + LOCAL nTempLevel + LOCAL nParent := 0 + --nRecno - while nRecno > 0 + WHILE nRecno > 0 nTempLevel := t_aReport[ BOOKMARK ][ nRecno ][ BOOKLEVEL ] IF nTempLevel < nCurLevel nParent := nRecno - exit + EXIT ENDIF --nRecno - enddo -return iif( nParent == 0, nObj - 1, nObj + nParent ) + ENDDO + + RETURN iif( nParent == 0, nObj - 1, nObj + nParent ) // --------------------------------------------------- -static function pdfBookPrev( nRecno, nCurLevel, nObj ) -local nTempLevel -local nPrev := 0 +STATIC FUNCTION pdfBookPrev( nRecno, nCurLevel, nObj ) + + LOCAL nTempLevel + LOCAL nPrev := 0 + --nRecno - while nRecno > 0 + WHILE nRecno > 0 nTempLevel := t_aReport[ BOOKMARK ][ nRecno ][ BOOKLEVEL ] IF nCurLevel > nTempLevel - exit + EXIT ELSEIF nCurLevel == nTempLevel nPrev := nRecno - exit + EXIT ELSE // keep going ENDIF --nRecno - enddo -return iif( nPrev == 0, nPrev, nObj + nPrev ) + ENDDO + + RETURN iif( nPrev == 0, nPrev, nObj + nPrev ) // ------------------------------------------------------------ -function pdfBox( x1, y1, x2, y2, nBorder, nShade, cUnits, cColor, cId ) -local cBoxColor -__defaultNIL( @nBorder, 0 ) -__defaultNIL( @nShade, 0 ) -__defaultNIL( @cUnits, "M" ) -__defaultNIL( @cColor, "" ) +FUNCTION pdfBox( x1, y1, x2, y2, nBorder, nShade, cUnits, cColor, cId ) + + LOCAL cBoxColor + + __defaultNIL( @nBorder, 0 ) + __defaultNIL( @nShade, 0 ) + __defaultNIL( @cUnits, "M" ) + __defaultNIL( @cColor, "" ) // version 0.02 cBoxColor := "" - IF !empty( cColor ) - cBoxColor := " " + Chr_RGB( substr( cColor, 2, 1 )) + " " + ; - Chr_RGB( substr( cColor, 3, 1 )) + " " + ; - Chr_RGB( substr( cColor, 4, 1 )) + " rg " - IF empty( alltrim( cBoxColor ) ) + IF !Empty( cColor ) + cBoxColor := " " + Chr_RGB( SubStr( cColor, 2, 1 ) ) + " " + ; + Chr_RGB( SubStr( cColor, 3, 1 ) ) + " " + ; + Chr_RGB( SubStr( cColor, 4, 1 ) ) + " rg " + IF Empty( AllTrim( cBoxColor ) ) cBoxColor := "" ENDIF ENDIF // version 0.02 IF t_aReport[ HEADEREDIT ] - return pdfHeader( "PDFBOX", cId, { x1, y1, x2, y2, nBorder, nShade, cUnits } ) + RETURN pdfHeader( "PDFBOX", cId, { x1, y1, x2, y2, nBorder, nShade, cUnits } ) ENDIF IF cUnits == "M" @@ -269,20 +301,20 @@ __defaultNIL( @cColor, "" ) IF nShade > 0 // version 0.02 - t_aReport[ PAGEBUFFER ] += CRLF + transform( 1.00 - nShade / 100.00, "9.99") + " g " + cBoxColor + hb_ntos( pdfM2X( y1 ) ) + " " + hb_ntos( pdfM2Y( x1 ) ) + " " + hb_ntos( pdfM2X( y2 - y1 ) ) + " -" + hb_ntos( pdfM2X( x2 - x1 ) ) + " re f 0 g" + t_aReport[ PAGEBUFFER ] += CRLF + Transform( 1.00 - nShade / 100.00, "9.99" ) + " g " + cBoxColor + hb_ntos( pdfM2X( y1 ) ) + " " + hb_ntos( pdfM2Y( x1 ) ) + " " + hb_ntos( pdfM2X( y2 - y1 ) ) + " -" + hb_ntos( pdfM2X( x2 - x1 ) ) + " re f 0 g" ENDIF IF nBorder > 0 - t_aReport[ PAGEBUFFER ] += CRLF + "0 g " + hb_ntos( pdfM2X( y1 ) ) + " " + hb_ntos(pdfM2Y( x1 )) + " " + hb_ntos(pdfM2X( y2 - y1 )) + " -" + hb_ntos(pdfM2X( nBorder )) + " re f" - t_aReport[ PAGEBUFFER ] += CRLF + "0 g " + hb_ntos(pdfM2X( y2 - nBorder )) + " " + hb_ntos(pdfM2Y( x1 )) + " " + hb_ntos(pdfM2X( nBorder )) + " -" + hb_ntos(pdfM2X( x2 - x1 )) + " re f" - t_aReport[ PAGEBUFFER ] += CRLF + "0 g " + hb_ntos(pdfM2X( y1 )) + " " + hb_ntos(pdfM2Y( x2 - nBorder )) + " " + hb_ntos(pdfM2X( y2 - y1 )) + " -" + hb_ntos(pdfM2X( nBorder )) + " re f" - t_aReport[ PAGEBUFFER ] += CRLF + "0 g " + hb_ntos(pdfM2X( y1 )) + " " + hb_ntos(pdfM2Y( x1 )) + " " + hb_ntos(pdfM2X( nBorder )) + " -" + hb_ntos(pdfM2X( x2 - x1 )) + " re f" + t_aReport[ PAGEBUFFER ] += CRLF + "0 g " + hb_ntos( pdfM2X( y1 ) ) + " " + hb_ntos( pdfM2Y( x1 ) ) + " " + hb_ntos( pdfM2X( y2 - y1 ) ) + " -" + hb_ntos( pdfM2X( nBorder ) ) + " re f" + t_aReport[ PAGEBUFFER ] += CRLF + "0 g " + hb_ntos( pdfM2X( y2 - nBorder ) ) + " " + hb_ntos( pdfM2Y( x1 ) ) + " " + hb_ntos( pdfM2X( nBorder ) ) + " -" + hb_ntos( pdfM2X( x2 - x1 ) ) + " re f" + t_aReport[ PAGEBUFFER ] += CRLF + "0 g " + hb_ntos( pdfM2X( y1 ) ) + " " + hb_ntos( pdfM2Y( x2 - nBorder ) ) + " " + hb_ntos( pdfM2X( y2 - y1 ) ) + " -" + hb_ntos( pdfM2X( nBorder ) ) + " re f" + t_aReport[ PAGEBUFFER ] += CRLF + "0 g " + hb_ntos( pdfM2X( y1 ) ) + " " + hb_ntos( pdfM2Y( x1 ) ) + " " + hb_ntos( pdfM2X( nBorder ) ) + " -" + hb_ntos( pdfM2X( x2 - x1 ) ) + " re f" ENDIF ELSEIF cUnits == "D"// "Dots" - //x1, y1, x2, y2 - nTop, nLeft, nBottom, nRight + // x1, y1, x2, y2 - nTop, nLeft, nBottom, nRight IF nShade > 0 // version 0.02 - t_aReport[ PAGEBUFFER ] += CRLF + transform( 1.00 - nShade / 100.00, "9.99") + " g " + cBoxColor + hb_ntos( y1 ) + " " + hb_ntos( t_aReport[ PAGEY ] - x1 ) + " " + hb_ntos( y2 - y1 ) + " -" + hb_ntos( x2 - x1 ) + " re f 0 g" + t_aReport[ PAGEBUFFER ] += CRLF + Transform( 1.00 - nShade / 100.00, "9.99" ) + " g " + cBoxColor + hb_ntos( y1 ) + " " + hb_ntos( t_aReport[ PAGEY ] - x1 ) + " " + hb_ntos( y2 - y1 ) + " -" + hb_ntos( x2 - x1 ) + " re f 0 g" ENDIF IF nBorder > 0 @@ -300,48 +332,52 @@ __defaultNIL( @cColor, "" ) ENDIF ENDIF -return nil + RETURN NIL // ------------------------------------------------------------ -function pdfBox1( nTop, nLeft, nBottom, nRight, nBorderWidth, cBorderColor, cBoxColor ) -__defaultNIL( @nBorderWidth, 0.5 ) -__defaultNIL( @cBorderColor, Chr( 0 ) + Chr( 0 ) + Chr( 0 ) ) -__defaultNIL( @cBoxColor, Chr( 255 ) + Chr( 255 ) + Chr( 255 ) ) +FUNCTION pdfBox1( nTop, nLeft, nBottom, nRight, nBorderWidth, cBorderColor, cBoxColor ) - t_aReport[ PAGEBUFFER ] += CRLF + ; - Chr_RGB( substr( cBorderColor, 1, 1 )) + " " + ; - Chr_RGB( substr( cBorderColor, 2, 1 )) + " " + ; - Chr_RGB( substr( cBorderColor, 3, 1 )) + ; - " RG" + ; - CRLF + ; - Chr_RGB( substr( cBoxColor, 1, 1 )) + " " + ; - Chr_RGB( substr( cBoxColor, 2, 1 )) + " " + ; - Chr_RGB( substr( cBoxColor, 3, 1 )) + ; - " rg" + ; - CRLF + hb_ntos( nBorderWidth ) + " w" + ; - CRLF + hb_ntos( nLeft + nBorderWidth / 2 ) + " " + ; - CRLF + hb_ntos( t_aReport[ PAGEY ] - nBottom + nBorderWidth / 2 ) + " " + ; - CRLF + hb_ntos( nRight - nLeft - nBorderWidth ) + ; - CRLF + hb_ntos( nBottom - nTop - nBorderWidth ) + " " + ; - " re" + ; - CRLF + "B" -return nil + __defaultNIL( @nBorderWidth, 0.5 ) + __defaultNIL( @cBorderColor, Chr( 0 ) + Chr( 0 ) + Chr( 0 ) ) + __defaultNIL( @cBoxColor, Chr( 255 ) + Chr( 255 ) + Chr( 255 ) ) + + t_aReport[ PAGEBUFFER ] += CRLF + ; + Chr_RGB( SubStr( cBorderColor, 1, 1 ) ) + " " + ; + Chr_RGB( SubStr( cBorderColor, 2, 1 ) ) + " " + ; + Chr_RGB( SubStr( cBorderColor, 3, 1 ) ) + ; + " RG" + ; + CRLF + ; + Chr_RGB( SubStr( cBoxColor, 1, 1 ) ) + " " + ; + Chr_RGB( SubStr( cBoxColor, 2, 1 ) ) + " " + ; + Chr_RGB( SubStr( cBoxColor, 3, 1 ) ) + ; + " rg" + ; + CRLF + hb_ntos( nBorderWidth ) + " w" + ; + CRLF + hb_ntos( nLeft + nBorderWidth / 2 ) + " " + ; + CRLF + hb_ntos( t_aReport[ PAGEY ] - nBottom + nBorderWidth / 2 ) + " " + ; + CRLF + hb_ntos( nRight - nLeft - nBorderWidth ) + ; + CRLF + hb_ntos( nBottom - nTop - nBorderWidth ) + " " + ; + " re" + ; + CRLF + "B" + + RETURN NIL // ----------------------------------------------------------- -function pdfCenter( cString, nRow, nCol, cUnits, lExact, cId ) -local nLen, nAt -__defaultNIL( @nRow, t_aReport[ REPORTLINE ] ) -__defaultNIL( @cUnits, "R" ) -__defaultNIL( @lExact, .F. ) -__defaultNIL( @nCol, iif( cUnits == "R", t_aReport[ REPORTWIDTH ] / 2, t_aReport[ PAGEX ] / 72 * 25.4 / 2 ) ) +FUNCTION pdfCenter( cString, nRow, nCol, cUnits, lExact, cId ) + + LOCAL nLen, nAt + + __defaultNIL( @nRow, t_aReport[ REPORTLINE ] ) + __defaultNIL( @cUnits, "R" ) + __defaultNIL( @lExact, .F. ) + __defaultNIL( @nCol, iif( cUnits == "R", t_aReport[ REPORTWIDTH ] / 2, t_aReport[ PAGEX ] / 72 * 25.4 / 2 ) ) IF t_aReport[ HEADEREDIT ] - return pdfHeader( "PDFCENTER", cId, { cString, nRow, nCol, cUnits, lExact } ) + RETURN pdfHeader( "PDFCENTER", cId, { cString, nRow, nCol, cUnits, lExact } ) ENDIF - IF ( nAt := at( "#pagenumber#", cString ) ) > 0 - cString := left( cString, nAt - 1 ) + hb_ntos( pdfPageNumber() ) + substr( cString, nAt + 12 ) + IF ( nAt := At( "#pagenumber#", cString ) ) > 0 + cString := Left( cString, nAt - 1 ) + hb_ntos( pdfPageNumber() ) + SubStr( cString, nAt + 12 ) ENDIF nLen := pdfLen( cString ) / 2 @@ -352,20 +388,24 @@ __defaultNIL( @nCol, iif( cUnits == "R", t_aReport[ REPORTWIDTH ] / 2, t_aReport ENDIF ENDIF pdfAtSay( cString, pdfR2M( nRow ), iif( cUnits == "R", t_aReport[ PDFLEFT ] + ( t_aReport[ PAGEX ] / 72 * 25.4 - 2 * t_aReport[ PDFLEFT ] ) * nCol / t_aReport[ REPORTWIDTH ], nCol ) - nLen, "M", lExact ) -return nil + + RETURN NIL // --------------------------------- -static function pdfCheckLine( nRow ) +STATIC FUNCTION pdfCheckLine( nRow ) + IF nRow + t_aReport[ PDFTOP ] > t_aReport[ PDFBOTTOM ] pdfNewPage() nRow := t_aReport[ REPORTLINE ] ENDIF t_aReport[ REPORTLINE ] := nRow -return nil + + RETURN NIL // ---------------- -function pdfClose() -local nI, cTemp, nCurLevel, nObj1, nLast, nCount, nFirst, nRecno, nBooklen +FUNCTION pdfClose() + + LOCAL nI, cTemp, nCurLevel, nObj1, nLast, nCount, nFirst, nRecno, nBooklen FIELD FIRST, PREV, NEXT, LAST, COUNT, PARENT, PAGE, COORD, TITLE, LEVEL @@ -374,46 +414,46 @@ local nI, cTemp, nCurLevel, nObj1, nLast, nCount, nFirst, nRecno, nBooklen // kids t_aReport[ REFS ][ 2 ] := t_aReport[ DOCLEN ] cTemp := ; - "1 0 obj"+CRLF+; - "<<"+CRLF+; - "/Type /Pages /Count " + hb_ntos( t_aReport[ REPORTPAGE ] ) + CRLF +; - "/Kids [" + "1 0 obj" + CRLF + ; + "<<" + CRLF + ; + "/Type /Pages /Count " + hb_ntos( t_aReport[ REPORTPAGE ] ) + CRLF + ; + "/Kids [" - for nI := 1 to t_aReport[ REPORTPAGE ] + FOR nI := 1 TO t_aReport[ REPORTPAGE ] cTemp += " " + hb_ntos( t_aReport[ PAGES ][ nI ] ) + " 0 R" - next + NEXT cTemp += " ]" + CRLF + ; - ">>" + CRLF + ; - "endobj" + CRLF + ">>" + CRLF + ; + "endobj" + CRLF - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) // info ++t_aReport[ REPORTOBJ ] - aadd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) + AAdd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) cTemp := hb_ntos( t_aReport[ REPORTOBJ ] ) + " 0 obj" + CRLF + ; - "<<" + CRLF + ; - "/Producer ()" + CRLF + ; - "/Title ()" + CRLF + ; - "/Author ()" + CRLF + ; - "/Creator ()" + CRLF + ; - "/Subject ()" + CRLF + ; - "/Keywords ()" + CRLF + ; - "/CreationDate (D:" + str(year(date()), 4) + padl( month(date()), 2, "0") + padl( day(date()), 2, "0") + substr( time(), 1, 2 ) + substr( time(), 4, 2 ) + substr( time(), 7, 2 ) + ")" + CRLF + ; - ">>" + CRLF + ; - "endobj" + CRLF - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + "<<" + CRLF + ; + "/Producer ()" + CRLF + ; + "/Title ()" + CRLF + ; + "/Author ()" + CRLF + ; + "/Creator ()" + CRLF + ; + "/Subject ()" + CRLF + ; + "/Keywords ()" + CRLF + ; + "/CreationDate (D:" + Str( Year( Date() ), 4 ) + PadL( Month( Date() ), 2, "0" ) + PadL( Day( Date() ), 2, "0" ) + SubStr( Time(), 1, 2 ) + SubStr( Time(), 4, 2 ) + SubStr( Time(), 7, 2 ) + ")" + CRLF + ; + ">>" + CRLF + ; + "endobj" + CRLF + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) // root ++t_aReport[ REPORTOBJ ] - aadd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) + AAdd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) cTemp := hb_ntos( t_aReport[ REPORTOBJ ] ) + " 0 obj" + CRLF + ; - "<< /Type /Catalog /Pages 1 0 R /Outlines " + hb_ntos( t_aReport[ REPORTOBJ ] + 1 ) + " 0 R" + iif( ( nBookLen := len( t_aReport[ BOOKMARK ] )) > 0, " /PageMode /UseOutlines", "") + " >>" + CRLF + "endobj" + CRLF - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + "<< /Type /Catalog /Pages 1 0 R /Outlines " + hb_ntos( t_aReport[ REPORTOBJ ] + 1 ) + " 0 R" + iif( ( nBookLen := Len( t_aReport[ BOOKMARK ] ) ) > 0, " /PageMode /UseOutlines", "" ) + " >>" + CRLF + "endobj" + CRLF + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) ++t_aReport[ REPORTOBJ ] nObj1 := t_aReport[ REPORTOBJ ] @@ -424,7 +464,7 @@ local nI, cTemp, nCurLevel, nObj1, nLast, nCount, nFirst, nRecno, nBooklen nFirst := t_aReport[ REPORTOBJ ] + 1 nLast := 0 nCount := 0 - while nRecno <= nBookLen + WHILE nRecno <= nBookLen nCurLevel := t_aReport[ BOOKMARK ][ nRecno ][ BOOKLEVEL ] t_aReport[ BOOKMARK ][ nRecno ][ BOOKPARENT ] := pdfBookParent( nRecno, nCurLevel, t_aReport[ REPORTOBJ ] ) t_aReport[ BOOKMARK ][ nRecno ][ BOOKPREV ] := pdfBookPrev( nRecno, nCurLevel, t_aReport[ REPORTOBJ ] ) @@ -437,33 +477,33 @@ local nI, cTemp, nCurLevel, nObj1, nLast, nCount, nFirst, nRecno, nBooklen ++nCount ENDIF ++nRecno - enddo + ENDDO nLast += t_aReport[ REPORTOBJ ] - cTemp := hb_ntos( t_aReport[ REPORTOBJ ] ) + " 0 obj" + CRLF + "<< /Type /Outlines /Count " + hb_ntos( nCount ) + " /First " + hb_ntos( nFirst ) + " 0 R /Last " + hb_ntos( nLast ) + " 0 R >>" + CRLF + "endobj" //+ CRLF - aadd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + cTemp := hb_ntos( t_aReport[ REPORTOBJ ] ) + " 0 obj" + CRLF + "<< /Type /Outlines /Count " + hb_ntos( nCount ) + " /First " + hb_ntos( nFirst ) + " 0 R /Last " + hb_ntos( nLast ) + " 0 R >>" + CRLF + "endobj" // + CRLF + AAdd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) ++t_aReport[ REPORTOBJ ] nRecno := 1 - FOR nI := 1 to nBookLen + FOR nI := 1 TO nBookLen cTemp := CRLF + hb_ntos( t_aReport[ REPORTOBJ ] + nI - 1 ) + " 0 obj" + CRLF + ; - "<<" + CRLF + ; - "/Parent " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKPARENT ]) + " 0 R" + CRLF + ; - "/Dest [" + hb_ntos( t_aReport[ PAGES ][ t_aReport[ BOOKMARK ][ nRecno ][ BOOKPAGE ] ] ) + " 0 R /XYZ 0 " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKCOORD ] ) + " 0]" + CRLF + ; - "/Title (" + alltrim( t_aReport[ BOOKMARK ][ nRecno ][ BOOKTITLE ]) + ")" + CRLF + ; - iif( t_aReport[ BOOKMARK ][ nRecno ][ BOOKPREV ] > 0, "/Prev " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKPREV ]) + " 0 R" + CRLF, "") + ; - iif( t_aReport[ BOOKMARK ][ nRecno ][ BOOKNEXT ] > 0, "/Next " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKNEXT ]) + " 0 R" + CRLF, "") + ; - iif( t_aReport[ BOOKMARK ][ nRecno ][ BOOKFIRST ] > 0, "/First " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKFIRST ]) + " 0 R" + CRLF, "") + ; - iif( t_aReport[ BOOKMARK ][ nRecno ][ BOOKLAST ] > 0, "/Last " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKLAST ]) + " 0 R" + CRLF, "") + ; - iif( t_aReport[ BOOKMARK ][ nRecno ][ BOOKCOUNT ] != 0, "/Count " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKCOUNT ]) + CRLF, "") + ; - ">>" + CRLF + "endobj" + CRLF + "<<" + CRLF + ; + "/Parent " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKPARENT ] ) + " 0 R" + CRLF + ; + "/Dest [" + hb_ntos( t_aReport[ PAGES ][ t_aReport[ BOOKMARK ][ nRecno ][ BOOKPAGE ] ] ) + " 0 R /XYZ 0 " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKCOORD ] ) + " 0]" + CRLF + ; + "/Title (" + AllTrim( t_aReport[ BOOKMARK ][ nRecno ][ BOOKTITLE ] ) + ")" + CRLF + ; + iif( t_aReport[ BOOKMARK ][ nRecno ][ BOOKPREV ] > 0, "/Prev " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKPREV ] ) + " 0 R" + CRLF, "" ) + ; + iif( t_aReport[ BOOKMARK ][ nRecno ][ BOOKNEXT ] > 0, "/Next " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKNEXT ] ) + " 0 R" + CRLF, "" ) + ; + iif( t_aReport[ BOOKMARK ][ nRecno ][ BOOKFIRST ] > 0, "/First " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKFIRST ] ) + " 0 R" + CRLF, "" ) + ; + iif( t_aReport[ BOOKMARK ][ nRecno ][ BOOKLAST ] > 0, "/Last " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKLAST ] ) + " 0 R" + CRLF, "" ) + ; + iif( t_aReport[ BOOKMARK ][ nRecno ][ BOOKCOUNT ] != 0, "/Count " + hb_ntos( t_aReport[ BOOKMARK ][ nRecno ][ BOOKCOUNT ] ) + CRLF, "" ) + ; + ">>" + CRLF + "endobj" + CRLF - aadd( t_aReport[ REFS ], t_aReport[ DOCLEN ] + 2 ) - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + AAdd( t_aReport[ REFS ], t_aReport[ DOCLEN ] + 2 ) + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) ++nRecno NEXT pdfBookClose() @@ -471,217 +511,218 @@ local nI, cTemp, nCurLevel, nObj1, nLast, nCount, nFirst, nRecno, nBooklen t_aReport[ REPORTOBJ ] += nBookLen - 1 ELSE cTemp := hb_ntos( t_aReport[ REPORTOBJ ] ) + " 0 obj" + CRLF + "<< /Type /Outlines /Count 0 >>" + CRLF + "endobj" + CRLF - aadd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + AAdd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) ENDIF cTemp := CRLF - t_aReport[ DOCLEN ] += len( cTemp ) + t_aReport[ DOCLEN ] += Len( cTemp ) ++t_aReport[ REPORTOBJ ] cTemp += "xref" + CRLF + ; - "0 " + hb_ntos( t_aReport[ REPORTOBJ ] ) + CRLF +; - padl( t_aReport[ REFS ][ 1 ], 10, "0") + " 65535 f" + CRLF + "0 " + hb_ntos( t_aReport[ REPORTOBJ ] ) + CRLF + ; + PadL( t_aReport[ REFS ][ 1 ], 10, "0" ) + " 65535 f" + CRLF - for nI := 2 to len( t_aReport[ REFS ] ) - cTemp += padl( t_aReport[ REFS ][ nI ], 10, "0") + " 00000 n" + CRLF - next + FOR nI := 2 TO Len( t_aReport[ REFS ] ) + cTemp += PadL( t_aReport[ REFS ][ nI ], 10, "0" ) + " 00000 n" + CRLF + NEXT cTemp += "trailer << /Size " + hb_ntos( t_aReport[ REPORTOBJ ] ) + " /Root " + hb_ntos( nObj1 - 1 ) + " 0 R /Info " + hb_ntos( nObj1 - 2 ) + " 0 R >>" + CRLF + ; - "startxref" + CRLF + ; - hb_ntos( t_aReport[ DOCLEN ] ) + CRLF + ; - "%%EOF" + CRLF - fwrite( t_aReport[ HANDLE ], cTemp ) + "startxref" + CRLF + ; + hb_ntos( t_aReport[ DOCLEN ] ) + CRLF + ; + "%%EOF" + CRLF + FWrite( t_aReport[ HANDLE ], cTemp ) /* IF t_aReport[ OPTIMIZE ] pdfOptimize( ) coming ! ENDIF */ - fclose( t_aReport[ HANDLE ] ) + FClose( t_aReport[ HANDLE ] ) t_aReport := nil -return nil + RETURN NIL // --------------------------- -static function pdfClosePage() -local cTemp, cBuffer, nBuffer, nRead, nI, k, nImage, nFont, nImageHandle +STATIC FUNCTION pdfClosePage() - aadd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) + LOCAL cTemp, cBuffer, nBuffer, nRead, nI, k, nImage, nFont, nImageHandle - aadd( t_aReport[ PAGES ], t_aReport[ REPORTOBJ ] + 1 ) + AAdd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) + + AAdd( t_aReport[ PAGES ], t_aReport[ REPORTOBJ ] + 1 ) cTemp := ; - hb_ntos( ++t_aReport[ REPORTOBJ ] ) + " 0 obj" + CRLF + ; - "<<" + CRLF + ; - "/Type /Page /Parent 1 0 R" + CRLF + ; - "/Resources " + hb_ntos( ++t_aReport[ REPORTOBJ ] ) + " 0 R" + CRLF + ; - "/MediaBox [ 0 0 " + ltrim(transform( t_aReport[ PAGEX ], "9999.99")) + " " + ; - ltrim(transform(t_aReport[ PAGEY ], "9999.99")) + " ]" + CRLF + ; - "/Contents " + hb_ntos( ++t_aReport[ REPORTOBJ ] ) + " 0 R" + CRLF + ; - ">>" + CRLF + ; - "endobj" + CRLF + hb_ntos( ++t_aReport[ REPORTOBJ ] ) + " 0 obj" + CRLF + ; + "<<" + CRLF + ; + "/Type /Page /Parent 1 0 R" + CRLF + ; + "/Resources " + hb_ntos( ++t_aReport[ REPORTOBJ ] ) + " 0 R" + CRLF + ; + "/MediaBox [ 0 0 " + LTrim( Transform( t_aReport[ PAGEX ], "9999.99" ) ) + " " + ; + LTrim( Transform( t_aReport[ PAGEY ], "9999.99" ) ) + " ]" + CRLF + ; + "/Contents " + hb_ntos( ++t_aReport[ REPORTOBJ ] ) + " 0 R" + CRLF + ; + ">>" + CRLF + ; + "endobj" + CRLF - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) - aadd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) + AAdd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) cTemp := ; - hb_ntos( t_aReport[ REPORTOBJ ] - 1 ) + " 0 obj" + CRLF + ; - "<<"+CRLF+; - "/ColorSpace << /DeviceRGB /DeviceGray >>" + CRLF + ; //version 0.01 + hb_ntos( t_aReport[ REPORTOBJ ] - 1 ) + " 0 obj" + CRLF + ; + "<<" + CRLF + ; + "/ColorSpace << /DeviceRGB /DeviceGray >>" + CRLF + ; // version 0.01 "/ProcSet [ /PDF /Text /ImageB /ImageC ]" - IF len( t_aReport[ PAGEFONTS ] ) > 0 + IF Len( t_aReport[ PAGEFONTS ] ) > 0 cTemp += CRLF + ; - "/Font" + CRLF + ; - "<<" + "/Font" + CRLF + ; + "<<" - for nI := 1 to len( t_aReport[ PAGEFONTS ] ) - nFont := ascan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ PAGEFONTS ][ nI ] } ) - cTemp += CRLF + "/Fo" + hb_ntos( nFont ) + " " + hb_ntos( t_aReport[ FONTS ][ nFont ][ 2 ]) + " 0 R" - next + FOR nI := 1 TO Len( t_aReport[ PAGEFONTS ] ) + nFont := AScan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ PAGEFONTS ][ nI ] } ) + cTemp += CRLF + "/Fo" + hb_ntos( nFont ) + " " + hb_ntos( t_aReport[ FONTS ][ nFont ][ 2 ] ) + " 0 R" + NEXT cTemp += CRLF + ">>" ENDIF - IF len( t_aReport[ PAGEIMAGES ] ) > 0 + IF Len( t_aReport[ PAGEIMAGES ] ) > 0 cTemp += CRLF + "/XObject" + CRLF + "<<" - for nI := 1 to len( t_aReport[ PAGEIMAGES ] ) - nImage := ascan( t_aReport[ IMAGES ], {| arr | arr[ 1 ] == t_aReport[ PAGEIMAGES ][ nI ][ 1 ] } ) + FOR nI := 1 TO Len( t_aReport[ PAGEIMAGES ] ) + nImage := AScan( t_aReport[ IMAGES ], {| arr | arr[ 1 ] == t_aReport[ PAGEIMAGES ][ nI ][ 1 ] } ) IF nImage == 0 - aadd( t_aReport[ IMAGES ], { t_aReport[ PAGEIMAGES ][ nI ][ 1 ], ++t_aReport[ NEXTOBJ ], pdfImageInfo( t_aReport[ PAGEIMAGES ][ nI ][ 1 ] ) } ) - nImage := len( t_aReport[ IMAGES ] ) + AAdd( t_aReport[ IMAGES ], { t_aReport[ PAGEIMAGES ][ nI ][ 1 ], ++t_aReport[ NEXTOBJ ], pdfImageInfo( t_aReport[ PAGEIMAGES ][ nI ][ 1 ] ) } ) + nImage := Len( t_aReport[ IMAGES ] ) ENDIF - cTemp += CRLF + "/Image" + hb_ntos( nImage ) + " " + hb_ntos( t_aReport[ IMAGES ][ nImage ][ 2 ]) + " 0 R" - next + cTemp += CRLF + "/Image" + hb_ntos( nImage ) + " " + hb_ntos( t_aReport[ IMAGES ][ nImage ][ 2 ] ) + " 0 R" + NEXT cTemp += CRLF + ">>" ENDIF cTemp += CRLF + ">>" + CRLF + "endobj" + CRLF - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) - aadd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) + AAdd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) cTemp := hb_ntos( t_aReport[ REPORTOBJ ] ) + " 0 obj << /Length " + ; - hb_ntos( t_aReport[ REPORTOBJ ] + 1 ) + " 0 R >>" + CRLF +; - "stream" + hb_ntos( t_aReport[ REPORTOBJ ] + 1 ) + " 0 R >>" + CRLF + ; + "stream" - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) - IF len( t_aReport[ PAGEIMAGES ] ) > 0 + IF Len( t_aReport[ PAGEIMAGES ] ) > 0 cTemp := "" - for nI := 1 to len( t_aReport[ PAGEIMAGES ] ) + FOR nI := 1 TO Len( t_aReport[ PAGEIMAGES ] ) cTemp += CRLF + "q" - nImage := ascan( t_aReport[ IMAGES ], {| arr | arr[ 1 ] == t_aReport[ PAGEIMAGES ][ nI ][ 1 ] } ) - cTemp += CRLF + hb_ntos( iif( t_aReport[ PAGEIMAGES ][ nI ][ 5 ] == 0, pdfM2X( t_aReport[ IMAGES ][ nImage ][ 3 ][ IMAGE_WIDTH ] / t_aReport[ IMAGES ][ nImage ][ 3 ][ IMAGE_XRES ] * 25.4 ), t_aReport[ PAGEIMAGES ][ nI ][ 5 ])) + ; - " 0 0 " + ; - hb_ntos( iif( t_aReport[ PAGEIMAGES ][ nI ][ 4 ] == 0, pdfM2X( t_aReport[ IMAGES ][ nImage ][ 3 ][ IMAGE_HEIGHT ] / t_aReport[ IMAGES ][ nImage ][ 3 ][ IMAGE_YRES ] * 25.4 ), t_aReport[ PAGEIMAGES ][ nI ][ 4 ])) + ; - " " + hb_ntos( t_aReport[ PAGEIMAGES ][ nI ][ 3 ] ) + ; - " " + hb_ntos( t_aReport[ PAGEY ] - t_aReport[ PAGEIMAGES ][ nI ][ 2 ] - ; - iif( t_aReport[ PAGEIMAGES ][ nI ][ 4 ] == 0, pdfM2X( t_aReport[ IMAGES ][ nImage ][ 3 ][ IMAGE_HEIGHT ] / t_aReport[ IMAGES ][ nImage ][ 3 ][ IMAGE_YRES ] * 25.4 ), t_aReport[ PAGEIMAGES ][ nI ][ 4 ])) + " cm" + nImage := AScan( t_aReport[ IMAGES ], {| arr | arr[ 1 ] == t_aReport[ PAGEIMAGES ][ nI ][ 1 ] } ) + cTemp += CRLF + hb_ntos( iif( t_aReport[ PAGEIMAGES ][ nI ][ 5 ] == 0, pdfM2X( t_aReport[ IMAGES ][ nImage ][ 3 ][ IMAGE_WIDTH ] / t_aReport[ IMAGES ][ nImage ][ 3 ][ IMAGE_XRES ] * 25.4 ), t_aReport[ PAGEIMAGES ][ nI ][ 5 ] ) ) + ; + " 0 0 " + ; + hb_ntos( iif( t_aReport[ PAGEIMAGES ][ nI ][ 4 ] == 0, pdfM2X( t_aReport[ IMAGES ][ nImage ][ 3 ][ IMAGE_HEIGHT ] / t_aReport[ IMAGES ][ nImage ][ 3 ][ IMAGE_YRES ] * 25.4 ), t_aReport[ PAGEIMAGES ][ nI ][ 4 ] ) ) + ; + " " + hb_ntos( t_aReport[ PAGEIMAGES ][ nI ][ 3 ] ) + ; + " " + hb_ntos( t_aReport[ PAGEY ] - t_aReport[ PAGEIMAGES ][ nI ][ 2 ] - ; + iif( t_aReport[ PAGEIMAGES ][ nI ][ 4 ] == 0, pdfM2X( t_aReport[ IMAGES ][ nImage ][ 3 ][ IMAGE_HEIGHT ] / t_aReport[ IMAGES ][ nImage ][ 3 ][ IMAGE_YRES ] * 25.4 ), t_aReport[ PAGEIMAGES ][ nI ][ 4 ] ) ) + " cm" cTemp += CRLF + "/Image" + hb_ntos( nImage ) + " Do" cTemp += CRLF + "Q" - next + NEXT t_aReport[ PAGEBUFFER ] := cTemp + t_aReport[ PAGEBUFFER ] ENDIF cTemp := t_aReport[ PAGEBUFFER ] cTemp += CRLF + "endstream" + CRLF + ; - "endobj" + CRLF + "endobj" + CRLF - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) - aadd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) + AAdd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) cTemp := hb_ntos( ++t_aReport[ REPORTOBJ ] ) + " 0 obj" + CRLF + ; - hb_ntos( len( t_aReport[ PAGEBUFFER ] )) + CRLF + ; - "endobj" + CRLF + hb_ntos( Len( t_aReport[ PAGEBUFFER ] ) ) + CRLF + ; + "endobj" + CRLF - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) - for nI := 1 to len( t_aReport[ FONTS ] ) + FOR nI := 1 TO Len( t_aReport[ FONTS ] ) IF t_aReport[ FONTS ][ nI ][ 2 ] > t_aReport[ REPORTOBJ ] - aadd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) + AAdd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) cTemp := ; - hb_ntos( t_aReport[ FONTS ][ nI ][ 2 ] ) + " 0 obj" + CRLF + ; - "<<" + CRLF + ; - "/Type /Font" + CRLF + ; - "/Subtype /Type1" + CRLF + ; - "/Name /Fo" + hb_ntos( nI ) + CRLF + ; - "/BaseFont /" + t_aReport[ TYPE1 ][ t_aReport[ FONTS ][ nI ][ 1 ] ] + CRLF + ; - "/Encoding /WinAnsiEncoding" + CRLF + ; - ">>" + CRLF + ; - "endobj" + CRLF + hb_ntos( t_aReport[ FONTS ][ nI ][ 2 ] ) + " 0 obj" + CRLF + ; + "<<" + CRLF + ; + "/Type /Font" + CRLF + ; + "/Subtype /Type1" + CRLF + ; + "/Name /Fo" + hb_ntos( nI ) + CRLF + ; + "/BaseFont /" + t_aReport[ TYPE1 ][ t_aReport[ FONTS ][ nI ][ 1 ] ] + CRLF + ; + "/Encoding /WinAnsiEncoding" + CRLF + ; + ">>" + CRLF + ; + "endobj" + CRLF - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) ENDIF - next + NEXT - for nI := 1 to len( t_aReport[ IMAGES ] ) + FOR nI := 1 TO Len( t_aReport[ IMAGES ] ) IF t_aReport[ IMAGES ][ nI ][ 2 ] > t_aReport[ REPORTOBJ ] - aadd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) + AAdd( t_aReport[ REFS ], t_aReport[ DOCLEN ] ) // "/Filter /CCITTFaxDecode" for B&W only ? cTemp := ; - hb_ntos( t_aReport[ IMAGES ][ nI ][ 2 ] ) + " 0 obj" + CRLF + ; - "<<" + CRLF + ; - "/Type /XObject" + CRLF + ; - "/Subtype /Image" + CRLF + ; - "/Name /Image" + hb_ntos(nI) + CRLF + ; - "/Filter [" + iif( at( ".jpg", lower( t_aReport[ IMAGES ][ nI ][ 1 ]) ) > 0, " /DCTDecode", "" ) + " ]" + CRLF + ; - "/Width " + hb_ntos( t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_WIDTH ] ) + CRLF + ; - "/Height " + hb_ntos( t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_HEIGHT ] ) + CRLF + ; - "/BitsPerComponent " + hb_ntos( t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_BITS ] ) + CRLF + ; - "/ColorSpace /" + iif( t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_SPACE ] == 1, "DeviceGray", "DeviceRGB") + CRLF + ; - "/Length " + hb_ntos( t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_LENGTH ]) + CRLF + ; - ">>" + CRLF + ; - "stream" + CRLF + hb_ntos( t_aReport[ IMAGES ][ nI ][ 2 ] ) + " 0 obj" + CRLF + ; + "<<" + CRLF + ; + "/Type /XObject" + CRLF + ; + "/Subtype /Image" + CRLF + ; + "/Name /Image" + hb_ntos( nI ) + CRLF + ; + "/Filter [" + iif( At( ".jpg", Lower( t_aReport[ IMAGES ][ nI ][ 1 ] ) ) > 0, " /DCTDecode", "" ) + " ]" + CRLF + ; + "/Width " + hb_ntos( t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_WIDTH ] ) + CRLF + ; + "/Height " + hb_ntos( t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_HEIGHT ] ) + CRLF + ; + "/BitsPerComponent " + hb_ntos( t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_BITS ] ) + CRLF + ; + "/ColorSpace /" + iif( t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_SPACE ] == 1, "DeviceGray", "DeviceRGB" ) + CRLF + ; + "/Length " + hb_ntos( t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_LENGTH ] ) + CRLF + ; + ">>" + CRLF + ; + "stream" + CRLF - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) - nImageHandle := fopen( t_aReport[ IMAGES ][ nI ][ 1 ] ) - fseek( nImageHandle, t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_FROM ] ) + nImageHandle := FOpen( t_aReport[ IMAGES ][ nI ][ 1 ] ) + FSeek( nImageHandle, t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_FROM ] ) nBuffer := 8192 - cBuffer := space( nBuffer ) + cBuffer := Space( nBuffer ) k := 0 - while k < t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_LENGTH ] + WHILE k < t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_LENGTH ] IF k + nBuffer <= t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_LENGTH ] nRead := nBuffer ELSE nRead := t_aReport[ IMAGES ][ nI ][ 3 ][ IMAGE_LENGTH ] - k ENDIF - fread( nImageHandle, @cBuffer, nRead ) + FRead( nImageHandle, @cBuffer, nRead ) t_aReport[ DOCLEN ] += nRead - fwrite( t_aReport[ HANDLE ], cBuffer, nRead ) + FWrite( t_aReport[ HANDLE ], cBuffer, nRead ) k += nRead - enddo + ENDDO - fclose( nImageHandle ) + FClose( nImageHandle ) cTemp := CRLF + "endstream" + CRLF + ; - "endobj" + CRLF + "endobj" + CRLF - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) ENDIF - next + NEXT t_aReport[ REPORTOBJ ] := t_aReport[ NEXTOBJ ] @@ -689,36 +730,39 @@ local cTemp, cBuffer, nBuffer, nRead, nI, k, nImage, nFont, nImageHandle t_aReport[ PAGEBUFFER ] := "" -return nil + RETURN NIL // ------------------------------------- -static function pdfGetFontInfo( cParam ) -local cRet +STATIC FUNCTION pdfGetFontInfo( cParam ) + + LOCAL cRet + IF cParam == "NAME" - IF left( t_aReport[ TYPE1 ][ t_aReport[ FONTNAME ] ], 5 ) == "Times" + IF Left( t_aReport[ TYPE1 ][ t_aReport[ FONTNAME ] ], 5 ) == "Times" cRet := "Times" - ELSEIF left( t_aReport[ TYPE1 ][ t_aReport[ FONTNAME ] ], 9 ) == "Helvetica" + ELSEIF Left( t_aReport[ TYPE1 ][ t_aReport[ FONTNAME ] ], 9 ) == "Helvetica" cRet := "Helvetica" ELSE cRet := "Courier" // 0.04 ENDIF ELSE // size - cRet := int(( t_aReport[ FONTNAME ] - 1 ) % 4) + cRet := Int( ( t_aReport[ FONTNAME ] - 1 ) % 4 ) ENDIF -return cRet + + RETURN cRet // ----------------------------------------------------------------- -function pdfImage( cFile, nRow, nCol, cUnits, nHeight, nWidth, cId ) +FUNCTION pdfImage( cFile, nRow, nCol, cUnits, nHeight, nWidth, cId ) -__defaultNIL( @nRow, t_aReport[ REPORTLINE ] ) -__defaultNIL( @nCol, 0 ) -__defaultNIL( @nHeight, 0 ) -__defaultNIL( @nWidth, 0 ) -__defaultNIL( @cUnits, "R" ) -__defaultNIL( @cId, "" ) + __defaultNIL( @nRow, t_aReport[ REPORTLINE ] ) + __defaultNIL( @nCol, 0 ) + __defaultNIL( @nHeight, 0 ) + __defaultNIL( @nWidth, 0 ) + __defaultNIL( @cUnits, "R" ) + __defaultNIL( @cId, "" ) IF t_aReport[ HEADEREDIT ] - return pdfHeader( "PDFIMAGE", cId, { cFile, nRow, nCol, cUnits, nHeight, nWidth } ) + RETURN pdfHeader( "PDFIMAGE", cId, { cFile, nRow, nCol, cUnits, nHeight, nWidth } ) ENDIF IF cUnits == "M" @@ -729,92 +773,97 @@ __defaultNIL( @cId, "" ) ELSEIF cUnits == "R" nRow := t_aReport[ PAGEY ] - pdfR2D( nRow ) nCol := pdfM2X( t_aReport[ PDFLEFT ] ) + ; - nCol * 100.00 / t_aReport[ REPORTWIDTH ] * ; - ( t_aReport[ PAGEX ] - pdfM2X( t_aReport[ PDFLEFT ] ) * 2 - 9.0 ) / 100.00 + nCol * 100.00 / t_aReport[ REPORTWIDTH ] * ; + ( t_aReport[ PAGEX ] - pdfM2X( t_aReport[ PDFLEFT ] ) * 2 - 9.0 ) / 100.00 nHeight := t_aReport[ PAGEY ] - pdfR2D( nHeight ) nWidth := pdfM2X( t_aReport[ PDFLEFT ] ) + ; - nWidth * 100.00 / t_aReport[ REPORTWIDTH ] * ; - ( t_aReport[ PAGEX ] - pdfM2X( t_aReport[ PDFLEFT ] ) * 2 - 9.0 ) / 100.00 + nWidth * 100.00 / t_aReport[ REPORTWIDTH ] * ; + ( t_aReport[ PAGEX ] - pdfM2X( t_aReport[ PDFLEFT ] ) * 2 - 9.0 ) / 100.00 ELSEIF cUnits == "D" ENDIF - aadd( t_aReport[ PAGEIMAGES ], { cFile, nRow, nCol, nHeight, nWidth } ) + AAdd( t_aReport[ PAGEIMAGES ], { cFile, nRow, nCol, nHeight, nWidth } ) -return nil + RETURN NIL // ----------------- -function pdfItalic() - IF pdfGetFontInfo("NAME") == "Times" +FUNCTION pdfItalic() + + IF pdfGetFontInfo( "NAME" ) == "Times" t_aReport[ FONTNAME ] := 3 - ELSEIF pdfGetFontInfo("NAME") == "Helvetica" + ELSEIF pdfGetFontInfo( "NAME" ) == "Helvetica" t_aReport[ FONTNAME ] := 7 ELSE t_aReport[ FONTNAME ] := 11 // 0.04 ENDIF - aadd( t_aReport[ PAGEFONTS ], t_aReport[ FONTNAME ] ) - IF ascan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ FONTNAME ] } ) == 0 - aadd( t_aReport[ FONTS ], { t_aReport[ FONTNAME ], ++t_aReport[ NEXTOBJ ] } ) + AAdd( t_aReport[ PAGEFONTS ], t_aReport[ FONTNAME ] ) + IF AScan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ FONTNAME ] } ) == 0 + AAdd( t_aReport[ FONTS ], { t_aReport[ FONTNAME ], ++t_aReport[ NEXTOBJ ] } ) ENDIF -return nil + + RETURN NIL // ----------------------- -function pdfLen( cString ) -local nWidth := 0.00, nI, nLen, nArr, nAdd := ( t_aReport[ FONTNAME ] - 1 ) % 4 +FUNCTION pdfLen( cString ) - nLen := len( cString ) - IF right( cString, 1 ) == Chr( 255 ) .or. right( cString, 1 ) == Chr( 254 ) // reverse or underline + LOCAL nWidth := 0.00, nI, nLen, nArr, nAdd := ( t_aReport[ FONTNAME ] - 1 ) % 4 + + nLen := Len( cString ) + IF Right( cString, 1 ) == Chr( 255 ) .OR. Right( cString, 1 ) == Chr( 254 ) // reverse or underline --nLen ENDIF - IF pdfGetFontInfo("NAME") == "Times" + IF pdfGetFontInfo( "NAME" ) == "Times" nArr := 1 - ELSEIF pdfGetFontInfo("NAME") == "Helvetica" + ELSEIF pdfGetFontInfo( "NAME" ) == "Helvetica" nArr := 2 ELSE nArr := 3 // 0.04 ENDIF - if !empty( t_aReport[ FONTWIDTH ] ) - For nI:= 1 To nLen - nWidth += t_aReport[ FONTWIDTH ][ nArr ][ ( asc( substr( cString, nI, 1 )) - 32 ) * 4 + 1 + nAdd ] * 25.4 * t_aReport[ FONTSIZE ] / 720.00 / 100.00 - Next - endif + IF !Empty( t_aReport[ FONTWIDTH ] ) + FOR nI := 1 TO nLen + nWidth += t_aReport[ FONTWIDTH ][ nArr ][ ( Asc( SubStr( cString, nI, 1 ) ) - 32 ) * 4 + 1 + nAdd ] * 25.4 * t_aReport[ FONTSIZE ] / 720.00 / 100.00 + NEXT + ENDIF -return nWidth + RETURN nWidth // ------------------------- -static function pdfM2R( mm ) -return int( t_aReport[ LPI ] * mm / 25.4 ) +STATIC FUNCTION pdfM2R( mm ) + RETURN Int( t_aReport[ LPI ] * mm / 25.4 ) // ------------------------ -static function pdfM2X( n ) -return n * 72 / 25.4 +STATIC FUNCTION pdfM2X( n ) + RETURN n * 72 / 25.4 // ------------------------ -static function pdfM2Y( n ) -return t_aReport[ PAGEY ] - n * 72 / 25.4 +STATIC FUNCTION pdfM2Y( n ) + RETURN t_aReport[ PAGEY ] - n * 72 / 25.4 // --------------------- -function pdfNewLine( n ) -__defaultNIL( @n, 1 ) +FUNCTION pdfNewLine( n ) + + __defaultNIL( @n, 1 ) IF t_aReport[ REPORTLINE ] + n + t_aReport[ PDFTOP ] > t_aReport[ PDFBOTTOM ] pdfNewPage() t_aReport[ REPORTLINE ] += 1 ELSE t_aReport[ REPORTLINE ] += n ENDIF -return t_aReport[ REPORTLINE ] + + RETURN t_aReport[ REPORTLINE ] // --------------------------------------------------------------------------------------- -function pdfNewPage( _cPageSize, _cPageOrient, _nLpi, _cFontName, _nFontType, _nFontSize ) +FUNCTION pdfNewPage( _cPageSize, _cPageOrient, _nLpi, _cFontName, _nFontType, _nFontSize ) -__defaultNIL( @_cPageSize, t_aReport[ PAGESIZE ] ) -__defaultNIL( @_cPageOrient, t_aReport[ PAGEORIENT ] ) -__defaultNIL( @_nLpi, t_aReport[ LPI ] ) -__defaultNIL( @_cFontName, pdfGetFontInfo("NAME") ) -__defaultNIL( @_nFontType, pdfGetFontInfo("TYPE") ) -__defaultNIL( @_nFontSize, t_aReport[ FONTSIZE ] ) + __defaultNIL( @_cPageSize, t_aReport[ PAGESIZE ] ) + __defaultNIL( @_cPageOrient, t_aReport[ PAGEORIENT ] ) + __defaultNIL( @_nLpi, t_aReport[ LPI ] ) + __defaultNIL( @_cFontName, pdfGetFontInfo( "NAME" ) ) + __defaultNIL( @_nFontType, pdfGetFontInfo( "TYPE" ) ) + __defaultNIL( @_nFontSize, t_aReport[ FONTSIZE ] ) - IF !empty(t_aReport[ PAGEBUFFER ]) + IF !Empty( t_aReport[ PAGEBUFFER ] ) pdfClosePage() ENDIF @@ -831,31 +880,36 @@ __defaultNIL( @_nFontSize, t_aReport[ FONTSIZE ] ) pdfDrawHeader() - t_aReport[ REPORTLINE ] := 0//5 + t_aReport[ REPORTLINE ] := 0// 5 t_aReport[ FONTNAMEPREV ] := 0 t_aReport[ FONTSIZEPREV ] := 0 -return nil + + RETURN NIL // ----------------- -function pdfNormal() - IF pdfGetFontInfo("NAME") == "Times" +FUNCTION pdfNormal() + + IF pdfGetFontInfo( "NAME" ) == "Times" t_aReport[ FONTNAME ] := 1 - ELSEIF pdfGetFontInfo("NAME") == "Helvetica" + ELSEIF pdfGetFontInfo( "NAME" ) == "Helvetica" t_aReport[ FONTNAME ] := 5 ELSE t_aReport[ FONTNAME ] := 9 // 0.04 ENDIF - aadd( t_aReport[ PAGEFONTS ], t_aReport[ FONTNAME ] ) - IF ascan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ FONTNAME ] } ) == 0 - aadd( t_aReport[ FONTS ], { t_aReport[ FONTNAME ], ++t_aReport[ NEXTOBJ ] } ) + AAdd( t_aReport[ PAGEFONTS ], t_aReport[ FONTNAME ] ) + IF AScan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ FONTNAME ] } ) == 0 + AAdd( t_aReport[ FONTS ], { t_aReport[ FONTNAME ], ++t_aReport[ NEXTOBJ ] } ) ENDIF -return nil + + RETURN NIL // --------------------------------------- -function pdfOpen( cFile, nLen, lOptimize ) -local cTemp, nI, nJ, n1, n2 := 896, n12 -__defaultNIL( @nLen, 200 ) -__defaultNIL( @lOptimize, .F. ) +FUNCTION pdfOpen( cFile, nLen, lOptimize ) + + LOCAL cTemp, nI, nJ, n1, n2 := 896, n12 + + __defaultNIL( @nLen, 200 ) + __defaultNIL( @lOptimize, .F. ) t_aReport[ FONTNAME ] := 1 t_aReport[ FONTSIZE ] := 10 @@ -866,11 +920,11 @@ __defaultNIL( @lOptimize, .F. ) t_aReport[ PAGEY ] := 11.0 * 72 t_aReport[ REPORTWIDTH ] := nLen // 200 // should be as parameter t_aReport[ REPORTPAGE ] := 0 - t_aReport[ REPORTLINE ] := 0//5 + t_aReport[ REPORTLINE ] := 0// 5 t_aReport[ FONTNAMEPREV ] := 0 t_aReport[ FONTSIZEPREV ] := 0 t_aReport[ PAGEBUFFER ] := "" - t_aReport[ REPORTOBJ ] := 1//2 + t_aReport[ REPORTOBJ ] := 1// 2 t_aReport[ DOCLEN ] := 0 t_aReport[ TYPE1 ] := { "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", "Helvetica", "Helvetica-Bold", "Helvetica-Oblique", "Helvetica-BoldOblique", "Courier", "Courier-Bold", "Courier-Oblique", "Courier-BoldOblique" } // 0.04 t_aReport[ MARGINS ] := .T. @@ -879,7 +933,7 @@ __defaultNIL( @lOptimize, .F. ) t_aReport[ PDFTOP ] := 1 // top t_aReport[ PDFLEFT ] := 10 // left & right t_aReport[ PDFBOTTOM ] := t_aReport[ PAGEY ] / 72 * t_aReport[ LPI ] - 1 // bottom, default "LETTER", "P", 6 - t_aReport[ HANDLE ] := fcreate( cFile ) + t_aReport[ HANDLE ] := FCreate( cFile ) t_aReport[ PAGES ] := {} t_aReport[ REFS ] := { 0, 0 } t_aReport[ BOOKMARK ] := {} @@ -892,53 +946,55 @@ __defaultNIL( @lOptimize, .F. ) // TOFIX: This external file dependency should be removed. cTemp := vpdf_FontsDat() // times, times-bold, times-italic, times-bolditalic, helvetica..., courier... // 0.04 - n1 := len( cTemp ) / ( 2 * n2 ) - t_aReport[ FONTWIDTH ] := array( n1, n2 ) + n1 := Len( cTemp ) / ( 2 * n2 ) + t_aReport[ FONTWIDTH ] := Array( n1, n2 ) t_aReport[ OPTIMIZE ] := lOptimize t_aReport[ NEXTOBJ ] := t_aReport[ REPORTOBJ ] + 4 n12 := 2 * n2 // 0.04 - for nI := 1 to n1 - for nJ := 1 to n2 - t_aReport[ FONTWIDTH ][ nI ][ nJ ] := bin2i(substr( cTemp, ( nI - 1 ) * n12 + ( nJ - 1 ) * 2 + 1, 2 )) - next - next + FOR nI := 1 TO n1 + FOR nJ := 1 TO n2 + t_aReport[ FONTWIDTH ][ nI ][ nJ ] := Bin2I( SubStr( cTemp, ( nI - 1 ) * n12 + ( nJ - 1 ) * 2 + 1, 2 ) ) + NEXT + NEXT t_aReport[ DOCLEN ] := 0 cTemp := "%PDF-1.3" + CRLF - t_aReport[ DOCLEN ] += len( cTemp ) - fwrite( t_aReport[ HANDLE ], cTemp ) + t_aReport[ DOCLEN ] += Len( cTemp ) + FWrite( t_aReport[ HANDLE ], cTemp ) -return nil + RETURN NIL // ------------------------------- -function pdfPageSize( _cPageSize, _nWidth, _nHeight ) -local nSize, aSize, nWidth, nHeight +FUNCTION pdfPageSize( _cPageSize, _nWidth, _nHeight ) - aSize := { { "LETTER", 8.50, 11.00 }, ; - { "LEGAL" , 8.50, 14.00 }, ; - { "LEDGER", 11.00, 17.00 }, ; - { "EXECUTIVE", 7.25, 10.50 }, ; - { "A4", 8.27, 11.69 }, ; - { "A3", 11.69, 16.54 }, ; - { "JIS B4", 10.12, 14.33 }, ; - { "JIS B5", 7.16, 10.12 }, ; - { "JPOST", 3.94, 5.83 }, ; - { "JPOSTD", 5.83, 7.87 }, ; - { "COM10", 4.12, 9.50 }, ; - { "MONARCH", 3.87, 7.50 }, ; - { "C5", 6.38, 9.01 }, ; - { "DL", 4.33, 8.66 }, ; - { "B5", 6.93, 9.84 }, ; - { "USSTDFOLD", 14.87, 11.00 } } + LOCAL nSize, aSize, nWidth, nHeight + + aSize := { ; + { "LETTER", 8.50, 11.00 }, ; + { "LEGAL", 8.50, 14.00 }, ; + { "LEDGER", 11.00, 17.00 }, ; + { "EXECUTIVE" , 7.25, 10.50 }, ; + { "A4", 8.27, 11.69 }, ; + { "A3", 11.69, 16.54 }, ; + { "JIS B4", 10.12, 14.33 }, ; + { "JIS B5", 7.16, 10.12 }, ; + { "JPOST", 3.94, 5.83 }, ; + { "JPOSTD", 5.83, 7.87 }, ; + { "COM10", 4.12, 9.50 }, ; + { "MONARCH", 3.87, 7.50 }, ; + { "C5", 6.38, 9.01 }, ; + { "DL", 4.33, 8.66 }, ; + { "B5", 6.93, 9.84 }, ; + { "USSTDFOLD", 14.87, 11.00 } } __defaultNIL( @_cPageSize, "LETTER" ) - if empty( _nWidth ) .or. empty( _nHeight ) + IF Empty( _nWidth ) .OR. Empty( _nHeight ) - nSize := ascan( aSize, {| arr | arr[ 1 ] == _cPageSize } ) + nSize := AScan( aSize, {| arr | arr[ 1 ] == _cPageSize } ) IF nSize == 0 nSize := 1 @@ -949,16 +1005,16 @@ local nSize, aSize, nWidth, nHeight nWidth := aSize[ nSize ][ 2 ] nHeight := aSize[ nSize ][ 3 ] - else + ELSE - _nWidth := val( str( _nWidth ) ) - _nHeight := val( str( _nHeight ) ) + _nWidth := Val( Str( _nWidth ) ) + _nHeight := Val( Str( _nHeight ) ) - nSize := ascan( aSize, {| arr | ( arr[ 2 ] == _nWidth ) .and. ( arr[ 3 ] == _nHeight ) } ) + nSize := AScan( aSize, {| arr | ( arr[ 2 ] == _nWidth ) .AND. ( arr[ 3 ] == _nHeight ) } ) - if nSize == 0 - nSize := ascan( aSize, {| arr | ( arr[ 3 ] == _nWidth ) .and. ( arr[ 2 ] == _nHeight ) } ) - endif + IF nSize == 0 + nSize := AScan( aSize, {| arr | ( arr[ 3 ] == _nWidth ) .AND. ( arr[ 2 ] == _nHeight ) } ) + ENDIF IF nSize == 0 nSize := 1 @@ -969,7 +1025,7 @@ local nSize, aSize, nWidth, nHeight nWidth := _nWidth nHeight := _nHeight - endif + ENDIF IF t_aReport[ PAGEORIENT ] == "P" t_aReport[ PAGEX ] := nWidth * 72 @@ -979,50 +1035,56 @@ local nSize, aSize, nWidth, nHeight t_aReport[ PAGEY ] := nWidth * 72 ENDIF - return nil + RETURN NIL // ----------------------------------- -function pdfPageOrient( _cPageOrient ) -__defaultNIL( @_cPageOrient, "P" ) +FUNCTION pdfPageOrient( _cPageOrient ) + + __defaultNIL( @_cPageOrient, "P" ) t_aReport[ PAGEORIENT ] := _cPageOrient pdfPageSize( t_aReport[ PAGESIZE ] ) -return nil + + RETURN NIL // --------------------------- -static function pdfR2D( nRow ) -return t_aReport[ PAGEY ] - nRow * 72 / t_aReport[ LPI ] +STATIC FUNCTION pdfR2D( nRow ) + RETURN t_aReport[ PAGEY ] - nRow * 72 / t_aReport[ LPI ] // --------------------------- -static function pdfR2M( nRow ) -return 25.4 * nRow / t_aReport[ LPI ] +STATIC FUNCTION pdfR2M( nRow ) + RETURN 25.4 * nRow / t_aReport[ LPI ] // ------------------------ -function pdfPageNumber( n ) -__defaultNIL( @n, 0 ) +FUNCTION pdfPageNumber( n ) + + __defaultNIL( @n, 0 ) IF n > 0 t_aReport[ REPORTPAGE ] := n // NEW !!! ENDIF -return t_aReport[ REPORTPAGE ] + + RETURN t_aReport[ REPORTPAGE ] // --------------------------- -function pdfReverse( cString ) -return cString + Chr( 255 ) +FUNCTION pdfReverse( cString ) + RETURN cString + Chr( 255 ) // ---------------------------------------------------------- -function pdfRJust( cString, nRow, nCol, cUnits, lExact, cId ) -local nLen, nAdj := 1.0, nAt -__defaultNIL( @nRow, t_aReport[ REPORTLINE ] ) -__defaultNIL( @cUnits, "R" ) -__defaultNIL( @lExact, .F. ) +FUNCTION pdfRJust( cString, nRow, nCol, cUnits, lExact, cId ) + + LOCAL nLen, nAdj := 1.0, nAt + + __defaultNIL( @nRow, t_aReport[ REPORTLINE ] ) + __defaultNIL( @cUnits, "R" ) + __defaultNIL( @lExact, .F. ) IF t_aReport[ HEADEREDIT ] - return pdfHeader( "PDFRJUST", cId, { cString, nRow, nCol, cUnits, lExact } ) + RETURN pdfHeader( "PDFRJUST", cId, { cString, nRow, nCol, cUnits, lExact } ) ENDIF - IF ( nAt := at( "#pagenumber#", cString ) ) > 0 - cString := left( cString, nAt - 1 ) + hb_ntos( pdfPageNumber()) + substr( cString, nAt + 12 ) + IF ( nAt := At( "#pagenumber#", cString ) ) > 0 + cString := Left( cString, nAt - 1 ) + hb_ntos( pdfPageNumber() ) + SubStr( cString, nAt + 12 ) ENDIF nLen := pdfLen( cString ) @@ -1034,20 +1096,21 @@ __defaultNIL( @lExact, .F. ) ENDIF ENDIF pdfAtSay( cString, pdfR2M( nRow ), iif( cUnits == "R", t_aReport[ PDFLEFT ] + ( t_aReport[ PAGEX ] / 72 * 25.4 - 2 * t_aReport[ PDFLEFT ] ) * nCol / t_aReport[ REPORTWIDTH ] - nAdj, nCol ) - nLen, "M", lExact ) -return nil + + RETURN NIL // ----------------------------------------------- -function pdfSetFont( _cFont, _nType, _nSize, cId ) +FUNCTION pdfSetFont( _cFont, _nType, _nSize, cId ) -__defaultNIL( @_cFont, "Times" ) -__defaultNIL( @_nType, 0 ) -__defaultNIL( @_nSize, 10 ) + __defaultNIL( @_cFont, "Times" ) + __defaultNIL( @_nType, 0 ) + __defaultNIL( @_nSize, 10 ) IF t_aReport[ HEADEREDIT ] - return pdfHeader( "PDFSETFONT", cId, { _cFont, _nType, _nSize } ) + RETURN pdfHeader( "PDFSETFONT", cId, { _cFont, _nType, _nSize } ) ENDIF - _cFont := upper( _cFont ) + _cFont := Upper( _cFont ) t_aReport[ FONTSIZE ] := _nSize IF _cFont == "TIMES" @@ -1058,51 +1121,59 @@ __defaultNIL( @_nSize, 10 ) t_aReport[ FONTNAME ] := _nType + 9 // 0.04 ENDIF - aadd( t_aReport[ PAGEFONTS ], t_aReport[ FONTNAME ] ) + AAdd( t_aReport[ PAGEFONTS ], t_aReport[ FONTNAME ] ) - IF ascan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ FONTNAME ] } ) == 0 - aadd( t_aReport[ FONTS ], { t_aReport[ FONTNAME ], ++t_aReport[ NEXTOBJ ] } ) + IF AScan( t_aReport[ FONTS ], {| arr | arr[ 1 ] == t_aReport[ FONTNAME ] } ) == 0 + AAdd( t_aReport[ FONTS ], { t_aReport[ FONTNAME ], ++t_aReport[ NEXTOBJ ] } ) ENDIF -return nil + + RETURN NIL // ---------------------- -function pdfSetLPI(_nLpi) -local cLpi := hb_ntos(_nLpi) -__defaultNIL( @_nLpi, 6 ) +FUNCTION pdfSetLPI( _nLpi ) - cLpi := iif(cLpi$"1;2;3;4;6;8;12;16;24;48",cLpi,"6") - t_aReport[ LPI ] := val( cLpi ) + LOCAL cLpi := hb_ntos( _nLpi ) + + __defaultNIL( @_nLpi, 6 ) + + cLpi := iif( cLpi $ "1;2;3;4;6;8;12;16;24;48", cLpi, "6" ) + t_aReport[ LPI ] := Val( cLpi ) pdfPageSize( t_aReport[ PAGESIZE ] ) -return nil + + RETURN NIL // --------------------------- -function pdfStringB( cString ) - cString := strtran( cString, "(", "\(" ) - cString := strtran( cString, ")", "\)" ) -return cString +FUNCTION pdfStringB( cString ) + + cString := StrTran( cString, "(", "\(" ) + cString := StrTran( cString, ")", "\)" ) + + RETURN cString // --------------------------------------------------------------------------- -function pdfTextCount( cString, nTop, nLeft, nLength, nTab, nJustify, cUnits ) -return pdfText( cString, nTop, nLeft, nLength, nTab, nJustify, cUnits, .F. ) +FUNCTION pdfTextCount( cString, nTop, nLeft, nLength, nTab, nJustify, cUnits ) + RETURN pdfText( cString, nTop, nLeft, nLength, nTab, nJustify, cUnits, .F. ) // ------------------------------------------------------------------------------ -function pdfText( cString, nTop, nLeft, nLength, nTab, nJustify, cUnits, cColor, lPrint ) -local cDelim := Chr( 0 ) + chr( 9 ) + chr( 10 ) + chr( 13 ) + chr( 26 ) + chr( 32 ) + chr( 138 ) + chr( 141 ) -local nI, cTemp, cToken, k, nL, nRow, nLines, nLineLen, nStart -local lParagraph, nSpace, nNew, nTokenLen, nCRLF, nTokens, nLen -__defaultNIL( @nTab, -1 ) -__defaultNIL( @cUnits, 'R' ) -__defaultNIL( @nJustify, 4 ) // justify -__defaultNIL( @lPrint, .T. ) -__defaultNIL( @cColor, "" ) +FUNCTION pdfText( cString, nTop, nLeft, nLength, nTab, nJustify, cUnits, cColor, lPrint ) + + LOCAL cDelim := Chr( 0 ) + Chr( 9 ) + Chr( 10 ) + Chr( 13 ) + Chr( 26 ) + Chr( 32 ) + Chr( 138 ) + Chr( 141 ) + LOCAL nI, cTemp, cToken, k, nL, nRow, nLines, nLineLen, nStart + LOCAL lParagraph, nSpace, nNew, nTokenLen, nCRLF, nTokens, nLen + + __defaultNIL( @nTab, -1 ) + __defaultNIL( @cUnits, 'R' ) + __defaultNIL( @nJustify, 4 ) // justify + __defaultNIL( @lPrint, .T. ) + __defaultNIL( @cColor, "" ) IF cUnits == "M" nTop := pdfM2R( nTop ) ELSEIF cUnits == "R" nLeft := pdfX2M( pdfM2X( t_aReport[ PDFLEFT ] ) + ; - nLeft * 100.00 / t_aReport[ REPORTWIDTH ] * ; - ( t_aReport[ PAGEX ] - pdfM2X( t_aReport[ PDFLEFT ] ) * 2 - 9.0 ) / 100.00 ) + nLeft * 100.00 / t_aReport[ REPORTWIDTH ] * ; + ( t_aReport[ PAGEX ] - pdfM2X( t_aReport[ PDFLEFT ] ) * 2 - 9.0 ) / 100.00 ) ENDIF t_aReport[ REPORTLINE ] := nTop - 1 @@ -1113,11 +1184,11 @@ __defaultNIL( @cColor, "" ) nNew := nTab - cString := alltrim( cString ) + cString := AllTrim( cString ) nTokens := numtoken( cString, cDelim ) nStart := 1 - IF nJustify == 1 .or. nJustify == 4 + IF nJustify == 1 .OR. nJustify == 4 nLeft := nLeft ELSEIF nJustify == 2 nLeft := nLeft - nLength / 2 @@ -1132,15 +1203,15 @@ __defaultNIL( @cColor, "" ) lParagraph := .T. nI := 1 - while nI <= nTokens + WHILE nI <= nTokens cToken := token( cString, cDelim, nI ) nTokenLen := pdfLen( cToken ) - nLen := len( cToken ) + nLen := Len( cToken ) IF nLineLen + nSpace + nTokenLen > nLength IF nStart == nI // single word > nLength k := 1 - while k <= nLen + WHILE k <= nLen cTemp := "" nLineLen := 0.00 nL := nLeft @@ -1156,13 +1227,13 @@ __defaultNIL( @cColor, "" ) ELSEIF nJustify == 3 nL := nLeft + nLength - pdfLen( cTemp ) ENDIF - while k <= nLen .and. ( ( nLineLen += pdfLen( substr( cToken, k, 1 ))) <= nLength ) - nLineLen += pdfLen( substr( cToken, k, 1 )) - cTemp += substr( cToken, k, 1 ) + WHILE k <= nLen .AND. ( ( nLineLen += pdfLen( SubStr( cToken, k, 1 ) ) ) <= nLength ) + nLineLen += pdfLen( SubStr( cToken, k, 1 ) ) + cTemp += SubStr( cToken, k, 1 ) ++k - enddo - IF empty( cTemp ) // single character > nlength - cTemp := substr( cToken, k, 1 ) + ENDDO + IF Empty( cTemp ) // single character > nlength + cTemp := SubStr( cToken, k, 1 ) ++k ENDIF ++nLines @@ -1171,13 +1242,13 @@ __defaultNIL( @cColor, "" ) // version 0.02 pdfAtSay( cColor + cTemp, pdfR2M( nRow + t_aReport[ PDFTOP ] ), nL, "M" ) ENDIF - enddo + ENDDO ++nI nStart := nI ELSE pdfTextPrint( nI - 1, nLeft, @lParagraph, nJustify, nSpace, nNew, nLength, @nLineLen, @nLines, @nStart, cString, cDelim, cColor, lPrint ) ENDIF - ELSEIF ( nI == nTokens ) .or. ( nI < nTokens .and. ( nCRLF := pdfTextNextPara( cString, cDelim, nI ) ) > 0 ) + ELSEIF ( nI == nTokens ) .OR. ( nI < nTokens .AND. ( nCRLF := pdfTextNextPara( cString, cDelim, nI ) ) > 0 ) IF nI == nTokens nLineLen += nSpace + nTokenLen ENDIF @@ -1195,13 +1266,14 @@ __defaultNIL( @cColor, "" ) nLineLen += nSpace + nTokenLen ++nI ENDIF - enddo + ENDDO -return nLines + RETURN nLines // -------------------------------------------------------------------------------------------------------------------------------------- -static function pdfTextPrint( nI, nLeft, lParagraph, nJustify, nSpace, nNew, nLength, nLineLen, nLines, nStart, cString, cDelim, cColor, lPrint ) -local nFinish, nL, nB, nJ, cToken, nRow +STATIC FUNCTION pdfTextPrint( nI, nLeft, lParagraph, nJustify, nSpace, nNew, nLength, nLineLen, nLines, nStart, cString, cDelim, cColor, lPrint ) + + LOCAL nFinish, nL, nB, nJ, cToken, nRow nFinish := nI @@ -1226,14 +1298,14 @@ local nFinish, nL, nB, nJ, cToken, nRow IF nJustify == 4 nB := ( nLength - nLineLen + ( nFinish - nStart ) * nSpace ) / ( nFinish - nStart ) ENDIF - for nJ := nStart to nFinish + FOR nJ := nStart TO nFinish cToken := token( cString, cDelim, nJ ) IF lPrint // version 0.02 pdfAtSay( cColor + cToken, pdfR2M( nRow + t_aReport[ PDFTOP ] ), nL, "M" ) ENDIF nL += pdfLen ( cToken ) + nB - next + NEXT nStart := nFinish + 1 @@ -1242,151 +1314,180 @@ local nFinish, nL, nB, nJ, cToken, nRow nLineLen := 0.00 nLineLen += nSpace * nNew -return nil + RETURN NIL // --------------------------------------------------- -static function pdfTextNextPara( cString, cDelim, nI ) -local nAt, cAt, nCRLF, nNew, nRat, nRet := 0 +STATIC FUNCTION pdfTextNextPara( cString, cDelim, nI ) + + LOCAL nAt, cAt, nCRLF, nNew, nRat, nRet := 0 + // check if next spaces paragraph(s) - nAt := attoken( cString, cDelim, nI ) + len( token( cString, cDelim, nI ) ) - cAt := substr( cString, nAt, attoken( cString, cDelim, nI + 1 ) - nAt ) - nCRLF := numat( chr( 13 ) + chr( 10 ), cAt ) - nRat := rat( chr( 13 ) + chr( 10 ), cAt ) - nNew := len( cAt ) - nRat - iif( nRat > 0, 1, 0 ) - IF nCRLF > 1 .or. ( nCRLF == 1 .and. nNew > 0 ) + nAt := attoken( cString, cDelim, nI ) + Len( token( cString, cDelim, nI ) ) + cAt := SubStr( cString, nAt, attoken( cString, cDelim, nI + 1 ) - nAt ) + nCRLF := numat( Chr( 13 ) + Chr( 10 ), cAt ) + nRat := RAt( Chr( 13 ) + Chr( 10 ), cAt ) + nNew := Len( cAt ) - nRat - iif( nRat > 0, 1, 0 ) + IF nCRLF > 1 .OR. ( nCRLF == 1 .AND. nNew > 0 ) nRet := nCRLF ENDIF -return nRet + + RETURN nRet // ----------------------------- -function pdfUnderLine( cString ) -return cString + chr( 254 ) +FUNCTION pdfUnderLine( cString ) + RETURN cString + Chr( 254 ) // ------------------------ -static function pdfX2M( n ) -return n * 25.4 / 72 +STATIC FUNCTION pdfX2M( n ) + RETURN n * 25.4 / 72 // -------------------------------- -static function TimeAsAMPM( cTime ) - IF VAL(cTime) < 12 +STATIC FUNCTION TimeAsAMPM( cTime ) + + IF Val( cTime ) < 12 cTime += " am" - ELSEIF VAL(cTime) == 12 + ELSEIF Val( cTime ) == 12 cTime += " pm" ELSE - cTime := STR(VAL(cTime) - 12, 2) + SUBSTR(cTime, 3) + " pm" + cTime := Str( Val( cTime ) - 12, 2 ) + SubStr( cTime, 3 ) + " pm" ENDIF - cTime := left( cTime, 5 ) + substr( cTime, 10 ) -return cTime + cTime := Left( cTime, 5 ) + SubStr( cTime, 10 ) -function pdfOpenHeader( cFile ) -local nAt //, nErrorCode:=0 -__defaultNIL( @cFile, "" ) - IF !empty( cFile ) - cFile := alltrim( cFile ) - IF len( cFile ) > 12 .or. ; - at( ' ', cFile ) > 0 .or. ; - ( at( ' ', cFile ) == 0 .and. len( cFile ) > 8 ) .or. ; - ( ( nAt := at( '.', cFile )) > 0 .and. len( substr( cFile, nAt + 1 )) > 3 ) - copy file (cFile) to temp.tmp + RETURN cTime + +FUNCTION pdfOpenHeader( cFile ) + + LOCAL nAt // , nErrorCode:=0 + + __defaultNIL( @cFile, "" ) + IF !Empty( cFile ) + cFile := AllTrim( cFile ) + IF Len( cFile ) > 12 .OR. ; + At( ' ', cFile ) > 0 .OR. ; + ( At( ' ', cFile ) == 0 .AND. Len( cFile ) > 8 ) .OR. ; + ( ( nAt := At( '.', cFile ) ) > 0 .AND. Len( SubStr( cFile, nAt + 1 ) ) > 3 ) + COPY File ( cFile ) TO temp.tmp cFile := "temp.tmp" ENDIF - //t_aReport[ HEADER ] := FT_RestArr( cFile, @nErrorCode ) + // t_aReport[ HEADER ] := FT_RestArr( cFile, @nErrorCode ) t_aReport[ HEADER ] := File2Array( cFile ) ELSE t_aReport[ HEADER ] := {} ENDIF t_aReport[ MARGINS ] := .T. -return nil -function pdfEditOnHeader() + RETURN NIL + +FUNCTION pdfEditOnHeader() + t_aReport[ HEADEREDIT ] := .T. t_aReport[ MARGINS ] := .T. -return nil -function pdfEditOffHeader() + RETURN NIL + +FUNCTION pdfEditOffHeader() + t_aReport[ HEADEREDIT ] := .F. t_aReport[ MARGINS ] := .T. -return nil -function pdfCloseHeader() + RETURN NIL + +FUNCTION pdfCloseHeader() + t_aReport[ HEADER ] := {} t_aReport[ MARGINS ] := .F. -return nil -function pdfDeleteHeader( cId ) -local nRet := -1, nId - cId := upper( cId ) - nId := ascan( t_aReport[ HEADER ], {| arr | arr[ 3 ] == cId }) + RETURN NIL + +FUNCTION pdfDeleteHeader( cId ) + + LOCAL nRet := -1, nId + + cId := Upper( cId ) + nId := AScan( t_aReport[ HEADER ], {| arr | arr[ 3 ] == cId } ) IF nId > 0 - nRet := len( t_aReport[ HEADER ] ) - 1 - aDel( t_aReport[ HEADER ], nId ) - aSize( t_aReport[ HEADER ], nRet ) + nRet := Len( t_aReport[ HEADER ] ) - 1 + ADel( t_aReport[ HEADER ], nId ) + ASize( t_aReport[ HEADER ], nRet ) t_aReport[ MARGINS ] := .T. ENDIF -return nRet -function pdfEnableHeader( cId ) -local nId - cId := upper( cId ) - nId := ascan( t_aReport[ HEADER ], {| arr | arr[ 3 ] == cId }) + RETURN nRet + +FUNCTION pdfEnableHeader( cId ) + + LOCAL nId + + cId := Upper( cId ) + nId := AScan( t_aReport[ HEADER ], {| arr | arr[ 3 ] == cId } ) IF nId > 0 t_aReport[ HEADER ][ nId ][ 1 ] := .T. t_aReport[ MARGINS ] := .T. ENDIF -return nil -function pdfDisableHeader( cId ) -local nId - cId := upper( cId ) - nId := ascan( t_aReport[ HEADER ], {| arr | arr[ 3 ] == cId }) + RETURN NIL + +FUNCTION pdfDisableHeader( cId ) + + LOCAL nId + + cId := Upper( cId ) + nId := AScan( t_aReport[ HEADER ], {| arr | arr[ 3 ] == cId } ) IF nId > 0 t_aReport[ HEADER ][ nId ][ 1 ] := .F. t_aReport[ MARGINS ] := .T. ENDIF -return nil -function pdfSaveHeader( cFile ) + RETURN NIL + +FUNCTION pdfSaveHeader( cFile ) + Array2File( 'temp.tmp', t_aReport[ HEADER ] ) - copy file temp.tmp to (cFile) -return nil + COPY file temp.tmp to ( cFile ) + + RETURN NIL + +FUNCTION pdfHeader( cFunction, cId, arr ) + + LOCAL nId, nI, nLen, nIdLen -function pdfHeader( cFunction, cId, arr ) -local nId, nI, nLen, nIdLen nId := 0 - IF !empty( cId ) - cId := upper( cId ) - nId := ascan( t_aReport[ HEADER ], {| arr | arr[ 3 ] == cId }) + IF !Empty( cId ) + cId := Upper( cId ) + nId := AScan( t_aReport[ HEADER ], {| arr | arr[ 3 ] == cId } ) ENDIF IF nId == 0 - nLen := len( t_aReport[ HEADER ] ) - IF empty( cId ) + nLen := Len( t_aReport[ HEADER ] ) + IF Empty( cId ) cId := cFunction - nIdLen := len( cId ) - for nI := 1 to nLen + nIdLen := Len( cId ) + FOR nI := 1 TO nLen IF t_aReport[ HEADER ][ nI ][ 2 ] == cId - IF val( substr( t_aReport[ HEADER ][ nI ][ 3 ], nIdLen + 1 ) ) > nId - nId := val( substr( t_aReport[ HEADER ][ nI ][ 3 ], nIdLen + 1 ) ) + IF Val( SubStr( t_aReport[ HEADER ][ nI ][ 3 ], nIdLen + 1 ) ) > nId + nId := Val( SubStr( t_aReport[ HEADER ][ nI ][ 3 ], nIdLen + 1 ) ) ENDIF ENDIF - next + NEXT ++nId - cId += hb_ntos(nId) + cId += hb_ntos( nId ) ENDIF - aadd( t_aReport[ HEADER ], { .T., cFunction, cId } ) + AAdd( t_aReport[ HEADER ], { .T., cFunction, cId } ) ++nLen - for nI := 1 to len( arr ) - aadd( t_aReport[ HEADER ][ nLen ], arr[ nI ] ) - next + FOR nI := 1 TO Len( arr ) + AAdd( t_aReport[ HEADER ][ nLen ], arr[ nI ] ) + NEXT ELSE - aSize( t_aReport[ HEADER ][ nId ], 3 ) - for nI := 1 to len( arr ) - aadd( t_aReport[ HEADER ][ nId ], arr[ nI ] ) - next + ASize( t_aReport[ HEADER ][ nId ], 3 ) + FOR nI := 1 TO Len( arr ) + AAdd( t_aReport[ HEADER ][ nId ], arr[ nI ] ) + NEXT ENDIF -return cId -function pdfDrawHeader() -local nI, _nFont, _nSize, nLen := len( t_aReport[ HEADER ] ) + RETURN cId + +FUNCTION pdfDrawHeader() + + LOCAL nI, _nFont, _nSize, nLen := Len( t_aReport[ HEADER ] ) IF nLen > 0 @@ -1394,30 +1495,30 @@ local nI, _nFont, _nSize, nLen := len( t_aReport[ HEADER ] ) _nFont := t_aReport[ FONTNAME ] _nSize := t_aReport[ FONTSIZE ] - for nI := 1 to nLen + FOR nI := 1 TO nLen IF t_aReport[ HEADER ][ nI ][ 1 ] // enabled - do case - case t_aReport[ HEADER ][ nI ][ 2 ] == "PDFATSAY" + DO CASE + CASE t_aReport[ HEADER ][ nI ][ 2 ] == "PDFATSAY" pdfAtSay( t_aReport[ HEADER ][ nI ][ 4 ], t_aReport[ HEADER ][ nI ][ 5 ], t_aReport[ HEADER ][ nI ][ 6 ], t_aReport[ HEADER ][ nI ][ 7 ], t_aReport[ HEADER ][ nI ][ 8 ], t_aReport[ HEADER ][ nI ][ 3 ] ) - case t_aReport[ HEADER ][ nI ][ 2 ] == "PDFCENTER" + CASE t_aReport[ HEADER ][ nI ][ 2 ] == "PDFCENTER" pdfCenter( t_aReport[ HEADER ][ nI ][ 4 ], t_aReport[ HEADER ][ nI ][ 5 ], t_aReport[ HEADER ][ nI ][ 6 ], t_aReport[ HEADER ][ nI ][ 7 ], t_aReport[ HEADER ][ nI ][ 8 ], t_aReport[ HEADER ][ nI ][ 3 ] ) - case t_aReport[ HEADER ][ nI ][ 2 ] == "PDFRJUST" + CASE t_aReport[ HEADER ][ nI ][ 2 ] == "PDFRJUST" pdfRJust( t_aReport[ HEADER ][ nI ][ 4 ], t_aReport[ HEADER ][ nI ][ 5 ], t_aReport[ HEADER ][ nI ][ 6 ], t_aReport[ HEADER ][ nI ][ 7 ], t_aReport[ HEADER ][ nI ][ 8 ], t_aReport[ HEADER ][ nI ][ 3 ] ) - case t_aReport[ HEADER ][ nI ][ 2 ] == "PDFBOX" + CASE t_aReport[ HEADER ][ nI ][ 2 ] == "PDFBOX" pdfBox( t_aReport[ HEADER ][ nI ][ 4 ], t_aReport[ HEADER ][ nI ][ 5 ], t_aReport[ HEADER ][ nI ][ 6 ], t_aReport[ HEADER ][ nI ][ 7 ], t_aReport[ HEADER ][ nI ][ 8 ], t_aReport[ HEADER ][ nI ][ 9 ], t_aReport[ HEADER ][ nI ][ 10 ], t_aReport[ HEADER ][ nI ][ 3 ] ) - case t_aReport[ HEADER ][ nI ][ 2 ] == "PDFSETFONT" + CASE t_aReport[ HEADER ][ nI ][ 2 ] == "PDFSETFONT" pdfSetFont( t_aReport[ HEADER ][ nI ][ 4 ], t_aReport[ HEADER ][ nI ][ 5 ], t_aReport[ HEADER ][ nI ][ 6 ], t_aReport[ HEADER ][ nI ][ 3 ] ) - case t_aReport[ HEADER ][ nI ][ 2 ] == "PDFIMAGE" + CASE t_aReport[ HEADER ][ nI ][ 2 ] == "PDFIMAGE" pdfImage( t_aReport[ HEADER ][ nI ][ 4 ], t_aReport[ HEADER ][ nI ][ 5 ], t_aReport[ HEADER ][ nI ][ 6 ], t_aReport[ HEADER ][ nI ][ 7 ], t_aReport[ HEADER ][ nI ][ 8 ], t_aReport[ HEADER ][ nI ][ 9 ], t_aReport[ HEADER ][ nI ][ 3 ] ) - endcase + ENDCASE ENDIF - next + NEXT t_aReport[ FONTNAME ] := _nFont t_aReport[ FONTSIZE ] := _nSize @@ -1434,12 +1535,14 @@ local nI, _nFont, _nSize, nLen := len( t_aReport[ HEADER ] ) t_aReport[ MARGINS ] := .F. ENDIF ENDIF -return nil -function pdfMargins( nTop, nLeft, nBottom ) -local nI, nLen := len( t_aReport[ HEADER ] ), nTemp, aTemp, nHeight + RETURN NIL -// version 0.07 begin +FUNCTION pdfMargins( nTop, nLeft, nBottom ) + + LOCAL nI, nLen := Len( t_aReport[ HEADER ] ), nTemp, aTemp, nHeight + + // version 0.07 begin __defaultNIL( @nTop, 1 ) __defaultNIL( @nLeft, 10 ) @@ -1450,9 +1553,9 @@ local nI, nLen := len( t_aReport[ HEADER ] ), nTemp, aTemp, nHeight t_aReport[ PDFLEFT ] := nLeft t_aReport[ PDFBOTTOM ] := nBottom -// version 0.07 end + // version 0.07 end - for nI := 1 to nLen + FOR nI := 1 TO nLen IF t_aReport[ HEADER ][ nI ][ 1 ] // enabled IF t_aReport[ HEADER ][ nI ][ 2 ] == "PDFSETFONT" @@ -1508,14 +1611,14 @@ local nI, nLen := len( t_aReport[ HEADER ] ), nTemp, aTemp, nHeight nTemp := t_aReport[ PAGEY ] / 72 * 25.4 / 2 - IF t_aReport[ HEADER ][ nI ][ 4 ] < nTemp .and. ; - t_aReport[ HEADER ][ nI ][ 6 ] < nTemp + IF t_aReport[ HEADER ][ nI ][ 4 ] < nTemp .AND. ; + t_aReport[ HEADER ][ nI ][ 6 ] < nTemp nTemp := t_aReport[ HEADER ][ nI ][ 6 ] * t_aReport[ LPI ] / 25.4 // top IF nTemp > t_aReport[ PDFTOP ] t_aReport[ PDFTOP ] := nTemp ENDIF - ELSEIF t_aReport[ HEADER ][ nI ][ 4 ] < nTemp .and. ; - t_aReport[ HEADER ][ nI ][ 6 ] > nTemp + ELSEIF t_aReport[ HEADER ][ nI ][ 4 ] < nTemp .AND. ; + t_aReport[ HEADER ][ nI ][ 6 ] > nTemp nTemp := ( t_aReport[ HEADER ][ nI ][ 4 ] + t_aReport[ HEADER ][ nI ][ 8 ] ) * t_aReport[ LPI ] / 25.4 // top IF nTemp > t_aReport[ PDFTOP ] @@ -1527,8 +1630,8 @@ local nI, nLen := len( t_aReport[ HEADER ] ), nTemp, aTemp, nHeight t_aReport[ PDFBOTTOM ] := nTemp ENDIF - ELSEIF t_aReport[ HEADER ][ nI ][ 4 ] > nTemp .and. ; - t_aReport[ HEADER ][ nI ][ 6 ] > nTemp + ELSEIF t_aReport[ HEADER ][ nI ][ 4 ] > nTemp .AND. ; + t_aReport[ HEADER ][ nI ][ 6 ] > nTemp nTemp := t_aReport[ HEADER ][ nI ][ 4 ] * t_aReport[ LPI ] / 25.4 // top IF nTemp < t_aReport[ PDFBOTTOM ] t_aReport[ PDFBOTTOM ] := nTemp @@ -1538,14 +1641,14 @@ local nI, nLen := len( t_aReport[ HEADER ] ), nTemp, aTemp, nHeight ELSEIF t_aReport[ HEADER ][ nI ][ 10 ] == "D" nTemp := t_aReport[ PAGEY ] / 2 - IF t_aReport[ HEADER ][ nI ][ 4 ] < nTemp .and. ; - t_aReport[ HEADER ][ nI ][ 6 ] < nTemp + IF t_aReport[ HEADER ][ nI ][ 4 ] < nTemp .AND. ; + t_aReport[ HEADER ][ nI ][ 6 ] < nTemp nTemp := t_aReport[ HEADER ][ nI ][ 6 ] / t_aReport[ LPI ] // top IF nTemp > t_aReport[ PDFTOP ] t_aReport[ PDFTOP ] := nTemp ENDIF - ELSEIF t_aReport[ HEADER ][ nI ][ 4 ] < nTemp .and. ; - t_aReport[ HEADER ][ nI ][ 6 ] > nTemp + ELSEIF t_aReport[ HEADER ][ nI ][ 4 ] < nTemp .AND. ; + t_aReport[ HEADER ][ nI ][ 6 ] > nTemp nTemp := ( t_aReport[ HEADER ][ nI ][ 4 ] + t_aReport[ HEADER ][ nI ][ 8 ] ) / t_aReport[ LPI ] // top IF nTemp > t_aReport[ PDFTOP ] @@ -1557,8 +1660,8 @@ local nI, nLen := len( t_aReport[ HEADER ] ), nTemp, aTemp, nHeight t_aReport[ PDFBOTTOM ] := nTemp ENDIF - ELSEIF t_aReport[ HEADER ][ nI ][ 4 ] > nTemp .and. ; - t_aReport[ HEADER ][ nI ][ 6 ] > nTemp + ELSEIF t_aReport[ HEADER ][ nI ][ 4 ] > nTemp .AND. ; + t_aReport[ HEADER ][ nI ][ 6 ] > nTemp nTemp := t_aReport[ HEADER ][ nI ][ 4 ] / t_aReport[ LPI ] // top IF nTemp < t_aReport[ PDFBOTTOM ] t_aReport[ PDFBOTTOM ] := nTemp @@ -1604,29 +1707,29 @@ local nI, nLen := len( t_aReport[ HEADER ] ), nTemp, aTemp, nHeight ENDIF ENDIF ENDIF - next + NEXT t_aReport[ MARGINS ] := .F. -return nil + RETURN NIL -function pdfCreateHeader( _file, _size, _orient, _lpi, _width ) -local ; - t_aReportStyle := { ; - { 1, 2, 3, 4, 5, 6 }, ; //"Default" - { 2.475, 4.0, 4.9, 6.4, 7.5, 64.0 }, ; //"P6" - { 3.3 , 5.4, 6.5, 8.6, 10.0, 85.35 }, ; //"P8" - { 2.475, 4.0, 4.9, 6.4, 7.5, 48.9 }, ; //"L6" - { 3.3 , 5.4, 6.5, 8.6, 10.0, 65.2 }, ; //"L8" - { 2.475, 4.0, 4.9, 6.4, 7.5, 82.0 }, ; //"P6" - { 3.3 , 5.4, 6.5, 8.6, 10.0, 109.35 } ; //"P8" - } -local nStyle := 1, nAdd := 0.00 +FUNCTION pdfCreateHeader( _file, _size, _orient, _lpi, _width ) -__defaultNIL( @_size, t_aReport[ PAGESIZE ] ) -__defaultNIL( @_orient, t_aReport[ PAGEORIENT ] ) -__defaultNIL( @_lpi, t_aReport[ LPI ] ) -__defaultNIL( @_width, 200 ) + LOCAL t_aReportStyle := { ; + { 1 , 2 , 3 , 4 , 5 , 6 }, ; // "Default" + { 2.475, 4.0, 4.9, 6.4, 7.5, 64.0 }, ; // "P6" + { 3.3 , 5.4, 6.5, 8.6, 10.0, 85.35 }, ; // "P8" + { 2.475, 4.0, 4.9, 6.4, 7.5, 48.9 }, ; // "L6" + { 3.3 , 5.4, 6.5, 8.6, 10.0, 65.2 }, ; // "L8" + { 2.475, 4.0, 4.9, 6.4, 7.5, 82.0 }, ; // "P6" + { 3.3 , 5.4, 6.5, 8.6, 10.0, 109.35 } } // "P8" + + LOCAL nStyle := 1, nAdd := 0.00 + + __defaultNIL( @_size, t_aReport[ PAGESIZE ] ) + __defaultNIL( @_orient, t_aReport[ PAGEORIENT ] ) + __defaultNIL( @_lpi, t_aReport[ LPI ] ) + __defaultNIL( @_width, 200 ) IF _size == "LETTER" IF _orient == "P" @@ -1668,8 +1771,8 @@ __defaultNIL( @_width, 200 ) pdfBox( 5.0, 5.0, 274.0 + nAdd, 210.0, 1.0 ) pdfBox( 6.5, 6.5, 272.5 + nAdd, 208.5, 0.5 ) - pdfBox( 11.5, 9.5, 22.0 , 205.5, 0.5, 5 ) - pdfBox( 23.0, 9.5, 33.5 , 205.5, 0.5, 5 ) + pdfBox( 11.5, 9.5, 22.0, 205.5, 0.5, 5 ) + pdfBox( 23.0, 9.5, 33.5, 205.5, 0.5, 5 ) pdfBox( 34.5, 9.5, 267.5 + nAdd, 205.5, 0.5 ) ELSE @@ -1681,74 +1784,79 @@ __defaultNIL( @_width, 200 ) pdfBox( 34.5, 9.5, 203.5, 269.5 + nAdd, 0.5 ) ENDIF - pdfSetFont("Helvetica", BOLD, 10) // 0.04 + pdfSetFont( "Helvetica", BOLD, 10 ) // 0.04 pdfAtSay( "Test Line 1", t_aReportStyle[ nStyle ][ 1 ], 1, "R", .T. ) - pdfSetFont("Times", BOLD, 18) - pdfCenter( "Test Line 2", t_aReportStyle[ nStyle ][ 2 ],,"R", .T. ) + pdfSetFont( "Times", BOLD, 18 ) + pdfCenter( "Test Line 2", t_aReportStyle[ nStyle ][ 2 ],, "R", .T. ) - pdfSetFont("Times", BOLD, 12) - pdfCenter( "Test Line 3", t_aReportStyle[ nStyle ][ 3 ],,"R", .T. ) + pdfSetFont( "Times", BOLD, 12 ) + pdfCenter( "Test Line 3", t_aReportStyle[ nStyle ][ 3 ],, "R", .T. ) - pdfSetFont("Helvetica", BOLD, 10) // 0.04 + pdfSetFont( "Helvetica", BOLD, 10 ) // 0.04 pdfAtSay( "Test Line 4", t_aReportStyle[ nStyle ][ 4 ], 1, "R", .T. ) - pdfSetFont("Helvetica", BOLD, 10) // 0.04 + pdfSetFont( "Helvetica", BOLD, 10 ) // 0.04 pdfAtSay( "Test Line 5", t_aReportStyle[ nStyle ][ 5 ], 1, "R", .T. ) - pdfAtSay( dtoc( date()) + " " + TimeAsAMPM( time() ), t_aReportStyle[ nStyle ][ 6 ], 1, "R", .T. ) + pdfAtSay( DToC( Date() ) + " " + TimeAsAMPM( Time() ), t_aReportStyle[ nStyle ][ 6 ], 1, "R", .T. ) pdfRJust( "Page: #pagenumber#", t_aReportStyle[ nStyle ][ 6 ], t_aReport[ REPORTWIDTH ], "R", .T. ) pdfEditOffHeader() pdfSaveHeader( _file ) -return nil + RETURN NIL -function pdfImageInfo( cFile ) -local cTemp := upper(substr( cFile, rat('.', cFile) + 1 )), aTemp := {} - do case - case cTemp == "TIF" +FUNCTION pdfImageInfo( cFile ) + + LOCAL cTemp := Upper( SubStr( cFile, RAt( '.', cFile ) + 1 ) ), aTemp := {} + + DO CASE + CASE cTemp == "TIF" aTemp := pdfTIFFInfo( cFile ) - case cTemp == "JPG" + CASE cTemp == "JPG" aTemp := pdfJPEGInfo( cFile ) - endcase -return aTemp + ENDCASE -function pdfTIFFInfo( cFile ) -local c40 := chr( 0 ) + chr( 0 ) + chr( 0 ) + chr( 0 ) -//local aType := {"BYTE","ASCII","SHORT","LONG","RATIONAL","SBYTE","UNDEFINED","SSHORT","SLONG","SRATIONAL","FLOAT","DOUBLE"} -local aCount := { 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8 } -local nTemp, nHandle, cValues, c2, nFieldType, nCount, nPos, nTag, nValues -local nOffset, cTemp, cIFDNext, nIFD, nFields, nn//, cTag, nPages + RETURN aTemp -local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0, yRes := 0, aTemp := {}, nSpace +FUNCTION pdfTIFFInfo( cFile ) - nHandle := fopen( cFile ) + LOCAL c40 := Chr( 0 ) + Chr( 0 ) + Chr( 0 ) + Chr( 0 ) + + // local aType := {"BYTE","ASCII","SHORT","LONG","RATIONAL","SBYTE","UNDEFINED","SSHORT","SLONG","SRATIONAL","FLOAT","DOUBLE"} + LOCAL aCount := { 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8 } + LOCAL nTemp, nHandle, cValues, c2, nFieldType, nCount, nPos, nTag, nValues + LOCAL nOffset, cTemp, cIFDNext, nIFD, nFields, nn// , cTag, nPages + + LOCAL nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0, yRes := 0, aTemp := {}, nSpace + + nHandle := FOpen( cFile ) c2 := ' ' - fread( nHandle, @c2, 2 ) - fread( nHandle, @c2, 2 ) + FRead( nHandle, @c2, 2 ) + FRead( nHandle, @c2, 2 ) cIFDNext := ' ' - fread( nHandle, @cIFDNext, 4 ) + FRead( nHandle, @cIFDNext, 4 ) - cTemp := space(12) - //nPages := 0 + cTemp := Space( 12 ) + // nPages := 0 - while !( cIFDNext == c40 ) //read IFD's + WHILE !( cIFDNext == c40 ) // read IFD's - nIFD := bin2l( cIFDNext ) + nIFD := Bin2L( cIFDNext ) - fseek( nHandle, nIFD ) - //?'*** IFD ' + hb_ntos( ++nPages ) + FSeek( nHandle, nIFD ) + // ? '*** IFD ' + hb_ntos( ++nPages ) - fread( nHandle, @c2, 2 ) - nFields := bin2i( c2 ) + FRead( nHandle, @c2, 2 ) + nFields := Bin2I( c2 ) - for nn := 1 to nFields - fread( nHandle, @cTemp, 12 ) + FOR nn := 1 TO nFields + FRead( nHandle, @cTemp, 12 ) - nTag := bin2w( substr( cTemp, 1, 2 ) ) - nFieldType := bin2w(substr( cTemp, 3, 2 )) + nTag := Bin2W( SubStr( cTemp, 1, 2 ) ) + nFieldType := Bin2W( SubStr( cTemp, 3, 2 ) ) /* 1 = BYTE 8-bit unsigned integer. 2 = ASCII 8-bit byte that contains a 7-bit ASCII code; the last byte @@ -1770,69 +1878,69 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 11 = FLOAT Single precision (4-byte) IEEE format. 12 = DOUBLE Double precision (8-byte) IEEE format. */ - nCount := bin2l(substr( cTemp, 5, 4 )) - nOffset := bin2l(substr( cTemp, 9, 4 )) + nCount := Bin2L( SubStr( cTemp, 5, 4 ) ) + nOffset := Bin2L( SubStr( cTemp, 9, 4 ) ) - IF nCount > 1 .or. nFieldType == RATIONAL .or. nFieldType == SRATIONAL + IF nCount > 1 .OR. nFieldType == RATIONAL .OR. nFieldType == SRATIONAL nPos := filepos( nHandle ) - fseek( nHandle, nOffset) + FSeek( nHandle, nOffset ) nValues := nCount * aCount[ nFieldType ] - cValues := space( nValues ) - fread( nHandle, @cValues, nValues ) - fseek( nHandle, nPos ) + cValues := Space( nValues ) + FRead( nHandle, @cValues, nValues ) + FSeek( nHandle, nPos ) ELSE - cValues := substr( cTemp, 9, 4 ) + cValues := SubStr( cTemp, 9, 4 ) ENDIF IF nFieldType == ASCII --nCount ENDIF - //?'Tag' - //??' ' + padr( nTag, 10 ) - //cTag := '' - do case - case nTag == 256 + // ? 'Tag' + // ?? ' ' + padr( nTag, 10 ) + // cTag := '' + DO CASE + CASE nTag == 256 /* ImageWidth Tag = 256 (100.H) Type = SHORT or LONG The number of columns in the image, i.e., the number of pixels per scanline. */ - //??'ImageWidth' - //cTag := 'ImageWidth' -/* - IF nFieldType != SHORT .and. nFieldType != LONG - alert('Wrong Type for ImageWidth') - ENDIF -*/ + // ?? 'ImageWidth' + // cTag := 'ImageWidth' +#if 0 + IF nFieldType != SHORT .AND. nFieldType != LONG + Alert( 'Wrong Type for ImageWidth' ) + ENDIF +#endif IF nFieldType == SHORT - nWidth := bin2w(substr( cValues, 1, 2 )) + nWidth := Bin2W( SubStr( cValues, 1, 2 ) ) ELSEIF nFieldType == LONG - nWidth := bin2l(substr( cValues, 1, 4 )) + nWidth := Bin2L( SubStr( cValues, 1, 4 ) ) ENDIF - case nTag == 257 + CASE nTag == 257 /* ImageLength Tag = 257 (101.H) Type = SHORT or LONG The number of rows (sometimes described as scanlines) in the image. */ - //??'ImageLength' - //cTag := 'ImageLength' -/* - IF nFieldType != SHORT .and. nFieldType != LONG - alert('Wrong Type for ImageLength') - ENDIF -*/ + // ?? 'ImageLength' + // cTag := 'ImageLength' +#if 0 + IF nFieldType != SHORT .AND. nFieldType != LONG + Alert( 'Wrong Type for ImageLength' ) + ENDIF +#endif IF nFieldType == SHORT - nHeight := bin2w(substr( cValues, 1, 2 )) + nHeight := Bin2W( SubStr( cValues, 1, 2 ) ) ELSEIF nFieldType == LONG - nHeight := bin2l(substr( cValues, 1, 4 )) + nHeight := Bin2L( SubStr( cValues, 1, 4 ) ) ENDIF - case nTag == 258 + CASE nTag == 258 /* BitsPerSample Tag = 258 (102.H) @@ -1841,19 +1949,19 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 Allowable values for Baseline TIFF grayscale images are 4 and 8, allowing either 16 or 256 distinct shades of gray. */ - //??'BitsPerSample' - //cTag := 'BitsPerSample' + // ?? 'BitsPerSample' + // cTag := 'BitsPerSample' nTemp := 0 IF nFieldType == SHORT - nTemp := bin2w( cValues ) + nTemp := Bin2W( cValues ) ELSE - //alert('Wrong Type for BitsPerSample') + // alert('Wrong Type for BitsPerSample') ENDIF nBits := nTemp - //IF nTemp != 4 .and. nTemp != 8 + // IF nTemp != 4 .and. nTemp != 8 // alert('Wrong Value for BitsPerSample') - //ENDIF - case nTag == 259 + // ENDIF + CASE nTag == 259 /* Compression Tag = 259 (103.H) @@ -1870,18 +1978,18 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 unaffected. Baseline TIFF readers must handle all three compression schemes. */ - //??'Compression' - //cTag := 'Compression' + // ?? 'Compression' + // cTag := 'Compression' /*nTemp := 0 IF nFieldType == SHORT nTemp := bin2w( cValues ) ELSE //alert('Wrong Type for Compression') ENDIF*/ - //IF nTemp != 1 .and. nTemp != 2 .and. nTemp != 32773 + // IF nTemp != 1 .and. nTemp != 2 .and. nTemp != 32773 // alert('Wrong Value for Compression') - //ENDIF - case nTag == 262 + // ENDIF + CASE nTag == 262 /* PhotometricInterpretation Tag = 262 (106.H) @@ -1893,18 +2001,18 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 value is imaged as white. If this value is specified for Compression=2, the image should display and print reversed. */ - //??'PhotometricInterpretation' - //cTag := 'PhotometricInterpretation' + // ?? 'PhotometricInterpretation' + // cTag := 'PhotometricInterpretation' nTemp := -1 IF nFieldType == SHORT - nTemp := bin2w( cValues ) + nTemp := Bin2W( cValues ) ELSE - //alert('Wrong Type for PhotometricInterpretation') + // alert('Wrong Type for PhotometricInterpretation') ENDIF - IF nTemp != 0 .and. nTemp != 1 .and. nTemp != 2 .and. nTemp != 3 - //alert('Wrong Value for PhotometricInterpretation') + IF nTemp != 0 .AND. nTemp != 1 .AND. nTemp != 2 .AND. nTemp != 3 + // alert('Wrong Value for PhotometricInterpretation') ENDIF - case nTag == 264 + CASE nTag == 264 /* CellWidth The width of the dithering or halftoning matrix used to create a dithered or @@ -1913,12 +2021,12 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 N = 1 No default. See also Threshholding. */ - //??'CellWidth' - //cTag := 'CellWidth' + // ?? 'CellWidth' + // cTag := 'CellWidth' IF nFieldType != SHORT - //alert('Wrong Type for CellWidth') + // alert('Wrong Type for CellWidth') ENDIF - case nTag == 265 + CASE nTag == 265 /* CellLength The length of the dithering or halftoning matrix used to create a dithered or @@ -1929,12 +2037,12 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 This field should only be present if Threshholding = 2 No default. See also Threshholding. */ - //??'CellLength' - //cTag := 'CellLength' + // ?? 'CellLength' + // cTag := 'CellLength' IF nFieldType != SHORT - //alert('Wrong Type for CellLength') + // alert('Wrong Type for CellLength') ENDIF - case nTag == 266 + CASE nTag == 266 /* FillOrder The logical order of bits within a byte. @@ -1942,31 +2050,31 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 Type = SHORT N = 1 */ - //??'FillOrder' - //cTag := 'FillOrder' + // ?? 'FillOrder' + // cTag := 'FillOrder' IF nFieldType != SHORT - //alert('Wrong Type for FillOrder') + // alert('Wrong Type for FillOrder') ENDIF - case nTag == 273 + CASE nTag == 273 /* StripOffsets Tag = 273 (111.H) Type = SHORT or LONG For each strip, the byte offset of that strip. */ - //??'StripOffsets' - //cTag := 'StripOffsets' - IF nFieldType != SHORT .and. nFieldType != LONG - //alert('Wrong Type for StripOffsets') + // ?? 'StripOffsets' + // cTag := 'StripOffsets' + IF nFieldType != SHORT .AND. nFieldType != LONG + // alert('Wrong Type for StripOffsets') ENDIF IF nFieldType == SHORT - nFrom := bin2w(substr( cValues, 1, 2 )) + nFrom := Bin2W( SubStr( cValues, 1, 2 ) ) ELSEIF nFieldType == LONG - nFrom := bin2l(substr( cValues, 1, 4 )) + nFrom := Bin2L( SubStr( cValues, 1, 4 ) ) ENDIF - case nTag == 277 + CASE nTag == 277 /* SamplesPerPixel Tag = 277 (115.H) @@ -1974,12 +2082,12 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 The number of components per pixel. This number is 3 for RGB images, unless extra samples are present. See the ExtraSamples field for further information. */ - //??'SamplesPerPixel' - //cTag := 'SamplesPerPixel' + // ?? 'SamplesPerPixel' + // cTag := 'SamplesPerPixel' IF nFieldType != SHORT - //alert('Wrong Type for SamplesPerPixel') + // alert('Wrong Type for SamplesPerPixel') ENDIF - case nTag == 278 + CASE nTag == 278 /* RowsPerStrip Tag = 278 (116.H) @@ -1990,33 +2098,33 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 third strip. (The data in the last strip is not padded with 6 extra rows of dummy data.) */ - //??'RowsPerStrip' - //cTag := 'RowsPerStrip' - IF nFieldType != SHORT .and. nFieldType != LONG - //alert('Wrong Type for RowsPerStrip') + // ?? 'RowsPerStrip' + // cTag := 'RowsPerStrip' + IF nFieldType != SHORT .AND. nFieldType != LONG + // alert('Wrong Type for RowsPerStrip') ENDIF - case nTag == 279 + CASE nTag == 279 /* StripByteCounts Tag = 279 (117.H) Type = SHORT or LONG For each strip, the number of bytes in that strip after any compression. */ - //??'StripByteCounts' - //cTag := 'StripByteCounts' - IF nFieldType != SHORT .and. nFieldType != LONG - //alert('Wrong Type for StripByteCounts') + // ?? 'StripByteCounts' + // cTag := 'StripByteCounts' + IF nFieldType != SHORT .AND. nFieldType != LONG + // alert('Wrong Type for StripByteCounts') ENDIF IF nFieldType == SHORT - nLength := bin2w(substr( cValues, 1, 2 )) + nLength := Bin2W( SubStr( cValues, 1, 2 ) ) ELSEIF nFieldType == LONG - nLength := bin2l(substr( cValues, 1, 4 )) + nLength := Bin2L( SubStr( cValues, 1, 4 ) ) ENDIF nLength *= nCount // Count all strips !!! - case nTag == 282 + CASE nTag == 282 /* XResolution Tag = 282 (11A.H) @@ -2024,13 +2132,13 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 The number of pixels per ResolutionUnit in the ImageWidth (typically, horizontal - see Orientation) direction. */ - //??'XResolution' - //cTag := 'XResolution' + // ?? 'XResolution' + // cTag := 'XResolution' IF nFieldType != RATIONAL - //alert('Wrong Type for XResolution') + // alert('Wrong Type for XResolution') ENDIF - xRes := bin2l(substr( cValues, 1, 4 )) - case nTag == 283 + xRes := Bin2L( SubStr( cValues, 1, 4 ) ) + CASE nTag == 283 /* YResolution Tag = 283 (11B.H) @@ -2038,19 +2146,19 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 The number of pixels per ResolutionUnit in the ImageLength (typically, vertical) direction. */ - //??'YResolution' - //cTag := 'YResolution' + // ?? 'YResolution' + // cTag := 'YResolution' IF nFieldType != RATIONAL - //alert('Wrong Type for YResolution') + // alert('Wrong Type for YResolution') ENDIF - yRes := bin2l(substr( cValues, 1, 4 )) - case nTag == 284 - //??'PlanarConfiguration' - //cTag := 'PlanarConfiguration' + yRes := Bin2L( SubStr( cValues, 1, 4 ) ) + CASE nTag == 284 + // ?? 'PlanarConfiguration' + // cTag := 'PlanarConfiguration' IF nFieldType != SHORT - //alert('Wrong Type for PlanarConfiguration') + // alert('Wrong Type for PlanarConfiguration') ENDIF - case nTag == 288 + CASE nTag == 288 /* FreeOffsets For each string of contiguous unused bytes in a TIFF file, the byte offset of the @@ -2060,12 +2168,12 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 Not recommended for general interchange. See also FreeByteCounts. */ - //??'FreeOffsets' - //cTag := 'FreeOffsets' + // ?? 'FreeOffsets' + // cTag := 'FreeOffsets' IF nFieldType != LONG - //alert('Wrong Type for FreeOffsets') + // alert('Wrong Type for FreeOffsets') ENDIF - case nTag == 289 + CASE nTag == 289 /* FreeByteCounts For each string of contiguous unused bytes in a TIFF file, the number of bytes in @@ -2075,12 +2183,12 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 Not recommended for general interchange. See also FreeOffsets. */ - //??'FreeByteCounts' - //cTag := 'FreeByteCounts' + // ?? 'FreeByteCounts' + // cTag := 'FreeByteCounts' IF nFieldType != LONG - //alert('Wrong Type for FreeByteCounts') + // alert('Wrong Type for FreeByteCounts') ENDIF - case nTag == 296 + CASE nTag == 296 /* ResolutionUnit Tag = 296 (128.H) @@ -2092,24 +2200,24 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 3 = Centimeter. Default = 2 (inch). */ - //??'ResolutionUnit' - //cTag := 'ResolutionUnit' + // ?? 'ResolutionUnit' + // cTag := 'ResolutionUnit' nTemp := 0 IF nFieldType == SHORT - nTemp := bin2w( cValues ) + nTemp := Bin2W( cValues ) ELSE - //alert('Wrong Type for ResolutionUnit') + // alert('Wrong Type for ResolutionUnit') ENDIF - IF nTemp != 1 .and. nTemp != 2 .and. nTemp != 3 - //alert('Wrong Value for ResolutionUnit') + IF nTemp != 1 .AND. nTemp != 2 .AND. nTemp != 3 + // alert('Wrong Value for ResolutionUnit') ENDIF - case nTag == 305 - //??'Software' - //cTag := 'Software' + CASE nTag == 305 + // ?? 'Software' + // cTag := 'Software' IF nFieldType != ASCII - //alert('Wrong Type for Software') + // alert('Wrong Type for Software') ENDIF - case nTag == 306 + CASE nTag == 306 /* DateTime Date and time of image creation. @@ -2120,12 +2228,12 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 clock, and one space character between the date and the time. The length of the string, including the terminating NUL, is 20 bytes. */ - //??'DateTime' - //cTag := 'DateTime' + // ?? 'DateTime' + // cTag := 'DateTime' IF nFieldType != ASCII - //alert('Wrong Type for DateTime') + // alert('Wrong Type for DateTime') ENDIF - case nTag == 315 + CASE nTag == 315 /* Artist Person who created the image. @@ -2133,12 +2241,12 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 Type = ASCII Note: some older TIFF files used this tag for storing Copyright information. */ - //??'Artist' - //cTag := 'Artist' + // ?? 'Artist' + // cTag := 'Artist' IF nFieldType != ASCII - //alert('Wrong Type for Artist') + // alert('Wrong Type for Artist') ENDIF - case nTag == 320 + CASE nTag == 320 /* ColorMap Tag = 320 (140.H) @@ -2152,12 +2260,12 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 then the Blue values. In the ColorMap, black is represented by 0,0,0 and white is represented by 65535, 65535, 65535. */ - //??'ColorMap' - //cTag := 'ColorMap' + // ?? 'ColorMap' + // cTag := 'ColorMap' IF nFieldType != SHORT - //alert('Wrong Type for ColorMap') + // alert('Wrong Type for ColorMap') ENDIF - case nTag == 338 + CASE nTag == 338 /* ExtraSamples Description of extra components. @@ -2165,12 +2273,12 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 Type = SHORT N = m */ - //??'ExtraSamples' - //cTag := 'ExtraSamples' + // ?? 'ExtraSamples' + // cTag := 'ExtraSamples' IF nFieldType != SHORT - //alert('Wrong Type for ExtraSamples') + // alert('Wrong Type for ExtraSamples') ENDIF - case nTag == 33432 + CASE nTag == 33432 /* Copyright Copyright notice. @@ -2181,180 +2289,188 @@ local nWidth := 0, nHeight := 0, nBits := 0, nFrom := 0, nLength := 0, xRes := 0 any dates and statements of claims. For example, Copyright, John Smith, 19xx. All rights reserved. */ - //??'Copyright' - //cTag := 'Copyright' + // ?? 'Copyright' + // cTag := 'Copyright' IF nFieldType != ASCII - //alert('Wrong Type for Copyright') + // alert('Wrong Type for Copyright') ENDIF - otherwise - //??'Unknown' - //cTag := 'Unknown' - endcase - /* - ??padr( cTag, 30 ) - ??' type ' + padr(aType[ nFieldType ], 10) + ' count ' + hb_ntos(nCount) + ' <' - do case - case nFieldType == BYTE - for nI := 1 to nCount - ??' ' + hb_ntos(asc( substr( cValues, nI, 1 ))) - next - case nFieldType == ASCII - ??' ' - for nI := 1 to nCount - ??substr( cValues, nI, 1 ) - next - case nFieldType == SHORT - for nI := 1 to nCount - ??' ' + hb_ntos(bin2w(substr( cValues, ( nI - 1 ) * 2 + 1, 2 ))) - next - case nFieldType == LONG - for nI := 1 to nCount - ??' ' + hb_ntos(bin2l(substr( cValues, ( nI - 1 ) * 4 + 1, 4 ))) - next - case nFieldType == RATIONAL - for nI := 1 to nCount - ??' ' + hb_ntos(bin2l(substr( cValues, ( nI - 1 ) * 8 + 1, 4 ))) + '/' + hb_ntos(bin2l(substr( cValues, nI + 4, 4 ))) - next - case nFieldType == SBYTE - for nI := 1 to nCount - ??' ' + hb_ntos(asc( substr( cValues, nI, 1 ))) - next - case nFieldType == UNDEFINED - for nI := 1 to nCount - ??' ' + substr( cValues, nI, 1 ) - next - case nFieldType == SSHORT - for nI := 1 to nCount - ??' ' + hb_ntos(bin2i(substr( cValues, ( nI - 1 ) * 2 + 1, 2 ))) - next - case nFieldType == SLONG - for nI := 1 to nCount - ??' ' + hb_ntos(bin2l(substr( cValues, ( nI - 1 ) * 4 + 1, 4 ))) - next - case nFieldType == SRATIONAL - for nI := 1 to nCount - ??' ' + hb_ntos(bin2l(substr( cValues, ( nI - 1 ) * 8 + 1, 4 ))) + '/' + hb_ntos(bin2l(substr( cValues, nI + 4, 4 ))) - next - case nFieldType == FLOAT - case nFieldType == DOUBLE - for nI := 1 to nCount - ??' ' + hb_ntos(ctof(substr( cValues, ( nI - 1 ) * 8 + 1, 8 ))) - next + OTHERWISE + // ?? 'Unknown' + // cTag := 'Unknown' + ENDCASE +#if 0 + ?? PadR( cTag, 30 ) + ?? ' type ' + PadR( aType[ nFieldType ], 10 ) + ' count ' + hb_ntos( nCount ) + ' <' + DO CASE + CASE nFieldType == BYTE + FOR nI := 1 TO nCount + ?? ' ' + hb_ntos( Asc( SubStr( cValues, nI, 1 ) ) ) + NEXT + CASE nFieldType == ASCII + ?? ' ' + FOR nI := 1 TO nCount + ?? SubStr( cValues, nI, 1 ) + NEXT + CASE nFieldType == SHORT + FOR nI := 1 TO nCount + ?? ' ' + hb_ntos( Bin2W( SubStr( cValues, ( nI - 1 ) * 2 + 1, 2 ) ) ) + NEXT + CASE nFieldType == LONG + FOR nI := 1 TO nCount + ?? ' ' + hb_ntos( Bin2L( SubStr( cValues, ( nI - 1 ) * 4 + 1, 4 ) ) ) + NEXT + CASE nFieldType == RATIONAL + FOR nI := 1 TO nCount + ?? ' ' + hb_ntos( Bin2L( SubStr( cValues, ( nI - 1 ) * 8 + 1, 4 ) ) ) + '/' + hb_ntos( Bin2L( SubStr( cValues, nI + 4, 4 ) ) ) + NEXT + CASE nFieldType == SBYTE + FOR nI := 1 TO nCount + ?? ' ' + hb_ntos( Asc( SubStr( cValues, nI, 1 ) ) ) + NEXT + CASE nFieldType == UNDEFINED + FOR nI := 1 TO nCount + ?? ' ' + SubStr( cValues, nI, 1 ) + NEXT + CASE nFieldType == SSHORT + FOR nI := 1 TO nCount + ?? ' ' + hb_ntos( Bin2I( SubStr( cValues, ( nI - 1 ) * 2 + 1, 2 ) ) ) + NEXT + CASE nFieldType == SLONG + FOR nI := 1 TO nCount + ?? ' ' + hb_ntos( Bin2L( SubStr( cValues, ( nI - 1 ) * 4 + 1, 4 ) ) ) + NEXT + CASE nFieldType == SRATIONAL + FOR nI := 1 TO nCount + ?? ' ' + hb_ntos( Bin2L( SubStr( cValues, ( nI - 1 ) * 8 + 1, 4 ) ) ) + '/' + hb_ntos( Bin2L( SubStr( cValues, nI + 4, 4 ) ) ) + NEXT + CASE nFieldType == FLOAT + CASE nFieldType == DOUBLE + FOR nI := 1 TO nCount + ?? ' ' + hb_ntos( ctof( SubStr( cValues, ( nI - 1 ) * 8 + 1, 8 ) ) ) + NEXT - endcase - ??' >' - */ - next - fread( nHandle, @cIFDNext, 4 ) - enddo + ENDCASE + ?? ' >' +#endif + NEXT + FRead( nHandle, @cIFDNext, 4 ) + ENDDO - fclose( nHandle ) + FClose( nHandle ) - aadd( aTemp, nWidth ) - aadd( aTemp, nHeight ) - aadd( aTemp, xRes ) - aadd( aTemp, yRes ) - aadd( aTemp, nBits ) - aadd( aTemp, nFrom ) - aadd( aTemp, nLength ) + AAdd( aTemp, nWidth ) + AAdd( aTemp, nHeight ) + AAdd( aTemp, xRes ) + AAdd( aTemp, yRes ) + AAdd( aTemp, nBits ) + AAdd( aTemp, nFrom ) + AAdd( aTemp, nLength ) nSpace := 0 - aadd( aTemp, nSpace ) -return aTemp + AAdd( aTemp, nSpace ) -function pdfJPEGInfo( cFile ) -local c255, nAt, nHandle -local nWidth, nHeight, nBits := 8, nFrom := 0, nLength, xRes, yRes, aTemp := {} -local nBuffer := 20000 -local nSpace // := 3 // 3 - RGB, 1 - GREY, 4 - CMYK + RETURN aTemp - nHandle := fopen( cFile ) +FUNCTION pdfJPEGInfo( cFile ) - c255 := space( nBuffer ) - fread( nHandle, @c255, nBuffer ) + LOCAL c255, nAt, nHandle + LOCAL nWidth, nHeight, nBits := 8, nFrom := 0, nLength, xRes, yRes, aTemp := {} + LOCAL nBuffer := 20000 + LOCAL nSpace // := 3 // 3 - RGB, 1 - GREY, 4 - CMYK - xRes := asc(substr( c255, 15, 1 )) * 256 + asc(substr( c255, 16, 1 )) - yRes := asc( substr( c255, 17, 1 )) * 256 + asc(substr( c255, 18, 1 )) + nHandle := FOpen( cFile ) - nAt := rat( chr( 255 ) + chr( 192 ), c255 ) + 5 - nHeight := asc(substr( c255, nAt, 1 )) * 256 + asc(substr( c255, nAt + 1, 1 )) - nWidth := asc( substr( c255, nAt + 2, 1 )) * 256 + asc(substr( c255, nAt + 3, 1 )) + c255 := Space( nBuffer ) + FRead( nHandle, @c255, nBuffer ) - nSpace := asc( substr( c255, nAt + 4, 1 )) + xRes := Asc( SubStr( c255, 15, 1 ) ) * 256 + Asc( SubStr( c255, 16, 1 ) ) + yRes := Asc( SubStr( c255, 17, 1 ) ) * 256 + Asc( SubStr( c255, 18, 1 ) ) + + nAt := RAt( Chr( 255 ) + Chr( 192 ), c255 ) + 5 + nHeight := Asc( SubStr( c255, nAt, 1 ) ) * 256 + Asc( SubStr( c255, nAt + 1, 1 ) ) + nWidth := Asc( SubStr( c255, nAt + 2, 1 ) ) * 256 + Asc( SubStr( c255, nAt + 3, 1 ) ) + + nSpace := Asc( SubStr( c255, nAt + 4, 1 ) ) nLength := filesize( nHandle ) - fclose( nHandle ) + FClose( nHandle ) - aadd( aTemp, nWidth ) - aadd( aTemp, nHeight ) - aadd( aTemp, xRes ) - aadd( aTemp, yRes ) - aadd( aTemp, nBits ) - aadd( aTemp, nFrom ) - aadd( aTemp, nLength ) - aadd( aTemp, nSpace ) + AAdd( aTemp, nWidth ) + AAdd( aTemp, nHeight ) + AAdd( aTemp, xRes ) + AAdd( aTemp, yRes ) + AAdd( aTemp, nBits ) + AAdd( aTemp, nFrom ) + AAdd( aTemp, nLength ) + AAdd( aTemp, nSpace ) -return aTemp + RETURN aTemp STATIC FUNCTION FilePos( nHandle ) -RETURN FSEEK( nHandle, 0, FS_RELATIVE ) + RETURN FSeek( nHandle, 0, FS_RELATIVE ) STATIC FUNCTION Chr_RGB( cChar ) -RETURN str(asc( cChar ) / 255, 4, 2) + RETURN Str( Asc( cChar ) / 255, 4, 2 ) STATIC FUNCTION NumToken( cString, cDelimiter ) -RETURN AllToken( cString, cDelimiter ) + RETURN AllToken( cString, cDelimiter ) STATIC FUNCTION Token( cString, cDelimiter, nPointer ) -RETURN AllToken( cString, cDelimiter, nPointer, 1 ) + RETURN AllToken( cString, cDelimiter, nPointer, 1 ) STATIC FUNCTION AtToken( cString, cDelimiter, nPointer ) -RETURN AllToken( cString, cDelimiter, nPointer, 2 ) + RETURN AllToken( cString, cDelimiter, nPointer, 2 ) STATIC FUNCTION AllToken( cString, cDelimiter, nPointer, nAction ) -LOCAL nTokens := 0, nPos := 1, nLen := len( cString ), nStart, cRet -__defaultNIL( @cDelimiter, chr( 0 ) + chr( 9 ) + chr( 10 ) + chr( 13 ) + chr( 26 ) + chr( 32 ) + chr( 138 ) + chr( 141 ) ) -__defaultNIL( @nAction, 0 ) -// nAction == 0 - numtoken -// nAction == 1 - token -// nAction == 2 - attoken + LOCAL nTokens := 0, nPos := 1, nLen := Len( cString ), nStart, cRet - while nPos <= nLen - if !substr( cString, nPos, 1 ) $ cDelimiter - nStart := nPos - while nPos <= nLen .and. !substr( cString, nPos, 1 ) $ cDelimiter - ++nPos - enddo - ++nTokens - IF nAction > 0 - IF nPointer == nTokens - IF nAction == 1 - cRet := substr( cString, nStart, nPos - nStart ) - ELSE - cRet := nStart - ENDIF - exit - ENDIF + __defaultNIL( @cDelimiter, Chr( 0 ) + Chr( 9 ) + Chr( 10 ) + Chr( 13 ) + Chr( 26 ) + Chr( 32 ) + Chr( 138 ) + Chr( 141 ) ) + __defaultNIL( @nAction, 0 ) + + // nAction == 0 - numtoken + // nAction == 1 - token + // nAction == 2 - attoken + + WHILE nPos <= nLen + IF !SubStr( cString, nPos, 1 ) $ cDelimiter + nStart := nPos + WHILE nPos <= nLen .AND. !SubStr( cString, nPos, 1 ) $ cDelimiter + ++nPos + ENDDO + ++nTokens + IF nAction > 0 + IF nPointer == nTokens + IF nAction == 1 + cRet := SubStr( cString, nStart, nPos - nStart ) + ELSE + cRet := nStart ENDIF - endif - if substr( cString, nPos, 1 ) $ cDelimiter - while nPos <= nLen .and. substr( cString, nPos, 1 ) $ cDelimiter - ++nPos - enddo - endif - cRet := nTokens - ENDDO -RETURN cRet + EXIT + ENDIF + ENDIF + ENDIF + IF SubStr( cString, nPos, 1 ) $ cDelimiter + WHILE nPos <= nLen .AND. SubStr( cString, nPos, 1 ) $ cDelimiter + ++nPos + ENDDO + ENDIF + cRet := nTokens + ENDDO + + RETURN cRet STATIC FUNCTION NumAt( cSearch, cString ) + LOCAL n := 0, nAt, nPos := 0 - WHILE ( nAt := at( cSearch, substr( cString, nPos + 1 ) )) > 0 - nPos += nAt - ++n + + WHILE ( nAt := At( cSearch, SubStr( cString, nPos + 1 ) ) ) > 0 + nPos += nAt + ++n ENDDO -RETURN n + + RETURN n STATIC FUNCTION FileSize( nHandle ) @@ -2365,102 +2481,111 @@ STATIC FUNCTION FileSize( nHandle ) nCurrent := FilePos( nHandle ) // Get file length - nLength := FSEEK( nHandle, 0, FS_END ) + nLength := FSeek( nHandle, 0, FS_END ) // nLength := FilePos( nHandle ) // Reset file position - FSEEK( nHandle, nCurrent ) + FSeek( nHandle, nCurrent ) -RETURN nLength + RETURN nLength // next 3 function written by Peter Kulek -//modified DATE processing by V.K. -static function Array2File(cFile,aRay,nDepth,hFile) -local nBytes := 0 -local i -nDepth := iif(HB_ISNUMERIC(nDepth),nDepth,0) -if hFile == NIL - if (hFile := fCreate(cFile,FC_NORMAL)) == F_ERROR - return nBytes - endif -endif -nDepth++ -nBytes += WriteData(hFile,aRay) -if HB_ISARRAY(aRay) - for i := 1 to len(aRay) - nBytes += Array2File(cFile,aRay[i],nDepth,hFile) - next -endif -nDepth-- -if nDepth == 0 - fClose(hFile) -endif -return nBytes +// modified DATE processing by V.K. +STATIC FUNCTION Array2File( cFile, aRay, nDepth, hFile ) -static function WriteData(hFile,xData) -local cData := valtype(xData) - if HB_ISSTRING(xData) - cData += i2bin(len(xData))+xData - elseif HB_ISNUMERIC(xData) - cData += i2bin(len(hb_ntos(xData)))+hb_ntos(xData) - elseif HB_ISDATE(xData) - cData += i2bin(8)+dtos(xData) - elseif HB_ISLOGICAL(xData) - cData += i2bin(1)+iif(xData,'T','F') - elseif HB_ISARRAY(xData) - cData += i2bin(len(xData)) - else - cData += i2bin(0) // NIL - endif -return fWrite(hFile,cData,len(cData)) + LOCAL nBytes := 0 + LOCAL i -static function File2Array(cFile,nLen,hFile) -LOCAL cData,cType,nDataLen,nBytes -local nDepth := 0 -local aRay := {} -if hFile == NIL - if (hFile:=fOpen(cFile,FO_READ)) == F_ERROR - return aRay - endif - cData := space(3) - fRead(hFile,@cData,3) - if !( left(cData,1) == 'A' ) - return aRay - endif - nLen := bin2i(right(cData,2)) -endif -do while nDepth < nLen - cData := space(3) - nBytes := fRead(hFile,@cData,3) - if nBytes<3 - exit - endif - cType:= padl(cData,1) - nDataLen:= bin2i(right(cData,2)) - if !( cType == 'A' ) - cData := space(nDataLen) - nBytes:= fRead(hFile,@cData,nDataLen) - if nBytes type , ; + cell := { ; + "type" => type, ; "style" => styleID, ; - "data" => xData , ; + "data" => xData, ; "formula" => formula } IF hb_HPos( ::cells, row ) > 0 hcol := ::cells[ row ] diff --git a/harbour/extras/hbxlsxml/xlsxml_y.prg b/harbour/extras/hbxlsxml/xlsxml_y.prg index 401dec0369..b594d45def 100644 --- a/harbour/extras/hbxlsxml/xlsxml_y.prg +++ b/harbour/extras/hbxlsxml/xlsxml_y.prg @@ -302,7 +302,7 @@ METHOD ExcelWriterXML_Style:checkColor( color ) IF Left( color, 1 ) == "#" RETURN COLOR ELSEIF hb_HPos( ::namedColorsIE, Lower( color ) ) > 0 - color := ::namedColorsIE[ lower( color ) ] + color := ::namedColorsIE[ Lower( color ) ] RETURN COLOR ELSE RETURN "" diff --git a/harbour/extras/httpsrv/cgifunc.prg b/harbour/extras/httpsrv/cgifunc.prg index 6b96896790..6ea9f05f84 100644 --- a/harbour/extras/httpsrv/cgifunc.prg +++ b/harbour/extras/httpsrv/cgifunc.prg @@ -53,7 +53,7 @@ #include "error.ch" #include "fileio.ch" -//#define HB_USE_HBTIP // Use functions from HBTIP - TOIMPLEMENT +// #define HB_USE_HBTIP // Use functions from HBTIP - TOIMPLEMENT #define CRLF ( Chr( 13 ) + Chr( 10 ) ) #xtranslate THROW( ) => ( Eval( ErrorBlock(), ), Break( ) ) @@ -62,9 +62,11 @@ MEMVAR _SERVER, _GET, _POST, _COOKIE, _REQUEST, _HTTP_REQUEST FUNCTION uhttpd_GetVars( cFields, cSeparator ) + LOCAL hHashVars := { => } LOCAL aField, cField, aFields LOCAL cName, xValue + __defaultNIL( @cSeparator, "&" ) aFields := uhttpd_Split( cSeparator, cFields ) @@ -82,8 +84,8 @@ FUNCTION uhttpd_GetVars( cFields, cSeparator ) xValue := uhttpd_UrlDecode( aField[ 2 ] ) // Is it an array entry? - IF Substr( cName, Len( cName ) - 1 ) == "[]" - cName := Substr( cName, 1, Len( cName ) - 2 ) + IF SubStr( cName, Len( cName ) - 1 ) == "[]" + cName := SubStr( cName, 1, Len( cName ) - 2 ) hHashVars[ cName ] := { xValue } ELSE // now check if variable already exists. If yes and I have already another element @@ -93,7 +95,7 @@ FUNCTION uhttpd_GetVars( cFields, cSeparator ) // Transform it to array hHashVars[ cName ] := { hHashVars[ cName ] } ENDIF - aAdd( hHashVars[ cName ], xValue ) + AAdd( hHashVars[ cName ], xValue ) ELSE hHashVars[ cName ] := xValue ENDIF @@ -129,6 +131,7 @@ FUNCTION uhttpd_GetVars( cFields, cSeparator ) */ FUNCTION uhttpd_SplitUrl( cUrl ) + LOCAL hUrl := { => } LOCAL nPos, cTemp, cUserNamePassword, cHostnamePort LOCAL cProto, cHost, cPort, nPort, cUser, cPass, cPath, cQuery, cFragment @@ -245,19 +248,20 @@ FUNCTION uhttpd_SplitUrl( cUrl ) ENDIF // Assemble hash - hb_hSet( hUrl, "SCHEME" , cProto ) - hb_hSet( hUrl, "HOST" , cHost ) - hb_hSet( hUrl, "PORT" , nPort ) - hb_hSet( hUrl, "USER" , cUser ) - hb_hSet( hUrl, "PASS" , cPass ) - hb_hSet( hUrl, "PATH" , cPath ) - hb_hSet( hUrl, "QUERY" , cQuery ) - hb_hSet( hUrl, "FRAGMENT", cFragment ) - hb_hSet( hUrl, "URI" , cURI ) + hb_HSet( hUrl, "SCHEME" , cProto ) + hb_HSet( hUrl, "HOST" , cHost ) + hb_HSet( hUrl, "PORT" , nPort ) + hb_HSet( hUrl, "USER" , cUser ) + hb_HSet( hUrl, "PASS" , cPass ) + hb_HSet( hUrl, "PATH" , cPath ) + hb_HSet( hUrl, "QUERY" , cQuery ) + hb_HSet( hUrl, "FRAGMENT", cFragment ) + hb_HSet( hUrl, "URI" , cURI ) // Prevents externals to add something else to this Hash hb_HSetAutoAdd( hUrl, .F. ) -RETURN hUrl + + RETURN hUrl /* @@ -279,27 +283,28 @@ RETURN hUrl */ FUNCTION uhttpd_SplitString( cString, cDelim, lRemDelim, nCount ) + LOCAL nEOLPos LOCAL cBuffer := cString LOCAL aLines := {}, cLine LOCAL nHowMany := 0 - __defaultNIL( @cDelim, ( CHR( 13 ) + CHR( 10 ) ) ) + __defaultNIL( @cDelim, ( Chr( 13 ) + Chr( 10 ) ) ) __defaultNIL( @lRemDelim, .T. ) __defaultNIL( @nCount, -1 ) - //WriteToLogFile( "Splitstring: " + cStr( cString ) ) + // WriteToLogFile( "Splitstring: " + cStr( cString ) ) - DO WHILE ( nEOLPos := AT( cDelim, cBuffer ) ) > 0 + DO WHILE ( nEOLPos := At( cDelim, cBuffer ) ) > 0 nHowMany++ IF lRemDelim - cLine := LEFT( cBuffer, nEOLPos - 1 ) + cLine := Left( cBuffer, nEOLPos - 1 ) ELSE - cLine := LEFT( cBuffer, ( nEOLPos + LEN( cDelim ) ) - 1 ) + cLine := Left( cBuffer, ( nEOLPos + Len( cDelim ) ) - 1 ) ENDIF - //WriteToLogFile( "cBuffer, cDelim, nEOLPos, cLine: " + cStr( cBuffer ) + "," + cStr( cDelim ) + "," + cStr( nEOLPos ) + "," + cStr( cLine ) ) - aAdd( aLines, cLine ) - cBuffer := SubStr( cBuffer, nEOLPos + LEN( cDelim ) ) + // WriteToLogFile( "cBuffer, cDelim, nEOLPos, cLine: " + cStr( cBuffer ) + "," + cStr( cDelim ) + "," + cStr( nEOLPos ) + "," + cStr( cLine ) ) + AAdd( aLines, cLine ) + cBuffer := SubStr( cBuffer, nEOLPos + Len( cDelim ) ) IF nCount > -1 IF nHowMany >= nCount EXIT @@ -309,17 +314,20 @@ FUNCTION uhttpd_SplitString( cString, cDelim, lRemDelim, nCount ) // Check last line IF Len( cBuffer ) > 0 - aAdd( aLines, cBuffer ) + AAdd( aLines, cBuffer ) ENDIF -RETURN aLines + RETURN aLines /************************************************************ * Encoding URL */ FUNCTION uhttpd_URLEncode( cString, lComplete ) + #ifdef HB_USE_HBTIP + __defaultNIL( @lComplete, .T. ) + RETURN TIPENCODERURL_ENCODE( cString, lComplete ) #else LOCAL cRet := "", i, nVal, cChar @@ -327,32 +335,34 @@ FUNCTION uhttpd_URLEncode( cString, lComplete ) __defaultNIL( @lComplete, .T. ) FOR i := 1 TO Len( cString ) - cChar := SubStr( cString, i, 1) + cChar := SubStr( cString, i, 1 ) DO CASE - CASE cChar == " " - cRet += "+" + CASE cChar == " " + cRet += "+" - CASE ( cChar >= "A" .AND. cChar <= "Z" ) .OR. ; - ( cChar >= "a" .AND. cChar <= "z" ) .OR. ; - ( cChar >= "0" .AND. cChar <= "9" ) .OR. ; - cChar == '.' .OR. cChar == ',' .OR. cChar == '&' .OR. ; - cChar == '/' .OR. cChar == ';' .OR. cChar == '_' - cRet += cChar + CASE ( cChar >= "A" .AND. cChar <= "Z" ) .OR. ; + ( cChar >= "a" .AND. cChar <= "z" ) .OR. ; + ( cChar >= "0" .AND. cChar <= "9" ) .OR. ; + cChar == '.' .OR. cChar == ',' .OR. cChar == '&' .OR. ; + cChar == '/' .OR. cChar == ';' .OR. cChar == '_' + cRet += cChar - CASE iif( !lComplete, cChar == ':' .OR. cChar == '?' .OR. cChar == '=', .F. ) - cRet += cChar + CASE iif( !lComplete, cChar == ':' .OR. cChar == '?' .OR. cChar == '=', .F. ) + cRet += cChar - OTHERWISE - nVal := Asc( cChar ) - cRet += "%" + hb_NumToHex( nVal ) + OTHERWISE + nVal := Asc( cChar ) + cRet += "%" + hb_NumToHex( nVal ) ENDCASE NEXT + RETURN cRet /************************************************************ * Decoding URL */ FUNCTION uhttpd_URLDecode( cString ) + #ifdef HB_USE_HBTIP RETURN TIPENCODERURL_DECODE( cString ) #else @@ -361,20 +371,21 @@ FUNCTION uhttpd_URLDecode( cString ) FOR i := 1 TO Len( cString ) cChar := SubStr( cString, i, 1 ) DO CASE - CASE cChar == "+" - cRet += " " + CASE cChar == "+" + cRet += " " - CASE cChar == "%" - i ++ - cRet += Chr( hb_HexToNum( SubStr( cString, i, 2 ) ) ) - i ++ + CASE cChar == "%" + i++ + cRet += Chr( hb_HexToNum( SubStr( cString, i, 2 ) ) ) + i++ - OTHERWISE - cRet += cChar + OTHERWISE + cRet += cChar ENDCASE NEXT + RETURN cRet #endif @@ -389,35 +400,36 @@ FUNCTION uhttpd_URLDecode( cString ) */ FUNCTION uhttpd_DateToGMT( dDate, cTime, nDayToAdd, nSecsToAdd ) - LOCAL cStr - LOCAL cOldDateFormat := Set( _SET_DATEFORMAT, "dd-mm-yy" ) - LOCAL nDay, nMonth, nYear, nDoW - LOCAL aDays := { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" } - LOCAL aMonths := { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" } - __defaultNIL( @dDate, DATE() ) - __defaultNIL( @cTime, TIME() ) - __defaultNIL( @nDayToAdd, 0 ) - __defaultNIL( @nSecsToAdd, 0 ) + LOCAL cStr + LOCAL cOldDateFormat := Set( _SET_DATEFORMAT, "dd-mm-yy" ) + LOCAL nDay, nMonth, nYear, nDoW + LOCAL aDays := { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" } + LOCAL aMonths := { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" } - //Tracelog( "DateToGMT - StartingValue", dDate, cTime, nDayToAdd, nSecsToAdd ) + __defaultNIL( @dDate, Date() ) + __defaultNIL( @cTime, Time() ) + __defaultNIL( @nDayToAdd, 0 ) + __defaultNIL( @nSecsToAdd, 0 ) - cTime := uhttpd_AddSecondsToTime( cTime, nSecsToAdd, @nDayToAdd ) - dDate += nDayToAdd + // Tracelog( "DateToGMT - StartingValue", dDate, cTime, nDayToAdd, nSecsToAdd ) - nDay := Day( dDate ) - nMonth := Month( dDate ) - nYear := Year( dDate) - nDoW := Dow( dDate ) + cTime := uhttpd_AddSecondsToTime( cTime, nSecsToAdd, @nDayToAdd ) + dDate += nDayToAdd - cStr := aDays[ nDow ] + ", " + StrZero( nDay, 2 ) + "-" + aMonths[ nMonth ] + "-" + ; - Right( StrZero( nYear, 4 ), 2 ) + " " + cTime + " GMT" + nDay := Day( dDate ) + nMonth := Month( dDate ) + nYear := Year( dDate ) + nDoW := DoW( dDate ) - //Tracelog( "DateToGMT", cStr ) + cStr := aDays[ nDow ] + ", " + StrZero( nDay, 2 ) + "-" + aMonths[ nMonth ] + "-" + ; + Right( StrZero( nYear, 4 ), 2 ) + " " + cTime + " GMT" - Set( _SET_DATEFORMAT, cOldDateFormat ) + // Tracelog( "DateToGMT", cStr ) -RETURN cStr + Set( _SET_DATEFORMAT, cOldDateFormat ) + + RETURN cStr /* * AddSecondsToTime( cTime, nSecsToAdd, @nDaysAdded ) --> cNewTime @@ -434,92 +446,107 @@ RETURN cStr */ FUNCTION uhttpd_AddSecondsToTime( cTime, nSecsToAdd, nDaysAdded ) - LOCAL nOneDaySeconds := 86400 // 24 * 60 * 60 - LOCAL cNewTime, nSecs - __defaultNIL( @cTime, TIME() ) - __defaultNIL( @nSecsToAdd, 0 ) - // nDaysAdded can be already valued, so below i add to this value - __defaultNIL( @nDaysAdded, 0 ) + LOCAL nOneDaySeconds := 86400 // 24 * 60 * 60 + LOCAL cNewTime, nSecs - IF nSecsToAdd != 0 - nSecs := Secs( cTime ) + nSecsToAdd - nDaysAdded += Int( nSecs / nOneDaySeconds ) // Attention! nDaysAdded can be already filled - nSecs := nSecs - nDaysAdded - cNewTime := TSTRING( nSecs ) - ELSE - cNewTime := cTime - ENDIF + __defaultNIL( @cTime, Time() ) + __defaultNIL( @nSecsToAdd, 0 ) + // nDaysAdded can be already valued, so below i add to this value + __defaultNIL( @nDaysAdded, 0 ) -RETURN cNewTime + IF nSecsToAdd != 0 + nSecs := Secs( cTime ) + nSecsToAdd + nDaysAdded += Int( nSecs / nOneDaySeconds ) // Attention! nDaysAdded can be already filled + nSecs := nSecs - nDaysAdded + cNewTime := TString( nSecs ) + ELSE + cNewTime := cTime + ENDIF + + RETURN cNewTime FUNCTION uhttpd_TimeDiffAsSeconds( dDateStart, dDateEnd, cTimeStart, cTimeEnd ) - LOCAL aRetVal - __defaultNIL( @dDateEnd, DATE() ) - __defaultNIL( @cTimeEnd, TIME() ) + LOCAL aRetVal - aRetVal := FT_ELAPSED( dDateStart, dDateEnd, cTimeStart, cTimeEnd ) + __defaultNIL( @dDateEnd, Date() ) + __defaultNIL( @cTimeEnd, Time() ) -RETURN aRetVal[ 4, 2 ] + aRetVal := FT_ELAPSED( dDateStart, dDateEnd, cTimeStart, cTimeEnd ) + + RETURN aRetVal[ 4, 2 ] FUNCTION uhttpd_OutputString( cString, aTranslate, lProtected ) - LOCAL cHtml - __defaultNIL( @lProtected, .F. ) - __defaultNIL( @aTranslate, { { '"', '"' }, { ' ', ' ' } } ) - //TraceLog( "OutputString( cString, aTranslate, lProtected )", cString, aTranslate, lProtected ) - IF lProtected - cHtml := uhttpd_HtmlSpecialChars( cString ) - ELSE - cHtml := uhttpd_TranslateStrings( cString, aTranslate ) - ENDIF - //TraceLog( "OutputString() = cHtml", cHtml ) + LOCAL cHtml -RETURN cHtml + __defaultNIL( @lProtected, .F. ) + __defaultNIL( @aTranslate, { { '"', '"' }, { ' ', ' ' } } ) + + // TraceLog( "OutputString( cString, aTranslate, lProtected )", cString, aTranslate, lProtected ) + IF lProtected + cHtml := uhttpd_HtmlSpecialChars( cString ) + ELSE + cHtml := uhttpd_TranslateStrings( cString, aTranslate ) + ENDIF + // TraceLog( "OutputString() = cHtml", cHtml ) + + RETURN cHtml FUNCTION uhttpd_HtmlSpecialChars( cString, cQuote_style ) - LOCAL aTranslations := { ; - { '&', '&' } ,; - { '<', '<' } ,; - { '>', '>' } ; - } -RETURN uhttpd_HtmlConvertChars( cString, cQuote_style, aTranslations ) + + LOCAL aTranslations := { ; + { '&', '&' },; + { '<', '<' },; + { '>', '>' } ; + } + + RETURN uhttpd_HtmlConvertChars( cString, cQuote_style, aTranslations ) FUNCTION uhttpd_HtmlConvertChars( cString, cQuote_style, aTranslations ) - __defaultNIL( @cQuote_style, "ENT_COMPAT" ) - DO CASE - CASE cQuote_style == "ENT_COMPAT" - aAdd( aTranslations, { '"', '"' } ) - CASE cQuote_style == "ENT_QUOTES" - aAdd( aTranslations, { '"', '"' } ) - aAdd( aTranslations, { "'", ''' } ) - CASE cQuote_style == "ENT_NOQUOTES" - ENDCASE -RETURN uhttpd_TranslateStrings( cString, aTranslations ) + + __defaultNIL( @cQuote_style, "ENT_COMPAT" ) + DO CASE + CASE cQuote_style == "ENT_COMPAT" + AAdd( aTranslations, { '"', '"' } ) + CASE cQuote_style == "ENT_QUOTES" + AAdd( aTranslations, { '"', '"' } ) + AAdd( aTranslations, { "'", ''' } ) + CASE cQuote_style == "ENT_NOQUOTES" + ENDCASE + + RETURN uhttpd_TranslateStrings( cString, aTranslations ) FUNCTION uhttpd_CRLF2BR( cString ) - LOCAL aTranslations := { ; - { CRLF, '
' } ; - } -RETURN uhttpd_TranslateStrings( cString, aTranslations ) + + LOCAL aTranslations := { ; + { CRLF, '
' } ; + } + + RETURN uhttpd_TranslateStrings( cString, aTranslations ) FUNCTION uhttpd_TranslateStrings( cString, aTranslate ) - LOCAL aTran - FOR EACH aTran IN aTranslate - IF aTran[1] $ cString - cString := StrTran( cString, aTran[1], aTran[2] ) + + LOCAL aTran + + FOR EACH aTran IN aTranslate + IF aTran[ 1 ] $ cString + cString := StrTran( cString, aTran[ 1 ], aTran[ 2 ] ) ENDIF - NEXT -RETURN cString + NEXT + + RETURN cString FUNCTION uhttpd_StrStr( cString, cSearch ) - LOCAL nPos := AT( cSearch, cString ) - LOCAL cVal := iif( nPos > 0, SubStr( cString, nPos ), NIL ) -RETURN cVal + + LOCAL nPos := At( cSearch, cString ) + LOCAL cVal := iif( nPos > 0, SubStr( cString, nPos ), NIL ) + + RETURN cVal FUNCTION uhttpd_StrIStr( cString, cSearch ) -RETURN uhttpd_StrStr( Upper( cSearch ), Upper( cString ) ) + RETURN uhttpd_StrStr( Upper( cSearch ), Upper( cString ) ) FUNCTION uhttpd_HtmlEntities( cString, cQuote_style ) // LOCAL aTranslations := { ; // ATTENTION, this chars are visible only with OEM font @@ -623,6 +650,7 @@ FUNCTION uhttpd_HtmlEntities( cString, cQuote_style ) LOCAL aTranslations := {} LOCAL i + FOR i := 160 TO 255 aAdd( aTranslations, { hb_BChar( i ), "&#" + Str( i, 3 ) + ";" } ) NEXT @@ -630,136 +658,145 @@ FUNCTION uhttpd_HtmlEntities( cString, cQuote_style ) RETURN uhttpd_HtmlConvertChars( cString, cQuote_style, aTranslations ) PROCEDURE uhttpd_Die( cError ) - LOCAL oErr, lError - IF cError != NIL //THEN OutStd( cError ) - //__OutDebug( "cError: ", cError ) - //IF !oCGI:HeaderSent() - // oCGI:WriteLN( CRLF2BR( cError ), CRLF2BR( CRLF() ) ) - // //oCGI:WriteLN( CRLF2BR( hb_dumpVar(TConfigure():hConfig) ) ) - //ENDIF - // Generate Error - oErr := ErrorNew() - oErr:severity := ES_ERROR - oErr:genCode := EG_LIMIT - oErr:subSystem := "uhttpd_CGI" - oErr:subCode := 0 - oErr:description := cError - oErr:canRetry := .F. - oErr:canDefault := .F. - oErr:fileName := "" - oErr:osCode := 0 - lError := Eval( ErrorBlock(), oErr ) - IF !HB_ISLOGICAL( lError ) .OR. lError - __ErrInHandler() - ENDIF - Break( oErr ) - //QUIT - ELSE - QUIT - ENDIF -RETURN + + LOCAL oErr, lError + + IF cError != NIL // THEN OutStd( cError ) + // __OutDebug( "cError: ", cError ) + // IF !oCGI:HeaderSent() + // oCGI:WriteLN( CRLF2BR( cError ), CRLF2BR( CRLF() ) ) + // //oCGI:WriteLN( CRLF2BR( hb_dumpVar(TConfigure():hConfig) ) ) + // ENDIF + // Generate Error + oErr := ErrorNew() + oErr:severity := ES_ERROR + oErr:genCode := EG_LIMIT + oErr:subSystem := "uhttpd_CGI" + oErr:subCode := 0 + oErr:description := cError + oErr:canRetry := .F. + oErr:canDefault := .F. + oErr:fileName := "" + oErr:osCode := 0 + lError := Eval( ErrorBlock(), oErr ) + IF !HB_ISLOGICAL( lError ) .OR. lError + __errInHandler() + ENDIF + Break( oErr ) + // QUIT + ELSE + QUIT + ENDIF + + RETURN FUNCTION uhttpd_HTMLSpace( n ) -RETURN replicate( " ", n ) //" " + RETURN Replicate( " ", n ) // " " /* FROM FT LIB */ -STATIC FUNCTION FT_ELAPSED(dStart, dEnd, cTimeStart, cTimeEnd) - LOCAL nTotalSec, nCtr, nConstant, nTemp, aRetVal[4,2] +STATIC FUNCTION FT_ELAPSED( dStart, dEnd, cTimeStart, cTimeEnd ) - IF HB_ISSTRING( dStart ) - cTimeStart := dStart - dStart := DATE() - ELSEIF ! HB_ISDATE( dStart ) - dStart := DATE() - ENDIF + LOCAL nTotalSec, nCtr, nConstant, nTemp, aRetVal[ 4, 2 ] - IF HB_ISSTRING( dEnd ) - cTimeEnd := dEnd - dEnd := DATE() - ELSEIF ! HB_ISDATE( dEnd ) - dEnd := DATE() - ENDIF + IF HB_ISSTRING( dStart ) + cTimeStart := dStart + dStart := Date() + ELSEIF ! HB_ISDATE( dStart ) + dStart := Date() + ENDIF - iif( ! HB_ISSTRING( cTimeStart ), cTimeStart := '00:00:00', ) - iif( ! HB_ISSTRING( cTimeEnd ) , cTimeEnd := '00:00:00', ) + IF HB_ISSTRING( dEnd ) + cTimeEnd := dEnd + dEnd := Date() + ELSEIF ! HB_ISDATE( dEnd ) + dEnd := Date() + ENDIF - nTotalSec := (dEnd - dStart) * 86400 + ; - VAL(cTimeEnd) * 3600 + ; - VAL(SUBSTR(cTimeEnd,AT(':', cTimeEnd)+1,2)) * 60 + ; - iif(RAT(':', cTimeEnd) == AT(':', cTimeEnd), 0, ; - VAL(SUBSTR(cTimeEnd,RAT(':', cTimeEnd)+1))) - ; - VAL(cTimeStart) * 3600 - ; - VAL(SUBSTR(cTimeStart,AT(':', cTimeStart)+1,2)) * 60 - ; - iif(RAT(':', cTimeStart) == AT(':', cTimeStart), 0, ; - VAL(SUBSTR(cTimeStart,RAT(':', cTimeStart)+1))) + iif( ! HB_ISSTRING( cTimeStart ), cTimeStart := '00:00:00', ) + iif( ! HB_ISSTRING( cTimeEnd ), cTimeEnd := '00:00:00', ) - nTemp := nTotalSec + nTotalSec := ; + ( dEnd - dStart ) * 86400 + ; + Val( cTimeEnd ) * 3600 + ; + Val( SubStr( cTimeEnd, At( ':', cTimeEnd ) + 1, 2 ) ) * 60 + ; + iif( RAt( ':', cTimeEnd ) == At( ':', cTimeEnd ), 0, ; + Val( SubStr( cTimeEnd, RAt( ':', cTimeEnd ) + 1 ) ) ) - ; + Val( cTimeStart ) * 3600 - ; + Val( SubStr( cTimeStart, At( ':', cTimeStart ) + 1, 2 ) ) * 60 - ; + iif( RAt( ':', cTimeStart ) == At( ':', cTimeStart ), 0, ; + Val( SubStr( cTimeStart, RAt( ':', cTimeStart ) + 1 ) ) ) - FOR nCtr := 1 to 4 - nConstant := iif(nCtr == 1, 86400, iif(nCtr == 2, 3600, iif( nCtr == 3, 60, 1))) - aRetVal[nCtr,1] := INT(nTemp/nConstant) - aRetval[nCtr,2] := nTotalSec / nConstant - nTemp -= aRetVal[nCtr,1] * nConstant - NEXT + nTemp := nTotalSec -RETURN aRetVal + FOR nCtr := 1 TO 4 + nConstant := iif( nCtr == 1, 86400, iif( nCtr == 2, 3600, iif( nCtr == 3, 60, 1 ) ) ) + aRetVal[ nCtr, 1 ] := Int( nTemp / nConstant ) + aRetval[ nCtr, 2 ] := nTotalSec / nConstant + nTemp -= aRetVal[ nCtr, 1 ] * nConstant + NEXT + + RETURN aRetVal PROCEDURE uhttpd_WriteToLogFile( cString, cLog, lCreate ) - LOCAL nHandle, cSep - cSep := hb_ps() + LOCAL nHandle, cSep -// __defaultNIL( @cLog, AppFullPath() + cSep + "logfile.log" ) - __defaultNIL( @cLog, cSep + "tmp" + cSep + "logfile.log" ) - __defaultNIL( @lCreate, .F. ) + cSep := hb_ps() - IF cLog != NIL + // __defaultNIL( @cLog, AppFullPath() + cSep + "logfile.log" ) + __defaultNIL( @cLog, cSep + "tmp" + cSep + "logfile.log" ) + __defaultNIL( @lCreate, .F. ) - IF !lCreate .AND. hb_FileExists( cLog ) - nHandle := FOpen( cLog, FO_READWRITE + FO_SHARED ) - ELSE - nHandle := hb_FCreate( cLog, FC_NORMAL, FO_READWRITE + FO_SHARED ) - //__OutDebug( "Create ", nHandle ) - ENDIF + IF cLog != NIL - //cString := "PROCEDURE: " + ProcName( -2 ) + " " + cString + IF !lCreate .AND. hb_FileExists( cLog ) + nHandle := FOpen( cLog, FO_READWRITE + FO_SHARED ) + ELSE + nHandle := hb_FCreate( cLog, FC_NORMAL, FO_READWRITE + FO_SHARED ) + // __OutDebug( "Create ", nHandle ) + ENDIF - IF nHandle > 0 - FSeek( nHandle, 0, FS_END ) - FWrite( nHandle, cString ) - FWrite( nHandle, CRLF ) - FClose( nHandle ) - ENDIF - ENDIF -RETURN + // cString := "PROCEDURE: " + ProcName( -2 ) + " " + cString + + IF nHandle > 0 + FSeek( nHandle, 0, FS_END ) + FWrite( nHandle, cString ) + FWrite( nHandle, CRLF ) + FClose( nHandle ) + ENDIF + ENDIF + + RETURN /*********************************************************************************/ FUNCTION uhttpd_SplitFileName( cFile ) + LOCAL hFile LOCAL cPath, cName, cExt, cDrive, cSep - HB_FnameSplit( cFile, @cPath, @cName, @cExt, @cDrive ) - hFile := { ; - "FILE" => cFile ,; - "DRIVE" => cDrive ,; - "PATH" => cPath ,; - "NAME" => cName ,; - "EXT" => cExt ,; - "FULLPATH" => NIL ,; - "FULLNAME" => cName + cExt ,; - "UNC" => NIL ; - } + hb_FNameSplit( cFile, @cPath, @cName, @cExt, @cDrive ) + hFile := { ; + "FILE" => cFile,; + "DRIVE" => cDrive,; + "PATH" => cPath,; + "NAME" => cName,; + "EXT" => cExt,; + "FULLPATH" => NIL,; + "FULLNAME" => cName + cExt,; + "UNC" => NIL ; + } cSep := hb_ps() hFile:FULLPATH := iif( !Empty( hFile:PATH ), iif( !( Right( hFile:PATH, Len( cSep ) ) == cSep ), hFile:PATH + cSep, hFile:PATH ), "" ) hFile:UNC := hFile:FULLPATH + hFile:FULLNAME -RETURN hFile + RETURN hFile FUNCTION uhttpd_AppFullPath() - LOCAL hExeFile := uhttpd_SplitFileName( HB_ARGV(0) ) + + LOCAL hExeFile := uhttpd_SplitFileName( hb_argv( 0 ) ) LOCAL cPrgFullPath := hExeFile:FULLPATH LOCAL cPath, cSep @@ -770,11 +807,14 @@ FUNCTION uhttpd_AppFullPath() ELSE cPath := cPrgFullPath ENDIF -RETURN cPath + + RETURN cPath FUNCTION uhttpd_AppFullName() - LOCAL hExeFile := uhttpd_SplitFileName( HB_ARGV(0) ) -RETURN hExeFile:FULLNAME + + LOCAL hExeFile := uhttpd_SplitFileName( hb_argv( 0 ) ) + + RETURN hExeFile:FULLNAME FUNCTION uhttpd_CStrToVal( cExp, cType ) @@ -784,30 +824,30 @@ FUNCTION uhttpd_CStrToVal( cExp, cType ) ENDIF SWITCH cType - CASE 'C' - RETURN cExp + CASE 'C' + RETURN cExp - CASE 'P' - RETURN hb_HexToNum( cExp ) + CASE 'P' + RETURN hb_HexToNum( cExp ) - CASE 'D' - IF cExp[3] >= '0' .AND. cExp[3] <= '9' .AND. cExp[5] >= '0' .AND. cExp[5] <= '9' - RETURN sToD( cExp ) - ELSE - RETURN cToD( cExp ) - ENDIF + CASE 'D' + IF cExp[ 3 ] >= '0' .AND. cExp[ 3 ] <= '9' .AND. cExp[ 5 ] >= '0' .AND. cExp[ 5 ] <= '9' + RETURN SToD( cExp ) + ELSE + RETURN CToD( cExp ) + ENDIF - CASE 'L' - RETURN iif( cExp[1] == 'T' .OR. cExp[1] == 'Y' .OR. cExp[2] == 'T' .OR. cExp[2] == 'Y', .T., .F. ) + CASE 'L' + RETURN iif( cExp[ 1 ] == 'T' .OR. cExp[ 1 ] == 'Y' .OR. cExp[ 2 ] == 'T' .OR. cExp[ 2 ] == 'Y', .T., .F. ) - CASE 'N' - RETURN Val( cExp ) + CASE 'N' + RETURN Val( cExp ) - CASE 'M' - RETURN cExp + CASE 'M' + RETURN cExp - CASE 'U' - RETURN NIL + CASE 'U' + RETURN NIL /* CASE 'A' @@ -820,18 +860,19 @@ FUNCTION uhttpd_CStrToVal( cExp, cType ) Throw( ErrorNew( "CSTR", 0, 3101, ProcName(), "Argument error", { cExp, cType } ) ) */ - OTHERWISE - Throw( ErrorNew( "CSTR", 0, 3101, ProcName(), "Argument error", { cExp, cType } ) ) + OTHERWISE + Throw( ErrorNew( "CSTR", 0, 3101, ProcName(), "Argument error", { cExp, cType } ) ) ENDSWITCH -RETURN NIL + RETURN NIL FUNCTION uhttpd_GetField( cVar, cType ) + LOCAL xVal LOCAL nPos := hb_HPos( _Request, cVar ) - IF nPos > 0 //cVar IN ::h_Request:Keys - xVal := hb_HValueAt( _Request, nPos ) //::h_Request[ cVar ] + IF nPos > 0 // cVar IN ::h_Request:Keys + xVal := hb_HValueAt( _Request, nPos ) // ::h_Request[ cVar ] IF Empty( xVal ) xVal := NIL ENDIF @@ -840,18 +881,24 @@ FUNCTION uhttpd_GetField( cVar, cType ) ENDIF ENDIF -RETURN xVal + RETURN xVal FUNCTION uhttpd_SetField( cVar, cVal ) + LOCAL xVal := uhttpd_HGetValue( _Request, cVar ) + _Request[ cVar ] := cVal -RETURN xVal + + RETURN xVal FUNCTION uhttpd_HGetValue( hHash, cKey ) + LOCAL nPos LOCAL xVal + IF hHash != NIL - xVal := iif( ( nPos := hb_HPos( hHash, cKey )) == 0, NIL, hb_HValueAt( hHash, nPos) ) + xVal := iif( ( nPos := hb_HPos( hHash, cKey ) ) == 0, NIL, hb_HValueAt( hHash, nPos ) ) ENDIF - //RETURN iif( cKey IN hHash:Keys, hHash[ cKey ], NIL ) + // RETURN iif( cKey IN hHash:Keys, hHash[ cKey ], NIL ) + RETURN xVal diff --git a/harbour/extras/httpsrv/cookie.prg b/harbour/extras/httpsrv/cookie.prg index 1a802706ba..d6ce265a0b 100644 --- a/harbour/extras/httpsrv/cookie.prg +++ b/harbour/extras/httpsrv/cookie.prg @@ -55,7 +55,7 @@ MEMVAR _COOKIE FUNCTION uhttpd_CookieNew( cDomain, cPath, nExpireDays, nExpireSecs ) -RETURN uhttpd_Cookie():New( cDomain, cPath, nExpireDays, nExpireSecs ) + RETURN uhttpd_Cookie():New( cDomain, cPath, nExpireDays, nExpireSecs ) CLASS uhttpd_Cookie @@ -83,6 +83,7 @@ ENDCLASS // ------------------------------ METHOD SetCookieDefaults( cDomain, cPath, nExpireDays, nExpireSecs ) CLASS uhttpd_Cookie + IF cDomain != NIL ::cDomain := cDomain ENDIF @@ -95,9 +96,11 @@ METHOD SetCookieDefaults( cDomain, cPath, nExpireDays, nExpireSecs ) CLASS uhttp IF nExpireSecs != NIL ::nExpireSecs := nExpireSecs ENDIF + RETURN NIL METHOD SetCookie( cCookieName, xValue, cDomain, cPath, cExpires, lSecure, lHttpOnly ) CLASS uhttpd_Cookie + LOCAL cStr, nPos, nCookies __defaultNIL( @cDomain, ::cDomain ) @@ -112,24 +115,24 @@ METHOD SetCookie( cCookieName, xValue, cDomain, cPath, cExpires, lSecure, lHttpO IF xValue != NIL // Search if a cookie already exists - // case sensitive - IF ( nPos := aScan( ::aCookies, {| e | e[ 1 ] == cCookieName } ) ) > 0 - ::aCookies[ nPos ][ 2 ] := uhttpd_UrlEncode( hb_cStr( xValue ) ) + // case sensitive + IF ( nPos := AScan( ::aCookies, {| e | e[ 1 ] == cCookieName } ) ) > 0 + ::aCookies[ nPos ][ 2 ] := uhttpd_UrlEncode( hb_CStr( xValue ) ) ELSE - aAdd( ::aCookies, { cCookieName, uhttpd_UrlEncode( hb_cStr( xValue ) ) } ) + AAdd( ::aCookies, { cCookieName, uhttpd_UrlEncode( hb_CStr( xValue ) ) } ) ENDIF ELSE - IF ( nPos := aScan( ::aCookies, {| e | e[ 1 ] == cCookieName } ) ) > 0 - hb_aDel( ::aCookies, nPos, .T. ) + IF ( nPos := AScan( ::aCookies, {| e | e[ 1 ] == cCookieName } ) ) > 0 + hb_ADel( ::aCookies, nPos, .T. ) ENDIF ENDIF // Rebuild cookie string as per RFC2616 (comma separated list) cStr := "" nCookies := Len( ::aCookies ) - aEval( ::aCookies, {| e, i | cStr += e[ 1 ] + "=" + e[ 2 ] + iif( i < nCookies, ",", "" ) } ) + AEval( ::aCookies, {| e, i | cStr += e[ 1 ] + "=" + e[ 2 ] + iif( i < nCookies, ",", "" ) } ) - //cStr := cCookieName + "=" + uhttpd_UrlEncode( hb_cStr( xValue ) ) + // cStr := cCookieName + "=" + uhttpd_UrlEncode( hb_cStr( xValue ) ) IF cDomain != NIL cStr += "; domain=" + cDomain @@ -141,45 +144,50 @@ METHOD SetCookie( cCookieName, xValue, cDomain, cPath, cExpires, lSecure, lHttpO cStr += "; expires=" + cExpires ENDIF IF HB_ISLOGICAL( lSecure ) .AND. lSecure - cStr += "; secure" + cStr += "; secure" ENDIF // Send the header - //uhttpd_SetHeader( "Set-Cookie", cStr, .F. ) + // uhttpd_SetHeader( "Set-Cookie", cStr, .F. ) uhttpd_SetHeader( "Set-Cookie", cStr ) RETURN NIL METHOD DeleteCookie( cCookieName, cDomain, cPath, lSecure ) CLASS uhttpd_Cookie - LOCAL cExpires := uhttpd_DateToGMT( DATE() - 1 ) // Setting date in the past delete cookie + + LOCAL cExpires := uhttpd_DateToGMT( Date() - 1 ) // Setting date in the past delete cookie ::SetCookie( cCookieName, "", cDomain, cPath, cExpires, lSecure ) RETURN NIL METHOD DeleteAllCookies( cDomain, cPath, lSecure ) CLASS uhttpd_Cookie + LOCAL cCookieName FOR EACH cCookieName IN _COOKIE:Keys - //::DeleteCookie( Substr( cCookieName, 2 ), cDomain, cPath, lSecure ) - ::DeleteCookie( cCookieName, cDomain, cPath, lSecure ) + // ::DeleteCookie( Substr( cCookieName, 2 ), cDomain, cPath, lSecure ) + ::DeleteCookie( cCookieName, cDomain, cPath, lSecure ) NEXT RETURN NIL METHOD GetCookie( cCookieName ) CLASS uhttpd_Cookie + LOCAL cHeader, cRet LOCAL nPos := 1 + DO WHILE .T. - IF ( cHeader := uhttpd_GetHeader( "Set-Cookie", @nPos ) ) != NIL - IF cHeader == cCookieName - cRet := cHeader - EXIT - ELSE - nPos++ - ENDIF - ELSE - EXIT - ENDIF + IF ( cHeader := uhttpd_GetHeader( "Set-Cookie", @nPos ) ) != NIL + IF cHeader == cCookieName + cRet := cHeader + EXIT + ELSE + nPos++ + ENDIF + ELSE + EXIT + ENDIF ENDDO + RETURN cRet diff --git a/harbour/extras/httpsrv/modules/cookie.prg b/harbour/extras/httpsrv/modules/cookie.prg index 0a79960c0d..3122552f80 100644 --- a/harbour/extras/httpsrv/modules/cookie.prg +++ b/harbour/extras/httpsrv/modules/cookie.prg @@ -55,15 +55,16 @@ MEMVAR _REQUEST #xcommand TEXT INTO => #pragma __cstream|+=%s -//#pragma escapedstrings = on +// #pragma escapedstrings = on FUNCTION HRBMAIN() + LOCAL cHtml := "" LOCAL cCookie := uhttpd_GetField( "mycookie" ) LOCAL cAction := uhttpd_GetField( "action" ) LOCAL oCookie - //hb_ToOutDebug( "cCookie = %s, cAction = %s\n\r", hb_ValToExp( cCookie ), cAction ) + // hb_ToOutDebug( "cCookie = %s, cAction = %s\n\r", hb_ValToExp( cCookie ), cAction ) hb_default( @cCookie, "" ) hb_default( @cAction, "" ) @@ -108,7 +109,7 @@ Pressing button you will redirect to /info page. Look at COOKIE values. oCookie := uhttpd_CookieNew( "localhost", "/", 1, 0 ) oCookie:SetCookie( "mycookie", cCookie ) uhttpd_SetHeader( "Location", "/info" ) - //uhttpd_Write( "cookie set Go to info page" ) + // uhttpd_Write( "cookie set Go to info page" ) RETURN NIL ENDIF diff --git a/harbour/extras/httpsrv/modules/showcounter.prg b/harbour/extras/httpsrv/modules/showcounter.prg index 179e1b0952..e6e2407885 100644 --- a/harbour/extras/httpsrv/modules/showcounter.prg +++ b/harbour/extras/httpsrv/modules/showcounter.prg @@ -104,10 +104,10 @@ STATIC FUNCTION CreateCounter( cValue, cBaseImage ) hb_default( @cBaseImage, "57chevy.gif" ) IF ! hb_FileExists( IMAGES_IN + cBaseImage ) - //hb_ToOutDebug( "ERROR: Base Image File '" + IMAGES_IN + cBaseImage + "' not found" ) - //THROW( "ERROR: Base Image File '" + IMAGES_IN + cBaseImage + "' not found" ) + // hb_ToOutDebug( "ERROR: Base Image File '" + IMAGES_IN + cBaseImage + "' not found" ) + // THROW( "ERROR: Base Image File '" + IMAGES_IN + cBaseImage + "' not found" ) RETURN NIL - //ELSE + // ELSE // hb_ToOutDebug( "ERROR: Base Image File '" + IMAGES_IN + cBaseImage + "' FOUND" ) ENDIF @@ -156,7 +156,7 @@ STATIC FUNCTION CreateCounter( cValue, cBaseImage ) /* extracts single digits */ FOR n := 1 TO nDigits oTemp := oIDigits:Copy( ( n - 1 ) * nNumWidth, 0, nNumWidth, nHeight ) - //oTemp:SaveGif( IMAGES_OUT + StrZero( n - 1, 2 ) + ".gif" ) + // oTemp:SaveGif( IMAGES_OUT + StrZero( n - 1, 2 ) + ".gif" ) // Here I have to clone the image, otherwise on var destruction I loose // the image in memory AAdd( aNumberImages, oTemp:Clone() ) @@ -184,7 +184,7 @@ STATIC FUNCTION CreateCounter( cValue, cBaseImage ) // Retrieve the number from array in memory oTemp := aNumberImages[ Val( SubStr( cValue, n, 1 ) ) + 1 ]:Clone() // Save it to show the number for a position - //oTemp:SaveGif( IMAGES_OUT + "Pos_" + StrZero( n, 2 ) + ".gif" ) + // oTemp:SaveGif( IMAGES_OUT + "Pos_" + StrZero( n, 2 ) + ".gif" ) // Set the digit as tile that I have to use to fill position in counter oI:SetTile( oTemp ) // Fill the position with the image digit diff --git a/harbour/extras/httpsrv/modules/tableservletdb.prg b/harbour/extras/httpsrv/modules/tableservletdb.prg index f0fa31167b..88cf908b21 100644 --- a/harbour/extras/httpsrv/modules/tableservletdb.prg +++ b/harbour/extras/httpsrv/modules/tableservletdb.prg @@ -154,15 +154,15 @@ METHOD Open() CLASS TableManager LOCAL cDBF := ::cTable - //hb_ToOutDebug( "CurPath = %s", hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() ) + // hb_ToOutDebug( "CurPath = %s", hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() ) - //hb_ToOutDebug( "before: cDBF = %s, Used() = %s\n", cDBF, Used() ) + // hb_ToOutDebug( "before: cDBF = %s, Used() = %s\n", cDBF, Used() ) IF ! ::lOpened CLOSE ALL USE ( cDBF ) ALIAS table SHARED NEW - //hb_ToOutDebug( "after: cDBF = %s, Used() = %s\n", cDBF, Used() ) + // hb_ToOutDebug( "after: cDBF = %s, Used() = %s\n", cDBF, Used() ) ::lOpened := Used() ENDIF @@ -182,8 +182,8 @@ METHOD READ() CLASS TableManager IF ::lOpened table->( dbGoTop() ) - //n := 0 - DO WHILE table->( !EOF() ) //.AND. ++n < 50 + // n := 0 + DO WHILE table->( !Eof() ) // .AND. ++n < 50 hMap := { => } hMap[ "recno" ] := StrZero( table->( RecNo() ), 4 ) @@ -252,7 +252,7 @@ METHOD getXmlData( page ) CLASS TableManager // Check the validity of the page index. IF startIndex < 0 .OR. startIndex >= stopIndex - //throw new IllegalArgumentException("Page index is out of bounds."); + // throw new IllegalArgumentException("Page index is out of bounds."); ENDIF xml := BasicXML():New() @@ -371,9 +371,9 @@ METHOD xmlEncode( input ) CLASS TableManager // CASE ' ' // out += " " // EXIT - CASE Chr( 9 ) //E'\t' - CASE Chr( 13 ) //E'\r' - CASE Chr( 10 ) //E'\n' + CASE Chr( 9 ) // E'\t' + CASE Chr( 13 ) // E'\r' + CASE Chr( 10 ) // E'\n' out += c EXIT OTHERWISE diff --git a/harbour/extras/httpsrv/session.prg b/harbour/extras/httpsrv/session.prg index 42554e3a5b..b2c68ce4c2 100644 --- a/harbour/extras/httpsrv/session.prg +++ b/harbour/extras/httpsrv/session.prg @@ -63,7 +63,7 @@ MEMVAR _COOKIE, _SESSION, _REQUEST, _SERVER #define MY_CRCKEY "UhTTpK3y76" FUNCTION uhttpd_SessionNew( cSessionName, cSessionPath ) -RETURN uhttpd_Session():New( cSessionName, cSessionPath ) + RETURN uhttpd_Session():New( cSessionName, cSessionPath ) CLASS uhttpd_Session @@ -102,7 +102,7 @@ CLASS uhttpd_Session METHOD Encode() // INLINE HB_Serialize( _SESSION ) METHOD Decode() - HIDDEN: + HIDDEN: VAR oCookie VAR cSID @@ -112,7 +112,7 @@ CLASS uhttpd_Session VAR nGc_Probability INIT 33 // Every 1/3 of checks i'll lunch Session GC VAR nGc_MaxLifeTime INIT 1440 // seconds - Number of seconds after gc can delete a session // VAR cSerialize_Handler INIT "HBHTMLLIB" - VAR nCookie_LifeTime INIT 3600 //0 // Number of seconds to keep cookie, 0 = until browser is closed + VAR nCookie_LifeTime INIT 3600 // 0 // Number of seconds to keep cookie, 0 = until browser is closed VAR cCookie_Path INIT "/" VAR cCookie_Domain VAR lCookie_Secure INIT .F. @@ -126,12 +126,12 @@ CLASS uhttpd_Session VAR lUse_Trans_SID INIT .F. // .F. = no SID appended to URL // Session Storage code blocks - VAR bOpen //INIT {| cPath, cName | ::SessionOpen( cPath, cName ) } - VAR bClose //INIT {|| ::SessionClose() } - VAR bRead //INIT {| cID | ::SessionRead( cID ) } - VAR bWrite //INIT {| cID, cData | ::SessionWrite( cID, cData ) } - VAR bDestroy //INIT {| cID | ::SessionDestroy( cID ) } - VAR bGC //INIT {| nMaxLifeTime | ::SessionGC( nMaxLifeTime ) } + VAR bOpen // INIT {| cPath, cName | ::SessionOpen( cPath, cName ) } + VAR bClose // INIT {|| ::SessionClose() } + VAR bRead // INIT {| cID | ::SessionRead( cID ) } + VAR bWrite // INIT {| cID, cData | ::SessionWrite( cID, cData ) } + VAR bDestroy // INIT {| cID | ::SessionDestroy( cID ) } + VAR bGC // INIT {| nMaxLifeTime | ::SessionGC( nMaxLifeTime ) } VAR nFileRetry INIT 10 // How many time try to open / write / delete file in case of error VAR nFileWait INIT 500 // How many milliseconds have to wait before retry @@ -156,12 +156,12 @@ ENDCLASS METHOD New( cSessionName, cSessionPath ) CLASS uhttpd_Session - //hb_ToOutDebug( "cSessionName = %s, cSessionPath = %s\n\r", cSessionName, cSessionPath ) + // hb_ToOutDebug( "cSessionName = %s, cSessionPath = %s\n\r", cSessionName, cSessionPath ) __defaultNIL( @cSessionName, "SESSION" ) __defaultNIL( @cSessionPath, ::cSavePath ) - //::cSID := ::GenerateSID() + // ::cSID := ::GenerateSID() // As default we will use FILES - this is FILE version ::bOpen := {| cPath, cName | ::SessionOpen( cPath, cName ) } @@ -191,6 +191,7 @@ METHOD New( cSessionName, cSessionPath ) CLASS uhttpd_Session RETURN Self METHOD Start( cSID ) CLASS uhttpd_Session + LOCAL lSendCookie := .T. LOCAL lDefine_SID := .T. LOCAL xVal, nRand, nPos @@ -200,9 +201,9 @@ METHOD Start( cSID ) CLASS uhttpd_Session ::cSID := cSID ENDIF - //hb_toOutDebug( "cSID = %s, ::cSID = %s\n\r", cSID, ::cSID ) + // hb_toOutDebug( "cSID = %s, ::cSID = %s\n\r", cSID, ::cSID ) - //TraceLog( "Active Sessions : " + hb_cStr( ::nActiveSessions ) ) + // TraceLog( "Active Sessions : " + hb_cStr( ::nActiveSessions ) ) IF ::nActiveSessions != 0 RETURN .F. @@ -210,19 +211,19 @@ METHOD Start( cSID ) CLASS uhttpd_Session // Start checking ID from global vars IF ( nPos := hb_HPos( _REQUEST, ::cName ) ) > 0 - //::cSID := ::oCGI:h_Request[ ::cName ] + // ::cSID := ::oCGI:h_Request[ ::cName ] ::cSID := hb_HValueAt( _REQUEST, nPos ) IF HB_ISARRAY( ::cSID ) ::cSID := ::cSID[ 1 ] // Get Only 1-st ENDIF lSendCookie := .F. lDefine_SID := .F. - //::oCGI:ToLogFile( "::cSID = " + hb_cStr( ::cSID ), "/pointtoit/tmp/log.txt" ) + // ::oCGI:ToLogFile( "::cSID = " + hb_cStr( ::cSID ), "/pointtoit/tmp/log.txt" ) ENDIF IF !Empty( ::cSID ) .AND. !::CheckSID() // Check if the SID is NOT valid, someone altered it - //::oCGI:ToLogFile( "::cSID = " + hb_cStr( ::cSID ) + " SID is NOT valid, someone altered it", "/pointtoit/tmp/log.txt" ) + // ::oCGI:ToLogFile( "::cSID = " + hb_cStr( ::cSID ) + " SID is NOT valid, someone altered it", "/pointtoit/tmp/log.txt" ) ::cSID := NIL // invalidate current SID, i'll generate a new one lSendCookie := .T. lDefine_SID := .T. @@ -231,12 +232,12 @@ METHOD Start( cSID ) CLASS uhttpd_Session IF !Empty( ::cSID ) .AND. !Empty( ::cReferrer_Check ) // TODO: fix - //oUrl := TUrl():New( ::cReferrer_Check ) + // oUrl := TUrl():New( ::cReferrer_Check ) hUrl := uhttpd_SplitUrl( ::cReferrer_Check ) - //hb_ToOutDebug( "hUrl = %s\n\r", hb_ValToExp( hUrl ) ) + // hb_ToOutDebug( "hUrl = %s\n\r", hb_ValToExp( hUrl ) ) - //IF !( oUrl:cServer == _SERVER[ "SERVER_NAME" ] ) + // IF !( oUrl:cServer == _SERVER[ "SERVER_NAME" ] ) IF !( hUrl[ "HOST" ] == _SERVER[ "SERVER_NAME" ] ) ::cSID := NIL // invalidate current SID, i'll generate a new one lSendCookie := .T. @@ -266,7 +267,7 @@ METHOD Start( cSID ) CLASS uhttpd_Session // Should we send a cookie? IF lSendCookie - ::oCookie:SetCookie( ::cName, ::cSID, ::cCookie_Domain, ::cCookie_Path, uhttpd_DateToGMT(,,,::nCookie_LifeTime), ::lCookie_Secure ) + ::oCookie:SetCookie( ::cName, ::cSID, ::cCookie_Domain, ::cCookie_Path, uhttpd_DateToGMT(,,, ::nCookie_LifeTime ), ::lCookie_Secure ) ENDIF // Should we define the SID? @@ -280,27 +281,27 @@ METHOD Start( cSID ) CLASS uhttpd_Session // Send caching headers // Start session - IF !::Open(::cSavePath, ::cName ) + IF !::Open( ::cSavePath, ::cName ) uhttpd_Die( 'ERROR: Failed to open session file' ) ENDIF // Read session data IF !( ( xVal := ::Read( ::cSID ) ) == NIL ) - //TraceLog( "Read session data - xVal", xVal ) - //::oCGI:ToLogFile( "xval = " + hb_cStr( xVal ), "/pointtoit/tmp/log.txt" ) + // TraceLog( "Read session data - xVal", xVal ) + // ::oCGI:ToLogFile( "xval = " + hb_cStr( xVal ), "/pointtoit/tmp/log.txt" ) // Decode session data ::Decode( xVal ) - //::oCGI:ToLogFile( "decoded", "/pointtoit/tmp/log.txt" ) + // ::oCGI:ToLogFile( "decoded", "/pointtoit/tmp/log.txt" ) ENDIF // Send HTTP cache headers ::SendCacheLimiter() // Check if we should clean up (call the garbage collection routines) - //TraceLog( "::nGc_probability = " + hb_cStr( ::nGc_probability ) ) + // TraceLog( "::nGc_probability = " + hb_cStr( ::nGc_probability ) ) IF ::nGc_probability > 0 - nRand := HB_RandomInt( 1, 100 ) - //TraceLog( "::nGc_probability - nRand = " + hb_cStr( nRand ) ) + nRand := hb_RandomInt( 1, 100 ) + // TraceLog( "::nGc_probability - nRand = " + hb_cStr( nRand ) ) IF nRand <= ::nGc_Probability ::GC( ::nGc_MaxLifeTime ) ENDIF @@ -322,9 +323,10 @@ METHOD Destroy() CLASS uhttpd_Session RETURN .T. METHOD Close() CLASS uhttpd_Session + LOCAL cVal - //TraceLog( "Session Close() - oCGI:h_Session", DumpValue( oCGI:h_Session ) ) + // TraceLog( "Session Close() - oCGI:h_Session", DumpValue( oCGI:h_Session ) ) IF ::nActiveSessions == 0 RETURN .F. @@ -339,7 +341,7 @@ METHOD Close() CLASS uhttpd_Session ENDIF // Close session IF !Eval( ::bClose ) - uhttpd_Die('Session could not be closed.') + uhttpd_Die( 'Session could not be closed.' ) ENDIF ::nActiveSessions-- @@ -359,11 +361,15 @@ METHOD GC( nMaxLifeTime ) CLASS uhttpd_Session METHOD IsRegistered() CLASS uhttpd_Session + LOCAL lRegistered := .F. + RETURN lRegistered METHOD CacheLimiter( cNewLimiter ) CLASS uhttpd_Session + LOCAL cOldLimiter := ::cCache_Limiter + IF cNewLimiter != NIL IF cNewLimiter $ "none/nocache/private/private_no_expire/public" ::cCache_Limiter := cNewLimiter @@ -371,9 +377,11 @@ METHOD CacheLimiter( cNewLimiter ) CLASS uhttpd_Session uhttpd_Die( "ERROR: uhttpd_Session:CacheLimiter() - New Limiter is incorrect" ) ENDIF ENDIF + RETURN cOldLimiter METHOD SetCookieParams( nLifeTime, cPath, cDomain, lSecure ) CLASS uhttpd_Session + IF nLifeTime != NIL ::nCookie_LifeTime := nLifeTime ENDIF @@ -386,35 +394,43 @@ METHOD SetCookieParams( nLifeTime, cPath, cDomain, lSecure ) CLASS uhttpd_Sessi IF lSecure != NIL ::lCookie_Secure := lSecure ENDIF + RETURN NIL METHOD RegenerateID() CLASS uhttpd_Session + ::cSID := ::GenerateSID() IF ::lUse_Cookies - ::oCookie:SetCookie( ::cName, ::cSID, ::cCookie_Domain, ::cCookie_Path, uhttpd_DateToGMT(,,,::nCookie_LifeTime), ::lCookie_Secure ) + ::oCookie:SetCookie( ::cName, ::cSID, ::cCookie_Domain, ::cCookie_Path, uhttpd_DateToGMT(,,, ::nCookie_LifeTime ), ::lCookie_Secure ) ENDIF + RETURN ::cSID METHOD SaveCookie() CLASS uhttpd_Session + LOCAL cExpires := uhttpd_DateToGMT( Date(), Time(),, ::nCookie_LifeTime ) LOCAL cKey - //oCGI:SetCookie( ::cName, ::cSID, ::cCookie_Domain, ::cCookie_Path, cExpires, ::lCookie_Secure ) + + // oCGI:SetCookie( ::cName, ::cSID, ::cCookie_Domain, ::cCookie_Path, cExpires, ::lCookie_Secure ) FOR EACH cKey IN _SESSION:Keys ::oCookie:SetCookie( ::cName + "_" + cKey, _SESSION[ cKey ], ::cCookie_Domain, ::cCookie_Path, cExpires, ::lCookie_Secure ) NEXT + RETURN NIL -//METHOD ReadCookie() +// METHOD ReadCookie() // oCGI:SetCookie( ::cName, ::cSID, ::cCookie_Domain, ::cCookie_Path, cExpires, ::lCookie_Secure ) // RETURN NIL METHOD GetSessionVars( aHashVars, cFields, cSeparator ) CLASS uhttpd_Session + LOCAL aNotSessionFlds := {} LOCAL aField, cField, aFields LOCAL cName, xValue LOCAL cSessPrefix := ::cName + "_" LOCAL cFieldsNotInSession := "" LOCAL cSessVarName + __defaultNIL( @cSeparator, "&" ) aFields := hb_regexSplit( cSeparator, cFields ) @@ -425,53 +441,53 @@ METHOD GetSessionVars( aHashVars, cFields, cSeparator ) CLASS uhttpd_Session LOOP ENDIF - cSessVarName := LTrim( aField[1] ) - //cName := "_" + LTrim( aField[1] ) // ERROR ON VAR NAME WITH LEN 1. X - //cName := LTrim( aField[1] ) // ERROR ON VAR NAME WITH LEN 1. X + cSessVarName := LTrim( aField[ 1 ] ) + // cName := "_" + LTrim( aField[ 1 ] ) // ERROR ON VAR NAME WITH LEN 1. X + // cName := LTrim( aField[ 1 ] ) // ERROR ON VAR NAME WITH LEN 1. X - //TraceLog( "SESSION: cSessVarName, cSessPrefix, Left( cSessVarName, Len( cSessPrefix ) )", ; + // TraceLog( "SESSION: cSessVarName, cSessPrefix, Left( cSessVarName, Len( cSessPrefix ) )", ; // cSessVarName, cSessPrefix, Left( cSessVarName, Len( cSessPrefix ) ) ) IF Left( cSessVarName, Len( cSessPrefix ) ) == cSessPrefix // IF Left part of var is equal to session prefixname i.e. "SESSION" - cName := Substr( cSessVarName, Len( cSessPrefix ) + 1 ) - xValue := uhttpd_UrlDecode( aField[2] ) - //TraceLog( "SESSION: cName, xValue", cName, xValue ) + cName := SubStr( cSessVarName, Len( cSessPrefix ) + 1 ) + xValue := uhttpd_UrlDecode( aField[ 2 ] ) + // TraceLog( "SESSION: cName, xValue", cName, xValue ) - //Tracelog( "cName, xValue", cName, xValue ) + // Tracelog( "cName, xValue", cName, xValue ) // is it an array entry? - IF Substr( cName, Len( cName ) - 1 ) == "[]" - cName := Substr( cName, 1, Len( cName ) - 2 ) - //aHashVars[ cName ] := { xValue } + IF SubStr( cName, Len( cName ) - 1 ) == "[]" + cName := SubStr( cName, 1, Len( cName ) - 2 ) + // aHashVars[ cName ] := { xValue } aHashVars[ cName ] := { xValue } - //aHashVars:Keys( cName ) - //__ObjSendMsg( aHashVars, "_" + cName, { xValue } ) // variant from Ron to handle 1 lenght name + // aHashVars:Keys( cName ) + // __ObjSendMsg( aHashVars, "_" + cName, { xValue } ) // variant from Ron to handle 1 lenght name ELSE - //aHashVars[ cName ] := xValue + // aHashVars[ cName ] := xValue aHashVars[ cName ] := xValue - //aHashVars:Keys( cName ) - //__ObjSendMsg( aHashVars, "_" + cName, xValue ) // variant from Ron to handle 1 lenght name + // aHashVars:Keys( cName ) + // __ObjSendMsg( aHashVars, "_" + cName, xValue ) // variant from Ron to handle 1 lenght name ENDIF - //Tracelog( "aHashVars, cName, xValue", DumpValue( aHashVars ), cName, xValue ) + // Tracelog( "aHashVars, cName, xValue", DumpValue( aHashVars ), cName, xValue ) ELSE - aAdd( aNotSessionFlds, aField ) + AAdd( aNotSessionFlds, aField ) ENDIF NEXT IF !Empty( aNotSessionFlds ) FOR EACH aField IN aNotSessionFlds - cFieldsNotInSession += aField[1] + "=" + aField[2] + "&" + cFieldsNotInSession += aField[ 1 ] + "=" + aField[ 2 ] + "&" NEXT // Delete last & char cFieldsNotInSession := Left( cFieldsNotInSession, Len( cFieldsNotInSession ) - 1 ) ENDIF - //TraceLog( "SESSION: cFieldsNotInSession", cFieldsNotInSession ) + // TraceLog( "SESSION: cFieldsNotInSession", cFieldsNotInSession ) RETURN cFieldsNotInSession @@ -482,6 +498,7 @@ METHOD GetSessionVars( aHashVars, cFields, cSeparator ) CLASS uhttpd_Session */ METHOD GenerateSID( cCRCKey ) CLASS uhttpd_Session + LOCAL cSID, nSIDCRC, cSIDCRC, n, cTemp LOCAL nLenSID := 25 LOCAL cBaseKeys := "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" @@ -489,18 +506,19 @@ METHOD GenerateSID( cCRCKey ) CLASS uhttpd_Session LOCAL cRet LOCAL nRand, nKey := 0 LOCAL nLenTemp - //LOCAL a := 0 + + // LOCAL a := 0 // Max Lenght must to be 10 -// __defaultNIL( @cCRCKey, "3InFoW4lL5" ) + // __defaultNIL( @cCRCKey, "3InFoW4lL5" ) __defaultNIL( @cCRCKey, MY_CRCKEY ) /* Let's generate the sequence */ - //cSID := Space( nLenSID ) + // cSID := Space( nLenSID ) cSID := "" FOR n := 1 TO nLenSID - 5 // 5 = CRC Length - nRand := HB_RandomInt( 1, nLenKeys ) - //cSID[ n ] := cBaseKeys[ nRand ] + nRand := hb_RandomInt( 1, nLenKeys ) + // cSID[ n ] := cBaseKeys[ nRand ] cSID += SubStr( cBaseKeys, nRand, 1 ) nKey += nRand NEXT @@ -510,39 +528,41 @@ METHOD GenerateSID( cCRCKey ) CLASS uhttpd_Session cSIDCRC := "" nLenTemp := Len( cTemp ) FOR n := 1 TO nLenTemp - //cSIDCRC += cCRCKey[ Val( cTemp[ n ] ) + 1 ] - cSIDCRC += SubStr( cCRCKey, Val( SubStr( cTemp, n, 1 ) ) + 1, 1 ) - //::oCGI:ToLogFile( "cCRCKey = " + hb_cStr( SubStr( cCRCKey, Val( SubStr( cTemp, n, 1 ) ) + 1, 1 ) ), "/pointtoit/tmp/log.txt" ) + // cSIDCRC += cCRCKey[ Val( cTemp[ n ] ) + 1 ] + cSIDCRC += SubStr( cCRCKey, Val( SubStr( cTemp, n, 1 ) ) + 1, 1 ) + // ::oCGI:ToLogFile( "cCRCKey = " + hb_cStr( SubStr( cCRCKey, Val( SubStr( cTemp, n, 1 ) ) + 1, 1 ) ), "/pointtoit/tmp/log.txt" ) NEXT cRet := cSID + cSIDCRC - //::oCGI:ToLogFile( "::GenerateSID() = " + hb_cStr( cSID ) + " " + hb_cStr( cSIDCRC ), "/pointtoit/tmp/log.txt" ) + // ::oCGI:ToLogFile( "::GenerateSID() = " + hb_cStr( cSID ) + " " + hb_cStr( cSIDCRC ), "/pointtoit/tmp/log.txt" ) - //TraceLog( "Generate SID: cRet, cSID, nSIDCRC, cTemp, cSIDCRC, nKey, a", cRet, cSID, nSIDCRC, cTemp, cSIDCRC, nKey, a ) + // TraceLog( "Generate SID: cRet, cSID, nSIDCRC, cTemp, cSIDCRC, nKey, a", cRet, cSID, nSIDCRC, cTemp, cSIDCRC, nKey, a ) RETURN cRet METHOD CheckSID( cSID, cCRCKey ) CLASS uhttpd_Session + LOCAL nSIDCRC, cSIDCRC, n, cTemp LOCAL nLenSID := 25 LOCAL cBaseKeys := "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" LOCAL nRand, nKey := 0 LOCAL nLenTemp LOCAL lOk - //LOCAL a := 0 + + // LOCAL a := 0 __defaultNIL( @::cSID, ::RegenerateID() ) __defaultNIL( @cSID, ::cSID ) // Max Lenght must to be 10 __defaultNIL( @cCRCKey, MY_CRCKEY ) - //hb_toOutDebug( "cSID = %s, ::cSID = %s\n\r", hb_valtoexp( cSID ), hb_valtoexp( ::cSID ) ) + // hb_toOutDebug( "cSID = %s, ::cSID = %s\n\r", hb_valtoexp( cSID ), hb_valtoexp( ::cSID ) ) IF !Empty( cSID ) /* Calculate the key */ FOR n := 1 TO nLenSID - 5 // 5 = CRC Length - //nRand := At( cSID[ n ], cBaseKeys ) + // nRand := At( cSID[ n ], cBaseKeys ) nRand := At( SubStr( cSID, n, 1 ), cBaseKeys ) nKey += nRand NEXT @@ -553,14 +573,14 @@ METHOD CheckSID( cSID, cCRCKey ) CLASS uhttpd_Session cSIDCRC := "" nLenTemp := Len( cTemp ) FOR n := 1 TO nLenTemp - //cSIDCRC += cCRCKey[ Val( cTemp[ n ] ) + 1 ] - cSIDCRC += SubStr( cCRCKey, Val( SubStr( cTemp, n, 1 ) ) + 1, 1 ) + // cSIDCRC += cCRCKey[ Val( cTemp[ n ] ) + 1 ] + cSIDCRC += SubStr( cCRCKey, Val( SubStr( cTemp, n, 1 ) ) + 1, 1 ) NEXT lOk := ( Right( cSID, 5 ) == cSIDCRC ) - //TraceLog( "Check SID: cRet, cSID, nSIDCRC, cTemp, cSIDCRC, nKey, a", cRet, cSID, nSIDCRC, cTemp, cSIDCRC, nKey, a ) - //::oCGI:ToLogFile( "::CheckSID() = " + hb_cStr( cSID ) + " " + hb_cStr( cSIDCRC ), "/pointtoit/tmp/log.txt" ) + // TraceLog( "Check SID: cRet, cSID, nSIDCRC, cTemp, cSIDCRC, nKey, a", cRet, cSID, nSIDCRC, cTemp, cSIDCRC, nKey, a ) + // ::oCGI:ToLogFile( "::CheckSID() = " + hb_cStr( cSID ) + " " + hb_cStr( cSIDCRC ), "/pointtoit/tmp/log.txt" ) ENDIF RETURN lOk @@ -568,6 +588,7 @@ METHOD CheckSID( cSID, cCRCKey ) CLASS uhttpd_Session // ------------------------------ METHOD SetSaveHandler( bOpen, bClose, bRead, bWrite, bDestroy, bGC ) CLASS uhttpd_Session + IF bOpen != NIL ::bOpen := bOpen ENDIF @@ -586,10 +607,12 @@ METHOD SetSaveHandler( bOpen, bClose, bRead, bWrite, bDestroy, bGC ) CLASS uhttp IF bGC != NIL ::bGC := bGC ENDIF + RETURN NIL METHOD SessionOpen( cPath, cName ) CLASS uhttpd_Session - //TraceLog( "SessionOpen() - cName", cName ) + + // TraceLog( "SessionOpen() - cName", cName ) IF cPath != NIL ::cSavePath := cPath ENDIF @@ -600,11 +623,14 @@ METHOD SessionOpen( cPath, cName ) CLASS uhttpd_Session RETURN .T. METHOD SessionClose() CLASS uhttpd_Session - //TraceLog( "SessionClose()" ) + + // TraceLog( "SessionClose()" ) // Nothing to do + RETURN .T. METHOD SessionRead( cID ) CLASS uhttpd_Session + LOCAL nH LOCAL cFile LOCAL nFileSize @@ -613,7 +639,7 @@ METHOD SessionRead( cID ) CLASS uhttpd_Session __defaultNIL( @cID, ::cSID ) cFile := ::cSavePath + hb_ps() + ::cName + "_" + cID - //TraceLog( "SessionRead: cFile", cFile ) + // TraceLog( "SessionRead: cFile", cFile ) IF hb_FileExists( cFile ) DO WHILE nRetry++ <= ::nFileRetry IF ( nH := FOpen( cFile, FO_READ + FO_DENYWRITE ) ) != F_ERROR @@ -624,7 +650,7 @@ METHOD SessionRead( cID ) CLASS uhttpd_Session FSeek( nH, 0, FS_SET ) cBuffer := Space( nFileSize ) IF ( FRead( nH, @cBuffer, nFileSize ) ) != nFileSize - //uhttpd_Die( "ERROR: On reading session file : " + cFile + ", File error : " + hb_cStr( FError() ) ) + // uhttpd_Die( "ERROR: On reading session file : " + cFile + ", File error : " + hb_cStr( FError() ) ) hb_idleSleep( ::nFileWait / 1000 ) LOOP ENDIF @@ -633,42 +659,44 @@ METHOD SessionRead( cID ) CLASS uhttpd_Session ENDDO ELSE - //uhttpd_Die( "ERROR: On opening session file : " + cFile + ", File error : " + hb_cStr( FError() ) ) + // uhttpd_Die( "ERROR: On opening session file : " + cFile + ", File error : " + hb_cStr( FError() ) ) hb_idleSleep( ::nFileWait / 1000 ) LOOP ENDIF EXIT ENDDO ENDIF - //TraceLog( "SessionRead() - cID, cFile, nFileSize, cBuffer", cID, cFile, nFileSize, cBuffer ) + // TraceLog( "SessionRead() - cID, cFile, nFileSize, cBuffer", cID, cFile, nFileSize, cBuffer ) + RETURN cBuffer METHOD SessionWrite( cID, cData ) CLASS uhttpd_Session + LOCAL nH LOCAL cFile LOCAL nFileSize LOCAL lOk := .F. LOCAL nRetry := 0 - //TraceLog( "SessionWrite() - cID, cData", cID, cData ) + // TraceLog( "SessionWrite() - cID, cData", cID, cData ) __defaultNIL( @cID, ::cSID ) __defaultNIL( @cData, "" ) nFileSize := Len( cData ) cFile := ::cSavePath + hb_ps() + ::cName + "_" + cID - //TraceLog( "SessionWrite() - cFile", cFile ) + // TraceLog( "SessionWrite() - cFile", cFile ) IF nFileSize > 0 DO WHILE nRetry++ <= ::nFileRetry IF ( nH := hb_FCreate( cFile, FC_NORMAL, FO_READWRITE + FO_DENYWRITE ) ) != F_ERROR IF ( FWrite( nH, @cData, nFileSize ) ) != nFileSize - uhttpd_Die( "ERROR: On writing session file : " + cFile + ", File error : " + hb_cStr( FError() ) ) + uhttpd_Die( "ERROR: On writing session file : " + cFile + ", File error : " + hb_CStr( FError() ) ) ELSE lOk := .T. ENDIF FClose( nH ) ELSE - //uhttpd_Die( "ERROR: On WRITING session file. I can not create session file : " + cFile + ", File error : " + hb_cStr( FError() ) ) + // uhttpd_Die( "ERROR: On WRITING session file. I can not create session file : " + cFile + ", File error : " + hb_cStr( FError() ) ) hb_idleSleep( ::nFileWait / 1000 ) LOOP ENDIF @@ -676,26 +704,28 @@ METHOD SessionWrite( cID, cData ) CLASS uhttpd_Session ENDDO ELSE // If session data is empty, I will delete the file if exist - //IF hb_FileExists( cFile ) + // IF hb_FileExists( cFile ) // FErase( cFile ) - //ENDIF + // ENDIF // Return that all is ok lOk := .T. ENDIF + RETURN lOk METHOD SessionDestroy( cID ) CLASS uhttpd_Session + LOCAL cFile LOCAL lOk LOCAL nRetry := 0 - //TraceLog( "SessionDestroy() - cID", cID ) + // TraceLog( "SessionDestroy() - cID", cID ) __defaultNIL( @cID, ::cSID ) _SESSION := { => } ::oCookie:DeleteCookie( ::cName ) - //TraceLog( "SessionDestroy() - cID, oCGI:h_Session", cID, DumpValue( oCGI:h_Session ) ) + // TraceLog( "SessionDestroy() - cID, oCGI:h_Session", cID, DumpValue( oCGI:h_Session ) ) cFile := ::cSavePath + hb_ps() + ::cName + "_" + cID lOk := .F. @@ -708,20 +738,22 @@ METHOD SessionDestroy( cID ) CLASS uhttpd_Session ENDIF ENDDO - //IF !( lOk := ( FErase( cFile ) == 0 ) ) + // IF !( lOk := ( FErase( cFile ) == 0 ) ) // uhttpd_Die( "ERROR: On deleting session file : " + cFile + ", File error : " + hb_cStr( FError() ) ) - //ELSE + // ELSE IF lOk - //TraceLog( "SessionDestroy() - Sessione Eliminata - File " + cFile ) + // TraceLog( "SessionDestroy() - Sessione Eliminata - File " + cFile ) // Genero un nuovo SID ::RegenerateID() ENDIF + RETURN lOk METHOD SessionGC( nMaxLifeTime ) CLASS uhttpd_Session - //TraceLog( "SessionGC() - nMaxLifeTime", nMaxLifeTime ) - //STATIC s_nStartTime + + // TraceLog( "SessionGC() - nMaxLifeTime", nMaxLifeTime ) + // STATIC s_nStartTime LOCAL nSecs LOCAL aDir, aFile @@ -729,22 +761,23 @@ METHOD SessionGC( nMaxLifeTime ) CLASS uhttpd_Session aDir := Directory( ::cSavePath + hb_ps() + ::cName + "_*.*" ) FOR EACH aFile IN aDir - nSecs := TimeDiffAsSeconds( aFile[ F_DATE ], Date(), aFile[ F_TIME ], Time() ) - //TraceLog( "GC: aFile[ F_NAME ], aFile[ F_DATE ], Date(), aFile[ F_TIME ], Time(), nSecs, nMaxLifeTime", ; - // aFile[ F_NAME ], aFile[ F_DATE ], Date(), aFile[ F_TIME ], Time(), nSecs, nMaxLifeTime ) - IF nSecs > nMaxLifeTime - // No error checking here, because if I cannot delete file now I will find it again on next loop - FErase( ::cSavePath + hb_ps() + aFile[ F_NAME ] ) - ENDIF + nSecs := TimeDiffAsSeconds( aFile[ F_DATE ], Date(), aFile[ F_TIME ], Time() ) + // TraceLog( "GC: aFile[ F_NAME ], aFile[ F_DATE ], Date(), aFile[ F_TIME ], Time(), nSecs, nMaxLifeTime", ; + // aFile[ F_NAME ], aFile[ F_DATE ], Date(), aFile[ F_TIME ], Time(), nSecs, nMaxLifeTime ) + IF nSecs > nMaxLifeTime + // No error checking here, because if I cannot delete file now I will find it again on next loop + FErase( ::cSavePath + hb_ps() + aFile[ F_NAME ] ) + ENDIF NEXT RETURN .T. STATIC FUNCTION TimeDiffAsSeconds( dDateStart, dDateEnd, cTimeStart, cTimeEnd ) + LOCAL aRetVal - __defaultNIL( @dDateEnd, DATE() ) - __defaultNIL( @cTimeEnd, TIME() ) + __defaultNIL( @dDateEnd, Date() ) + __defaultNIL( @cTimeEnd, Time() ) aRetVal := FT_ELAPSED( dDateStart, dDateEnd, cTimeStart, cTimeEnd ) @@ -752,43 +785,45 @@ STATIC FUNCTION TimeDiffAsSeconds( dDateStart, dDateEnd, cTimeStart, cTimeEnd ) // Nanforum ELAPSED -STATIC FUNCTION FT_ELAPSED(dStart, dEnd, cTimeStart, cTimeEnd) - LOCAL nTotalSec, nCtr, nConstant, nTemp, aRetVal[4,2] +STATIC FUNCTION FT_ELAPSED( dStart, dEnd, cTimeStart, cTimeEnd ) + + LOCAL nTotalSec, nCtr, nConstant, nTemp, aRetVal[ 4, 2 ] IF HB_ISSTRING( dStart ) cTimeStart := dStart - dStart := DATE() + dStart := Date() ELSEIF ! HB_ISDATE( dStart ) - dStart := DATE() + dStart := Date() ENDIF IF HB_ISSTRING( dEnd ) cTimeEnd := dEnd - dEnd := DATE() + dEnd := Date() ELSEIF ! HB_ISDATE( dEnd ) - dEnd := DATE() + dEnd := Date() ENDIF - iif( ! HB_ISSTRING(cTimeStart), cTimeStart := '00:00:00', ) - iif( ! HB_ISSTRING(cTimeEnd) , cTimeEnd := '00:00:00', ) + iif( ! HB_ISSTRING( cTimeStart ), cTimeStart := '00:00:00', ) + iif( ! HB_ISSTRING( cTimeEnd ), cTimeEnd := '00:00:00', ) - nTotalSec := (dEnd - dStart) * 86400 + ; - VAL(cTimeEnd) * 3600 + ; - VAL(SUBSTR(cTimeEnd,AT(':', cTimeEnd)+1,2)) * 60 + ; - iif(RAT(':', cTimeEnd) == AT(':', cTimeEnd), 0, ; - VAL(SUBSTR(cTimeEnd,RAT(':', cTimeEnd)+1))) - ; - VAL(cTimeStart) * 3600 - ; - VAL(SUBSTR(cTimeStart,AT(':', cTimeStart)+1,2)) * 60 - ; - iif(RAT(':', cTimeStart) == AT(':', cTimeStart), 0, ; - VAL(SUBSTR(cTimeStart,RAT(':', cTimeStart)+1))) + nTotalSec := ; + ( dEnd - dStart ) * 86400 + ; + Val( cTimeEnd ) * 3600 + ; + Val( SubStr( cTimeEnd, At( ':', cTimeEnd ) + 1, 2 ) ) * 60 + ; + iif( RAt( ':', cTimeEnd ) == At( ':', cTimeEnd ), 0, ; + Val( SubStr( cTimeEnd, RAt( ':', cTimeEnd ) + 1 ) ) ) - ; + Val( cTimeStart ) * 3600 - ; + Val( SubStr( cTimeStart, At( ':', cTimeStart ) + 1, 2 ) ) * 60 - ; + iif( RAt( ':', cTimeStart ) == At( ':', cTimeStart ), 0, ; + Val( SubStr( cTimeStart, RAt( ':', cTimeStart ) + 1 ) ) ) nTemp := nTotalSec - FOR nCtr := 1 to 4 - nConstant := iif(nCtr == 1, 86400, iif(nCtr == 2, 3600, iif( nCtr == 3, 60, 1))) - aRetVal[nCtr,1] := INT(nTemp/nConstant) - aRetval[nCtr,2] := nTotalSec / nConstant - nTemp -= aRetVal[nCtr,1] * nConstant + FOR nCtr := 1 TO 4 + nConstant := iif( nCtr == 1, 86400, iif( nCtr == 2, 3600, iif( nCtr == 3, 60, 1 ) ) ) + aRetVal[ nCtr, 1 ] := Int( nTemp / nConstant ) + aRetval[ nCtr, 2 ] := nTotalSec / nConstant + nTemp -= aRetVal[ nCtr, 1 ] * nConstant NEXT RETURN aRetVal @@ -796,37 +831,40 @@ STATIC FUNCTION FT_ELAPSED(dStart, dEnd, cTimeStart, cTimeEnd) // ------------------------------ METHOD Encode() CLASS uhttpd_Session + LOCAL aSerial := {} LOCAL cKey, xVal IF Type( "_SESSION" ) == "H" FOR EACH cKey IN _SESSION:Keys - xVal := _SESSION[ cKey ] - IF xVal != NIL - AAdd( aSerial, { cKey, xVal } ) - ENDIF + xVal := _SESSION[ cKey ] + IF xVal != NIL + AAdd( aSerial, { cKey, xVal } ) + ENDIF NEXT ENDIF - RETURN iif( !Empty( aSerial ), HB_Serialize( aSerial ), NIL ) + RETURN iif( !Empty( aSerial ), hb_Serialize( aSerial ), NIL ) METHOD Decode( cData ) CLASS uhttpd_Session + LOCAL lOk := .T. LOCAL cSerial := cData LOCAL xVal, aElem - //LOCAL cKey - //TraceLog( "Decode - cSerial", cSerial ) - //::oCGI:ToLogFile( "Decode - cSerial = " + hb_cStr( cSerial ), "/pointtoit/tmp/log.txt" ) + // LOCAL cKey - DO WHILE ( xVal := HB_Deserialize( @cSerial ) ) != NIL - //TraceLog( "Decode - xVal", DumpValue( xVal ) ) - //::oCGI:ToLogFile( "Decode - xVal = " + hb_cStr( xVal ) + ", ValType( xVal ) = " + ValType( xVal ), "/pointtoit/tmp/log.txt" ) + // TraceLog( "Decode - cSerial", cSerial ) + // ::oCGI:ToLogFile( "Decode - cSerial = " + hb_cStr( cSerial ), "/pointtoit/tmp/log.txt" ) + + DO WHILE ( xVal := hb_Deserialize( @cSerial ) ) != NIL + // TraceLog( "Decode - xVal", DumpValue( xVal ) ) + // ::oCGI:ToLogFile( "Decode - xVal = " + hb_cStr( xVal ) + ", ValType( xVal ) = " + ValType( xVal ), "/pointtoit/tmp/log.txt" ) SWITCH ValType( xVal ) - //CASE 'O' + // CASE 'O' // //TraceLog( "Decode - xVal - Object", xVal ) // IF xVal:classname == "TASSOCIATIVEARRAY" // //TraceLog( "Decode - xVal - Object - TAssociativeArray - Keys", xVal:Keys ) @@ -837,54 +875,59 @@ METHOD Decode( cData ) CLASS uhttpd_Session // ENDIF // EXIT - CASE 'A' // Le variabili sono conservate come array { VarName, Value } - //TraceLog( "Decode - xVal - Array", xVal ) - //::oCGI:ToLogFile( "Decode - xVal - Array = " + hb_cStr( xVal ) + ", Len = " + hb_cStr( Len( xVal ) ), "/pointtoit/tmp/log.txt" ) - FOR EACH aElem IN xVal - //::oCGI:ToLogFile( "Decode - aElem = " + hb_cStr( hb_valtoexp( aElem ) ), "/pointtoit/tmp/log.txt" ) - _SESSION[ aElem[1] ] := aElem[2] - NEXT - EXIT + CASE 'A' // Le variabili sono conservate come array { VarName, Value } + // TraceLog( "Decode - xVal - Array", xVal ) + // ::oCGI:ToLogFile( "Decode - xVal - Array = " + hb_cStr( xVal ) + ", Len = " + hb_cStr( Len( xVal ) ), "/pointtoit/tmp/log.txt" ) + FOR EACH aElem IN xVal + // ::oCGI:ToLogFile( "Decode - aElem = " + hb_cStr( hb_valtoexp( aElem ) ), "/pointtoit/tmp/log.txt" ) + _SESSION[ aElem[ 1 ] ] := aElem[ 2 ] + NEXT + EXIT - OTHERWISE - uhttpd_Die( "ERROR: On deserializing session data" ) - lOk := .F. - EXIT + OTHERWISE + uhttpd_Die( "ERROR: On deserializing session data" ) + lOk := .F. + EXIT ENDSWITCH ENDDO RETURN lOk METHOD SendCacheLimiter() CLASS uhttpd_Session + LOCAL dDate + DO CASE CASE ::cCache_Limiter == 'nocache' - //uhttpd_SetHeader( 'Expires', 'Thu, 19 Nov 1981 08:52:00 GMT' ) - uhttpd_SetHeader( 'Expires', uhttpd_DateToGMT( ,,-1, ) ) + // uhttpd_SetHeader( 'Expires', 'Thu, 19 Nov 1981 08:52:00 GMT' ) + uhttpd_SetHeader( 'Expires', uhttpd_DateToGMT( ,, -1, ) ) uhttpd_SetHeader( 'Cache-Control', 'no-cache' ) - //uhttpd_SetHeader("Cache-Control", "no-store, no-cache, must-revalidate") // HTTP/1.1 - //uhttpd_SetHeader("Cache-Control", "post-check=0, pre-check=0", .F. ) + // uhttpd_SetHeader("Cache-Control", "no-store, no-cache, must-revalidate") // HTTP/1.1 + // uhttpd_SetHeader("Cache-Control", "post-check=0, pre-check=0", .F. ) uhttpd_SetHeader( 'Pragma', 'no-cache' ) CASE ::cCache_Limiter == 'private' uhttpd_SetHeader( 'Expires', 'Thu, 19 Nov 1981 08:52:00 GMT' ) uhttpd_SetHeader( 'Cache-Control', 'private, max-age=' + hb_ntos( ::nCache_Expire * 60 ) ) - IF hb_FGetDateTime( hb_argv(0), @dDate ) + IF hb_FGetDateTime( hb_argv( 0 ), @dDate ) uhttpd_SetHeader( 'Last-Modified', uhttpd_DateToGMT( dDate ) ) ENDIF CASE ::cCache_Limiter == 'public' uhttpd_SetHeader( 'Expires', uhttpd_DateToGMT( ,,, ::nCache_Expire * 60 ) ) uhttpd_SetHeader( 'Cache-Control', 'public, max-age=' + hb_ntos( ::nCache_Expire * 60 ) ) - IF hb_FGetDateTime( hb_argv(0), @dDate ) + IF hb_FGetDateTime( hb_argv( 0 ), @dDate ) uhttpd_SetHeader( 'Last-Modified', uhttpd_DateToGMT( dDate ) ) ENDIF OTHERWISE uhttpd_Die( "ERROR: Caching method " + ::cCache_Limiter + " not implemented." ) ENDCASE - //__OutDebug( "Header cache '" + ::cCache_Limiter + "' inviato" ) + // __OutDebug( "Header cache '" + ::cCache_Limiter + "' inviato" ) + RETURN NIL PROCEDURE DestroyObject() CLASS uhttpd_Session + ::Close() - //::oCGI:ToLogFile( "Session destroyed" ) - //::oCGI := NIL + // ::oCGI:ToLogFile( "Session destroyed" ) + // ::oCGI := NIL + RETURN diff --git a/harbour/extras/httpsrv/uhttpd.prg b/harbour/extras/httpsrv/uhttpd.prg index 74a74255b7..ee7c03bfa3 100644 --- a/harbour/extras/httpsrv/uhttpd.prg +++ b/harbour/extras/httpsrv/uhttpd.prg @@ -80,7 +80,7 @@ */ // remove comment to activate hb_toOutDebug() -//#define DEBUG_ACTIVE +// #define DEBUG_ACTIVE #define FIXED_THREADS // This force application to use fixed number of running threads and no service threads @@ -95,21 +95,21 @@ REQUEST __HB_EXTERN__ #include "hbsocket.ch" #ifdef GD_SUPPORT - // adding GD support - REQUEST GDIMAGE, GDIMAGECHAR, GDCHART - #define APP_GD_SUPPORT "_GD" - #stdout "Lib GD support enabled" +// adding GD support +REQUEST GDIMAGE, GDIMAGECHAR, GDCHART +# define APP_GD_SUPPORT "_GD" +# stdout "Lib GD support enabled" #else - #define APP_GD_SUPPORT "" - #stdout "Lib GD support disabled" +# define APP_GD_SUPPORT "" +# stdout "Lib GD support disabled" #endif #ifdef FIXED_THREADS - #define APP_DT_SUPPORT "_FIXED_THREADS" - #stdout "Fixed # of threads" +# define APP_DT_SUPPORT "_FIXED_THREADS" +# stdout "Fixed # of threads" #else - #define APP_DT_SUPPORT "" - #stdout "Dynamic # of threads" +# define APP_DT_SUPPORT "" +# stdout "Dynamic # of threads" #endif #define APP_NAME "uhttpd" @@ -125,7 +125,7 @@ REQUEST __HB_EXTERN__ #define MAX_SERVICE_THREADS 3 // Max running threads #define LISTEN_PORT 8082 // differs from standard 80 port for tests in case - // anyone has a apache/IIS installed +// anyone has a apache/IIS installed #define FILE_STOP ".uhttpd.stop" #define FILE_ACCESS_LOG "logs" + hb_ps() + "access.log" #define FILE_ERROR_LOG "logs" + hb_ps() + "error.log" @@ -142,12 +142,12 @@ REQUEST __HB_EXTERN__ #define HB_IHASH() HB_HSETCASEMATCH( { => }, .F. ) #ifdef __PLATFORM__WINDOWS - REQUEST HB_GT_WVT_DEFAULT - REQUEST HB_GT_WIN - REQUEST HB_GT_NUL +REQUEST HB_GT_WVT_DEFAULT +REQUEST HB_GT_WIN +REQUEST HB_GT_NUL #else - REQUEST HB_GT_TRM_DEFAULT - REQUEST HB_GT_NUL +REQUEST HB_GT_TRM_DEFAULT +REQUEST HB_GT_NUL #endif #define THREAD_GT hb_gtVersion() @@ -168,7 +168,7 @@ STATIC s_nConnections, s_nMaxConnections, s_nTotConnections STATIC s_nServiceConnections, s_nMaxServiceConnections, s_nTotServiceConnections STATIC s_aRunningThreads := {} STATIC s_aServiceThreads := {} -STATIC s_hHRBModules := {=>} +STATIC s_hHRBModules := { => } STATIC s_aDirectoryIndex STATIC s_hActions := { ; @@ -186,10 +186,10 @@ STATIC s_hHandlers := { ; "/serverstatus" => "server-status" ; } -//STATIC s_lAcceptPathInfo := .T. +// STATIC s_lAcceptPathInfo := .T. // SCRIPTALIASES: now read from ini file -//STATIC s_hScriptAliases := { "/info" => "/cgi-bin/info.hrb" } +// STATIC s_hScriptAliases := { "/info" => "/cgi-bin/info.hrb" } STATIC s_hScriptAliases := { => } STATIC s_hAliases := { => } @@ -207,6 +207,7 @@ ANNOUNCE ERRORSYS // ---------------------------------------- PROCEDURE Main( ... ) + LOCAL nPort, hListen, hSocket, aRemote, cI, xVal LOCAL aThreads, nStartThreads, nMaxThreads, nStartServiceThreads LOCAL i, cPar, lStop @@ -218,7 +219,7 @@ PROCEDURE Main( ... ) LOCAL nConsoleRows, nConsoleCols LOCAL nCmdConsoleRows, nCmdConsoleCols - IF !HB_MTVM() + IF !hb_mtvm() ? "I need multhread support. Please, recompile me!" WAIT ErrorLevel( 2 ) @@ -241,13 +242,13 @@ PROCEDURE Main( ... ) // Check GT version - if I have started app with //GT:NUL then I have to disable // console and application will start in hidden way. - cGT := HB_GTVERSION() + cGT := hb_gtVersion() IF cGT == "NUL" lConsole := .F. ENDIF // TOCHECK: now not force case insensitive - //HB_HSETCASEMATCH( s_hScriptAliases, .F. ) + // HB_HSETCASEMATCH( s_hScriptAliases, .F. ) // ----------------- Line command parameters checking ---------------------- @@ -300,15 +301,15 @@ PROCEDURE Main( ... ) // -------------------- checking STOP request ------------------------------- IF lStop - HB_MEMOWRIT( FILE_STOP, "" ) + hb_MemoWrit( FILE_STOP, "" ) RETURN ELSE - FERASE( FILE_STOP ) + FErase( FILE_STOP ) ENDIF // ----------------- Parse ini file ---------------------------------------- - //hb_ToOutDebug( "cConfig = %s\n\r", cConfig ) + // hb_ToOutDebug( "cConfig = %s\n\r", cConfig ) hDefault := ParseIni( cConfig ) @@ -334,23 +335,23 @@ PROCEDURE Main( ... ) // ATTENTION: script aliases can be in mixed case // i.e. we can have /info or /Info that will be different unless lScriptAliasMixedCase will be .F. FOR EACH xVal IN hDefault[ "SCRIPTALIASES" ] - IF HB_ISSTRING( xVal ) - hb_HSet( s_hScriptAliases, iif( lScriptAliasMixedCase, xVal:__enumKey(), Upper( xVal:__enumKey() ) ), xVal ) - ENDIF + IF HB_ISSTRING( xVal ) + hb_HSet( s_hScriptAliases, iif( lScriptAliasMixedCase, xVal:__enumKey(), Upper( xVal:__enumKey() ) ), xVal ) + ENDIF NEXT // ATTENTION: path aliases cannnot be in mixed case // i.e. we can have /info or /Info that will be different FOR EACH xVal IN hDefault[ "ALIASES" ] - IF HB_ISSTRING( xVal ) - hb_HSet( s_hAliases, xVal:__enumKey(), xVal ) - ENDIF + IF HB_ISSTRING( xVal ) + hb_HSet( s_hAliases, xVal:__enumKey(), xVal ) + ENDIF NEXT - //hb_ToOutDebug( "cLogAccess = %s, cLogError = %s\n\r", cLogAccess, cLogError ) - //hb_ToOutDebug( "hDefault = %s\n\r", hb_ValToExp( hDefault ) ) - //hb_ToOutDebug( "s_hScriptAliases = %s\n\r", hb_ValToExp( s_hScriptAliases ) ) - //hb_ToOutDebug( "s_hAliases = %s\n\r", hb_ValToExp( s_hAliases ) ) + // hb_ToOutDebug( "cLogAccess = %s, cLogError = %s\n\r", cLogAccess, cLogError ) + // hb_ToOutDebug( "hDefault = %s\n\r", hb_ValToExp( hDefault ) ) + // hb_ToOutDebug( "s_hScriptAliases = %s\n\r", hb_ValToExp( s_hScriptAliases ) ) + // hb_ToOutDebug( "s_hAliases = %s\n\r", hb_ValToExp( s_hAliases ) ) // ------------------- Parameters forced from command line ---------------- @@ -390,9 +391,9 @@ PROCEDURE Main( ... ) // cApplicationRoot can be only ExePath() or a correct full path cDocumentRoot := StrTran( cDocumentRoot, "$(APP_DIR)", cApplicationRoot ) - cSessionPath := StrTran( cSessionPath , "$(APP_DIR)", cApplicationRoot ) - cLogAccess := StrTran( cLogAccess , "$(APP_DIR)", cApplicationRoot ) - cLogError := StrTran( cLogError , "$(APP_DIR)", cApplicationRoot ) + cSessionPath := StrTran( cSessionPath, "$(APP_DIR)", cApplicationRoot ) + cLogAccess := StrTran( cLogAccess, "$(APP_DIR)", cApplicationRoot ) + cLogError := StrTran( cLogError, "$(APP_DIR)", cApplicationRoot ) // -------------------- checking starting values ---------------------------- @@ -405,11 +406,11 @@ PROCEDURE Main( ... ) IF HB_ISSTRING( cApplicationRoot ) cI := cApplicationRoot - IF HB_DirExists( cI ) - IF RIGHT( cI, 1 ) == "/" .AND. LEN(cI) > 2 .AND. !( SUBSTR( cI, LEN( cI ) - 2, 1 ) == ":" ) - s_cApplicationRoot := LEFT( cI, LEN( cI ) - 1 ) + IF hb_DirExists( cI ) + IF Right( cI, 1 ) == "/" .AND. Len( cI ) > 2 .AND. !( SubStr( cI, Len( cI ) - 2, 1 ) == ":" ) + s_cApplicationRoot := Left( cI, Len( cI ) - 1 ) ELSE - s_cApplicationRoot := cI + s_cApplicationRoot := cI ENDIF ELSE ? "Invalid application root:", cI @@ -429,13 +430,13 @@ PROCEDURE Main( ... ) #endif IF HB_ISSTRING( cDocumentRoot ) - //cI := STRTRAN( SUBSTR( cDocumentRoot, 2 ), "\", "/" ) + // cI := STRTRAN( SUBSTR( cDocumentRoot, 2 ), "\", "/" ) cI := cDocumentRoot - IF HB_DirExists( cI ) - IF RIGHT( cI, 1 ) == "/" .AND. LEN(cI) > 2 .AND. !( SUBSTR( cI, LEN( cI ) - 2, 1 ) == ":" ) - s_cDocumentRoot := LEFT( cI, LEN( cI ) - 1 ) + IF hb_DirExists( cI ) + IF Right( cI, 1 ) == "/" .AND. Len( cI ) > 2 .AND. !( SubStr( cI, Len( cI ) - 2, 1 ) == ":" ) + s_cDocumentRoot := Left( cI, Len( cI ) - 1 ) ELSE - s_cDocumentRoot := cI + s_cDocumentRoot := cI ENDIF ELSE ? "Invalid document root:", cI @@ -464,11 +465,11 @@ PROCEDURE Main( ... ) nStartThreads := nMaxThreads ENDIF - IF nConsoleRows < 1 //.OR. nConsoleRows > MaxRow() + 1 + IF nConsoleRows < 1 // .OR. nConsoleRows > MaxRow() + 1 nConsoleRows := MaxRow() ENDIF - IF nConsoleCols < 1 //.OR. nConsoleCols > MaxCol() + 1 + IF nConsoleCols < 1 // .OR. nConsoleCols > MaxCol() + 1 nConsoleCols := MaxCol() ENDIF @@ -494,29 +495,29 @@ PROCEDURE Main( ... ) // --------------------- Open log files ------------------------------------- - IF ( s_hfileLogAccess := FOPEN( cLogAccess, FO_CREAT + FO_WRITE ) ) == F_ERROR + IF ( s_hfileLogAccess := FOpen( cLogAccess, FO_CREAT + FO_WRITE ) ) == F_ERROR ? "Can't open access log file" WAIT ErrorLevel( 1 ) RETURN ENDIF - FSEEK( s_hfileLogAccess, 0, FS_END ) + FSeek( s_hfileLogAccess, 0, FS_END ) - IF ( s_hfileLogError := FOPEN( cLogError, FO_CREAT + FO_WRITE ) ) == F_ERROR + IF ( s_hfileLogError := FOpen( cLogError, FO_CREAT + FO_WRITE ) ) == F_ERROR ? "Can't open error log file" WAIT ErrorLevel( 1 ) RETURN ENDIF - FSEEK( s_hfileLogError, 0, FS_END ) + FSeek( s_hfileLogError, 0, FS_END ) // --------------------- MAIN PART ------------------------------------------ IF s_lConsole SET CURSOR OFF SetMode( nConsoleRows, nConsoleCols ) - //hb_toOutDebug( "nConsoleRows = %s, nConsoleCols = %s", nConsoleRows, nConsoleCols ) - //hb_toOutDebug( "nCmdConsoleRows = %s, nCmdConsoleCols = %s", nCmdConsoleRows, nCmdConsoleCols ) + // hb_toOutDebug( "nConsoleRows = %s, nConsoleCols = %s", nConsoleRows, nConsoleCols ) + // hb_toOutDebug( "nCmdConsoleRows = %s, nCmdConsoleCols = %s", nCmdConsoleRows, nCmdConsoleCols ) ENDIF // --------------------- define mutexes ------------------------------------- @@ -547,7 +548,7 @@ PROCEDURE Main( ... ) WriteToConsole( "Starting AcceptConnection Thread" ) aThreads := {} - AADD( aThreads, hb_threadStart( @AcceptConnections() ) ) + AAdd( aThreads, hb_threadStart( @AcceptConnections() ) ) #ifdef DEBUG_ACTIVE hb_ToOutDebug( "Len( aThreads ) = %i\n\r", Len( aThreads ) ) #endif @@ -600,7 +601,7 @@ PROCEDURE Main( ... ) hb_DispOutAt( 7, 37, "Max Connections : " + Transform( s_nMaxServiceConnections, "9999999999" ) ) hb_DispOutAt( 8, 37, "Total Connections : " + Transform( s_nTotServiceConnections, "9999999999" ) ) #endif // FIXED_THREADS - hb_DispOutAt( 10, 40, "Memory: " + hb_ntos( memory( HB_MEM_USED ) ) ) + hb_DispOutAt( 10, 40, "Memory: " + hb_ntos( Memory( HB_MEM_USED ) ) ) hb_mutexUnlock( s_hmtxBusy ) ENDIF @@ -609,11 +610,11 @@ PROCEDURE Main( ... ) ENDIF // Wait a connection - IF EMPTY( hSocket := hb_socketAccept( hListen, @aRemote, 50 ) ) + IF Empty( hSocket := hb_socketAccept( hListen, @aRemote, 50 ) ) IF hb_socketGetError() == HB_SOCKET_ERR_TIMEOUT // Checking if I have to quit - IF HB_FileExists( FILE_STOP ) - FERASE( FILE_STOP ) + IF hb_FileExists( FILE_STOP ) + FErase( FILE_STOP ) EXIT ENDIF ELSE @@ -625,15 +626,15 @@ PROCEDURE Main( ... ) ENDIF // Memory release - //hb_GCAll( .T. ) + // hb_GCAll( .T. ) ENDDO WriteToConsole( "Waiting threads" ) // Send to threads that they have to stop - AEVAL( aThreads, {|| hb_mutexNotify( s_hmtxQueue, NIL ) } ) + AEval( aThreads, {|| hb_mutexNotify( s_hmtxQueue, NIL ) } ) // Wait threads to end - AEVAL( aThreads, {| h | hb_threadJoin( h ) } ) + AEval( aThreads, {| h | hb_threadJoin( h ) } ) ENDIF @@ -643,8 +644,8 @@ PROCEDURE Main( ... ) hb_socketClose( hListen ) // Close log files - FCLOSE( s_hfileLogAccess ) - FCLOSE( s_hfileLogError ) + FClose( s_hfileLogAccess ) + FClose( s_hfileLogError ) SET CURSOR ON @@ -655,6 +656,7 @@ PROCEDURE Main( ... ) // --------------------------------------------------------------------------------- // STATIC FUNCTION AcceptConnections() + LOCAL hSocket LOCAL n #ifndef FIXED_THREADS @@ -672,14 +674,14 @@ STATIC FUNCTION AcceptConnections() IF hb_mutexLock( s_hmtxBusy ) // Starting initial running threads FOR n := 1 TO s_nStartThreads - pThread := hb_threadStart( @ProcessConnection() ) - AADD( s_aRunningThreads, pThread ) + pThread := hb_threadStart( @ProcessConnection() ) + AAdd( s_aRunningThreads, pThread ) NEXT // Starting initial service threads FOR n := 1 TO s_nStartServiceThreads - pThread := hb_threadStart( @ServiceConnection() ) - AADD( s_aServiceThreads, pThread ) + pThread := hb_threadStart( @ServiceConnection() ) + AAdd( s_aServiceThreads, pThread ) NEXT hb_mutexUnlock( s_hmtxBusy ) ENDIF @@ -714,22 +716,22 @@ STATIC FUNCTION AcceptConnections() IF hSocket == NIL .OR. lQuitRequest // Requesting to Running threads to quit (using -1 value) - AEVAL( s_aRunningThreads, {|| hb_mutexNotify( s_hmtxRunningThreads, -1 ) } ) + AEval( s_aRunningThreads, {|| hb_mutexNotify( s_hmtxRunningThreads, -1 ) } ) #ifndef FIXED_THREADS // Requesting to Service threads to quit (using -1 value) - AEVAL( s_aServiceThreads, {|| hb_mutexNotify( s_hmtxServiceThreads, -1 ) } ) + AEval( s_aServiceThreads, {|| hb_mutexNotify( s_hmtxServiceThreads, -1 ) } ) #endif // waiting running threads to quit - AEVAL( s_aRunningThreads, {| h | hb_threadJoin( h ) } ) + AEval( s_aRunningThreads, {| h | hb_threadJoin( h ) } ) #ifndef FIXED_THREADS // waiting service threads to quit - AEVAL( s_aServiceThreads, {| h | hb_threadJoin( h ) } ) + AEval( s_aServiceThreads, {| h | hb_threadJoin( h ) } ) #endif IF hb_mutexLock( s_hmtxBusy ) - //hb_ToOutDebug( "Len( s_aRunningThreads ) = %i\n\r", Len( s_aRunningThreads ) ) - asize( s_aRunningThreads, 0 ) + // hb_ToOutDebug( "Len( s_aRunningThreads ) = %i\n\r", Len( s_aRunningThreads ) ) + ASize( s_aRunningThreads, 0 ) #ifndef FIXED_THREADS - asize( s_aServiceThreads, 0 ) + ASize( s_aServiceThreads, 0 ) #endif hb_mutexUnlock( s_hmtxBusy ) ENDIF @@ -743,7 +745,7 @@ STATIC FUNCTION AcceptConnections() nConnections := s_nConnections nThreads := s_nThreads nMaxThreads := s_nMaxThreads - nServiceConnections:= s_nServiceConnections + nServiceConnections := s_nServiceConnections nServiceThreads := s_nServiceThreads nMaxServiceThreads := s_nMaxServiceThreads hb_mutexUnlock( s_hmtxBusy ) @@ -756,16 +758,16 @@ STATIC FUNCTION AcceptConnections() // If I have no more of service threads to use ... (DOS attack ?) IF nServiceConnections > nMaxServiceThreads - // DROP connection + // DROP connection hb_socketShutdown( hSocket ) hb_socketClose( hSocket ) - // If I have no service threads in use ... + // If I have no service threads in use ... ELSEIF nServiceConnections >= nServiceThreads // Add one more IF hb_mutexLock( s_hmtxBusy ) pThread := hb_threadStart( @ServiceConnection() ) - AADD( s_aServiceThreads, pThread ) + AAdd( s_aServiceThreads, pThread ) lCanNotify := .T. hb_mutexUnlock( s_hmtxBusy ) ENDIF @@ -778,12 +780,12 @@ STATIC FUNCTION AcceptConnections() LOOP - // If I have no free running threads to use ... + // If I have no free running threads to use ... ELSEIF nConnections >= nThreads // Add one more IF hb_mutexLock( s_hmtxBusy ) pThread := hb_threadStart( @ProcessConnection() ) - AADD( s_aRunningThreads, pThread ) + AAdd( s_aRunningThreads, pThread ) lCanNotify := .T. hb_mutexUnlock( s_hmtxBusy ) ENDIF @@ -791,7 +793,7 @@ STATIC FUNCTION AcceptConnections() lCanNotify := .T. ENDIF // Otherwise I send connection to running thread queue - //hb_ToOutDebug( "Len( s_aRunningThreads ) = %i\n\r", Len( s_aRunningThreads ) ) + // hb_ToOutDebug( "Len( s_aRunningThreads ) = %i\n\r", Len( s_aRunningThreads ) ) IF lCanNotify #endif // FIXED_THREADS hb_mutexNotify( s_hmtxRunningThreads, hSocket ) @@ -809,6 +811,7 @@ STATIC FUNCTION AcceptConnections() // CONNECTIONS // --------------------------------------------------------------------------------- // STATIC FUNCTION ProcessConnection() + LOCAL hSocket, nLen, cRequest, cSend LOCAL nMsecs, nParseTime, nPos, nThreadID LOCAL lQuitRequest := .F. @@ -881,7 +884,7 @@ STATIC FUNCTION ProcessConnection() ENDIF EXIT #else // FIXED_THREADS - LOOP + LOOP #endif // FIXED_THREADS ENDIF @@ -894,7 +897,7 @@ STATIC FUNCTION ProcessConnection() ENDIF // Save initial time - nMsecs := hb_milliseconds() + nMsecs := hb_MilliSeconds() BEGIN SEQUENCE @@ -904,7 +907,7 @@ STATIC FUNCTION ProcessConnection() nLen := readRequest( hSocket, @cRequest ) #ifdef DEBUG_ACTIVE - hb_ToOutDebug( "cRequest -- BEGIN --\n\r%s\n\rcRequest -- END --\n\r", cRequest ) + hb_ToOutDebug( "cRequest -- BEGIN --\n\r%s\n\rcRequest -- END --\n\r", cRequest ) #endif IF nLen == -1 @@ -913,23 +916,23 @@ STATIC FUNCTION ProcessConnection() ELSEIF nLen == 0 /* connection closed */ ELSE - //hb_ToOutDebug( "cRequest -- BEGIN --\n\r%s\n\rcRequest -- END --\n\r", cRequest ) + // hb_ToOutDebug( "cRequest -- BEGIN --\n\r%s\n\rcRequest -- END --\n\r", cRequest ) _SERVER := HB_IHASH(); _GET := HB_IHASH(); _POST := HB_IHASH(); _COOKIE := HB_IHASH() _SESSION := HB_IHASH(); _REQUEST := HB_IHASH(); _HTTP_REQUEST := HB_IHASH(); _HTTP_RESPONSE := HB_IHASH() m_cPost := NIL t_cResult := "" - //t_aHeader := {} + // t_aHeader := {} t_nStatusCode := 200 t_cErrorMsg := "" defineServer( hSocket ) IF ParseRequest( cRequest ) - //hb_ToOutDebug( "_SERVER = %s,\n\r _GET = %s,\n\r _POST = %s,\n\r _REQUEST = %s,\n\r _HTTP_REQUEST = %s,\n\r _HTTP_RESPONSE = %s\n\r", hb_ValToExp( _SERVER ), hb_ValToExp( _GET ), hb_ValToExp( _POST ), hb_ValToExp( _REQUEST ), hb_ValToExp( _HTTP_REQUEST ), hb_ValToExp( _HTTP_RESPONSE ) ) + // hb_ToOutDebug( "_SERVER = %s,\n\r _GET = %s,\n\r _POST = %s,\n\r _REQUEST = %s,\n\r _HTTP_REQUEST = %s,\n\r _HTTP_RESPONSE = %s\n\r", hb_ValToExp( _SERVER ), hb_ValToExp( _GET ), hb_ValToExp( _POST ), hb_ValToExp( _REQUEST ), hb_ValToExp( _HTTP_REQUEST ), hb_ValToExp( _HTTP_RESPONSE ) ) cSend := uproc_default() ELSE - //uhttpd_SetStatusCode( 400 ) + // uhttpd_SetStatusCode( 400 ) cSend := MakeResponse() ENDIF @@ -948,8 +951,8 @@ STATIC FUNCTION ProcessConnection() END SEQUENCE - nParseTime := hb_milliseconds() - nMsecs - WriteToConsole( "Page served in : " + Str( nParseTime/1000, 7, 4 ) + " seconds" ) + nParseTime := hb_MilliSeconds() - nMsecs + WriteToConsole( "Page served in : " + Str( nParseTime / 1000, 7, 4 ) + " seconds" ) hb_socketShutdown( hSocket ) hb_socketClose( hSocket ) @@ -960,7 +963,7 @@ STATIC FUNCTION ProcessConnection() ENDIF // Memory release - hb_GCAll( .T. ) + hb_gcAll( .T. ) ENDDO @@ -970,9 +973,9 @@ STATIC FUNCTION ProcessConnection() // an external quit request. In this case application is quitting and I cannot resize array // here to avoid race condition IF !lQuitRequest .AND. hb_mutexLock( s_hmtxBusy ) - //hb_ToOutDebug( "Len( s_aRunningThreads ) = %i\n\r", Len( s_aRunningThreads ) ) - IF ( nPos := aScan( s_aRunningThreads, hb_threadSelf() ) > 0 ) - hb_aDel( s_aRunningThreads, nPos, .T. ) + // hb_ToOutDebug( "Len( s_aRunningThreads ) = %i\n\r", Len( s_aRunningThreads ) ) + IF ( nPos := AScan( s_aRunningThreads, hb_threadSelf() ) > 0 ) + hb_ADel( s_aRunningThreads, nPos, .T. ) s_nThreads := Len( s_aRunningThreads ) ENDIF hb_mutexUnlock( s_hmtxBusy ) @@ -981,6 +984,7 @@ STATIC FUNCTION ProcessConnection() RETURN 0 STATIC FUNCTION ServiceConnection() + LOCAL hSocket, nLen, cRequest, cSend LOCAL nMsecs, nParseTime, nPos, nThreadId LOCAL nError := 500013 @@ -1049,7 +1053,7 @@ STATIC FUNCTION ServiceConnection() ENDIF // Save initial time - nMsecs := hb_milliseconds() + nMsecs := hb_MilliSeconds() BEGIN SEQUENCE @@ -1061,20 +1065,20 @@ STATIC FUNCTION ServiceConnection() ELSEIF nLen == 0 /* connection closed */ ELSE - //hb_ToOutDebug( "cRequest -- INIZIO --\n\r%s\n\rcRequest -- FINE --\n\r", cRequest ) + // hb_ToOutDebug( "cRequest -- INIZIO --\n\r%s\n\rcRequest -- FINE --\n\r", cRequest ) _SERVER := HB_IHASH(); _GET := HB_IHASH(); _POST := HB_IHASH(); _COOKIE := HB_IHASH() _SESSION := HB_IHASH(); _REQUEST := HB_IHASH(); _HTTP_REQUEST := HB_IHASH(); _HTTP_RESPONSE := HB_IHASH() m_cPost := NIL t_cResult := "" - //t_aHeader := {} + // t_aHeader := {} t_nStatusCode := 200 t_cErrorMsg := "" defineServer( hSocket ) IF ParseRequest( cRequest ) - //hb_ToOutDebug( "_SERVER = %s,\n\r _GET = %s,\n\r _POST = %s,\n\r _REQUEST = %s,\n\r _HTTP_REQUEST = %s,\n\r _HTTP_RESPONSE = %s\n\r", hb_ValToExp( _SERVER ), hb_ValToExp( _GET ), hb_ValToExp( _POST ), hb_ValToExp( _REQUEST ), hb_ValToExp( _HTTP_REQUEST ), hb_ValToExp( _HTTP_RESPONSE ) ) + // hb_ToOutDebug( "_SERVER = %s,\n\r _GET = %s,\n\r _POST = %s,\n\r _REQUEST = %s,\n\r _HTTP_REQUEST = %s,\n\r _HTTP_RESPONSE = %s\n\r", hb_ValToExp( _SERVER ), hb_ValToExp( _GET ), hb_ValToExp( _POST ), hb_ValToExp( _REQUEST ), hb_ValToExp( _HTTP_REQUEST ), hb_ValToExp( _HTTP_RESPONSE ) ) define_Env( _SERVER ) ENDIF // Error page served @@ -1092,8 +1096,8 @@ STATIC FUNCTION ServiceConnection() END SEQUENCE - nParseTime := hb_milliseconds() - nMsecs - WriteToConsole( "Page served in : " + Str( nParseTime/1000, 7, 4 ) + " seconds" ) + nParseTime := hb_MilliSeconds() - nMsecs + WriteToConsole( "Page served in : " + Str( nParseTime / 1000, 7, 4 ) + " seconds" ) hb_socketShutdown( hSocket ) hb_socketClose( hSocket ) @@ -1104,7 +1108,7 @@ STATIC FUNCTION ServiceConnection() ENDIF // Memory release - hb_GCAll( .T. ) + hb_gcAll( .T. ) ENDDO @@ -1114,8 +1118,8 @@ STATIC FUNCTION ServiceConnection() // an external quit request. In this case application is quitting and I cannot resize array // here to avoid race condition IF !lQuitRequest .AND. hb_mutexLock( s_hmtxBusy ) - IF ( nPos := aScan( s_aServiceThreads, hb_threadSelf() ) > 0 ) - hb_aDel( s_aServiceThreads, nPos, .T. ) + IF ( nPos := AScan( s_aServiceThreads, hb_threadSelf() ) > 0 ) + hb_ADel( s_aServiceThreads, nPos, .T. ) s_nServiceThreads := Len( s_aServiceThreads ) ENDIF hb_mutexUnlock( s_hmtxBusy ) @@ -1124,6 +1128,7 @@ STATIC FUNCTION ServiceConnection() RETURN 0 STATIC FUNCTION ParseRequest( cRequest ) + LOCAL aRequest, aLine, nI, nJ, cI LOCAL cReq, aVal, cFields, hVars LOCAL hUrl @@ -1137,10 +1142,10 @@ STATIC FUNCTION ParseRequest( cRequest ) WriteToConsole( aRequest[ 1 ] ) aLine := uhttpd_split( " ", aRequest[ 1 ] ) - IF LEN( aLine ) != 3 .OR. ; + IF Len( aLine ) != 3 .OR. ; ( !( Left( aLine[ 1 ], 3 ) == "GET" ) .AND. ; !( Left( aLine[ 1 ], 4 ) == "POST" ) ) .OR. ; // Sorry, we support GET and POST only - !( LEFT( aLine[ 3 ], 5 ) == "HTTP/" ) + !( Left( aLine[ 3 ], 5 ) == "HTTP/" ) // Set status code t_nStatusCode := 501 // Not Implemented RETURN .F. @@ -1166,46 +1171,46 @@ STATIC FUNCTION ParseRequest( cRequest ) ENDIF */ - FOR nI := 2 TO LEN( aRequest ) + FOR nI := 2 TO Len( aRequest ) IF aRequest[ nI ] == ""; EXIT - ELSEIF ( nJ := AT( ":", aRequest[ nI ] ) ) > 0 - cI := LTRIM( SUBSTR( aRequest[ nI ], nJ + 1)) - SWITCH UPPER( LEFT( aRequest[ nI ], nJ - 1)) - CASE "ACCEPT" - CASE "ACCEPT-CHARSET" - CASE "ACCEPT-ENCODING" - CASE "ACCEPT-LANGUAGE" - CASE "CACHE-CONTROL" - CASE "CONNECTION" - CASE "COOKIE" - CASE "KEEP-ALIVE" - CASE "REFERER" - CASE "USER-AGENT" - _SERVER[ "HTTP_" + STRTRAN( UPPER( LEFT( aRequest[ nI ], nJ - 1 ) ), "-", "_" ) ] := cI - EXIT - CASE "HOST" - //aVal := uhttpd_split( ":", aRequest[ nI ] ) - //_SERVER[ "HTTP_" + STRTRAN( UPPER( aVal[ 1 ] ), "-", "_")] := AllTrim( aVal[ 2 ] ) - _SERVER[ "HTTP_" + STRTRAN( UPPER( LEFT( aRequest[ nI ], nJ - 1 ) ), "-", "_" ) ] := cI - EXIT - CASE "CONTENT-TYPE" - CASE "CONTENT-LENGTH" - _SERVER[ STRTRAN( UPPER( LEFT( aRequest[ nI ], nJ - 1 ) ), "-", "_" ) ] := cI - EXIT - ENDSWITCH + ELSEIF ( nJ := At( ":", aRequest[ nI ] ) ) > 0 + cI := LTrim( SubStr( aRequest[ nI ], nJ + 1 ) ) + SWITCH Upper( Left( aRequest[ nI ], nJ - 1 ) ) + CASE "ACCEPT" + CASE "ACCEPT-CHARSET" + CASE "ACCEPT-ENCODING" + CASE "ACCEPT-LANGUAGE" + CASE "CACHE-CONTROL" + CASE "CONNECTION" + CASE "COOKIE" + CASE "KEEP-ALIVE" + CASE "REFERER" + CASE "USER-AGENT" + _SERVER[ "HTTP_" + StrTran( Upper( Left( aRequest[ nI ], nJ - 1 ) ), "-", "_" ) ] := cI + EXIT + CASE "HOST" + // aVal := uhttpd_split( ":", aRequest[ nI ] ) + // _SERVER[ "HTTP_" + STRTRAN( UPPER( aVal[ 1 ] ), "-", "_")] := AllTrim( aVal[ 2 ] ) + _SERVER[ "HTTP_" + StrTran( Upper( Left( aRequest[ nI ], nJ - 1 ) ), "-", "_" ) ] := cI + EXIT + CASE "CONTENT-TYPE" + CASE "CONTENT-LENGTH" + _SERVER[ StrTran( Upper( Left( aRequest[ nI ], nJ - 1 ) ), "-", "_" ) ] := cI + EXIT + ENDSWITCH ENDIF NEXT // Load _HTTP_REQUEST FOR EACH cReq IN aRequest - IF cReq:__enumIndex() == 1 // GET request - hb_HSet( _HTTP_REQUEST, "HTTP Request", cReq ) - ELSEIF Empty( cReq ) - EXIT - ELSE - aVal := uhttpd_split( ":", cReq, 1 ) - hb_HSet( _HTTP_REQUEST, aVal[ 1 ], iif( Len( aVal ) == 2, AllTrim( aVal[ 2 ] ), NIL ) ) - ENDIF + IF cReq:__enumIndex() == 1 // GET request + hb_HSet( _HTTP_REQUEST, "HTTP Request", cReq ) + ELSEIF Empty( cReq ) + EXIT + ELSE + aVal := uhttpd_split( ":", cReq, 1 ) + hb_HSet( _HTTP_REQUEST, aVal[ 1 ], iif( Len( aVal ) == 2, AllTrim( aVal[ 2 ] ), NIL ) ) + ENDIF NEXT // check if Host field is provided @@ -1223,7 +1228,7 @@ STATIC FUNCTION ParseRequest( cRequest ) ENDIF - //hb_toOutDebug( "_HTTP_REQUEST: aRequest = %s, _HTTP_REQUEST = %s\n\r", hb_ValToExp( aRequest ), hb_ValToExp( _HTTP_REQUEST ) ) + // hb_toOutDebug( "_HTTP_REQUEST: aRequest = %s, _HTTP_REQUEST = %s\n\r", hb_ValToExp( aRequest ), hb_ValToExp( _HTTP_REQUEST ) ) // GET cFields := _SERVER[ "QUERY_STRING" ] @@ -1233,11 +1238,11 @@ STATIC FUNCTION ParseRequest( cRequest ) hb_HMerge( _REQUEST, hVars ) ENDIF - //hb_toOutDebug( "GET: cFields = %s, hVars = %s, _GET = %s, _REQUEST = %s\n\r", cFields, hb_ValToExp( hVars ), hb_ValToExp( _GET ), hb_ValToExp( _REQUEST ) ) + // hb_toOutDebug( "GET: cFields = %s, hVars = %s, _GET = %s, _REQUEST = %s\n\r", cFields, hb_ValToExp( hVars ), hb_ValToExp( _GET ), hb_ValToExp( _REQUEST ) ) // POST IF "POST" $ Upper( _SERVER[ 'REQUEST_METHOD' ] ) - cFields := aTail( aRequest ) + cFields := ATail( aRequest ) IF !Empty( cFields ) hVars := uhttpd_GetVars( cFields ) hb_HMerge( _POST, hVars ) @@ -1246,7 +1251,7 @@ STATIC FUNCTION ParseRequest( cRequest ) m_cPost := cFields // TOFIX: Who needs this ? ENDIF - //hb_toOutDebug( "POST: cFields = %s, hVars = %s, _POST = %s, _REQUEST = %s\n\r", cFields, hb_ValToExp( hVars ), hb_ValToExp( _POST ), hb_ValToExp( _REQUEST ) ) + // hb_toOutDebug( "POST: cFields = %s, hVars = %s, _POST = %s, _REQUEST = %s\n\r", cFields, hb_ValToExp( hVars ), hb_ValToExp( _POST ), hb_ValToExp( _REQUEST ) ) // COOKIES cFields := _SERVER[ 'HTTP_COOKIE' ] @@ -1255,7 +1260,7 @@ STATIC FUNCTION ParseRequest( cRequest ) hb_HMerge( _COOKIE, hVars ) hb_HMerge( _REQUEST, hVars ) ENDIF - //hb_toOutDebug( "COOKIE: cFields = %s, hVars = %s, _COOKIE = %s, _REQUEST = %s\n\r", cFields, hb_ValToExp( hVars ), hb_ValToExp( _COOKIE ), hb_ValToExp( _REQUEST ) ) + // hb_toOutDebug( "COOKIE: cFields = %s, hVars = %s, _COOKIE = %s, _REQUEST = %s\n\r", cFields, hb_ValToExp( hVars ), hb_ValToExp( _COOKIE ), hb_ValToExp( _REQUEST ) ) // define _HTTP_RESPONSE @@ -1263,11 +1268,11 @@ STATIC FUNCTION ParseRequest( cRequest ) _HTTP_RESPONSE[ "Connection" ] := "Close" _HTTP_RESPONSE[ "Content-Type" ] := "text/html; charset=UTF-8" _HTTP_RESPONSE[ "Server" ] := APP_NAME + " " + APP_VERSION - //_HTTP_RESPONSE[ "Transfer-Encoding" ] := "chunked" + // _HTTP_RESPONSE[ "Transfer-Encoding" ] := "chunked" // Complete _SERVER _SERVER[ "SERVER_NAME" ] := uhttpd_split( ":", _HTTP_REQUEST[ "HOST" ], 1 )[ 1 ] - _SERVER[ "SCRIPT_FILENAME" ] := STRTRAN( STRTRAN( _SERVER[ "DOCUMENT_ROOT" ] + _SERVER[ "SCRIPT_NAME" ], "//", "/" ), "\", "/" ) + _SERVER[ "SCRIPT_FILENAME" ] := StrTran( StrTran( _SERVER[ "DOCUMENT_ROOT" ] + _SERVER[ "SCRIPT_NAME" ], "//", "/" ), "\", "/" ) _SERVER[ "SCRIPT_URL" ] := _SERVER[ "SCRIPT_NAME" ] _SERVER[ "SCRIPT_URI" ] := "http://" + _HTTP_REQUEST[ "HOST" ] + _SERVER[ "SCRIPT_NAME" ] @@ -1290,11 +1295,12 @@ STATIC FUNCTION ParseRequest( cRequest ) STATIC FUNCTION MakeResponse() + LOCAL cRet, cReturnCode, v - //uhttpd_SetHeader( "X-Powered-By", Version() ) + // uhttpd_SetHeader( "X-Powered-By", Version() ) - //uhttpd_SetHeader( "Connection", "close" ) + // uhttpd_SetHeader( "Connection", "close" ) IF uhttpd_GetHeader( "Location" ) != NIL t_nStatusCode := 301 @@ -1307,39 +1313,39 @@ STATIC FUNCTION MakeResponse() cReturnCode := DecodeStatusCode() SWITCH t_nStatusCode - CASE 200 - EXIT + CASE 200 + EXIT - CASE 301 - CASE 400 - CASE 401 - CASE 402 - CASE 403 - CASE 404 - CASE 405 - CASE 500 - CASE 501 - CASE 502 - CASE 503 - CASE 504 - CASE 505 - t_cResult := "

" + cReturnCode + "

" - EXIT + CASE 301 + CASE 400 + CASE 401 + CASE 402 + CASE 403 + CASE 404 + CASE 405 + CASE 500 + CASE 501 + CASE 502 + CASE 503 + CASE 504 + CASE 505 + t_cResult := "

" + cReturnCode + "

" + EXIT - // extended error messages - from Microsoft IIS Server - CASE 500013 // error: 500-13 Server too busy - uhttpd_SetHeader( "Retry-After", "60" ) // retry after 60 seconds - t_cResult := "

500 Server Too Busy

" - EXIT + // extended error messages - from Microsoft IIS Server + CASE 500013 // error: 500-13 Server too busy + uhttpd_SetHeader( "Retry-After", "60" ) // retry after 60 seconds + t_cResult := "

500 Server Too Busy

" + EXIT - CASE 500100 // error: 500-100 Undeclared Variable + CASE 500100 // error: 500-100 Undeclared Variable - OTHERWISE - cReturnCode := "403 Forbidden" - t_cResult := "

" + cReturnCode + "

" + OTHERWISE + cReturnCode := "403 Forbidden" + t_cResult := "

" + cReturnCode + "

" ENDSWITCH - //hb_ToOutDebug( "_SESSION = %s\n\r", hb_ValToExp( _SESSION ) ) + // hb_ToOutDebug( "_SESSION = %s\n\r", hb_ValToExp( _SESSION ) ) // Close session - Autodestructor will NOT close it, because t_oSession is destroyed only at end of Thread @@ -1352,123 +1358,125 @@ STATIC FUNCTION MakeResponse() cRet += cReturnCode + CR_LF FOR EACH v IN _HTTP_RESPONSE - cRet += v:__enumKey() + ": " + v + CR_LF + cRet += v:__enumKey() + ": " + v + CR_LF NEXT - //AEVAL( t_aHeader, {| x | cRet += x[1] + ": " + x[2] + CR_LF } ) + // AEVAL( t_aHeader, {| x | cRet += x[1] + ": " + x[2] + CR_LF } ) cRet += CR_LF cRet += t_cResult - //hb_ToOutDebug( "_HTTP_RESPONSE = %s\n\rcRet = %s\n\r", hb_ValToExp( _HTTP_RESPONSE ), cRet ) + // hb_ToOutDebug( "_HTTP_RESPONSE = %s\n\rcRet = %s\n\r", hb_ValToExp( _HTTP_RESPONSE ), cRet ) RETURN cRet STATIC FUNCTION DecodeStatusCode() + LOCAL cReturnCode SWITCH t_nStatusCode - CASE 200 - cReturnCode := "200 OK" - EXIT - CASE 301 - cReturnCode := "301 Moved Permanently" - EXIT - CASE 400 - cReturnCode := "400 Bad Request" - EXIT - CASE 401 - cReturnCode := "401 Unauthorized" - EXIT - CASE 402 - cReturnCode := "402 Payment Required" - EXIT - CASE 403 - cReturnCode := "403 Forbidden" - EXIT - CASE 404 - cReturnCode := "404 Not Found" - EXIT - CASE 405 - cReturnCode := "405 Method Not Allowed" - EXIT - CASE 500 - cReturnCode := "500 Internal Server Error" - EXIT - CASE 501 - cReturnCode := "501 Not Implemented" - EXIT - CASE 502 - cReturnCode := "502 Bad Gateway" - EXIT - CASE 503 - cReturnCode := "503 Service Unavailable" - EXIT - CASE 504 - cReturnCode := "504 Gateway Timeout" - EXIT - CASE 505 - cReturnCode := "505 HTTP Version Not Supported" - EXIT + CASE 200 + cReturnCode := "200 OK" + EXIT + CASE 301 + cReturnCode := "301 Moved Permanently" + EXIT + CASE 400 + cReturnCode := "400 Bad Request" + EXIT + CASE 401 + cReturnCode := "401 Unauthorized" + EXIT + CASE 402 + cReturnCode := "402 Payment Required" + EXIT + CASE 403 + cReturnCode := "403 Forbidden" + EXIT + CASE 404 + cReturnCode := "404 Not Found" + EXIT + CASE 405 + cReturnCode := "405 Method Not Allowed" + EXIT + CASE 500 + cReturnCode := "500 Internal Server Error" + EXIT + CASE 501 + cReturnCode := "501 Not Implemented" + EXIT + CASE 502 + cReturnCode := "502 Bad Gateway" + EXIT + CASE 503 + cReturnCode := "503 Service Unavailable" + EXIT + CASE 504 + cReturnCode := "504 Gateway Timeout" + EXIT + CASE 505 + cReturnCode := "505 HTTP Version Not Supported" + EXIT - // extended error messages - from Microsoft IIS Server - CASE 500013 // error: 500-13 Server too busy - cReturnCode := "500-13 Server Too Busy" - EXIT + // extended error messages - from Microsoft IIS Server + CASE 500013 // error: 500-13 Server too busy + cReturnCode := "500-13 Server Too Busy" + EXIT - CASE 500100 // error: 500-100 Undeclared Variable + CASE 500100 // error: 500-100 Undeclared Variable - OTHERWISE - cReturnCode := "403 Forbidden" + OTHERWISE + cReturnCode := "403 Forbidden" ENDSWITCH RETURN cReturnCode STATIC PROCEDURE WriteToLog( cRequest ) + LOCAL cTime, cDate LOCAL aDays := { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" } - LOCAL aMonths := {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"} + LOCAL aMonths := { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" } LOCAL cAccess, cError, nDoW, dDate, nDay, nMonth, nYear, nSize, cBias LOCAL cErrorMsg LOCAL cReferer IF hb_mutexLock( s_hmtxLog ) - //hb_ToOutDebug( "TIP_TimeStamp() = %s \n\r", TIP_TIMESTAMP() ) + // hb_ToOutDebug( "TIP_TimeStamp() = %s \n\r", TIP_TIMESTAMP() ) - cTime := TIME() + cTime := Time() dDate := Date() - cDate := DTOS( dDate ) - nSize := LEN( t_cResult ) + cDate := DToS( dDate ) + nSize := Len( t_cResult ) cReferer := _SERVER[ "HTTP_REFERER" ] cBias := uhttpd_UTCOffset() - cAccess := _SERVER[ "REMOTE_ADDR" ] + " - - [" + RIGHT( cDate, 2 ) + "/" + ; - aMonths[ VAL( SUBSTR( cDate, 5, 2 ) ) ] + ; - "/" + LEFT( cDate, 4 ) + ":" + cTime + ' ' + cBias + '] "' + ; - LEFT( cRequest, AT( CR_LF, cRequest ) - 1 ) + '" ' + ; - hb_ntos( t_nStatusCode ) + " " + iif( nSize == 0, "-", hb_ntos( nSize ) ) + ; - ' "' + iif( Empty( cReferer ), "-", cReferer ) + '" "' + _SERVER[ "HTTP_USER_AGENT" ] + ; - '"' + hb_eol() + cAccess := _SERVER[ "REMOTE_ADDR" ] + " - - [" + Right( cDate, 2 ) + "/" + ; + aMonths[ Val( SubStr( cDate, 5, 2 ) ) ] + ; + "/" + Left( cDate, 4 ) + ":" + cTime + ' ' + cBias + '] "' + ; + Left( cRequest, At( CR_LF, cRequest ) - 1 ) + '" ' + ; + hb_ntos( t_nStatusCode ) + " " + iif( nSize == 0, "-", hb_ntos( nSize ) ) + ; + ' "' + iif( Empty( cReferer ), "-", cReferer ) + '" "' + _SERVER[ "HTTP_USER_AGENT" ] + ; + '"' + hb_eol() - //hb_ToOutDebug( "AccessLog = %s \n\r", cAccess ) + // hb_ToOutDebug( "AccessLog = %s \n\r", cAccess ) - FWRITE( s_hfileLogAccess, cAccess ) + FWrite( s_hfileLogAccess, cAccess ) IF !( t_nStatusCode == 200 ) // ok - nDoW := Dow( dDate ) + nDoW := DoW( dDate ) nDay := Day( dDate ) nMonth := Month( dDate ) nYear := Year( dDate ) cErrorMsg := t_cErrorMsg 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_eol() + PadL( LTrim( cTime ), 8, "0" ) + " " + StrZero( nYear, 4 ) + "] [error] [client " + _SERVER[ "REMOTE_ADDR" ] + "] " + ; + cErrorMsg + hb_eol() - //hb_ToOutDebug( "ErrorLog = %s \n\r", cError ) + // hb_ToOutDebug( "ErrorLog = %s \n\r", cError ) - FWRITE( s_hfileLogError, cError ) + FWrite( s_hfileLogError, cError ) ENDIF hb_mutexUnlock( s_hmtxLog ) @@ -1477,6 +1485,7 @@ STATIC PROCEDURE WriteToLog( cRequest ) RETURN STATIC FUNCTION CGIExec( cProc, /*@*/ cOutPut ) + LOCAL hIn, hOut LOCAL cData, nLen, cSend, v LOCAL nErrorLevel := 0, nKillExit := 0 @@ -1484,51 +1493,52 @@ STATIC FUNCTION CGIExec( cProc, /*@*/ cOutPut ) LOCAL hProc LOCAL hmtxCGIKill := hb_mutexCreate() LOCAL cCurPath - //LOCAL cError + + // LOCAL cError IF HB_ISSTRING( cProc ) - //hb_toOutDebug( "Launching process: %s\n\r", cProc ) + // hb_toOutDebug( "Launching process: %s\n\r", cProc ) // No hIn, hErr == hOut // save current directory cCurPath := hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() - //hb_toOutDebug( "cCurPath: %s\n\r", cCurPath ) + // hb_toOutDebug( "cCurPath: %s\n\r", cCurPath ) // Change dir to document root DirChange( s_cDocumentRoot ) - //hb_toOutDebug( "New Path: %s\n\r", hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() ) + // hb_toOutDebug( "New Path: %s\n\r", hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() ) hProc := hb_processOpen( cProc, @hIn, @hOut, @hOut, .T. ) // .T. = Detached Process (Hide Window) // return to original folder DirChange( cCurPath ) - //hb_toOutDebug( "New 2 Path: %s\n\r", hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() ) + // hb_toOutDebug( "New 2 Path: %s\n\r", hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() ) IF hProc > -1 - //hb_toOutDebug( "Process handler: %s\n\r", hProc ) - //hb_toOutDebug( "Error: %s\n\r", FError() ) + // hb_toOutDebug( "Process handler: %s\n\r", hProc ) + // hb_toOutDebug( "Error: %s\n\r", FError() ) pThread := hb_threadStart( @CGIKill(), hProc, hmtxCGIKill ) // Sending POST variables to CGI via STD_IN cSend := "" FOR EACH v IN _POST - cSend += v:__enumKey() + "=" + LTrim( hb_cStr( v ) ) + iif( v:__enumIndex() < Len( _POST ), "&", "" ) + cSend += v:__enumKey() + "=" + LTrim( hb_CStr( v ) ) + iif( v:__enumIndex() < Len( _POST ), "&", "" ) NEXT FWrite( hIn, cSend ) - //hb_toOutDebug( "Sending: %s\n\r", cSend ) + // hb_toOutDebug( "Sending: %s\n\r", cSend ) hb_mutexNotify( hmtxCGIKill, { hProc, .T. } ) - //hb_toOutDebug( "Reading output\n\r" ) + // hb_toOutDebug( "Reading output\n\r" ) cData := Space( 1000 ) cOutPut := "" - DO WHILE ( nLen := Fread( hOut, @cData, Len( cData ) ) ) > 0 + DO WHILE ( nLen := FRead( hOut, @cData, Len( cData ) ) ) > 0 cOutPut += SubStr( cData, 1, nLen ) cData := Space( 1000 ) ENDDO @@ -1544,19 +1554,19 @@ STATIC FUNCTION CGIExec( cProc, /*@*/ cOutPut ) cOutPut += cError */ - //hb_toOutDebug( "Received: cOutPut = %s\n\r", cOutPut ) + // hb_toOutDebug( "Received: cOutPut = %s\n\r", cOutPut ) - //? "Waiting for process termination" + // ? "Waiting for process termination" // Return value - nErrorLevel := HB_ProcessValue( hProc ) + nErrorLevel := hb_processValue( hProc ) - //hb_toOutDebug( "CGIExec HB_ProcessValue nErrorLevel = %s\n\r", nErrorLevel ) + // hb_toOutDebug( "CGIExec HB_ProcessValue nErrorLevel = %s\n\r", nErrorLevel ) // Notify to CGIKill to terminate hb_mutexNotify( hmtxCGIKill, { hProc, .F. } ) hb_threadJoin( pThread, @nKillExit ) - //hb_toOutDebug( "CGIExec quitting CGI, nErrorLevel = %s\n\r", nKillExit ) + // hb_toOutDebug( "CGIExec quitting CGI, nErrorLevel = %s\n\r", nKillExit ) IF nKillExit != 0 // retrieving last command from nErrorLevel := nKillExit @@ -1565,9 +1575,9 @@ STATIC FUNCTION CGIExec( cProc, /*@*/ cOutPut ) FClose( hProc ) FClose( hIn ) FClose( hOut ) - //FClose( hErr ) + // FClose( hErr ) - //hb_toOutDebug( "CGIExec closed handles\n\r" ) + // hb_toOutDebug( "CGIExec closed handles\n\r" ) ENDIF @@ -1582,13 +1592,14 @@ STATIC FUNCTION CGIExec( cProc, /*@*/ cOutPut ) RETURN nErrorLevel STATIC FUNCTION CGIKill( hProc, hmtxCGIKill ) + LOCAL lWait - LOCAL nStartTime := hb_milliseconds() + LOCAL nStartTime := hb_MilliSeconds() LOCAL nErrorLevel := 0 LOCAL aValue, hRecProc LOCAL hCurProc := hProc - //hb_toOutDebug( "CGIKill() Started. nStartTime = %s\n\r", nStartTime ) + // hb_toOutDebug( "CGIKill() Started. nStartTime = %s\n\r", nStartTime ) // Kill process after MAX_PROCESS_EXEC_TIME DO WHILE .T. @@ -1607,23 +1618,23 @@ STATIC FUNCTION CGIKill( hProc, hmtxCGIKill ) ENDIF ENDIF - //hb_toOutDebug( "CGIKill() lWait = %s, time := %s\n\r", lWait, hb_milliseconds() - nStartTime ) + // hb_toOutDebug( "CGIKill() lWait = %s, time := %s\n\r", lWait, hb_milliseconds() - nStartTime ) IF HB_ISLOGICAL( lWait ) IF lWait - nStartTime := hb_milliseconds() + nStartTime := hb_MilliSeconds() ELSE EXIT ENDIF ENDIF - IF ( hb_milliseconds() - nStartTime ) > CGI_MAX_EXEC_TIME * 1000 + IF ( hb_MilliSeconds() - nStartTime ) > CGI_MAX_EXEC_TIME * 1000 - //hb_toOutDebug( "CGIKill() Killing Process hCurProc = %s\n\r", hCurProc ) + // hb_toOutDebug( "CGIKill() Killing Process hCurProc = %s\n\r", hCurProc ) // Killing process if still exists IF hCurProc != NIL - HB_ProcessClose( hCurProc ) + hb_processClose( hCurProc ) nErrorLevel := 1 ENDIF EXIT @@ -1638,20 +1649,25 @@ STATIC FUNCTION CGIKill( hProc, hmtxCGIKill ) ********************************************************************/ FUNCTION uhttpd_OSFileName( cFileName ) + IF hb_ps() == "/" RETURN cFileName ENDIF - RETURN STRTRAN( cFileName, "/", hb_ps() ) -PROCEDURE uhttpd_SetStatusCode(nStatusCode) + RETURN StrTran( cFileName, "/", hb_ps() ) + +PROCEDURE uhttpd_SetStatusCode( nStatusCode ) + t_nStatusCode := nStatusCode + RETURN PROCEDURE uhttpd_SetHeader( cType, cValue ) -// LOCAL nI -// // Needed from SetCookie() -// __defaultNIL( @lReplace, .T. ) + + // LOCAL nI + // // Needed from SetCookie() + // __defaultNIL( @lReplace, .T. ) hb_HSet( _HTTP_RESPONSE, cType, cValue ) @@ -1679,10 +1695,13 @@ FUNCTION uhttpd_GetHeader( cType ) */ PROCEDURE uhttpd_DelHeader( cType ) + LOCAL nPos := hb_HPos( _HTTP_RESPONSE, cType ) + IF nPos > 0 hb_HDelAt( _HTTP_RESPONSE, nPos ) ENDIF + RETURN /* LOCAL nI @@ -1694,7 +1713,9 @@ PROCEDURE uhttpd_DelHeader( cType ) */ PROCEDURE uhttpd_Write( cString ) + t_cResult += cString + RETURN /******************************************************************** @@ -1702,6 +1723,7 @@ PROCEDURE uhttpd_Write( cString ) ********************************************************************/ STATIC FUNCTION readRequest( hSocket, /* @ */ cRequest ) + LOCAL cBuf, nLen, nPos /* receive query */ @@ -1712,7 +1734,7 @@ STATIC FUNCTION readRequest( hSocket, /* @ */ cRequest ) IF nLen <= 0 EXIT ENDIF - cRequest += LEFT( cBuf, nLen ) + cRequest += Left( cBuf, nLen ) IF CR_LF + CR_LF $ cRequest EXIT ENDIF @@ -1720,9 +1742,9 @@ STATIC FUNCTION readRequest( hSocket, /* @ */ cRequest ) /* receive CONTENT-LENGTH data */ IF nLen > 0 - nPos := HB_ATI( CR_LF + "CONTENT-LENGTH:", cRequest ) + nPos := hb_AtI( CR_LF + "CONTENT-LENGTH:", cRequest ) IF nPos > 0 - nPos := Val( Substr( cRequest, nPos + 17, 10 ) ) + nPos := Val( SubStr( cRequest, nPos + 17, 10 ) ) IF nPos > 0 /* we have to decrease number of bytes to read by already read * data after CR_LF + CR_LF @@ -1734,7 +1756,7 @@ STATIC FUNCTION readRequest( hSocket, /* @ */ cRequest ) IF nLen <= 0 EXIT ENDIF - cRequest += LEFT( cBuf, nPos ) + cRequest += Left( cBuf, nPos ) nPos -= nLen ENDDO ENDIF @@ -1748,22 +1770,24 @@ STATIC FUNCTION readRequest( hSocket, /* @ */ cRequest ) RETURN nLen STATIC FUNCTION sendReply( hSocket, cSend ) + LOCAL nError := 0 LOCAL nLen - DO WHILE LEN( cSend ) > 0 + DO WHILE Len( cSend ) > 0 IF ( nLen := hb_socketSend( hSocket, cSend ) ) == -1 ? "send() error:", hb_socketGetError() WriteToConsole( hb_StrFormat( "ServiceConnection() - send() error: %s, cSend = %s, hSocket = %s", hb_socketGetError(), cSend, hSocket ) ) EXIT ELSEIF nLen > 0 - cSend := SUBSTR( cSend, nLen + 1 ) + cSend := SubStr( cSend, nLen + 1 ) ENDIF ENDDO RETURN nError STATIC PROCEDURE defineServer( hSocket ) + LOCAL aI // define _SERVER vars (address part) @@ -1810,37 +1834,42 @@ STATIC PROCEDURE defineServer( hSocket ) RETURN FUNCTION uhttpd_split( cSeparator, cString, nMax ) + LOCAL aRet := {}, nI LOCAL nIter := 0 __defaultNIL( @nMax, 0 ) - DO WHILE ( nI := AT( cSeparator, cString ) ) > 0 - AADD( aRet, LEFT( cString, nI - 1 ) ) - cString := SUBSTR( cString, nI + LEN( cSeparator ) ) + DO WHILE ( nI := At( cSeparator, cString ) ) > 0 + AAdd( aRet, Left( cString, nI - 1 ) ) + cString := SubStr( cString, nI + Len( cSeparator ) ) IF nMax > 0 .AND. ++nIter >= nMax EXIT ENDIF ENDDO - AADD( aRet, cString ) + AAdd( aRet, cString ) + RETURN aRet FUNCTION uhttpd_join( cSeparator, aData ) + LOCAL cRet := "", nI - FOR nI := 1 TO LEN( aData ) + FOR nI := 1 TO Len( aData ) IF nI > 1; cRet += cSeparator ENDIF - SWITCH VALTYPE( aData[ nI ] ) + SWITCH ValType( aData[ nI ] ) CASE "C" CASE "M"; cRet += aData[ nI ]; EXIT - CASE "N"; cRet += LTRIM(STR(aData[ nI ])); EXIT - CASE "D"; cRet += iif(!EMPTY(aData[ nI ]), DTOC(aData[ nI ]), ""); EXIT + CASE "N"; cRet += LTrim( Str( aData[ nI ] ) ); EXIT + CASE "D"; cRet += iif( !Empty( aData[ nI ] ), DToC( aData[ nI ] ), "" ); EXIT ENDSWITCH NEXT + RETURN cRet STATIC FUNCTION uproc_default() + LOCAL cScript LOCAL cFileName, nI LOCAL cExt, cHandler, xAction, nPos @@ -1850,15 +1879,15 @@ STATIC FUNCTION uproc_default() // Starting from Script Name request cScript := _SERVER[ "SCRIPT_NAME" ] - //cFileName := STRTRAN(cRoot + _SERVER["SCRIPT_NAME"], "//", "/") + // cFileName := STRTRAN(cRoot + _SERVER["SCRIPT_NAME"], "//", "/") cFileName := NIL cPathInfo := "" DO WHILE .T. - #ifdef DEBUG_ACTIVE - //hb_ToOutDebug( "cFileName = %s, cScript = %s\n\r", cFileName, cScript ) - #endif +#ifdef DEBUG_ACTIVE + // hb_ToOutDebug( "cFileName = %s, cScript = %s\n\r", cFileName, cScript ) +#endif IF cFileName == NIL @@ -1881,9 +1910,9 @@ STATIC FUNCTION uproc_default() cFileName := _SERVER[ "SCRIPT_FILENAME" ] ENDIF - #ifdef DEBUG_ACTIVE - //hb_ToOutDebug( "cFileName = %s, uhttpd_OSFileName( cFileName ) = %s,\n\r", cFileName, uhttpd_OSFileName( cFileName ) ) - #endif +#ifdef DEBUG_ACTIVE + // hb_ToOutDebug( "cFileName = %s, uhttpd_OSFileName( cFileName ) = %s,\n\r", cFileName, uhttpd_OSFileName( cFileName ) ) +#endif // Security IF ".." $ cFileName @@ -1892,31 +1921,31 @@ STATIC FUNCTION uproc_default() RETURN MakeResponse() ENDIF - //hb_toOutDebug( "cFileName = %s, uhttpd_OSFileName( cFileName ) = %s,\n\r s_hScriptAliases = %s\n\r", cFileName, uhttpd_OSFileName( cFileName ), hb_ValToExp( s_hScriptAliases ) ) + // hb_toOutDebug( "cFileName = %s, uhttpd_OSFileName( cFileName ) = %s,\n\r s_hScriptAliases = %s\n\r", cFileName, uhttpd_OSFileName( cFileName ), hb_ValToExp( s_hScriptAliases ) ) // checking extension IF cExt == NIL // checking if file exists - IF HB_FileExists( uhttpd_OSFileName( cFileName ) ) + IF hb_FileExists( uhttpd_OSFileName( cFileName ) ) // extract extension - IF ( nI := RAT( ".", cFileName ) ) > 0 - cExt := LOWER( SUBSTR( cFileName, nI + 1 ) ) + IF ( nI := RAt( ".", cFileName ) ) > 0 + cExt := Lower( SubStr( cFileName, nI + 1 ) ) ENDIF - // is it a directory ? - ELSEIF HB_DirExists( uhttpd_OSFileName( cFileName ) ) + // is it a directory ? + ELSEIF hb_DirExists( uhttpd_OSFileName( cFileName ) ) // if it exists as folder and it is missing trailing slash I add it and redirect to it - IF !( RIGHT( cFileName, 1 ) == "/" ) + IF !( Right( cFileName, 1 ) == "/" ) uhttpd_SetHeader( "Location", "http://" + _SERVER[ "HTTP_HOST" ] + _SERVER[ "SCRIPT_NAME" ] + "/" ) RETURN MakeResponse() ENDIF // Search for directory index file, i.e.: index.html - IF ASCAN( s_aDirectoryIndex, ; - {| x | iif( HB_FileExists( uhttpd_OSFileName( cFileName + X ) ), ( cFileName += X, .T. ), .F. ) } ) > 0 + IF AScan( s_aDirectoryIndex, ; + {| x | iif( hb_FileExists( uhttpd_OSFileName( cFileName + X ) ), ( cFileName += X, .T. ), .F. ) } ) > 0 // I have to check filename again (behaviour changes on extension file name) // resetting extension @@ -1932,30 +1961,30 @@ STATIC FUNCTION uproc_default() lFound := .F. DO WHILE !Empty( cBaseFile ) - //hb_toOutDebug( "cBaseFile = %s, cPathInfo = %s\n\r", cBaseFile, cPathInfo ) + // hb_toOutDebug( "cBaseFile = %s, cPathInfo = %s\n\r", cBaseFile, cPathInfo ) - IF ( nPos := RAT( "/", cBaseFile ) ) > 0 + IF ( nPos := RAt( "/", cBaseFile ) ) > 0 cPathInfo := SubStr( cBaseFile, nPos ) + cPathInfo cBaseFile := Left( cBaseFile, nPos - 1 ) ELSE EXIT ENDIF - IF HB_FileExists( uhttpd_OSFileName( _SERVER[ "DOCUMENT_ROOT" ] + cBaseFile ) ) + IF hb_FileExists( uhttpd_OSFileName( _SERVER[ "DOCUMENT_ROOT" ] + cBaseFile ) ) cFileName := uhttpd_OSFileName( _SERVER[ "DOCUMENT_ROOT" ] + cBaseFile ) lFound := .T. EXIT ENDIF cFile := FileUnAlias( cBaseFile ) - IF cFile != NIL .AND. HB_FileExists( uhttpd_OSFileName( cFile ) ) + IF cFile != NIL .AND. hb_FileExists( uhttpd_OSFileName( cFile ) ) cFileName := uhttpd_OSFileName( cFile ) lFound := .T. EXIT ENDIF ENDDO - //hb_toOutDebug( "Uscita: cBaseFile = %s, cPathInfo = %s\n\r", cBaseFile, cPathInfo ) + // hb_toOutDebug( "Uscita: cBaseFile = %s, cPathInfo = %s\n\r", cBaseFile, cPathInfo ) // Found a script file name IF lFound .AND. !Empty( cPathInfo ) @@ -1972,26 +2001,26 @@ STATIC FUNCTION uproc_default() // Ok, now I have to see what action I have to take - //hb_toOutDebug( "cExt = %s\n\r", cExt ) + // hb_toOutDebug( "cExt = %s\n\r", cExt ) // Begin to search Handlers IF cExt != NIL cHandler := uhttpd_HGetValue( s_hHandlers, cExt ) ENDIF - //hb_toOutDebug( "cHandler = %s\n\r", cHandler ) + // hb_toOutDebug( "cHandler = %s\n\r", cHandler ) IF cHandler != NIL xAction := uhttpd_HGetValue( s_hActions, cHandler ) ENDIF - //hb_toOutDebug( "xAction = %s\n\r", xAction ) + // hb_toOutDebug( "xAction = %s\n\r", xAction ) IF xAction == NIL xAction := @Handler_Default() ENDIF - //hb_toOutDebug( "xAction = %s\n\r", xAction ) + // hb_toOutDebug( "xAction = %s\n\r", xAction ) // Setting CGI vars define_Env( _SERVER ) @@ -2005,6 +2034,7 @@ STATIC FUNCTION uproc_default() // Define environment variables STATIC PROCEDURE Define_Env( hmServer ) + LOCAL v FOR EACH v IN hmServer @@ -2016,13 +2046,15 @@ STATIC PROCEDURE Define_Env( hmServer ) // ------------------------------- DEFAULT PAGES ----------------------------------- STATIC PROCEDURE ShowServerStatus() + LOCAL cThreads + uhttpd_SetHeader( "Content-Type", "text/html" ) uhttpd_Write( '' ) uhttpd_Write( '' ) uhttpd_Write( '' ) - uhttpd_Write( 'Server Status

Server Status

')
-   //uhttpd_Write( '')
+   uhttpd_Write( 'Server Status

Server Status

' )
+   // uhttpd_Write( '
') uhttpd_Write( 'SERVER: ' + _SERVER[ "SERVER_SOFTWARE" ] + " Server at " + _SERVER[ "SERVER_NAME" ] + " Port " + _SERVER[ "SERVER_PORT" ] ) uhttpd_Write( '
' ) @@ -2032,7 +2064,7 @@ STATIC PROCEDURE ShowServerStatus() uhttpd_Write( '
Max Connections: ' + Str( s_nMaxConnections ) ) uhttpd_Write( '
Total Connections: ' + Str( s_nTotConnections ) ) cThreads := "" - aEval( s_aRunningThreads, {| e | cThreads += hb_ntos( hb_threadId( e ) ) + "," } ) + AEval( s_aRunningThreads, {| e | cThreads += hb_ntos( hb_threadID( e ) ) + "," } ) cThreads := "{ " + iif( !Empty( cThreads ), Left( cThreads, Len( cThreads ) - 1 ), "" ) + " }" uhttpd_Write( '
Running Threads: ' + cThreads ) @@ -2042,7 +2074,7 @@ STATIC PROCEDURE ShowServerStatus() uhttpd_Write( '
Max Service Connections: ' + Str( s_nMaxServiceConnections ) ) uhttpd_Write( '
Total Service Connections: ' + Str( s_nTotServiceConnections ) ) cThreads := "" - aEval( s_aServiceThreads, {| e | cThreads += hb_ntos( hb_threadId( e ) ) + "," } ) + AEval( s_aServiceThreads, {| e | cThreads += hb_ntos( hb_threadID( e ) ) + "," } ) cThreads := "{ " + iif( !Empty( cThreads ), Left( cThreads, Len( cThreads ) - 1 ), "" ) + " }" uhttpd_Write( '
Service Threads: ' + cThreads ) #endif // FIXED_THREADS @@ -2051,32 +2083,33 @@ STATIC PROCEDURE ShowServerStatus() ENDIF uhttpd_Write( '
Time: ' + Time() ) - //uhttpd_Write( '
') + // uhttpd_Write( '') uhttpd_Write( "
" ) RETURN STATIC PROCEDURE ShowFolder( cDir ) + LOCAL aDir, aF LOCAL cParentDir, nPos uhttpd_SetHeader( "Content-Type", "text/html" ) - aDir := DIRECTORY( uhttpd_OSFileName( cDir ), "D" ) - IF HB_HHasKey( _GET, "s" ) + aDir := Directory( uhttpd_OSFileName( cDir ), "D" ) + IF hb_HHasKey( _GET, "s" ) IF _GET[ "s" ] == "s" - ASORT( aDir,,, {| X, Y | iif( X[ 5 ] == "D", iif( Y[ 5 ] == "D", X[ 1 ] < Y[ 1 ], .T. ), ; - iif( Y[ 5 ] == "D", .F., X[ 2 ] < Y[ 2 ] ) ) } ) + ASort( aDir,,, {| X, Y | iif( X[ 5 ] == "D", iif( Y[ 5 ] == "D", X[ 1 ] < Y[ 1 ], .T. ), ; + iif( Y[ 5 ] == "D", .F., X[ 2 ] < Y[ 2 ] ) ) } ) ELSEIF _GET[ "s" ] == "m" - ASORT( aDir,,, {| X, Y | iif( X[ 5 ] == "D", iif( Y[ 5 ] == "D", X[ 1 ] < Y[ 1 ], .T.), ; - iif( Y[ 5 ] == "D", .F., DTOS( X[ 3 ] ) + X[ 4 ] < DTOS( Y[ 3 ] ) + Y[ 4 ] ) ) } ) + ASort( aDir,,, {| X, Y | iif( X[ 5 ] == "D", iif( Y[ 5 ] == "D", X[ 1 ] < Y[ 1 ], .T. ), ; + iif( Y[ 5 ] == "D", .F., DToS( X[ 3 ] ) + X[ 4 ] < DToS( Y[ 3 ] ) + Y[ 4 ] ) ) } ) ELSE - ASORT( aDir,,, {| X, Y | iif( X[ 5 ] == "D", iif( Y[ 5 ] == "D", X[ 1 ] < Y[ 1 ], .T. ), ; - iif( Y[ 5 ] == "D", .F., X[ 1 ] < Y[ 1 ] ) ) } ) + ASort( aDir,,, {| X, Y | iif( X[ 5 ] == "D", iif( Y[ 5 ] == "D", X[ 1 ] < Y[ 1 ], .T. ), ; + iif( Y[ 5 ] == "D", .F., X[ 1 ] < Y[ 1 ] ) ) } ) ENDIF ELSE - ASORT( aDir,,, {| X, Y | iif( X[ 5 ] == "D", iif( Y[ 5 ] == "D", X[ 1 ] < Y[ 1 ], .T. ), ; - iif( Y[ 5 ] == "D", .F., X[ 1 ] < Y[ 1 ] ) ) } ) + ASort( aDir,,, {| X, Y | iif( X[ 5 ] == "D", iif( Y[ 5 ] == "D", X[ 1 ] < Y[ 1 ], .T. ), ; + iif( Y[ 5 ] == "D", .F., X[ 1 ] < Y[ 1 ] ) ) } ) ENDIF uhttpd_Write( '

Index of ' + _SERVER[ "SCRIPT_NAME" ] + '

      ' )
@@ -2085,29 +2118,29 @@ STATIC PROCEDURE ShowFolder( cDir )
    uhttpd_Write( 'Size' + CR_LF + '
' ) // Adding Upper Directory - nPos := RAT( "/", SUBSTR( cDir, 1, Len( cDir ) - 1 ) ) - cParentDir := SUBSTR( cDir, 1, nPos ) - cParentDir := SUBSTR( cParentDir, Len( _SERVER[ "DOCUMENT_ROOT" ] ) + 1 ) + nPos := RAt( "/", SubStr( cDir, 1, Len( cDir ) - 1 ) ) + cParentDir := SubStr( cDir, 1, nPos ) + cParentDir := SubStr( cParentDir, Len( _SERVER[ "DOCUMENT_ROOT" ] ) + 1 ) - //hb_ToOutDebug( "cDir = %s, nPos = %i, cParentDir = %s\n\r", cDir, nPos, cParentDir ) + // hb_ToOutDebug( "cDir = %s, nPos = %i, cParentDir = %s\n\r", cDir, nPos, cParentDir ) IF !Empty( cParentDir ) // Add parent directory - hb_aIns( aDir, 1, { "", 0, "", "", "D" }, .T. ) + hb_AIns( aDir, 1, { "", 0, "", "", "D" }, .T. ) ENDIF FOR EACH aF IN aDir - IF aF[ 1 ] == "" - uhttpd_Write( '[DIR] ..' + ; - CR_LF ) - ELSEIF LEFT( aF[ 1 ], 1 ) == "." - ELSEIF "D" $ aF[ 5 ] - uhttpd_Write( '[DIR] '+ aF[ 1 ] + '' + SPACE( 50 - LEN( aF[ 1 ] ) ) + ; - DTOC( aF[ 3 ] ) + ' ' + aF[ 4 ] + CR_LF ) - ELSE - uhttpd_Write( ' '+ aF[ 1 ] + '' + SPACE( 50 - LEN( aF[ 1 ] ) ) + ; - DTOC( aF[ 3 ]) + ' ' + aF[ 4 ] + STR( aF[ 2 ], 12 ) + CR_LF ) - ENDIF + IF aF[ 1 ] == "" + uhttpd_Write( '[DIR] ..' + ; + CR_LF ) + ELSEIF Left( aF[ 1 ], 1 ) == "." + ELSEIF "D" $ aF[ 5 ] + uhttpd_Write( '[DIR] ' + aF[ 1 ] + '' + Space( 50 - Len( aF[ 1 ] ) ) + ; + DToC( aF[ 3 ] ) + ' ' + aF[ 4 ] + CR_LF ) + ELSE + uhttpd_Write( ' ' + aF[ 1 ] + '' + Space( 50 - Len( aF[ 1 ] ) ) + ; + DToC( aF[ 3 ] ) + ' ' + aF[ 4 ] + Str( aF[ 2 ], 12 ) + CR_LF ) + ENDIF NEXT uhttpd_Write( "
" ) @@ -2117,10 +2150,13 @@ STATIC PROCEDURE ShowFolder( cDir ) // from Przemek's example, useful to use encrypted HRB module files STATIC FUNCTION HRB_LoadFromFileEncrypted( cFile, cKey ) + LOCAL cHrbBody - cHrbBody := hb_memoread( cFile ) - cHrbBody := sx_decrypt( cHrbBody, cKey ) - cHrbBody := hb_zuncompress( cHrbBody ) + + cHrbBody := hb_MemoRead( cFile ) + cHrbBody := sx_Decrypt( cHrbBody, cKey ) + cHrbBody := hb_ZUncompress( cHrbBody ) + RETURN cHrbBody /* @@ -2136,15 +2172,16 @@ PROCEDURE HRB_SaveToFileEncrypted( cHrbBody, cKey, cEncFileName ) */ STATIC FUNCTION HRB_LoadFromFile( cFile ) - RETURN hb_memoread( cFile ) + RETURN hb_MemoRead( cFile ) STATIC PROCEDURE Help() - //LOCAL cPrg := hb_argv( 0 ) - //LOCAL nPos := RAt( "\", cPrg ) - //__OutDebug( hb_argv(0) ) - //IF nPos > 0 + + // LOCAL cPrg := hb_argv( 0 ) + // LOCAL nPos := RAt( "\", cPrg ) + // __OutDebug( hb_argv(0) ) + // IF nPos > 0 // cPrg := SubStr( cPrg, nPos + 1 ) - //ENDIF + // ENDIF ? ? "(C) 2009 Francesco Saverio Giudice " ? @@ -2167,9 +2204,11 @@ STATIC PROCEDURE Help() ? "-h | -? | --help This help message" ? WAIT + RETURN STATIC PROCEDURE SysSettings() + SET SCOREBOARD OFF SET CENTURY ON SET DATE ANSI @@ -2178,39 +2217,47 @@ STATIC PROCEDURE SysSettings() SET CONFIRM ON SET ESCAPE ON SET WRAP ON - //RDDSetDefault( "DBFCDX" ) + // RDDSetDefault( "DBFCDX" ) + RETURN STATIC FUNCTION Exe_Path() + LOCAL cPath := hb_argv( 0 ) LOCAL nPos := RAt( hb_ps(), cPath ) + IF nPos == 0 cPath := "" ELSE cPath := SubStr( cPath, 1, nPos - 1 ) ENDIF + RETURN cPath STATIC FUNCTION Exe_Name() + LOCAL cPrg := hb_argv( 0 ) LOCAL nPos := RAt( hb_ps(), cPrg ) + IF nPos > 0 - cPrg := SubStr( cPrg, nPos+1 ) + cPrg := SubStr( cPrg, nPos + 1 ) ENDIF + RETURN cPrg STATIC PROCEDURE Progress( /*@*/ nProgress ) + LOCAL cString := "[" DO CASE CASE nProgress == 0 - cString += "-" + cString += "-" CASE nProgress == 1 - cString += "\" + cString += "\" CASE nProgress == 2 - cString += "|" + cString += "|" CASE nProgress == 3 - cString += "/" + cString += "/" ENDCASE cString += "]" @@ -2222,8 +2269,8 @@ STATIC PROCEDURE Progress( /*@*/ nProgress ) ENDIF // using hb_dispOutAt() to avoid MT screen updates problem - hb_dispOutAt( 10, 5, cString ) - hb_dispOutAt( 0, 60, "Time: " + Time() ) + hb_DispOutAt( 10, 5, cString ) + hb_DispOutAt( 0, 60, "Time: " + Time() ) RETURN @@ -2231,18 +2278,19 @@ STATIC PROCEDURE Progress( /*@*/ nProgress ) #define CONSOLE_FIRSTROW 12 #define CONSOLE_LASTROW MaxRow() STATIC PROCEDURE WriteToConsole( ... ) + LOCAL cMsg IF hb_mutexLock( s_hmtxConsole ) IF s_lConsole - FOR EACH cMsg IN hb_aParams() + FOR EACH cMsg IN hb_AParams() - hb_Scroll( CONSOLE_FIRSTROW, 0, CONSOLE_LASTROW, MaxCol(), -1 ) - hb_DispOutAt( CONSOLE_FIRSTROW, 0, PadR( "> " + hb_cStr( cMsg ), MaxCol() ) ) + hb_Scroll( CONSOLE_FIRSTROW, 0, CONSOLE_LASTROW, MaxCol(), -1 ) + hb_DispOutAt( CONSOLE_FIRSTROW, 0, PadR( "> " + hb_CStr( cMsg ), MaxCol() ) ) #ifdef DEBUG_ACTIVE - hb_ToOutDebug( ">>> %s\n\r", cMsg ) + hb_ToOutDebug( ">>> %s\n\r", cMsg ) #endif NEXT @@ -2254,11 +2302,12 @@ STATIC PROCEDURE WriteToConsole( ... ) RETURN STATIC FUNCTION ParseIni( cConfig ) - LOCAL hIni := hb_IniRead( cConfig, .T. ) // .T. = load all keys in MixedCase, redundant as it is default, but to remember + + LOCAL hIni := hb_iniRead( cConfig, .T. ) // .T. = load all keys in MixedCase, redundant as it is default, but to remember LOCAL cSection, hSect, cKey, xVal, cVal, nPos LOCAL hDefault - //hb_ToOutDebug( "cConfig = %s,\n\rhIni = %s\n\r", cConfig, hb_ValToExp( hIni ) ) + // hb_ToOutDebug( "cConfig = %s,\n\rhIni = %s\n\r", cConfig, hb_ValToExp( hIni ) ) // Define here what attributes we can have in ini config file and their defaults // Please add all keys in uppercase. hDefaults is Case Insensitive @@ -2288,151 +2337,153 @@ STATIC FUNCTION ParseIni( cConfig ) "ALIASES" => { => } ; }, .F. ) - //hb_ToOutDebug( "hDefault = %s\n\r", hb_ValToExp( hDefault ) ) + // hb_ToOutDebug( "hDefault = %s\n\r", hb_ValToExp( hDefault ) ) // Now read changes from ini file and modify only admited keys IF !Empty( hIni ) FOR EACH cSection IN hIni:Keys - cSection := Upper( cSection ) + cSection := Upper( cSection ) - //hb_ToOutDebug( "cSection = %s\n\r", cSection ) + // hb_ToOutDebug( "cSection = %s\n\r", cSection ) - IF cSection $ hDefault + IF cSection $ hDefault - hSect := hIni[ cSection ] + hSect := hIni[ cSection ] - //hb_ToOutDebug( "hSect = %s\n\r", hb_ValToExp( hSect ) ) + // hb_ToOutDebug( "hSect = %s\n\r", hb_ValToExp( hSect ) ) - IF HB_ISHASH( hSect ) - FOR EACH cKey IN hSect:Keys + IF HB_ISHASH( hSect ) + FOR EACH cKey IN hSect:Keys - // Please, below check values MUST be uppercase + // Please, below check values MUST be uppercase - //hb_ToOutDebug( "cKey = %s\n\r", cKey ) + // hb_ToOutDebug( "cKey = %s\n\r", cKey ) - IF cSection == "SCRIPTALIASES" - xVal := hSect[ cKey ] - IF xVal != NIL - hDefault[ cSection ][ cKey ] := xVal - ENDIF + IF cSection == "SCRIPTALIASES" + xVal := hSect[ cKey ] + IF xVal != NIL + hDefault[ cSection ][ cKey ] := xVal + ENDIF - ELSEIF cSection == "ALIASES" - xVal := hSect[ cKey ] - IF xVal != NIL - hDefault[ cSection ][ cKey ] := xVal - ENDIF + ELSEIF cSection == "ALIASES" + xVal := hSect[ cKey ] + IF xVal != NIL + hDefault[ cSection ][ cKey ] := xVal + ENDIF - ELSEIF ( cKey := Upper( cKey ) ) $ hDefault[ cSection ] // force cKey to be uppercase + ELSEIF ( cKey := Upper( cKey ) ) $ hDefault[ cSection ] // force cKey to be uppercase - IF ( nPos := hb_HScan( hSect, {| k | Upper( k ) == cKey } ) ) > 0 - cVal := hb_HValueAt( hSect, nPos ) + IF ( nPos := hb_HScan( hSect, {| k | Upper( k ) == cKey } ) ) > 0 + cVal := hb_HValueAt( hSect, nPos ) - //hb_ToOutDebug( "cVal = %s\n\r", cVal ) + // hb_ToOutDebug( "cVal = %s\n\r", cVal ) - DO CASE - CASE cSection == "MAIN" + DO CASE + CASE cSection == "MAIN" - DO CASE - CASE cKey == "PORT" - xVal := Val( cVal ) - CASE cKey == "CONSOLE-ROWS" - xVal := Val( cVal ) - CASE cKey == "CONSOLE-COLS" - xVal := Val( cVal ) - CASE cKey == "APPLICATION_ROOT" - IF !Empty( cVal ) - // Change APP_DIR macro with current exe path - xVal := cVal - ENDIF - CASE cKey == "DOCUMENT_ROOT" - IF !Empty( cVal ) - // After will change APP_DIR macro with application dir - //xVal := StrTran( cVal, "$(APP_DIR)", Exe_Path() ) - xVal := cVal - ENDIF - CASE cKey == "SCRIPTALIASMIXEDCASE" - xVal := cVal - CASE cKey == "SESSIONPATH" - IF !Empty( cVal ) - // Change APP_DIR macro with current exe path - //xVal := StrTran( cVal, "$(APP_DIR)", Exe_Path() ) - xVal := cVal - ENDIF - CASE cKey == "DIRECTORYINDEX" - IF !Empty( cVal ) - xVal := uhttpd_split( " ", AllTrim( cVal ) ) - ENDIF - ENDCASE + DO CASE + CASE cKey == "PORT" + xVal := Val( cVal ) + CASE cKey == "CONSOLE-ROWS" + xVal := Val( cVal ) + CASE cKey == "CONSOLE-COLS" + xVal := Val( cVal ) + CASE cKey == "APPLICATION_ROOT" + IF !Empty( cVal ) + // Change APP_DIR macro with current exe path + xVal := cVal + ENDIF + CASE cKey == "DOCUMENT_ROOT" + IF !Empty( cVal ) + // After will change APP_DIR macro with application dir + // xVal := StrTran( cVal, "$(APP_DIR)", Exe_Path() ) + xVal := cVal + ENDIF + CASE cKey == "SCRIPTALIASMIXEDCASE" + xVal := cVal + CASE cKey == "SESSIONPATH" + IF !Empty( cVal ) + // Change APP_DIR macro with current exe path + // xVal := StrTran( cVal, "$(APP_DIR)", Exe_Path() ) + xVal := cVal + ENDIF + CASE cKey == "DIRECTORYINDEX" + IF !Empty( cVal ) + xVal := uhttpd_split( " ", AllTrim( cVal ) ) + ENDIF + ENDCASE - CASE cSection == "LOGFILES" + CASE cSection == "LOGFILES" - DO CASE - CASE cKey == "ACCESS" - xVal := cVal - CASE cKey == "ERROR" - xVal := cVal - ENDCASE + DO CASE + CASE cKey == "ACCESS" + xVal := cVal + CASE cKey == "ERROR" + xVal := cVal + ENDCASE - CASE cSection == "THREADS" + CASE cSection == "THREADS" - DO CASE - CASE cKey == "MAX_WAIT" - xVal := Val( cVal ) - CASE cKey == "START_NUM" - xVal := Val( cVal ) - CASE cKey == "MAX_NUM" - xVal := Val( cVal ) - ENDCASE + DO CASE + CASE cKey == "MAX_WAIT" + xVal := Val( cVal ) + CASE cKey == "START_NUM" + xVal := Val( cVal ) + CASE cKey == "MAX_NUM" + xVal := Val( cVal ) + ENDCASE - ENDCASE + ENDCASE - IF xVal != NIL - hDefault[ cSection ][ cKey ] := xVal - ENDIF - ENDIF + IF xVal != NIL + hDefault[ cSection ][ cKey ] := xVal + ENDIF + ENDIF - ENDIF - NEXT - ENDIF - ENDIF + ENDIF + NEXT + ENDIF + ENDIF NEXT ENDIF RETURN hDefault STATIC FUNCTION FileUnAlias( cScript ) + LOCAL cFileName, x // Checking if the request contains a Script Alias - IF HB_HHasKey( s_hScriptAliases, cScript ) + IF hb_HHasKey( s_hScriptAliases, cScript ) // in this case I have to substitute the alias with the real file name - cFileName := hb_hGet( s_hScriptAliases, cScript ) + cFileName := hb_HGet( s_hScriptAliases, cScript ) // substitute macros cFileName := StrTran( cFileName, "$(DOCROOT_DIR)", _SERVER[ "DOCUMENT_ROOT" ] ) - cFileName := StrTran( cFileName, "$(APP_DIR)" , s_cApplicationRoot ) + cFileName := StrTran( cFileName, "$(APP_DIR)", s_cApplicationRoot ) ENDIF IF cFileName == NIL // Checking if the request contains an alias FOR EACH x IN s_hAliases - IF x:__enumKey() == Left( cScript, Len( x:__enumKey() ) ) - cFileName := x + SubStr( cScript, Len( x:__enumKey() ) + 1 ) + IF x:__enumKey() == Left( cScript, Len( x:__enumKey() ) ) + cFileName := x + SubStr( cScript, Len( x:__enumKey() ) + 1 ) - // substitute macros - cFileName := StrTran( cFileName, "$(DOCROOT_DIR)", _SERVER[ "DOCUMENT_ROOT" ] ) - cFileName := StrTran( cFileName, "$(APP_DIR)" , s_cApplicationRoot ) - EXIT - ENDIF + // substitute macros + cFileName := StrTran( cFileName, "$(DOCROOT_DIR)", _SERVER[ "DOCUMENT_ROOT" ] ) + cFileName := StrTran( cFileName, "$(APP_DIR)", s_cApplicationRoot ) + EXIT + ENDIF NEXT ENDIF -RETURN cFileName + RETURN cFileName STATIC FUNCTION uhttpd_DefError( oError ) + LOCAL cMessage LOCAL cCallstack LOCAL cDOSError @@ -2539,13 +2590,14 @@ STATIC FUNCTION uhttpd_DefError( oError ) OutErr( cCallstack ) // Write to errorlog - cDateTime := HB_TTOC( hb_DateTime() ) - cString := Replicate( "*", 70 ) + cNewLine + ; - cDateTime + cNewLine + ; - Replicate( "*", 70 ) + cNewLine + ; - cMessage + cNewLine + ; - cCallstack + cNewLine + ; - Replicate( "*", 70 ) + cNewLine + cDateTime := hb_TToC( hb_DateTime() ) + cString := ; + Replicate( "*", 70 ) + cNewLine + ; + cDateTime + cNewLine + ; + Replicate( "*", 70 ) + cNewLine + ; + cMessage + cNewLine + ; + cCallstack + cNewLine + ; + Replicate( "*", 70 ) + cNewLine uhttpd_WriteToLogFile( cString, Exe_Path() + "\error.log" ) @@ -2594,26 +2646,27 @@ STATIC FUNCTION ErrorMessage( oError ) // This handler handle static files STATIC FUNCTION Handler_Default( cFileName ) + LOCAL cMime LOCAL cExt, nI LOCAL hMimeTypes := LoadMimeTypes() // If file exists - IF HB_FileExists( uhttpd_OSFileName( cFileName ) ) - IF ( nI := RAT( ".", cFileName ) ) > 0 - cExt := LOWER( SUBSTR( cFileName, nI + 1 ) ) + IF hb_FileExists( uhttpd_OSFileName( cFileName ) ) + IF ( nI := RAt( ".", cFileName ) ) > 0 + cExt := Lower( SubStr( cFileName, nI + 1 ) ) cMime := uhttpd_HGetValue( hMimeTypes, cExt ) ENDIF IF cMime == NIL // Unknown file type - cMime := "application/octet-stream" + cMime := "application/octet-stream" ENDIF uhttpd_SetHeader( "Content-Type", cMime ) - uhttpd_Write( HB_MEMOREAD( uhttpd_OSFileName( cFileName ) ) ) + uhttpd_Write( hb_MemoRead( uhttpd_OSFileName( cFileName ) ) ) - // Directory content request - ELSEIF HB_DirExists( uhttpd_OSFileName( cFileName ) ) + // Directory content request + ELSEIF hb_DirExists( uhttpd_OSFileName( cFileName ) ) // If I'm here it's means that I have no page, so, if it is defined, I will display content folder IF !s_lIndexes @@ -2632,17 +2685,19 @@ STATIC FUNCTION Handler_Default( cFileName ) ENDIF -RETURN MakeResponse() + RETURN MakeResponse() // This handler handle server status STATIC FUNCTION Handler_ServerStatus() + LOCAL cThreads + uhttpd_SetHeader( "Content-Type", "text/html" ) uhttpd_Write( '' ) uhttpd_Write( '' ) uhttpd_Write( '' ) - uhttpd_Write( 'Server Status

Server Status

')
-   //uhttpd_Write( '')
+   uhttpd_Write( 'Server Status

Server Status

' )
+   // uhttpd_Write( '
') uhttpd_Write( 'SERVER: ' + _SERVER[ "SERVER_SOFTWARE" ] + " Server at " + _SERVER[ "SERVER_NAME" ] + " Port " + _SERVER[ "SERVER_PORT" ] ) uhttpd_Write( '
' ) @@ -2652,7 +2707,7 @@ STATIC FUNCTION Handler_ServerStatus() uhttpd_Write( '
Max Connections: ' + Str( s_nMaxConnections ) ) uhttpd_Write( '
Total Connections: ' + Str( s_nTotConnections ) ) cThreads := "" - aEval( s_aRunningThreads, {| e | cThreads += hb_ntos( hb_threadId( e ) ) + "," } ) + AEval( s_aRunningThreads, {| e | cThreads += hb_ntos( hb_threadID( e ) ) + "," } ) cThreads := "{ " + iif( !Empty( cThreads ), Left( cThreads, Len( cThreads ) - 1 ), "" ) + " }" uhttpd_Write( '
Running Threads: ' + cThreads ) @@ -2662,7 +2717,7 @@ STATIC FUNCTION Handler_ServerStatus() uhttpd_Write( '
Max Service Connections: ' + Str( s_nMaxServiceConnections ) ) uhttpd_Write( '
Total Service Connections: ' + Str( s_nTotServiceConnections ) ) cThreads := "" - aEval( s_aServiceThreads, {| e | cThreads += hb_ntos( hb_threadId( e ) ) + "," } ) + AEval( s_aServiceThreads, {| e | cThreads += hb_ntos( hb_threadID( e ) ) + "," } ) cThreads := "{ " + iif( !Empty( cThreads ), Left( cThreads, Len( cThreads ) - 1 ), "" ) + " }" uhttpd_Write( '
Service Threads: ' + cThreads ) #endif // FIXED_THREADS @@ -2671,12 +2726,13 @@ STATIC FUNCTION Handler_ServerStatus() ENDIF uhttpd_Write( '
Time: ' + Time() ) - //uhttpd_Write( '
') + // uhttpd_Write( '') uhttpd_Write( "
" ) -RETURN MakeResponse() + RETURN MakeResponse() STATIC FUNCTION Handler_HrbScript( cFileName ) + LOCAL xResult LOCAL cHRBBody, pHRB, oError LOCAL cCurPath @@ -2696,27 +2752,27 @@ STATIC FUNCTION Handler_HrbScript( cFileName ) cHRBBody := s_hHRBModules[ cFileName ] ENDIF WriteToConsole( "Executing: " + cFileName ) - IF !EMPTY( pHRB := HB_HRBLOAD( cHRBBody ) ) + IF !Empty( pHRB := hb_hrbLoad( cHRBBody ) ) - // save current directory - cCurPath := hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() - // Change dir to document root - DirChange( s_cDocumentRoot ) + // save current directory + cCurPath := hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() + // Change dir to document root + DirChange( s_cDocumentRoot ) - xResult := HRBMAIN() + xResult := HRBMAIN() #ifdef DEBUG_ACTIVE - hb_ToOutDebug( "Handler_HrbScript(): cFileName = %s,\n\rcCurPath = %s,\n\rs_cDocumentRoot = %s,\n\rpHRB = %s,\n\rxResult = %s\n\r", ; - cFileName, cCurPath, s_cDocumentRoot, pHRB, xResult ) + hb_ToOutDebug( "Handler_HrbScript(): cFileName = %s,\n\rcCurPath = %s,\n\rs_cDocumentRoot = %s,\n\rpHRB = %s,\n\rxResult = %s\n\r", ; + cFileName, cCurPath, s_cDocumentRoot, pHRB, xResult ) #endif - // return to original folder - DirChange( cCurPath ) + // return to original folder + DirChange( cCurPath ) - HB_HRBUNLOAD( pHRB ) + hb_hrbUnload( pHRB ) ELSE - uhttpd_SetStatusCode( 404 ) - t_cErrorMsg := "File does not exist: " + cFileName + uhttpd_SetStatusCode( 404 ) + t_cErrorMsg := "File does not exist: " + cFileName ENDIF ALWAYS hb_mutexUnlock( s_hmtxHRB ) @@ -2737,30 +2793,31 @@ STATIC FUNCTION Handler_HrbScript( cFileName ) uhttpd_SetHeader( "Content-Type", "text/html" ) uhttpd_Write( "Error" ) - uhttpd_Write( "
Description: " + hb_cStr( oError:Description ) ) - uhttpd_Write( "
Filename: " + hb_cStr( oError:filename ) ) - uhttpd_Write( "
Operation: " + hb_cStr( oError:operation ) ) - uhttpd_Write( "
OsCode: " + hb_cStr( oError:osCode ) ) - uhttpd_Write( "
GenCode: " + hb_cStr( oError:genCode ) ) - uhttpd_Write( "
SubCode: " + hb_cStr( oError:subCode ) ) - uhttpd_Write( "
SubSystem: " + hb_cStr( oError:subSystem ) ) - uhttpd_Write( "
Args: " + hb_cStr( hb_ValToExp( oError:args ) ) ) - uhttpd_Write( "
ProcName: " + hb_cStr( procname( 0 ) ) ) - uhttpd_Write( "
ProcLine: " + hb_cStr( procline( 0 ) ) ) + uhttpd_Write( "
Description: " + hb_CStr( oError:Description ) ) + uhttpd_Write( "
Filename: " + hb_CStr( oError:filename ) ) + uhttpd_Write( "
Operation: " + hb_CStr( oError:operation ) ) + uhttpd_Write( "
OsCode: " + hb_CStr( oError:osCode ) ) + uhttpd_Write( "
GenCode: " + hb_CStr( oError:genCode ) ) + uhttpd_Write( "
SubCode: " + hb_CStr( oError:subCode ) ) + uhttpd_Write( "
SubSystem: " + hb_CStr( oError:subSystem ) ) + uhttpd_Write( "
Args: " + hb_CStr( hb_ValToExp( oError:args ) ) ) + uhttpd_Write( "
ProcName: " + hb_CStr( ProcName( 0 ) ) ) + uhttpd_Write( "
ProcLine: " + hb_CStr( ProcLine( 0 ) ) ) END SEQUENCE RETURN MakeResponse() STATIC FUNCTION Handler_CgiScript( cFileName ) + LOCAL xResult WriteToConsole( "Executing: " + cFileName ) - IF ( CGIExec( uhttpd_OSFileName(cFileName), @xResult ) ) == 0 + IF ( CGIExec( uhttpd_OSFileName( cFileName ), @xResult ) ) == 0 - //uhttpd_SetHeader( "Content-Type", cI ) - //uhttpd_Write( xResult ) + // uhttpd_SetHeader( "Content-Type", cI ) + // uhttpd_Write( xResult ) RETURN "HTTP/1.1 200 OK " + CR_LF + xResult ELSE @@ -2777,54 +2834,57 @@ STATIC FUNCTION Handler_CgiScript( cFileName ) RETURN MakeResponse() STATIC FUNCTION LoadMimeTypes() + // TODO: load mime types from file + RETURN { ; - "css" => "text/css" ,; - "htm" => "text/html" ,; - "html" => "text/html" ,; - "txt" => "text/plain" ,; - "text" => "text/plain" ,; - "asc" => "text/plain" ,; - "c" => "text/plain" ,; - "h" => "text/plain" ,; - "cpp" => "text/plain" ,; - "hpp" => "text/plain" ,; - "log" => "text/plain" ,; - "rtf" => "text/rtf" ,; - "xml" => "text/xml" ,; - "xsl" => "text/xsl" ,; - "bmp" => "image/bmp" ,; - "gif" => "image/gif" ,; - "jpg" => "image/jpeg" ,; - "jpe" => "image/jpeg" ,; - "jpeg" => "image/jpeg" ,; - "png" => "image/png" ,; - "tif" => "image/tiff" ,; - "tiff" => "image/tiff" ,; - "djv" => "image/vnd.djvu" ,; - "djvu" => "image/vnd.djvu" ,; - "ico" => "image/x-icon" ,; - "xls" => "application/excel" ,; - "doc" => "application/msword" ,; - "pdf" => "application/pdf" ,; - "ps" => "application/postscript" ,; - "eps" => "application/postscript" ,; - "ppt" => "application/powerpoint" ,; - "bz2" => "application/x-bzip2" ,; - "gz" => "application/x-gzip" ,; - "tgz" => "application/x-gtar" ,; - "js" => "application/x-javascript" ,; - "tar" => "application/x-tar" ,; - "tex" => "application/x-tex" ,; - "zip" => "application/zip" ,; - "midi" => "audio/midi" ,; - "mp3" => "audio/mpeg" ,; - "wav" => "audio/x-wav" ,; - "qt" => "video/quicktime" ,; - "mov" => "video/quicktime" ,; + "css" => "text/css",; + "htm" => "text/html",; + "html" => "text/html",; + "txt" => "text/plain",; + "text" => "text/plain",; + "asc" => "text/plain",; + "c" => "text/plain",; + "h" => "text/plain",; + "cpp" => "text/plain",; + "hpp" => "text/plain",; + "log" => "text/plain",; + "rtf" => "text/rtf",; + "xml" => "text/xml",; + "xsl" => "text/xsl",; + "bmp" => "image/bmp",; + "gif" => "image/gif",; + "jpg" => "image/jpeg",; + "jpe" => "image/jpeg",; + "jpeg" => "image/jpeg",; + "png" => "image/png",; + "tif" => "image/tiff",; + "tiff" => "image/tiff",; + "djv" => "image/vnd.djvu",; + "djvu" => "image/vnd.djvu",; + "ico" => "image/x-icon",; + "xls" => "application/excel",; + "doc" => "application/msword",; + "pdf" => "application/pdf",; + "ps" => "application/postscript",; + "eps" => "application/postscript",; + "ppt" => "application/powerpoint",; + "bz2" => "application/x-bzip2",; + "gz" => "application/x-gzip",; + "tgz" => "application/x-gtar",; + "js" => "application/x-javascript",; + "tar" => "application/x-tar",; + "tex" => "application/x-tex",; + "zip" => "application/zip",; + "midi" => "audio/midi",; + "mp3" => "audio/mpeg",; + "wav" => "audio/x-wav",; + "qt" => "video/quicktime",; + "mov" => "video/quicktime",; "avi" => "video/x-msvideo" } STATIC FUNCTION GT_notifier( nEvent, xParams ) + LOCAL nReturn := 0 DO CASE @@ -2841,7 +2901,9 @@ STATIC FUNCTION GT_notifier( nEvent, xParams ) RETURN nReturn STATIC FUNCTION UHTTPD_UTCOFFSET() - LOCAL nOffset := HB_UTCOFFSET() - RETURN iif( nOffset < 0, "-", "+" ) +; - StrZero( nOffset / 3600, 2, 0 ) +; - StrZero( ( nOffset % 3600 ) / 60, 2, 0 ) + + LOCAL nOffset := hb_UTCOffset() + + RETURN iif( nOffset < 0, "-", "+" ) + ; + StrZero( nOffset / 3600, 2, 0 ) + ; + StrZero( ( nOffset % 3600 ) / 60, 2, 0 ) diff --git a/harbour/extras/rddado/adordd.prg b/harbour/extras/rddado/adordd.prg index aa9621f113..d613d663c8 100644 --- a/harbour/extras/rddado/adordd.prg +++ b/harbour/extras/rddado/adordd.prg @@ -1183,11 +1183,11 @@ STATIC FUNCTION ADO_ORDDESTROY( nWA, aOrderInfo ) LOCAL aWAData := USRRDD_AREADATA( nWA ), n, oIndex IF aWAData[ WA_CATALOG ]:Tables( aWAData[ WA_TABLENAME ] ):Indexes != NIL - FOR n := 1 to aWAData[ WA_CATALOG ]:Tables( aWAData[ WA_TABLENAME ] ):Indexes:Count - oIndex := aWAData[ WA_CATALOG ]:Tables( aWAData[ WA_TABLENAME ] ):Indexes( n - 1 ) - IF oIndex:Name == aOrderInfo[ UR_ORI_TAG ] - aWAData[ WA_CATALOG ]:Tables( aWAData[ WA_TABLENAME ] ):Indexes:Delete( oIndex:Name ) - ENDIF + FOR n := 1 TO aWAData[ WA_CATALOG ]:Tables( aWAData[ WA_TABLENAME ] ):Indexes:Count + oIndex := aWAData[ WA_CATALOG ]:Tables( aWAData[ WA_TABLENAME ] ):Indexes( n - 1 ) + IF oIndex:Name == aOrderInfo[ UR_ORI_TAG ] + aWAData[ WA_CATALOG ]:Tables( aWAData[ WA_TABLENAME ] ):Indexes:Delete( oIndex:Name ) + ENDIF NEXT ENDIF @@ -1199,7 +1199,7 @@ STATIC FUNCTION ADO_EVALBLOCK( nArea, bBlock, uResult ) nCurrArea := Select() IF nCurrArea != nArea - DbSelectArea( nArea ) + dbSelectArea( nArea ) ELSE nCurrArea := 0 ENDIF @@ -1207,7 +1207,7 @@ STATIC FUNCTION ADO_EVALBLOCK( nArea, bBlock, uResult ) uResult := Eval( bBlock ) IF nCurrArea > 0 - DbSelectArea( nCurrArea ) + dbSelectArea( nCurrArea ) ENDIF RETURN HB_SUCCESS @@ -1221,13 +1221,13 @@ STATIC FUNCTION ADO_EXISTS( nRdd, cTable, cIndex, ulConnect ) IF ! Empty( cTable ) .AND. ! Empty( aRData[ WA_CATALOG ] ) BEGIN SEQUENCE WITH {| oErr | Break( oErr ) } - //n := aRData[ WA_CATALOG ]:Tables( cTable ) + // n := aRData[ WA_CATALOG ]:Tables( cTable ) lRet := HB_SUCCESS RECOVER END SEQUENCE IF ! Empty( cIndex ) BEGIN SEQUENCE WITH {| oErr | Break( oErr ) } - //n := aRData[ WA_CATALOG ]:Tables( cTable ):Indexes( cIndex ) + // n := aRData[ WA_CATALOG ]:Tables( cTable ):Indexes( cIndex ) lRet := HB_SUCCESS RECOVER END SEQUENCE @@ -1245,13 +1245,13 @@ STATIC FUNCTION ADO_DROP( nRdd, cTable, cIndex, ulConnect ) IF ! Empty( cTable ) .AND. ! Empty( aRData[ WA_CATALOG ] ) BEGIN SEQUENCE WITH {| oErr | Break( oErr ) } - //n := aRData[ WA_CATALOG ]:Tables:Delete( cTable ) + // n := aRData[ WA_CATALOG ]:Tables:Delete( cTable ) lRet := HB_SUCCESS RECOVER END SEQUENCE IF ! Empty( cIndex ) BEGIN SEQUENCE WITH {| oErr | Break( oErr ) } - //n := aRData[ WA_CATALOG ]:Tables( cTable ):Indexes:Delete( cIndex ) + // n := aRData[ WA_CATALOG ]:Tables( cTable ):Indexes:Delete( cIndex ) lRet := HB_SUCCESS RECOVER END SEQUENCE @@ -1554,7 +1554,7 @@ PROCEDURE HB_AdoSetLocateFor( cLocateFor ) STATIC FUNCTION SQLTranslate( cExpr ) - IF Left( cExpr, 1 ) == '"' .and. Right( cExpr, 1 ) == '"' + IF Left( cExpr, 1 ) == '"' .AND. Right( cExpr, 1 ) == '"' cExpr := SubStr( cExpr, 2, Len( cExpr ) - 2 ) ENDIF diff --git a/harbour/extras/rddado/tests/access1.prg b/harbour/extras/rddado/tests/access1.prg index 2cc4962481..c825c12aad 100644 --- a/harbour/extras/rddado/tests/access1.prg +++ b/harbour/extras/rddado/tests/access1.prg @@ -11,7 +11,7 @@ PROCEDURE Main() SET DATE ANSI SET CENTURY ON - USE ( hb_dirBase() + "test.mdb" ) VIA "ADORDD" TABLE "Table1" + USE ( hb_DirBase() + "test.mdb" ) VIA "ADORDD" TABLE "Table1" Browse() diff --git a/harbour/extras/rddado/tests/access2.prg b/harbour/extras/rddado/tests/access2.prg index c571183001..0762bfb6bb 100644 --- a/harbour/extras/rddado/tests/access2.prg +++ b/harbour/extras/rddado/tests/access2.prg @@ -13,10 +13,11 @@ PROCEDURE Main() SET DATE ANSI SET CENTURY ON - dbCreate( "test2.mdb;table1", { { "FIRST", "C", 10, 0 },; - { "LAST", "C", 10, 0 },; - { "AGE", "N", 8, 0 },; - { "MYDATE", "D", 8, 0 } }, "ADORDD" ) + dbCreate( "test2.mdb;table1", { ; + { "FIRST", "C", 10, 0 }, ; + { "LAST", "C", 10, 0 }, ; + { "AGE", "N", 8, 0 }, ; + { "MYDATE", "D", 8, 0 } }, "ADORDD" ) USE test2.mdb VIA "ADORDD" TABLE "table1" diff --git a/harbour/extras/rddado/tests/mysql3.prg b/harbour/extras/rddado/tests/mysql3.prg index 425c72df0a..6571d8fc38 100644 --- a/harbour/extras/rddado/tests/mysql3.prg +++ b/harbour/extras/rddado/tests/mysql3.prg @@ -15,7 +15,7 @@ PROCEDURE Main() LOCATE FOR "City LIKE 'Chi*'" - DO WHILE ! EOF() + DO WHILE ! Eof() ? test00->First, test00->City CONTINUE ENDDO diff --git a/harbour/extras/superlib/hbsuper.prg b/harbour/extras/superlib/hbsuper.prg index 8d493b1f72..d179cc587f 100644 --- a/harbour/extras/superlib/hbsuper.prg +++ b/harbour/extras/superlib/hbsuper.prg @@ -59,11 +59,15 @@ FUNCTION ISPRN( p ) RETURN hb_IsPrinter( p ) PROCEDURE RAT_ON() + MShow() + RETURN PROCEDURE RAT_OFF() + MHide() + RETURN FUNCTION RAT_ROW() @@ -73,14 +77,18 @@ FUNCTION RAT_COL() RETURN MCol() PROCEDURE RAT_POSIT( nRow, nCol ) + MSetPos( nRow, nCol ) + RETURN FUNCTION RAT_EXIST() RETURN MPresent() PROCEDURE RAT_AREA( nTop, nLeft, nBottom, nRight ) + MSetBounds( nTop, nLeft, nBottom, nRight ) + RETURN FUNCTION RAT_LBHD @@ -123,5 +131,7 @@ FUNCTION RAT_RIGHTB() /* TOFIX: This is just a dummy stub */ FUNCTION SHIFTY( f ) + HB_SYMBOL_UNUSED( f ) + RETURN .F. diff --git a/harbour/include/harbour.hbx b/harbour/include/harbour.hbx index 3d1c7aa8ed..e3aeb4e74d 100644 --- a/harbour/include/harbour.hbx +++ b/harbour/include/harbour.hbx @@ -70,11 +70,11 @@ DYNAMIC ATail DYNAMIC Bin2I DYNAMIC Bin2L DYNAMIC Bin2W -DYNAMIC BOF +DYNAMIC Bof DYNAMIC Break DYNAMIC Browse DYNAMIC ButtnDefCo -DYNAMIC CDOW +DYNAMIC CDoW DYNAMIC cftsAdd DYNAMIC cftsClose DYNAMIC cftsCrea @@ -190,12 +190,12 @@ DYNAMIC DispOut DYNAMIC DispOutAt DYNAMIC Do DYNAMIC DosError -DYNAMIC DOW +DYNAMIC DoW DYNAMIC DToC DYNAMIC DToS DYNAMIC ElapTime DYNAMIC Empty -DYNAMIC EOF +DYNAMIC Eof DYNAMIC EraseGetMsg DYNAMIC ErrorBlock DYNAMIC ErrorInHan @@ -673,7 +673,7 @@ DYNAMIC hb_MemoRead DYNAMIC hb_MemoWrit DYNAMIC hb_MethodName DYNAMIC hb_MGetBounds -DYNAMIC hb_milliSeconds +DYNAMIC hb_MilliSeconds DYNAMIC hb_Minute DYNAMIC hb_MMiddleDown DYNAMIC hb_mtvm @@ -699,7 +699,7 @@ DYNAMIC hb_osError DYNAMIC hb_osFileMask DYNAMIC hb_osIs64bit DYNAMIC hb_osIsWin2K -DYNAMIC hb_osIsWin9X +DYNAMIC hb_osIsWin9x DYNAMIC hb_osIsWinCE DYNAMIC hb_osIsWinNT DYNAMIC hb_osIsWinVista @@ -908,7 +908,7 @@ DYNAMIC Int DYNAMIC IsAffirm DYNAMIC IsAlpha DYNAMIC IsColor -DYNAMIC IsDefcolor +DYNAMIC IsDefColor DYNAMIC IsDigit DYNAMIC IsDisk DYNAMIC IsLower @@ -1167,8 +1167,8 @@ DYNAMIC sx_SetTurbo DYNAMIC sx_SkipUnique DYNAMIC sx_SlimFast DYNAMIC sx_SortOption -DYNAMIC sx_STEP -DYNAMIC sx_STRXCHECK +DYNAMIC sx_Step +DYNAMIC sx_StrXCheck DYNAMIC sx_TableName DYNAMIC sx_TableType DYNAMIC sx_TagCount @@ -1207,7 +1207,7 @@ DYNAMIC TBModal DYNAMIC TBMouse DYNAMIC TBReader DYNAMIC TBrowse -DYNAMIC TBrowseDb +DYNAMIC TBrowseDB DYNAMIC TBrowseNew DYNAMIC TBSBlock DYNAMIC TBSkip @@ -1229,7 +1229,7 @@ DYNAMIC Year DYNAMIC _CHECKBOX_ DYNAMIC _DBF DYNAMIC _dtxCondSet -DYNAMIC _EInstVar +DYNAMIC _eInstVar DYNAMIC _GETNUMCOL DYNAMIC _IsGraphic DYNAMIC _LISTBOX_ @@ -1364,10 +1364,10 @@ DYNAMIC __dynSIsFun DYNAMIC __dynSN2Ptr DYNAMIC __dynSN2Sym DYNAMIC __dynSP2Name -DYNAMIC __EInstVar52 -DYNAMIC __EInstVar53 +DYNAMIC __eInstVar52 +DYNAMIC __eInstVar53 DYNAMIC __Eject -DYNAMIC __ErrInHandler +DYNAMIC __errInHandler DYNAMIC __errRT_BASE DYNAMIC __errRT_SBASE DYNAMIC __FLedit diff --git a/harbour/package/harb_win.mft b/harbour/package/harb_win.mft index 2469727b58..d5d1cf131b 100644 --- a/harbour/package/harb_win.mft +++ b/harbour/package/harb_win.mft @@ -1,10 +1,11 @@  - + diff --git a/harbour/package/harbour.rb b/harbour/package/harbour.rb index 9843489195..cb463cf292 100644 --- a/harbour/package/harbour.rb +++ b/harbour/package/harbour.rb @@ -9,7 +9,7 @@ class Harbour < Formula homepage 'harbour-project.sourceforge.net/' sha1 '66c21d666ac24c45485179eeaa9f90458b552e92' - head 'https://harbour-project.svn.sourceforge.net/svnroot/harbour-project/trunk/harbour' + head 'https://svn.code.sf.net/p/harbour-project/code/trunk/harbour' # depends_on 'pcre' if ARGV.include? '--with-pcre' diff --git a/harbour/package/mpkg_src_nightly.sh b/harbour/package/mpkg_src_nightly.sh index cc1270bffb..354d0c56e4 100755 --- a/harbour/package/mpkg_src_nightly.sh +++ b/harbour/package/mpkg_src_nightly.sh @@ -55,7 +55,7 @@ cd _hb_mpkg_src echo Downloading sources with LF line ending... -svn export -q --native-eol LF http://harbour-project.svn.sourceforge.net/svnroot/harbour-project/trunk/harbour +svn export -q --native-eol LF http://svn.code.sf.net/p/harbour-project/code/trunk/harbour echo Creating bz2, gz packages... @@ -68,7 +68,7 @@ rm harbour-nightly.tar echo Downloading sources with CRLF line ending... rm -f -r harbour -svn export -q --native-eol CRLF http://harbour-project.svn.sourceforge.net/svnroot/harbour-project/trunk/harbour +svn export -q --native-eol CRLF http://svn.code.sf.net/p/harbour-project/code/trunk/harbour echo Creating zip package... diff --git a/harbour/package/mpkg_win_nightly.bat b/harbour/package/mpkg_win_nightly.bat index fe5d99bb7b..1f49497d14 100644 --- a/harbour/package/mpkg_win_nightly.bat +++ b/harbour/package/mpkg_win_nightly.bat @@ -41,7 +41,7 @@ set _HB_DIR_TOOL=%~dp0tool\ echo ! Downloading Harbour sources... if exist harbour rd /q /s harbour -%_HB_DIR_TOOL%svn\bin\svn export http://harbour-project.svn.sourceforge.net/svnroot/harbour-project/trunk/harbour +%_HB_DIR_TOOL%svn\bin\svn export http://svn.code.sf.net/p/harbour-project/code/trunk/harbour if errorlevel 1 goto _EXIT cd harbour diff --git a/harbour/package/updt_web_nightly.sh b/harbour/package/updt_web_nightly.sh index 2d5c254999..a940ca890f 100755 --- a/harbour/package/updt_web_nightly.sh +++ b/harbour/package/updt_web_nightly.sh @@ -53,7 +53,7 @@ cd _hb_web_src echo Downloading sources... -svn export -q --native-eol LF http://harbour-project.svn.sourceforge.net/svnroot/harbour-project/trunk/harbour/website +svn export -q --native-eol LF http://svn.code.sf.net/p/harbour-project/code/trunk/harbour/website echo Updating website... diff --git a/harbour/src/common/hbver.c b/harbour/src/common/hbver.c index f9295aa8a5..6aafda2275 100644 --- a/harbour/src/common/hbver.c +++ b/harbour/src/common/hbver.c @@ -392,7 +392,14 @@ char * hb_verPlatform( void ) if( GetVersionEx( ( OSVERSIONINFO * ) &osVerEx ) ) { - if( osVer.dwMinorVersion == 1 ) + if( osVer.dwMinorVersion == 2 ) + { + if( osVerEx.wProductType == VER_NT_WORKSTATION ) + pszName = " 8"; + else + pszName = " Server 2012"; + } + else if( osVer.dwMinorVersion == 1 ) { if( osVerEx.wProductType == VER_NT_WORKSTATION ) pszName = " 7"; @@ -476,7 +483,7 @@ char * hb_verPlatform( void ) int i; /* Skip the leading spaces (Win95B, Win98) */ - for( i = 0; pszCSDVersion[ i ] != '\0' && HB_ISSPACE( ( int ) pszCSDVersion[ i ] ); i++ ) {}; + for( i = 0; pszCSDVersion[ i ] != '\0' && HB_ISSPACE( ( int ) pszCSDVersion[ i ] ); i++ ); if( pszCSDVersion[ i ] != '\0' ) { @@ -539,7 +546,7 @@ static void s_hb_winVerInit( void ) s_fWinVista = osvi.dwMajorVersion >= 6; s_fWin2K3 = s_fWinVista; s_fWin2K = osvi.dwMajorVersion >= 5; - s_fWinNT = osvi.dwPlatformId == VER_PLATFORM_WIN32_NT; /* && osvi.dwMajorVersion >= 4); */ + s_fWinNT = osvi.dwPlatformId == VER_PLATFORM_WIN32_NT; /* && osvi.dwMajorVersion >= 4 ); */ s_fWin9x = osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS; #if !defined( HB_OS_WIN_CE ) && !defined( __DMC__ ) && \ @@ -1093,5 +1100,5 @@ char * hb_verBuildDate( void ) pszDate = ( char * ) hb_xgrab( 64 ); hb_snprintf( pszDate, 64, "%s %s", __DATE__, __TIME__ ); - return pszDate; + return pszDate; } diff --git a/harbour/src/compiler/cmdcheck.c b/harbour/src/compiler/cmdcheck.c index bf27f95b8c..8afa13c47f 100644 --- a/harbour/src/compiler/cmdcheck.c +++ b/harbour/src/compiler/cmdcheck.c @@ -64,11 +64,11 @@ /* 76543210765432107654321076543210 |.......|.......|.......|....... |____| Year 6 bits - |__| Month 4 bits - |___| Day 5 bits - |___| Hour 5 bits - |____| Minute 6 bits - |____| Second 6 bits */ + . |__| Month 4 bits + . |___| Day 5 bits + . |___| Hour 5 bits + . |____| Minute 6 bits + . |____| Second 6 bits */ static HB_ULONG PackDateTime( void ) { diff --git a/harbour/src/compiler/harbour.y b/harbour/src/compiler/harbour.y index 6c5ce40275..62d00799b8 100644 --- a/harbour/src/compiler/harbour.y +++ b/harbour/src/compiler/harbour.y @@ -1232,7 +1232,7 @@ Declaration: DECLARE IdentName '(' { hb_compDeclaredAdd( HB_COMP_PARAM, $2 ); HB { HB_COMP_PARAM->pLastDeclared->cType = $7->cVarType; - if ( HB_TOUPPER( $7->cVarType ) == 'S' ) + if( HB_TOUPPER( $7->cVarType ) == 'S' ) { HB_COMP_PARAM->pLastDeclared->pClass = hb_compClassFind( HB_COMP_PARAM, $7->szFromClass ); if( ! HB_COMP_PARAM->pLastDeclared->pClass ) @@ -1267,7 +1267,7 @@ DecMethod : IdentName '(' { HB_COMP_PARAM->pLastMethod = hb_compMethodAdd( HB_C if( HB_COMP_PARAM->pLastMethod ) { HB_COMP_PARAM->pLastMethod->cType = $6->cVarType; - if ( HB_TOUPPER( $6->cVarType ) == 'S' ) + if( HB_TOUPPER( $6->cVarType ) == 'S' ) { HB_COMP_PARAM->pLastMethod->pClass = hb_compClassFind( HB_COMP_PARAM, $6->szFromClass ); if( ! HB_COMP_PARAM->pLastMethod->pClass ) @@ -1295,7 +1295,7 @@ DecData : IdentName { HB_COMP_PARAM->pLastMethod = hb_compMethodAdd( HB_COMP_ cVarType = HB_COMP_PARAM->cDataListType; HB_COMP_PARAM->pLastMethod->cType = cVarType; - if ( HB_TOUPPER( cVarType ) == 'S' ) + if( HB_TOUPPER( cVarType ) == 'S' ) { pClass = hb_compClassFind( HB_COMP_PARAM, $3->szFromClass ); HB_COMP_PARAM->pLastMethod->pClass = pClass; @@ -1326,7 +1326,7 @@ DecData : IdentName { HB_COMP_PARAM->pLastMethod = hb_compMethodAdd( HB_COMP_ HB_COMP_PARAM->pLastMethod->cParamTypes[0] = cVarType; HB_COMP_PARAM->pLastMethod->pParamClasses[0] = pClass; - if ( HB_TOUPPER( cVarType ) == 'S' ) + if( HB_TOUPPER( cVarType ) == 'S' ) { HB_COMP_PARAM->pLastMethod->pClass = pClass; } diff --git a/harbour/src/compiler/harbour.yyc b/harbour/src/compiler/harbour.yyc index 6e7db41e15..a9619985b3 100644 --- a/harbour/src/compiler/harbour.yyc +++ b/harbour/src/compiler/harbour.yyc @@ -6480,7 +6480,7 @@ yyreduce: { HB_COMP_PARAM->pLastDeclared->cType = (yyvsp[(7) - (8)].asVarType)->cVarType; - if ( HB_TOUPPER( (yyvsp[(7) - (8)].asVarType)->cVarType ) == 'S' ) + if( HB_TOUPPER( (yyvsp[(7) - (8)].asVarType)->cVarType ) == 'S' ) { HB_COMP_PARAM->pLastDeclared->pClass = hb_compClassFind( HB_COMP_PARAM, (yyvsp[(7) - (8)].asVarType)->szFromClass ); if( ! HB_COMP_PARAM->pLastDeclared->pClass ) @@ -6559,7 +6559,7 @@ yyreduce: if( HB_COMP_PARAM->pLastMethod ) { HB_COMP_PARAM->pLastMethod->cType = (yyvsp[(6) - (6)].asVarType)->cVarType; - if ( HB_TOUPPER( (yyvsp[(6) - (6)].asVarType)->cVarType ) == 'S' ) + if( HB_TOUPPER( (yyvsp[(6) - (6)].asVarType)->cVarType ) == 'S' ) { HB_COMP_PARAM->pLastMethod->pClass = hb_compClassFind( HB_COMP_PARAM, (yyvsp[(6) - (6)].asVarType)->szFromClass ); if( ! HB_COMP_PARAM->pLastMethod->pClass ) @@ -6597,7 +6597,7 @@ yyreduce: cVarType = HB_COMP_PARAM->cDataListType; HB_COMP_PARAM->pLastMethod->cType = cVarType; - if ( HB_TOUPPER( cVarType ) == 'S' ) + if( HB_TOUPPER( cVarType ) == 'S' ) { pClass = hb_compClassFind( HB_COMP_PARAM, (yyvsp[(3) - (3)].asVarType)->szFromClass ); HB_COMP_PARAM->pLastMethod->pClass = pClass; @@ -6628,7 +6628,7 @@ yyreduce: HB_COMP_PARAM->pLastMethod->cParamTypes[0] = cVarType; HB_COMP_PARAM->pLastMethod->pParamClasses[0] = pClass; - if ( HB_TOUPPER( cVarType ) == 'S' ) + if( HB_TOUPPER( cVarType ) == 'S' ) { HB_COMP_PARAM->pLastMethod->pClass = pClass; } diff --git a/harbour/src/debug/dbgbrwsr.prg b/harbour/src/debug/dbgbrwsr.prg index 221ce328a9..6101189dff 100644 --- a/harbour/src/debug/dbgbrwsr.prg +++ b/harbour/src/debug/dbgbrwsr.prg @@ -127,19 +127,24 @@ METHOD New( nTop, nLeft, nBottom, nRight, oParentWindow ) CLASS HBDbBrowser RETURN Self METHOD Configure() + ::rowCount := ::nBottom - ::nTop + 1 AFill( ASize( ::aRowState, ::rowCount ), .F. ) ::lConfigured := .T. + RETURN Self METHOD SetColorSpec( cColors ) + IF HB_ISSTRING( cColors ) ::cColorSpec := cColors - ::aColorSpec := hb_aTokens( ::cColorSpec, "," ) + ::aColorSpec := hb_ATokens( ::cColorSpec, "," ) ENDIF + RETURN ::cColorSpec METHOD MoveCursor( nSkip ) + LOCAL nSkipped nSkipped := ::GoTo( ::rowPos + ::nFirstVisible - 1 + nSkip ) @@ -153,9 +158,11 @@ METHOD MoveCursor( nSkip ) ::RefreshAll() ENDIF ENDIF + RETURN Self METHOD ForceStable() + LOCAL nRow, nCol, xData, oCol, nColX, nWid, aClr, nClr IF !::lConfigured @@ -166,7 +173,7 @@ METHOD ForceStable() IF !::aRowState[ nRow ] ::GoTo( ::nFirstVisible + nRow - 1 ) IF ::hitBottom - hb_dispOutAt( ::nTop + nRow - 1, ::nLeft, Space( ::nRight - ::nLeft + 1 ), ::aColorSpec[ 1 ] ) + hb_DispOutAt( ::nTop + nRow - 1, ::nLeft, Space( ::nRight - ::nLeft + 1 ), ::aColorSpec[ 1 ] ) ELSE nColX := ::nLeft FOR nCol := 1 TO Len( ::aColumns ) @@ -184,7 +191,7 @@ METHOD ForceStable() IF nWid == NIL nWid := Len( xData ) ENDIF - hb_dispOutAt( ::nTop + nRow - 1, nColX, PadR( xData, nWid ) + iif( nCol < Len( ::aColumns ), " ", "" ), ::aColorSpec[ nClr ] ) + hb_DispOutAt( ::nTop + nRow - 1, nColX, PadR( xData, nWid ) + iif( nCol < Len( ::aColumns ), " ", "" ), ::aColorSpec[ nClr ] ) nColX += nWid + 1 ENDIF NEXT @@ -195,9 +202,11 @@ METHOD ForceStable() ::GoTo( ::nFirstVisible + ::rowPos - 1 ) SetPos( ::nTop + ::rowPos - 1, ::nLeft ) DispEnd() + RETURN Self METHOD GoTo( nRow ) + LOCAL nOldRow := ::nFirstVisible + ::rowPos - 1 LOCAL nSkipped := 0 @@ -208,15 +217,19 @@ METHOD GoTo( nRow ) nSkipped := Eval( ::skipBlock, nRow - 1 ) ::hitBottom := ( nSkipped != nRow - 1 ) ENDIF + RETURN nSkipped - nOldRow + 1 METHOD GoBottom() + DO WHILE !::hitBottom ::PageDown() ENDDO + RETURN Self METHOD Resize( nTop, nLeft, nBottom, nRight ) + LOCAL lResize := .F. IF nTop != NIL .AND. nTop != ::nTop diff --git a/harbour/src/debug/dbgentry.c b/harbour/src/debug/dbgentry.c index caab8ddab4..e077d0e2a3 100644 --- a/harbour/src/debug/dbgentry.c +++ b/harbour/src/debug/dbgentry.c @@ -85,12 +85,12 @@ static HB_BOOL hb_clsSetScope( HB_BOOL fScope ) { return fScope; } } while( 0 ) #if 1 -# define HB_DBGCOMMON_LOCK hb_threadEnterCriticalSection( &s_dbgMtx ); -# define HB_DBGCOMMON_UNLOCK hb_threadLeaveCriticalSection( &s_dbgMtx ); +# define HB_DBGCOMMON_LOCK() hb_threadEnterCriticalSection( &s_dbgMtx ) +# define HB_DBGCOMMON_UNLOCK() hb_threadLeaveCriticalSection( &s_dbgMtx ) static HB_CRITICAL_NEW( s_dbgMtx ); #else -# define HB_DBGCOMMON_LOCK -# define HB_DBGCOMMON_UNLOCK +# define HB_DBGCOMMON_LOCK() +# define HB_DBGCOMMON_UNLOCK() #endif typedef struct @@ -293,7 +293,7 @@ static PHB_ITEM hb_dbgActivateModuleArray( void ) PHB_ITEM pArray; int i; - HB_DBGCOMMON_LOCK + HB_DBGCOMMON_LOCK(); pArray = hb_itemArrayNew( s_common.nModules ); @@ -323,7 +323,7 @@ static PHB_ITEM hb_dbgActivateModuleArray( void ) hb_itemRelease( pModule ); } - HB_DBGCOMMON_UNLOCK + HB_DBGCOMMON_UNLOCK(); return pArray; } @@ -591,11 +591,11 @@ static void hb_dbgAddLocal( HB_DEBUGINFO * info, const char * szName, int nIndex { HB_MODULEINFO * module; - HB_DBGCOMMON_LOCK + HB_DBGCOMMON_LOCK(); module = &s_common.aModules[ s_common.nModules - 1 ]; hb_dbgAddVar( &module->nGlobals, &module->aGlobals, szName, 'G', nIndex, hb_dbg_vmVarGCount(), NULL ); - HB_DBGCOMMON_UNLOCK + HB_DBGCOMMON_UNLOCK(); } else { @@ -617,7 +617,7 @@ static void hb_dbgAddModule( const char * szName ) iLen = szFuncName ? ( int ) ( szFuncName - szName ) : ( int ) strlen( szName ); szModuleName = hb_strndup( szName, iLen ); - HB_DBGCOMMON_LOCK + HB_DBGCOMMON_LOCK(); if( !s_common.nModules || strcmp( s_common.aModules[ s_common.nModules - 1 ].szModule, szModuleName ) ) { HB_MODULEINFO * pModule; @@ -630,7 +630,7 @@ static void hb_dbgAddModule( const char * szName ) szModuleName = NULL; } - HB_DBGCOMMON_UNLOCK + HB_DBGCOMMON_UNLOCK(); if( szModuleName ) hb_xfree( szModuleName ); @@ -687,21 +687,21 @@ static void hb_dbgAddStatic( HB_DEBUGINFO * info, const char * szName, int nInde { HB_MODULEINFO * module; - HB_DBGCOMMON_LOCK + HB_DBGCOMMON_LOCK(); module = &s_common.aModules[ s_common.nModules - 1 ]; hb_dbgAddVar( &module->nExternGlobals, &module->aExternGlobals, szName, 'G', nIndex, hb_dbg_vmVarGCount(), NULL ); - HB_DBGCOMMON_UNLOCK + HB_DBGCOMMON_UNLOCK(); } else if( info->bInitStatics ) { HB_MODULEINFO * module; - HB_DBGCOMMON_LOCK + HB_DBGCOMMON_LOCK(); module = &s_common.aModules[ s_common.nModules - 1 ]; hb_dbgAddVar( &module->nStatics, &module->aStatics, szName, 'S', nIndex, 0, pFrame ); - HB_DBGCOMMON_UNLOCK + HB_DBGCOMMON_UNLOCK(); } else { @@ -716,7 +716,7 @@ static void hb_dbgAddStopLines( PHB_ITEM pItem ) { HB_ISIZ i, nLinesLen; - HB_DBGCOMMON_LOCK + HB_DBGCOMMON_LOCK(); if( !s_common.pStopLines ) { @@ -793,7 +793,7 @@ static void hb_dbgAddStopLines( PHB_ITEM pItem ) } } - HB_DBGCOMMON_UNLOCK + HB_DBGCOMMON_UNLOCK(); } @@ -1214,7 +1214,7 @@ static PHB_ITEM hb_dbgEvalResolve( HB_DEBUGINFO * info, HB_WATCHPOINT * watch ) scopes = ( HB_VARINFO * ) hb_xgrab( watch->nVars * sizeof( HB_VARINFO ) ); nProcLevel = hb_dbg_ProcLevel(); - HB_DBGCOMMON_LOCK + HB_DBGCOMMON_LOCK(); for( i = 0; i < s_common.nModules; i++ ) { @@ -1323,7 +1323,7 @@ static PHB_ITEM hb_dbgEvalResolve( HB_DEBUGINFO * info, HB_WATCHPOINT * watch ) } watch->aScopes = scopes; - HB_DBGCOMMON_UNLOCK + HB_DBGCOMMON_UNLOCK(); return aVars; } @@ -1356,12 +1356,12 @@ PHB_ITEM hb_dbgGetSourceFiles( void * handle ) /* HB_DEBUGINFO * info = ( HB_DEBUGINFO * ) handle; */ HB_SYMBOL_UNUSED( handle ); - HB_DBGCOMMON_LOCK + HB_DBGCOMMON_LOCK(); nModules = hb_itemSize( s_common.pStopLines ); ret = hb_itemArrayNew( nModules ); for( i = 1; i <= nModules; i++ ) hb_arraySet( ret, i, hb_arrayGetItemPtr( hb_arrayGetItemPtr( s_common.pStopLines, i ), 1 ) ); - HB_DBGCOMMON_UNLOCK + HB_DBGCOMMON_UNLOCK(); return ret; } @@ -1409,7 +1409,7 @@ HB_BOOL hb_dbgIsValidStopLine( void * handle, const char * szModule, int nLine ) /* HB_DEBUGINFO * info = ( HB_DEBUGINFO * ) handle; */ HB_SYMBOL_UNUSED( handle ); - HB_DBGCOMMON_LOCK + HB_DBGCOMMON_LOCK(); nModules = hb_itemSize( s_common.pStopLines ); for( i = 1; i <= nModules; i++ ) { @@ -1426,7 +1426,7 @@ HB_BOOL hb_dbgIsValidStopLine( void * handle, const char * szModule, int nLine ) break; } } - HB_DBGCOMMON_UNLOCK + HB_DBGCOMMON_UNLOCK(); return fResult; } diff --git a/harbour/src/debug/dbghelp.prg b/harbour/src/debug/dbghelp.prg index a4d296225b..0afdf3a4af 100644 --- a/harbour/src/debug/dbghelp.prg +++ b/harbour/src/debug/dbghelp.prg @@ -79,9 +79,9 @@ PROCEDURE __dbgHelp( nTopic ) oBrw:Cargo := 1 oBrw:AddColumn( HBDbColumnNew( "", {|| aTopics[ oBrw:Cargo ][ 1 ] }, 12 ) ) oBrw:ColorSpec := StrTran( __Dbg():ClrModal(), ", R/W" ) - oBrw:SkipBlock := {| nSkip, nOld | nOld := oBrw:Cargo, oBrw:Cargo += nSkip,; - oBrw:Cargo := Min( Max( oBrw:Cargo, 1 ), Len( aTopics ) ),; - oBrw:Cargo - nOld } + oBrw:SkipBlock := {| nSkip, nOld | nOld := oBrw:Cargo, oBrw:Cargo += nSkip, ; + oBrw:Cargo := Min( Max( oBrw:Cargo, 1 ), Len( aTopics ) ), ; + oBrw:Cargo - nOld } oBrw:GoTopBlock := {|| oBrw:Cargo := 1 } oBrw:GoBottomBlock := {|| oBrw:Cargo := Len( aTopics ) } @@ -98,9 +98,9 @@ PROCEDURE __dbgHelp( nTopic ) STATIC PROCEDURE PaintWindow( oDlg, oBrw, aTopics ) - hb_dispBox( oDlg:nTop + 1, oDlg:nLeft + 13, oDlg:nBottom - 1, oDlg:nLeft + 13, HB_B_SINGLE_UNI, oDlg:cColor ) - hb_dispOutAtBox( oDlg:nTop , oDlg:nLeft + 13, hb_UTF8ToStrBox( "┬" ), oDlg:cColor ) - hb_dispOutAtBox( oDlg:nBottom , oDlg:nLeft + 13, hb_UTF8ToStrBox( "â”´" ), oDlg:cColor ) + hb_DispBox( oDlg:nTop + 1, oDlg:nLeft + 13, oDlg:nBottom - 1, oDlg:nLeft + 13, HB_B_SINGLE_UNI, oDlg:cColor ) + hb_DispOutAtBox( oDlg:nTop, oDlg:nLeft + 13, hb_UTF8ToStrBox( "┬" ), oDlg:cColor ) + hb_DispOutAtBox( oDlg:nBottom, oDlg:nLeft + 13, hb_UTF8ToStrBox( "â”´" ), oDlg:cColor ) oBrw:ForceStable() ShowTopic( oDlg, aTopics, oBrw:Cargo, 0 ) // Start on page 1 @@ -177,7 +177,7 @@ STATIC PROCEDURE ProcessKey( nKey, oDlg, oBrw, aTopics ) STATIC PROCEDURE ShowTopic( oDlg, aTopics, nTopic, nPageOp ) - local oDebug := __Dbg() + LOCAL oDebug := __Dbg() LOCAL nRows := oDlg:nBottom - oDlg:nTop - 1 LOCAL nPages := Len( aTopics[ nTopic ][ 2 ] ) / nRows LOCAL nRowsToPaint @@ -222,734 +222,735 @@ STATIC PROCEDURE ShowTopic( oDlg, aTopics, nTopic, nPageOp ) nRowsToPaint := Min( nRows, Len( aTopics[ nTopic ][ 2 ] ) - ( ( oDebug:nHelpPage - 1 ) * nRows ) ) FOR n := 1 TO nRowsToPaint - hb_dispOutAt( 2 + n, 16, aTopics[ nTopic ][ 2 ][ ( ( oDebug:nHelpPage - 1 ) * nRows ) + n ] ) + hb_DispOutAt( 2 + n, 16, aTopics[ nTopic ][ 2 ][ ( ( oDebug:nHelpPage - 1 ) * nRows ) + n ] ) NEXT IF Len( aTopics[ nTopic ][ 2 ] ) <= nRows - hb_dispOutAt( oDlg:nBottom, oDlg:nRight - 16, " Page 1 of 1 " ) + hb_DispOutAt( oDlg:nBottom, oDlg:nRight - 16, " Page 1 of 1 " ) ELSE - hb_dispOutAt( oDlg:nBottom, oDlg:nRight - 16, " Page " + Str( oDebug:nHelpPage, 1 ) + " of " + Str( nPages, 1 ) + " " ) + hb_DispOutAt( oDlg:nBottom, oDlg:nRight - 16, " Page " + Str( oDebug:nHelpPage, 1 ) + " of " + Str( nPages, 1 ) + " " ) ENDIF RETURN STATIC FUNCTION GetTopics() - LOCAL aTopics := { { "About Help ", },; - { "Keys ", },; - { " Function ", },; - { " Window ", },; - { " Other ", },; - { "Windows ", },; - { " Command ", },; - { " Code ", },; - { " Watch ", },; - { " Monitor ", },; - { " CallStack", },; - { "Menus ", },; - { " File ", },; - { " Locate ", },; - { " View ", },; - { " Run ", },; - { " Point ", },; - { " Monitor ", },; - { " Options ", },; - { " Window ", },; - { "Commands ", },; - { "Script files", } } + LOCAL aTopics := { ; + { "About Help ", }, ; + { "Keys ", }, ; + { " Function ", }, ; + { " Window ", }, ; + { " Other ", }, ; + { "Windows ", }, ; + { " Command ", }, ; + { " Code ", }, ; + { " Watch ", }, ; + { " Monitor ", }, ; + { " CallStack", }, ; + { "Menus ", }, ; + { " File ", }, ; + { " Locate ", }, ; + { " View ", }, ; + { " Run ", }, ; + { " Point ", }, ; + { " Monitor ", }, ; + { " Options ", }, ; + { " Window ", }, ; + { "Commands ", }, ; + { "Script files", } } - aTopics[ 1 ][ 2 ] := ; - { " " + Chr( 24 ) /* LOW-ASCII "↑" */ + Chr( 25 ) /* LOW-ASCII "↓" */ +; - " Select help topic.",; - " PageUp Page help text down.",; - " PageDn Page help text down.",; - " Esc Returns to debugger." } + aTopics[ 1 ][ 2 ] := { ; + " " + Chr( 24 ) /* LOW-ASCII "↑" */ + Chr( 25 ) /* LOW-ASCII "↓" */ +; + " Select help topic.", ; + " PageUp Page help text down.", ; + " PageDn Page help text down.", ; + " Esc Returns to debugger." } - aTopics[ 2 ][ 2 ] := ; - { "Special debugger keys fall into the following",; - "categories:",; - "",; - " Function Keys",; - " Keys that execute debugger functions",; - "",; - " Window keys",; - " Keys that operate on the active window",; - "",; - " Others",; - " Keys for window navigation and sizing",; - "",; - "",; - "Other keys (typeable characters) are sent to",; - "the Command window and treated as input text." } + aTopics[ 2 ][ 2 ] := { ; + "Special debugger keys fall into the following", ; + "categories:", ; + "", ; + " Function Keys", ; + " Keys that execute debugger functions", ; + "", ; + " Window keys", ; + " Keys that operate on the active window", ; + "", ; + " Others", ; + " Keys for window navigation and sizing", ; + "", ; + "", ; + "Other keys (typeable characters) are sent to", ; + "the Command window and treated as input text." } - aTopics[ 3 ][ 2 ] := ; - { "F1 Help",; - "F2 Zoom active window",; - "",; - "F3 Retype last command",; - "F4 View Application (User) screen",; - "",; - "F5 Go (Run application)",; - "F6 View Workareas screen",; - "",; - "F7 Run to cursor line",; - "F8 Step",; - "",; - "F9 Set breakpoint on cursor line",; - "F10 Trace" } + aTopics[ 3 ][ 2 ] := { ; + "F1 Help", ; + "F2 Zoom active window", ; + "", ; + "F3 Retype last command", ; + "F4 View Application (User) screen", ; + "", ; + "F5 Go (Run application)", ; + "F6 View Workareas screen", ; + "", ; + "F7 Run to cursor line", ; + "F8 Step", ; + "", ; + "F9 Set breakpoint on cursor line", ; + "F10 Trace" } - aTopics[ 4 ][ 2 ] := ; - { "Enter If input is pending in the Command window,",; - " will execute the command, regardless",; - " of which window is active. Otherwise, if the",; - " Monitor or Watch window is active, ENTER will",; - " inspect the selected window item.",; - "",; - "Up In Code window, moves cursor line up.",; - " In Command window, recalls previous command.",; - " In other windows, moves selected item up.",; - "",; - "Down In Code window, moves cursor line down.",; - " In Command window, recalls previous command.",; - " In other windows, moves selected item down.",; - "",; - "PageUp In Code window, pages source up.",; - " In Command window, does nothing.",; - " In other windows, pages item list up.",; - "",; - "PageDn In Code window, pages source down.",; - " In Command window, does nothing.",; - " In other windows, pages item list down.",; - "",; - "Ctrl PageUp In Code window, moves cursor line to top.",; - " of source.",; - " In Command window, does nothing.",; - " In other windows, selects first item on list.",; - "",; - "Ctrl PageDn In Code window, moves cursor line to bottom.",; - " of source.",; - " In Command window, does nothing",; - " In other windows, selects last item on list.",; - "",; - "Left In Code window, scrolls left 1 column.",; - " In Command window, moves cursor left.",; - " In other windows, does nothing",; - "",; - "Right In Code window, scrolls right 1 column.",; - " In Command window, moves cursor right.",; - " In other windows, does nothing.",; - "",; - "Home In Code window, scrolls hard left.",; - " In Command window, moves cursor to beginning",; - " of line.",; - " In other windows, does nothing.",; - "",; - "End In Code window, scrolls hard right.",; - " In Command window, moves cursor to end",; - " of line.",; - " In other windows, does nothing.",; - "",; - "Esc In Command window, clears command line.",; - " In other windows, does nothing." } + aTopics[ 4 ][ 2 ] := { ; + "Enter If input is pending in the Command window,", ; + " will execute the command, regardless", ; + " of which window is active. Otherwise, if the", ; + " Monitor or Watch window is active, ENTER will", ; + " inspect the selected window item.", ; + "", ; + "Up In Code window, moves cursor line up.", ; + " In Command window, recalls previous command.", ; + " In other windows, moves selected item up.", ; + "", ; + "Down In Code window, moves cursor line down.", ; + " In Command window, recalls previous command.", ; + " In other windows, moves selected item down.", ; + "", ; + "PageUp In Code window, pages source up.", ; + " In Command window, does nothing.", ; + " In other windows, pages item list up.", ; + "", ; + "PageDn In Code window, pages source down.", ; + " In Command window, does nothing.", ; + " In other windows, pages item list down.", ; + "", ; + "Ctrl PageUp In Code window, moves cursor line to top.", ; + " of source.", ; + " In Command window, does nothing.", ; + " In other windows, selects first item on list.", ; + "", ; + "Ctrl PageDn In Code window, moves cursor line to bottom.", ; + " of source.", ; + " In Command window, does nothing", ; + " In other windows, selects last item on list.", ; + "", ; + "Left In Code window, scrolls left 1 column.", ; + " In Command window, moves cursor left.", ; + " In other windows, does nothing", ; + "", ; + "Right In Code window, scrolls right 1 column.", ; + " In Command window, moves cursor right.", ; + " In other windows, does nothing.", ; + "", ; + "Home In Code window, scrolls hard left.", ; + " In Command window, moves cursor to beginning", ; + " of line.", ; + " In other windows, does nothing.", ; + "", ; + "End In Code window, scrolls hard right.", ; + " In Command window, moves cursor to end", ; + " of line.", ; + " In other windows, does nothing.", ; + "", ; + "Esc In Command window, clears command line.", ; + " In other windows, does nothing." } - aTopics[ 5 ][ 2 ] := ; - { "TAB Next window",; - "",; - "SHIFT-TAB Previous window",; - "",; - "ALT-G Grow active window",; - "",; - "ALT-S Shrink active window",; - "",; - "ALT-U Move the border between Command and Code",; - " windows Up",; - "",; - "ALT-D Move the border between Command and Code",; - " windows Down",; - "",; - "ALT-X Exit" } + aTopics[ 5 ][ 2 ] := { ; + "TAB Next window", ; + "", ; + "SHIFT-TAB Previous window", ; + "", ; + "ALT-G Grow active window", ; + "", ; + "ALT-S Shrink active window", ; + "", ; + "ALT-U Move the border between Command and Code", ; + " windows Up", ; + "", ; + "ALT-D Move the border between Command and Code", ; + " windows Down", ; + "", ; + "ALT-X Exit" } - aTopics[ 6 ][ 2 ] := ; - { "The Debugger display consists of the following five",; - "windows:",; - "",; - " Command Window",; - " Accepts and displays debugger commands.",; - " Always open.",; - "",; - " Code Window",; - " Displays program source code.",; - " Always open.",; - "",; - " Watch Window",; - " Displays Watchpoints and Tracepoints, and inspects",; - " their values.",; - " Open when any Watchpoints or Tracepoints are",; - " defined. These are set and deleted via the",; - " Point menu.",; - "",; - " Monitor Window",; - " Displays monitored variables, and inspects their",; - " values.",; - " Open when any classes of variables are being",; - " monitored, via commands in the Monitor menu.",; - "",; - " CallStack Window",; - " Displays program call stack.",; - " Opened via the View:CallStack menu option.",; - "",; - " If this window is active, the Code, Watch and",; - " Monitor windows will display information pertaining",; - " to the selected call on the CallStack.",; - "",; - "",; - "One debugger window is active at a time. The active window",; - "is displayed with a hilighted border. TAB and SHIFT-TAB",; - "navigate among open windows.",; - "",; - "The Window menu contains options to Move, Size, Zoom and",; - "Iconize the active window.",; - "",; - "After a long session of moving and sizing, the Window:Tile",; - "menu option will restore the windows to their original",; - "size and location." } + aTopics[ 6 ][ 2 ] := { ; + "The Debugger display consists of the following five", ; + "windows:", ; + "", ; + " Command Window", ; + " Accepts and displays debugger commands.", ; + " Always open.", ; + "", ; + " Code Window", ; + " Displays program source code.", ; + " Always open.", ; + "", ; + " Watch Window", ; + " Displays Watchpoints and Tracepoints, and inspects", ; + " their values.", ; + " Open when any Watchpoints or Tracepoints are", ; + " defined. These are set and deleted via the", ; + " Point menu.", ; + "", ; + " Monitor Window", ; + " Displays monitored variables, and inspects their", ; + " values.", ; + " Open when any classes of variables are being", ; + " monitored, via commands in the Monitor menu.", ; + "", ; + " CallStack Window", ; + " Displays program call stack.", ; + " Opened via the View:CallStack menu option.", ; + "", ; + " If this window is active, the Code, Watch and", ; + " Monitor windows will display information pertaining", ; + " to the selected call on the CallStack.", ; + "", ; + "", ; + "One debugger window is active at a time. The active window", ; + "is displayed with a hilighted border. TAB and SHIFT-TAB", ; + "navigate among open windows.", ; + "", ; + "The Window menu contains options to Move, Size, Zoom and", ; + "Iconize the active window.", ; + "", ; + "After a long session of moving and sizing, the Window:Tile", ; + "menu option will restore the windows to their original", ; + "size and location." } - aTopics[ 7 ][ 2 ] := ; - { "The Command window accepts debugger commands as line",; - "input, and displays the response from an executed",; - "command, if any.",; - "",; - "Commands are entered simply by typing in the command",; - "text, then pressing ENTER.",; - "",; - "Commands may be entered and executed while any",; - "window is active. However, the entry cursor is",; - "only visible within the Command window when it is",; - "active.",; - "",; - "When the Command window is active, the UP and DOWN",; - "arrow keys can be used to recall previous commands." } + aTopics[ 7 ][ 2 ] := { ; + "The Command window accepts debugger commands as line", ; + "input, and displays the response from an executed", ; + "command, if any.", ; + "", ; + "Commands are entered simply by typing in the command", ; + "text, then pressing ENTER.", ; + "", ; + "Commands may be entered and executed while any", ; + "window is active. However, the entry cursor is", ; + "only visible within the Command window when it is", ; + "active.", ; + "", ; + "When the Command window is active, the UP and DOWN", ; + "arrow keys can be used to recall previous commands." } - aTopics[ 8 ][ 2 ] := ; - { "The Code window displays Clipper source code for",; - "the program being debugged.",; - "",; - "",; - "What file the Code window displays may be controlled",; - "in the following ways:",; - "",; - " 1. By default, the Code window will contain the line",; - " of Clipper code currently being executed.",; - "",; - " 2. If the CallStack window is open, the code being",; - " viewed is that of the selected call in the CallStack",; - " window.",; - "",; - " NOTE: By default this will be the same code as 1,",; - " but code for the other calls may be viewed by",; - " making the CallStack window active and using UP",; - " and DOWN to traverse the call stack.",; - "",; - " 3. A specific file may be viewed by issuing a VIEW",; - " command, or selecting the File:View menu option.",; - "",; - "",; - "If the Code window contains the line of Clipper code",; - "currently being executed, that line will be hilighted.",; - "Any lines which have Breakpoints set on them will also",; - "be marked.",; - "",; - "",; - "In addition to standard navigation keys, you can search",; - "the viewed file for a specific string, or go to a particular",; - "line within it, using options found in the Locate menu." } + aTopics[ 8 ][ 2 ] := { ; + "The Code window displays Clipper source code for", ; + "the program being debugged.", ; + "", ; + "", ; + "What file the Code window displays may be controlled", ; + "in the following ways:", ; + "", ; + " 1. By default, the Code window will contain the line", ; + " of Clipper code currently being executed.", ; + "", ; + " 2. If the CallStack window is open, the code being", ; + " viewed is that of the selected call in the CallStack", ; + " window.", ; + "", ; + " NOTE: By default this will be the same code as 1,", ; + " but code for the other calls may be viewed by", ; + " making the CallStack window active and using UP", ; + " and DOWN to traverse the call stack.", ; + "", ; + " 3. A specific file may be viewed by issuing a VIEW", ; + " command, or selecting the File:View menu option.", ; + "", ; + "", ; + "If the Code window contains the line of Clipper code", ; + "currently being executed, that line will be hilighted.", ; + "Any lines which have Breakpoints set on them will also", ; + "be marked.", ; + "", ; + "", ; + "In addition to standard navigation keys, you can search", ; + "the viewed file for a specific string, or go to a particular", ; + "line within it, using options found in the Locate menu." } - aTopics[ 9 ][ 2 ] := ; - { "The Watch window displays Watchpoint and Tracepoint",; - "expressions, and their current values.",; - "",; - "Watchpoints and Tracepoints may be defined and deleted via",; - "options on the Point menu. You can edit a Watchpoint or",; - "Tracepoint expression by selecting it in the Watch window",; - "and pressing CTRL-ENTER.",; - "",; - "If the Watch window is active, pressing ENTER will inspect",; - "the value of the selected expression. The navigation keys",; - "described in 'Window Keys' may be used to change the",; - "selected item.",; - "",; - "If the CallStack window is active, the Watch window will",; - "display the values for Watchpoints and Tracepoints at the",; - "activation level represented by the selected call in the",; - "CallStack window." } + aTopics[ 9 ][ 2 ] := { ; + "The Watch window displays Watchpoint and Tracepoint", ; + "expressions, and their current values.", ; + "", ; + "Watchpoints and Tracepoints may be defined and deleted via", ; + "options on the Point menu. You can edit a Watchpoint or", ; + "Tracepoint expression by selecting it in the Watch window", ; + "and pressing CTRL-ENTER.", ; + "", ; + "If the Watch window is active, pressing ENTER will inspect", ; + "the value of the selected expression. The navigation keys", ; + "described in 'Window Keys' may be used to change the", ; + "selected item.", ; + "", ; + "If the CallStack window is active, the Watch window will", ; + "display the values for Watchpoints and Tracepoints at the", ; + "activation level represented by the selected call in the", ; + "CallStack window." } - aTopics[ 10 ][ 2 ] := ; - { "The Monitor window displays monitored variables.",; - "",; - "Classes of variables may be monitored via options in the",; - "Monitor menu.",; - "",; - "If the Monitor window is active, pressing ENTER will",; - "inspect the value of the selected variable. The navigation",; - "keys described in 'Window Keys' may be used to change the",; - "selected item.",; - "",; - "If the CallStack window is active, the Monitor window will",; - "display the values of variables at the point of the",; - "activation level represented by the selected call in the",; - "CallStack window." } + aTopics[ 10 ][ 2 ] := { ; + "The Monitor window displays monitored variables.", ; + "", ; + "Classes of variables may be monitored via options in the", ; + "Monitor menu.", ; + "", ; + "If the Monitor window is active, pressing ENTER will", ; + "inspect the value of the selected variable. The navigation", ; + "keys described in 'Window Keys' may be used to change the", ; + "selected item.", ; + "", ; + "If the CallStack window is active, the Monitor window will", ; + "display the values of variables at the point of the", ; + "activation level represented by the selected call in the", ; + "CallStack window." } - aTopics[ 11 ][ 2 ] := ; - { "The CallStack window displays the program's call stack.",; - "It is opened and closed via the View:CallStack menu",; - "option.",; - "",; - "By default, the selected call within the CallStack window",; - "is the top one -- i.e., the call currently being executed.",; - "When the CallStack window is active, the other call levels",; - "may be selected using the navigation keys described in",; - "'Window Keys'.",; - "",; - "All other windows except the Command window are synchronized",; - "with the CallStack window. The code viewed in the Code",; - "window, the values of Watchpoints and Tracepoints in the",; - "Watch window, and the values of variables in the Monitor",; - "window are all in the context of the activation level",; - "selected in the CallStack window." } + aTopics[ 11 ][ 2 ] := { ; + "The CallStack window displays the program's call stack.", ; + "It is opened and closed via the View:CallStack menu", ; + "option.", ; + "", ; + "By default, the selected call within the CallStack window", ; + "is the top one -- i.e., the call currently being executed.", ; + "When the CallStack window is active, the other call levels", ; + "may be selected using the navigation keys described in", ; + "'Window Keys'.", ; + "", ; + "All other windows except the Command window are synchronized", ; + "with the CallStack window. The code viewed in the Code", ; + "window, the values of Watchpoints and Tracepoints in the", ; + "Watch window, and the values of variables in the Monitor", ; + "window are all in the context of the activation level", ; + "selected in the CallStack window." } - aTopics[ 12 ][ 2 ] := ; - { "The debugger menus contain various debugger functions.",; - "",; - "Each menu may be accessed at any time by pressing the",; - "ALT key, and the first letter in the menu's name.",; - "",; - "Once in a menu, the UP and DOWN arrow keys navigate",; - "the list of options. An option may be selected by",; - "pressing ENTER, or by typing the first uppercase",; - "letter within the name of the desired option.",; - "",; - "",; - "Some menu options toggle a debugger setting. These",; - "options will have a checkmark displayed to their left",; - "if the setting they refer to is currently ON.",; - "",; - "",; - "Each menu option is also available as a command,",; - "made up of the Menu name, followed by the first",; - "word of the option name. For instance, the",; - "View:CallStack menu option may also be accessed via",; - "the command:",; - "",; - " View Call",; - "",; - "Words within these commands may be shortened in most",; - "cases to one letter.",; - "",; - "For more information on this class of commands, see",; - "the 'Commands' section of this help." } + aTopics[ 12 ][ 2 ] := { ; + "The debugger menus contain various debugger functions.", ; + "", ; + "Each menu may be accessed at any time by pressing the", ; + "ALT key, and the first letter in the menu's name.", ; + "", ; + "Once in a menu, the UP and DOWN arrow keys navigate", ; + "the list of options. An option may be selected by", ; + "pressing ENTER, or by typing the first uppercase", ; + "letter within the name of the desired option.", ; + "", ; + "", ; + "Some menu options toggle a debugger setting. These", ; + "options will have a checkmark displayed to their left", ; + "if the setting they refer to is currently ON.", ; + "", ; + "", ; + "Each menu option is also available as a command,", ; + "made up of the Menu name, followed by the first", ; + "word of the option name. For instance, the", ; + "View:CallStack menu option may also be accessed via", ; + "the command:", ; + "", ; + " View Call", ; + "", ; + "Words within these commands may be shortened in most", ; + "cases to one letter.", ; + "", ; + "For more information on this class of commands, see", ; + "the 'Commands' section of this help." } - aTopics[ 13 ][ 2 ] := ; - { "Options:",; - "",; - " Open...",; - " Specify a file to be opened in the Code window",; - "",; - " OS Access",; - " Shell to the OS environment",; - "",; - " Exit Alt-X",; - " Exit the debugger" } + aTopics[ 13 ][ 2 ] := { ; + "Options:", ; + "", ; + " Open...", ; + " Specify a file to be opened in the Code window", ; + "", ; + " OS Access", ; + " Shell to the OS environment", ; + "", ; + " Exit Alt-X", ; + " Exit the debugger" } - aTopics[ 14 ][ 2 ] := ; - { "Facilites for navigating the file in the Code window",; - "",; - "Options:",; - "",; - " Find...",; - " Search for a specified string, from the beginning",; - " of the file onward.",; - "",; - " Next",; - " Search for the next occurence of the Find string,",; - " from the cursor line onward.",; - "",; - " Prev",; - " Search for the previous occurence of the Find string,",; - " from the cursor line backward.",; - "",; - " Goto Line...",; - " Go to a specific line in the file being viewed.",; - "",; - " Case Sensitivity",; - " Toggles case sensitivity in searches. Default is",; - " OFF." } + aTopics[ 14 ][ 2 ] := { ; + "Facilites for navigating the file in the Code window", ; + "", ; + "Options:", ; + "", ; + " Find...", ; + " Search for a specified string, from the beginning", ; + " of the file onward.", ; + "", ; + " Next", ; + " Search for the next occurence of the Find string,", ; + " from the cursor line onward.", ; + "", ; + " Prev", ; + " Search for the previous occurence of the Find string,", ; + " from the cursor line backward.", ; + "", ; + " Goto Line...", ; + " Go to a specific line in the file being viewed.", ; + "", ; + " Case Sensitivity", ; + " Toggles case sensitivity in searches. Default is", ; + " OFF." } - aTopics[ 15 ][ 2 ] := ; - { "Options:",; - "",; - " Sets",; - " View Set status information",; - "",; - " Work Areas F6",; - " View Database status information",; - "",; - " App. screen F4",; - " Displays application screen, until key is pressed",; - "",; - " CallStack",; - " Toggles the CallStack window. Default is OFF" } + aTopics[ 15 ][ 2 ] := { ; + "Options:", ; + "", ; + " Sets", ; + " View Set status information", ; + "", ; + " Work Areas F6", ; + " View Database status information", ; + "", ; + " App. screen F4", ; + " Displays application screen, until key is pressed", ; + "", ; + " CallStack", ; + " Toggles the CallStack window. Default is OFF" } - aTopics[ 16 ][ 2 ] := ; - { "Options:",; - "",; - " Restart",; - " Terminate program and re-execute, leaving debugger",; - " settings in place",; - "",; - " Animate",; - " Execute program in Animate mode",; - "",; - " Step F8",; - " Execute one line of program code",; - "",; - " Trace F10",; - " Trace over function call in program code",; - "",; - " Go F5",; - " Execute program",; - "",; - " to Cursor F7",; - " Execute program, breaking at the current cursor",; - " line in Code window",; - "",; - " Next routine Ctrl-F5",; - " Execute program, breaking at line 1 of the next",; - " procedure or function call.,",; - "",; - " sPeed...",; - " Set step speed for Animate mode execution" } + aTopics[ 16 ][ 2 ] := { ; + "Options:", ; + "", ; + " Restart", ; + " Terminate program and re-execute, leaving debugger", ; + " settings in place", ; + "", ; + " Animate", ; + " Execute program in Animate mode", ; + "", ; + " Step F8", ; + " Execute one line of program code", ; + "", ; + " Trace F10", ; + " Trace over function call in program code", ; + "", ; + " Go F5", ; + " Execute program", ; + "", ; + " to Cursor F7", ; + " Execute program, breaking at the current cursor", ; + " line in Code window", ; + "", ; + " Next routine Ctrl-F5", ; + " Execute program, breaking at line 1 of the next", ; + " procedure or function call.,", ; + "", ; + " sPeed...", ; + " Set step speed for Animate mode execution" } - aTopics[ 17 ][ 2 ] := ; - { "Options:",; - "",; - " Watchpoint...",; - "",; - " Add Watchpoint. A Watchpoint is an expression which",; - " the debugger tracks during program execution -- the",; - " current value of a Watchpoint is displayed in the",; - " Watch window during debugging.",; - "",; - " A Watchpoint may be any valid Clipper expression,",; - " i.e.:",; - "",; - " s // variable",; - " a[n] // array element",; - " g:buffer // object instance variable",; - " At(s, t) // return value of function call",; - " ValType(s) == 'C' // value of expression",; - "",; - "",; - " Tracepoint...",; - "",; - " Add Tracepoint. A Tracepoint is similar to a Watchpoint,",; - " with the additional property that if the value of a",; - " Tracepoint expression changes, the debugger will be",; - " invoked as if a Breakpoint had been hit.",; - "",; - "",; - " Breakpoint F9",; - "",; - " Set Breakpoint on current cursor line in",; - " Code window",; - "",; - "",; - " Delete",; - "",; - " Delete Tracepoint or Watchpoint." } + aTopics[ 17 ][ 2 ] := { ; + "Options:", ; + "", ; + " Watchpoint...", ; + "", ; + " Add Watchpoint. A Watchpoint is an expression which", ; + " the debugger tracks during program execution -- the", ; + " current value of a Watchpoint is displayed in the", ; + " Watch window during debugging.", ; + "", ; + " A Watchpoint may be any valid Clipper expression,", ; + " i.e.:", ; + "", ; + " s // variable", ; + " a[n] // array element", ; + " g:buffer // object instance variable", ; + " At(s, t) // return value of function call", ; + " ValType(s) == 'C' // value of expression", ; + "", ; + "", ; + " Tracepoint...", ; + "", ; + " Add Tracepoint. A Tracepoint is similar to a Watchpoint,", ; + " with the additional property that if the value of a", ; + " Tracepoint expression changes, the debugger will be", ; + " invoked as if a Breakpoint had been hit.", ; + "", ; + "", ; + " Breakpoint F9", ; + "", ; + " Set Breakpoint on current cursor line in", ; + " Code window", ; + "", ; + "", ; + " Delete", ; + "", ; + " Delete Tracepoint or Watchpoint." } - aTopics[ 18 ][ 2 ] := ; - { "Options:",; - "",; - " Public",; - " Monitor Public variables.",; - "",; - " Private",; - " Monitor Private variables.",; - "",; - " Local",; - " Monitor Local variables.",; - "",; - " Static",; - " Monitor Static variables.",; - "",; - " Global",; - " Monitor Global variables.",; - "",; - " All",; - " Monitor All variables.",; - "",; - " Sort",; - " Toggles whether monitored variables are sorted by",; - " name. Default is OFF." } + aTopics[ 18 ][ 2 ] := { ; + "Options:", ; + "", ; + " Public", ; + " Monitor Public variables.", ; + "", ; + " Private", ; + " Monitor Private variables.", ; + "", ; + " Local", ; + " Monitor Local variables.", ; + "", ; + " Static", ; + " Monitor Static variables.", ; + "", ; + " Global", ; + " Monitor Global variables.", ; + "", ; + " All", ; + " Monitor All variables.", ; + "", ; + " Sort", ; + " Toggles whether monitored variables are sorted by", ; + " name. Default is OFF." } - aTopics[ 19 ][ 2 ] := ; - { "Options:",; - "",; - " Preprocessed code",; - " Toggles the display of preprocessed code (from",; - " PPO file) within the Code window. Default is OFF.",; - "",; - " Line numbers",; - " Toggles the display of line numbers in the Code",; - " window. Default is OFF.",; - "",; - " Exchange screens",; - " Toggles whether debugger screen is swapped with",; - " application screen during debugger execution.",; - " Default is ON.",; - "",; - " Swap on Input",; - " Toggles whether debugger screen is swapped with",; - " application screen when the program being debugged",; - " is waiting for input. Default is ON.",; - " This setting is only meaningful when the Exchange",; - " Screens setting is OFF.",; - "",; - " Codeblock Trace",; - " Toggles whether the debugger will trace into",; - " code blocks when tracing (i.e., when in Trace",; - " mode). Defaults to ON.",; - "",; - " Menu Bar",; - " Toggles display of the debugger menu bar.",; - " Default is ON.",; - "",; - " mono Display",; - " Toggles display between monochrome and color.",; - " Default is OFF.",; - "",; - " Colors...",; - " Inspects debugger colors.",; - "",; - " Tab width...",; - " Set tab width in Code window. Default is 4.",; - "",; - " pAth for Files...",; - " Specify search path for source files.",; - " The debugger will use this path to search for",; - " files, if not found in the current directory.",; - " NOTE: If not found in the debugger path, the",; - " directories specified in the environment's PATH",; - " will be searched.",; - "",; - "",; - " Save Settings",; - " Save debugger settings to a script file.",; - "",; - " Restore Settings",; - " Restore debugger settings from a previously",; - " saved script file." } + aTopics[ 19 ][ 2 ] := { ; + "Options:", ; + "", ; + " Preprocessed code", ; + " Toggles the display of preprocessed code (from", ; + " PPO file) within the Code window. Default is OFF.", ; + "", ; + " Line numbers", ; + " Toggles the display of line numbers in the Code", ; + " window. Default is OFF.", ; + "", ; + " Exchange screens", ; + " Toggles whether debugger screen is swapped with", ; + " application screen during debugger execution.", ; + " Default is ON.", ; + "", ; + " Swap on Input", ; + " Toggles whether debugger screen is swapped with", ; + " application screen when the program being debugged", ; + " is waiting for input. Default is ON.", ; + " This setting is only meaningful when the Exchange", ; + " Screens setting is OFF.", ; + "", ; + " Codeblock Trace", ; + " Toggles whether the debugger will trace into", ; + " code blocks when tracing (i.e., when in Trace", ; + " mode). Defaults to ON.", ; + "", ; + " Menu Bar", ; + " Toggles display of the debugger menu bar.", ; + " Default is ON.", ; + "", ; + " mono Display", ; + " Toggles display between monochrome and color.", ; + " Default is OFF.", ; + "", ; + " Colors...", ; + " Inspects debugger colors.", ; + "", ; + " Tab width...", ; + " Set tab width in Code window. Default is 4.", ; + "", ; + " pAth for Files...", ; + " Specify search path for source files.", ; + " The debugger will use this path to search for", ; + " files, if not found in the current directory.", ; + " NOTE: If not found in the debugger path, the", ; + " directories specified in the environment's PATH", ; + " will be searched.", ; + "", ; + "", ; + " Save Settings", ; + " Save debugger settings to a script file.", ; + "", ; + " Restore Settings", ; + " Restore debugger settings from a previously", ; + " saved script file." } - aTopics[ 20 ][ 2 ] := ; - { "Options:",; - "",; - " Next Tab",; - " Make next window active.",; - "",; - " Prev Sh-Tab",; - " Make previous window active.",; - "",; - " Move",; - " Move active window. UP, DOWN, LEFT, RIGHT,",; - " PGUP, PGDN, HOME, END move ENTER finishes,",; - " While Moving, top left corner of window is marked.",; - "",; - " Size",; - " Size active window. UP, DOWN, LEFT, RIGHT,",; - " PGUP, PGDN, HOME, END size ENTER finishes,",; - " While Sizing, bottom right corner of window is marked.",; - "",; - " Zoom F2",; - " Toggles whether active window is Zoomed. When",; - " Zoomed, window will fill entire display area.",; - "",; - " Iconize",; - " Toggles whether active window is Iconized. When",; - " Iconized, window will be one row high and a few",; - " columns wide.",; - "",; - " Tile",; - " Restore all windows to original size and position." } + aTopics[ 20 ][ 2 ] := { ; + "Options:", ; + "", ; + " Next Tab", ; + " Make next window active.", ; + "", ; + " Prev Sh-Tab", ; + " Make previous window active.", ; + "", ; + " Move", ; + " Move active window. UP, DOWN, LEFT, RIGHT,", ; + " PGUP, PGDN, HOME, END move ENTER finishes,", ; + " While Moving, top left corner of window is marked.", ; + "", ; + " Size", ; + " Size active window. UP, DOWN, LEFT, RIGHT,", ; + " PGUP, PGDN, HOME, END size ENTER finishes,", ; + " While Sizing, bottom right corner of window is marked.", ; + "", ; + " Zoom F2", ; + " Toggles whether active window is Zoomed. When", ; + " Zoomed, window will fill entire display area.", ; + "", ; + " Iconize", ; + " Toggles whether active window is Iconized. When", ; + " Iconized, window will be one row high and a few", ; + " columns wide.", ; + "", ; + " Tile", ; + " Restore all windows to original size and position." } - aTopics[ 21 ][ 2 ] := ; - { "There are two sets of debugger commands:",; - "",; - "1. Menu option commands. These commands are formed",; - "from the menu name, followed by the (first word of)",; - "the option name. For instance, the Monitor:Public",; - "menu option may be invoked via the command:",; - "",; - " Monitor Public",; - "",; - "These commands may be abbreviated down to one letter",; - "per word. However in some cases a second letter will",; - "be required in the second word, as in the case of",; - "Monitor Private:",; - "",; - " M P // invokes Monitor Public",; - " M Pr // invokes Monitor Private",; - "",; - "",; - "",; - "2. Other commands. Listed below.",; - "",; - "",; - "? ",; - " Display the value of a variable or expression.",; - "",; - "?? ",; - " Inspect the value of a variable or expression.",; - "",; - "ANIMATE",; - " Execute application in Animate Mode.",; - "",; - "BP [ [ ]]|[]",; - "",; - " BP",; - " Toggle breakpoint at current line in current",; - " source file.",; - "",; - " BP ",; - " Toggle breakpoint at in current source",; - " file.",; - "",; - " BP ",; - " Toggle breakpoint at in ",; - " source file.",; - " BP ",; - " Toggle breakpoint on function.",; - "",; - "CALLSTACK on|OFF",; - " Toggle display of CallStack window",; - "",; - "DELETE ALL [WP|TP|BP]",; - "DELETE WP|TP|BP ",; - " Delete all or particular Watchpoint, Tracepoint",; - " or Breakpoint.",; - "",; - "DOS",; - " Visit the operating system.",; - "",; - "FIND ",; - " Search currently viewed file for specified",; - " character string.",; - "",; - "GO",; - " Execute application in Run Mode.",; - "",; - "GOTO ",; - " Move cursor to specified line in currently viewed",; - " file.",; - "",; - "HELP",; - " Get advice in the form of the Help window.",; - "",; - "INPUT ",; - " Read commands from specified Script File.",; - "",; - "LIST BP|WP|TP",; - " List Breakpoints, Watchpoints or Tracepoints in",; - " the Command Window.",; - "",; - "NEXT",; - " Search for next occurence of FIND string.",; - "",; - "NUM ON|off",; - " Toggle display of line numbers in Code window.",; - "",; - "OUTPUT",; - " View application screen.",; - "",; - "",; - "PREV",; - " Search for previous occurence of FIND string.",; - "",; - "QUIT",; - " Quit.",; - "",; - "RESTART",; - " Restart application",; - "",; - "RESUME",; - " Resume viewing the currently executing program",; - " code in the Code Window, after VIEWing another",; - " file.",; - "",; - "SPEED ",; - " Set Animate mode step speed. designates",; - " the number of tenths of a second to delay.",; - " must be greater than or equal to 0.",; - "",; - "STEP",; - " Execute one line of program code.",; - "",; - "TP ",; - " Establish as a Tracepoint. may be a",; - " variable or expression.",; - "",; - "VIEW ",; - " View specified file in Code window.",; - "",; - "WP ",; - " Establish as a Watchpoint. may be a",; - " variable or expression." } + aTopics[ 21 ][ 2 ] := { ; + "There are two sets of debugger commands:", ; + "", ; + "1. Menu option commands. These commands are formed", ; + "from the menu name, followed by the (first word of)", ; + "the option name. For instance, the Monitor:Public", ; + "menu option may be invoked via the command:", ; + "", ; + " Monitor Public", ; + "", ; + "These commands may be abbreviated down to one letter", ; + "per word. However in some cases a second letter will", ; + "be required in the second word, as in the case of", ; + "Monitor Private:", ; + "", ; + " M P // invokes Monitor Public", ; + " M Pr // invokes Monitor Private", ; + "", ; + "", ; + "", ; + "2. Other commands. Listed below.", ; + "", ; + "", ; + "? ", ; + " Display the value of a variable or expression.", ; + "", ; + "?? ", ; + " Inspect the value of a variable or expression.", ; + "", ; + "ANIMATE", ; + " Execute application in Animate Mode.", ; + "", ; + "BP [ [ ]]|[]", ; + "", ; + " BP", ; + " Toggle breakpoint at current line in current", ; + " source file.", ; + "", ; + " BP ", ; + " Toggle breakpoint at in current source", ; + " file.", ; + "", ; + " BP ", ; + " Toggle breakpoint at in ", ; + " source file.", ; + " BP ", ; + " Toggle breakpoint on function.", ; + "", ; + "CALLSTACK on|OFF", ; + " Toggle display of CallStack window", ; + "", ; + "DELETE ALL [WP|TP|BP]", ; + "DELETE WP|TP|BP ", ; + " Delete all or particular Watchpoint, Tracepoint", ; + " or Breakpoint.", ; + "", ; + "DOS", ; + " Visit the operating system.", ; + "", ; + "FIND ", ; + " Search currently viewed file for specified", ; + " character string.", ; + "", ; + "GO", ; + " Execute application in Run Mode.", ; + "", ; + "GOTO ", ; + " Move cursor to specified line in currently viewed", ; + " file.", ; + "", ; + "HELP", ; + " Get advice in the form of the Help window.", ; + "", ; + "INPUT ", ; + " Read commands from specified Script File.", ; + "", ; + "LIST BP|WP|TP", ; + " List Breakpoints, Watchpoints or Tracepoints in", ; + " the Command Window.", ; + "", ; + "NEXT", ; + " Search for next occurence of FIND string.", ; + "", ; + "NUM ON|off", ; + " Toggle display of line numbers in Code window.", ; + "", ; + "OUTPUT", ; + " View application screen.", ; + "", ; + "", ; + "PREV", ; + " Search for previous occurence of FIND string.", ; + "", ; + "QUIT", ; + " Quit.", ; + "", ; + "RESTART", ; + " Restart application", ; + "", ; + "RESUME", ; + " Resume viewing the currently executing program", ; + " code in the Code Window, after VIEWing another", ; + " file.", ; + "", ; + "SPEED ", ; + " Set Animate mode step speed. designates", ; + " the number of tenths of a second to delay.", ; + " must be greater than or equal to 0.", ; + "", ; + "STEP", ; + " Execute one line of program code.", ; + "", ; + "TP ", ; + " Establish as a Tracepoint. may be a", ; + " variable or expression.", ; + "", ; + "VIEW ", ; + " View specified file in Code window.", ; + "", ; + "WP ", ; + " Establish as a Watchpoint. may be a", ; + " variable or expression." } - aTopics[ 22 ][ 2 ] := ; - { "Script files contain debugger commands, in the same",; - "form they would take as input in the Command window.",; - "By default, script files use the extension CLD, as in",; - "'myscript.cld'.",; - "",; - "",; - "Creating a script file:",; - "",; - "A script file containing all the debugger's current",; - "settings may be created via the Options:Save menu",; - "option. A script file may also be written by hand,",; - "in a text editor.",; - "",; - "",; - "Reading a script file:",; - "",; - "A script file may be read into the debugger at any",; - "time using the Options:Restore menu option.",; - "",; - "When using CLD.EXE, a script file may also be",; - "specified on the command line, before the name of",; - "the program to be debugged, i.e.:",; - "",; - " CLD @ ",; - "",; - "In both of these, the extension '.cld' will be assumed",; - "if no extension is supplied.",; - "",; - "When reading a script file, the debugger will look",; - "for the file in the current directory first. If the",; - "script is not found there, the debugger will search",; - "all directories in the PATH environment variable.",; - "",; - "",; - "init.cld:",; - "",; - "On startup (or, if it is linked into a program, when",; - "it is first invoked), the debugger will look for a",; - "script file called init.cld, in the current directory",; - "and then, if not found, in the directories specified",; - "by the PATH environment variable.",; - "",; - "If init.cld is found, the debugger will read it",; - "automatically. It is useful to place general",; - "preferences in init.cld -- specifying colors,",; - "turning on the CallStack window, and so on." } + aTopics[ 22 ][ 2 ] := { ; + "Script files contain debugger commands, in the same", ; + "form they would take as input in the Command window.", ; + "By default, script files use the extension CLD, as in", ; + "'myscript.cld'.", ; + "", ; + "", ; + "Creating a script file:", ; + "", ; + "A script file containing all the debugger's current", ; + "settings may be created via the Options:Save menu", ; + "option. A script file may also be written by hand,", ; + "in a text editor.", ; + "", ; + "", ; + "Reading a script file:", ; + "", ; + "A script file may be read into the debugger at any", ; + "time using the Options:Restore menu option.", ; + "", ; + "When using CLD.EXE, a script file may also be", ; + "specified on the command line, before the name of", ; + "the program to be debugged, i.e.:", ; + "", ; + " CLD @ ", ; + "", ; + "In both of these, the extension '.cld' will be assumed", ; + "if no extension is supplied.", ; + "", ; + "When reading a script file, the debugger will look", ; + "for the file in the current directory first. If the", ; + "script is not found there, the debugger will search", ; + "all directories in the PATH environment variable.", ; + "", ; + "", ; + "init.cld:", ; + "", ; + "On startup (or, if it is linked into a program, when", ; + "it is first invoked), the debugger will look for a", ; + "script file called init.cld, in the current directory", ; + "and then, if not found, in the directories specified", ; + "by the PATH environment variable.", ; + "", ; + "If init.cld is found, the debugger will read it", ; + "automatically. It is useful to place general", ; + "preferences in init.cld -- specifying colors,", ; + "turning on the CallStack window, and so on." } RETURN aTopics diff --git a/harbour/src/debug/dbgtarr.prg b/harbour/src/debug/dbgtarr.prg index 9e2d5b5213..b38a235c11 100644 --- a/harbour/src/debug/dbgtarr.prg +++ b/harbour/src/debug/dbgtarr.prg @@ -87,6 +87,7 @@ METHOD New( aArray, cVarName, lEditable ) CLASS HBDbArray RETURN Self METHOD addWindows( aArray, nRow ) CLASS HBDbArray + LOCAL oBrwSets LOCAL nSize := Len( aArray ) LOCAL oWndSets @@ -142,11 +143,11 @@ METHOD addWindows( aArray, nRow ) CLASS HBDbArray oBrwSets:goTopBlock := {|| oBrwSets:cargo[ 1 ] := 1 } oBrwSets:goBottomBlock := {|| oBrwSets:cargo[ 1 ] := Len( oBrwSets:cargo[ 2 ][ 1 ] ) } oBrwSets:skipBlock := {| nPos | ( nPos := ArrayBrowseSkip( nPos, oBrwSets ), oBrwSets:cargo[ 1 ] := ; - oBrwSets:cargo[ 1 ] + nPos, nPos ) } + oBrwSets:cargo[ 1 ] + nPos, nPos ) } ::aWindows[ ::nCurWindow ]:bPainted := {|| ( oBrwSets:forcestable(), RefreshVarsS( oBrwSets ) ) } - ::aWindows[ ::nCurWindow ]:bKeyPressed := {| nKey | ::SetsKeyPressed( nKey, oBrwSets,; - ::aWindows[ ::nCurWindow ], ::arrayName, aArray ) } + ::aWindows[ ::nCurWindow ]:bKeyPressed := {| nKey | ::SetsKeyPressed( nKey, oBrwSets, ; + ::aWindows[ ::nCurWindow ], ::arrayName, aArray ) } SetCursor( SC_NONE ) @@ -157,16 +158,16 @@ METHOD addWindows( aArray, nRow ) CLASS HBDbArray METHOD doGet( oBrowse, pItem, nSet ) CLASS HBDbArray LOCAL oErr - LOCAL cValue := PadR( __dbgValToStr( pItem[ nSet ] ),; - oBrowse:nRight - oBrowse:nLeft - oBrowse:GetColumn( 1 ):width ) + LOCAL cValue := PadR( __dbgValToStr( pItem[ nSet ] ), ; + oBrowse:nRight - oBrowse:nLeft - oBrowse:GetColumn( 1 ):width ) // make sure browse is stable oBrowse:forceStable() // if confirming new record, append blank IF __dbgInput( Row(), oBrowse:nLeft + oBrowse:GetColumn( 1 ):width + 1,, @cValue, ; - {| cValue | iif( Type( cValue ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } ) - BEGIN SEQUENCE WITH {| oErr | break( oErr ) } + {| cValue | iif( Type( cValue ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } ) + BEGIN SEQUENCE WITH {| oErr | Break( oErr ) } pItem[ nSet ] := &cValue RECOVER USING oErr __dbgAlert( oErr:description ) @@ -241,7 +242,7 @@ METHOD SetsKeyPressed( nKey, oBrwSets, oWnd, cName, aArray ) CLASS HBDbArray RefreshVarsS( oBrwSets ) ::aWindows[ ::nCurWindow ]:SetCaption( cName + "[" + hb_ntos( oBrwSets:cargo[ 1 ] ) + ".." + ; - hb_ntos( Len( aArray ) ) + "]" ) + hb_ntos( Len( aArray ) ) + "]" ) RETURN self @@ -271,6 +272,6 @@ STATIC PROCEDURE RefreshVarsS( oBrowse ) RETURN STATIC FUNCTION ArrayBrowseSkip( nPos, oBrwSets ) - RETURN iif( oBrwSets:cargo[ 1 ] + nPos < 1, 0 - oBrwSets:cargo[ 1 ] + 1 , ; - iif( oBrwSets:cargo[ 1 ] + nPos > Len( oBrwSets:cargo[ 2 ][ 1 ] ), ; - Len( oBrwSets:cargo[ 2 ][ 1 ] ) - oBrwSets:cargo[ 1 ], nPos ) ) + RETURN iif( oBrwSets:cargo[ 1 ] + nPos < 1, 0 - oBrwSets:cargo[ 1 ] + 1, ; + iif( oBrwSets:cargo[ 1 ] + nPos > Len( oBrwSets:cargo[ 2 ][ 1 ] ), ; + Len( oBrwSets:cargo[ 2 ][ 1 ] ) - oBrwSets:cargo[ 1 ], nPos ) ) diff --git a/harbour/src/debug/dbgthsh.prg b/harbour/src/debug/dbgthsh.prg index d68f4e1685..bab38c02a5 100644 --- a/harbour/src/debug/dbgthsh.prg +++ b/harbour/src/debug/dbgthsh.prg @@ -87,6 +87,7 @@ METHOD New( hHash, cVarName, lEditable ) CLASS HBDbHash RETURN Self METHOD addWindows( hHash, nRow ) CLASS HBDbHash + LOCAL oBrwSets LOCAL nSize := Len( hHash ) LOCAL oWndSets @@ -141,16 +142,16 @@ METHOD addWindows( hHash, nRow ) CLASS HBDbHash oCol:width := 50 */ - oCol:DefColor:= { 1, 3 } + oCol:DefColor := { 1, 3 } oBrwSets:goTopBlock := {|| oBrwSets:cargo[ 1 ] := 1 } oBrwSets:goBottomBlock := {|| oBrwSets:cargo[ 1 ] := Len( oBrwSets:cargo[ 2 ][ 1 ] ) } oBrwSets:skipBlock := {| nPos | ( nPos := HashBrowseSkip( nPos, oBrwSets ), oBrwSets:cargo[ 1 ] := ; - oBrwSets:cargo[ 1 ] + nPos, nPos ) } + oBrwSets:cargo[ 1 ] + nPos, nPos ) } ::aWindows[ ::nCurWindow ]:bPainted := {|| ( oBrwSets:forcestable(), RefreshVarsS( oBrwSets ) ) } - ::aWindows[ ::nCurWindow ]:bKeyPressed := {| nKey | ::SetsKeyPressed( nKey, oBrwSets,; - ::aWindows[ ::nCurWindow ],::hashName, hHash ) } + ::aWindows[ ::nCurWindow ]:bKeyPressed := {| nKey | ::SetsKeyPressed( nKey, oBrwSets, ; + ::aWindows[ ::nCurWindow ], ::hashName, hHash ) } SetCursor( SC_NONE ) @@ -161,17 +162,17 @@ METHOD addWindows( hHash, nRow ) CLASS HBDbHash METHOD doGet( oBrowse, pItem, nSet ) CLASS HBDbHash LOCAL oErr - LOCAL cValue := PadR( __dbgValToStr( HB_HValueAt( pItem, nSet ) ),; - oBrowse:nRight - oBrowse:nLeft - oBrowse:GetColumn( 1 ):width ) + LOCAL cValue := PadR( __dbgValToStr( hb_HValueAt( pItem, nSet ) ), ; + oBrowse:nRight - oBrowse:nLeft - oBrowse:GetColumn( 1 ):width ) // make sure browse is stable oBrowse:forceStable() // if confirming new record, append blank IF __dbgInput( Row(), oBrowse:nLeft + oBrowse:GetColumn( 1 ):width + 1,, @cValue, ; - {| cValue | iif( Type( cValue ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } ) - BEGIN SEQUENCE WITH {| oErr | break( oErr ) } - HB_HValueAt( pItem, nSet, &cValue ) + {| cValue | iif( Type( cValue ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } ) + BEGIN SEQUENCE WITH {| oErr | Break( oErr ) } + hb_HValueAt( pItem, nSet, &cValue ) RECOVER USING oErr __dbgAlert( oErr:description ) END SEQUENCE @@ -206,7 +207,7 @@ METHOD SetsKeyPressed( nKey, oBrwSets, oWnd, cName, hHash ) CLASS HBDbHash CASE nKey == K_ENTER - uValue := HB_HValueAt( hHash, nSet ) + uValue := hb_HValueAt( hHash, nSet ) IF HB_ISHASH( uValue ) @@ -216,8 +217,8 @@ METHOD SetsKeyPressed( nKey, oBrwSets, oWnd, cName, hHash ) CLASS HBDbHash SetPos( ownd:nBottom, ownd:nLeft ) ::aWindows[ ::nCurwindow ]:lFocused := .F. - ::hashName:= ::hashName + "[" + HashKeyString( hHash, nSet ) + "]" - ::AddWindows( HB_HValueAt( hHash, nSet ), oBrwSets:RowPos + oBrwSets:nTop ) + ::hashName := ::hashName + "[" + HashKeyString( hHash, nSet ) + "]" + ::AddWindows( hb_HValueAt( hHash, nSet ), oBrwSets:RowPos + oBrwSets:nTop ) ::hashName := cOldName hb_ADel( ::aWindows, ::nCurWindow, .T. ) @@ -250,8 +251,8 @@ METHOD SetsKeyPressed( nKey, oBrwSets, oWnd, cName, hHash ) CLASS HBDbHash RefreshVarsS( oBrwSets ) - ::aWindows[ ::nCurwindow ]:SetCaption( cName + "[" + hb_NToS( oBrwSets:cargo[ 1 ] ) + ".." + ; - hb_NToS( Len( hHash ) ) + "]" ) + ::aWindows[ ::nCurwindow ]:SetCaption( cName + "[" + hb_ntos( oBrwSets:cargo[ 1 ] ) + ".." + ; + hb_ntos( Len( hHash ) ) + "]" ) RETURN self @@ -262,7 +263,7 @@ STATIC FUNCTION GetTopPos( nPos ) RETURN iif( ( MaxRow() - nPos ) < 5, MaxRow() - nPos, nPos ) STATIC FUNCTION GetBottomPos( nPos ) - RETURN iif( nPos < MaxRow() - 2, nPos, MaxRow()-2 ) + RETURN iif( nPos < MaxRow() - 2, nPos, MaxRow() - 2 ) STATIC PROCEDURE RefreshVarsS( oBrowse ) @@ -281,19 +282,19 @@ STATIC PROCEDURE RefreshVarsS( oBrowse ) RETURN STATIC FUNCTION HashBrowseSkip( nPos, oBrwSets ) - RETURN iif( oBrwSets:cargo[ 1 ] + nPos < 1, 0 - oBrwSets:cargo[ 1 ] + 1 , ; - iif( oBrwSets:cargo[ 1 ] + nPos > Len( oBrwSets:cargo[ 2 ][ 1 ] ), ; - Len( oBrwSets:cargo[ 2 ][ 1 ] ) - oBrwSets:cargo[ 1 ], nPos ) ) + RETURN iif( oBrwSets:cargo[ 1 ] + nPos < 1, 0 - oBrwSets:cargo[ 1 ] + 1, ; + iif( oBrwSets:cargo[ 1 ] + nPos > Len( oBrwSets:cargo[ 2 ][ 1 ] ), ; + Len( oBrwSets:cargo[ 2 ][ 1 ] ) - oBrwSets:cargo[ 1 ], nPos ) ) STATIC FUNCTION HashKeyString( hHash, nAt ) - LOCAL xVal := HB_HKeyAt( hHash, nAt ) + LOCAL xVal := hb_HKeyAt( hHash, nAt ) LOCAL cType := ValType( xVal ) DO CASE CASE cType == "C" ; RETURN '"' + xVal + '"' CASE cType == "D" ; RETURN '"' + DToC( xVal ) + '"' - CASE cType == "N" ; RETURN hb_NToS( xVal ) + CASE cType == "N" ; RETURN hb_ntos( xVal ) ENDCASE RETURN AllTrim( __dbgCStr( xVal ) ) diff --git a/harbour/src/debug/dbgtinp.prg b/harbour/src/debug/dbgtinp.prg index 68f6bbc7a8..2347a55e33 100644 --- a/harbour/src/debug/dbgtinp.prg +++ b/harbour/src/debug/dbgtinp.prg @@ -62,7 +62,8 @@ CREATE CLASS HbDbInput -HIDDEN: + HIDDEN: + VAR nRow AS INTEGER VAR nCol AS INTEGER VAR nWidth AS INTEGER @@ -73,7 +74,8 @@ HIDDEN: VAR acColor AS ARRAY VAR lFocus AS LOGICAL INIT .F. -EXPORTED: + EXPORTED: + METHOD new( nRow, nCol, nWidth, cValue, cColor, nSize ) METHOD applyKey( nKey ) METHOD getValue() @@ -99,45 +101,55 @@ METHOD new( nRow, nCol, nWidth, cValue, cColor, nSize ) CLASS HbDbInput RETURN Self -METHOD setColor( cColor ) CLASS HbDbInput +METHOD SetColor( cColor ) CLASS HbDbInput - ::acColor:= { hb_ColorIndex( cColor, CLR_STANDARD ), ; - hb_ColorIndex( cColor, CLR_ENHANCED ) } - IF hb_colorToN( ::acColor[ 2 ] ) == -1 - ::acColor[ 2 ] := iif( hb_colorToN( ::acColor[ 1 ] ) != -1, ; - ::acColor[ 1 ], ; - hb_ColorIndex( SetColor(), CLR_ENHANCED ) ) + ::acColor := { ; + hb_ColorIndex( cColor, CLR_STANDARD ), ; + hb_ColorIndex( cColor, CLR_ENHANCED ) } + IF hb_ColorToN( ::acColor[ 2 ] ) == -1 + ::acColor[ 2 ] := iif( hb_ColorToN( ::acColor[ 1 ] ) != -1, ; + ::acColor[ 1 ], ; + hb_ColorIndex( SetColor(), CLR_ENHANCED ) ) ENDIF - IF hb_colorToN( ::acColor[ 1 ] ) == -1 + IF hb_ColorToN( ::acColor[ 1 ] ) == -1 ::acColor[ 1 ] := hb_ColorIndex( SetColor(), CLR_STANDARD ) ENDIF + RETURN Self METHOD newPos( nRow, nCol ) CLASS HbDbInput + ::nRow := nRow ::nCol := nCol + RETURN Self METHOD setFocus() CLASS HbDbInput + IF !::lFocus ::lFocus := .T. ::display() ENDIF + RETURN Self METHOD killFocus() CLASS HbDbInput + IF ::lFocus ::lFocus := .F. ::display() ENDIF + RETURN Self METHOD getValue() CLASS HbDbInput RETURN ::cValue METHOD setValue( cValue ) CLASS HbDbInput + ::cValue := PadR( cValue, ::nSize ) ::nPos := Min( ::nSize, Len( RTrim( ::cValue ) ) + 1 ) + RETURN Self METHOD display() CLASS HbDbInput @@ -147,12 +159,13 @@ METHOD display() CLASS HbDbInput ELSEIF ::nPos - ::nFirst >= ::nWidth ::nFirst := ::nPos - ::nWidth + 1 ENDIF - hb_dispOutAt( ::nRow, ::nCol, Substr( ::cValue, ::nFirst, ::nWidth ), ; - ::acColor[ iif( ::lFocus, 2, 1 ) ] ) + hb_DispOutAt( ::nRow, ::nCol, SubStr( ::cValue, ::nFirst, ::nWidth ), ; + ::acColor[ iif( ::lFocus, 2, 1 ) ] ) IF ::lFocus SetPos( ::nRow, ::nCol + ::nPos - ::nFirst ) SetCursor( iif( Set( _SET_INSERT ), SC_INSERT, SC_NORMAL ) ) ENDIF + RETURN Self METHOD applyKey( nKey ) CLASS HbDbInput diff --git a/harbour/src/debug/dbgtmenu.prg b/harbour/src/debug/dbgtmenu.prg index 517c366d3c..6140f300da 100644 --- a/harbour/src/debug/dbgtmenu.prg +++ b/harbour/src/debug/dbgtmenu.prg @@ -86,9 +86,9 @@ CREATE CLASS HBDbMenu METHOD AddItem( oMenuItem ) METHOD Build() METHOD ClosePopup( nPopup ) - METHOD Close() INLINE ::ClosePopup( ::nOpenPopup ), ::nOpenPopup := 0 + METHOD CLOSE() INLINE ::ClosePopup( ::nOpenPopup ), ::nOpenPopup := 0 METHOD DeHilite() - METHOD Display() + METHOD DISPLAY() METHOD EvalAction() METHOD GetHotKeyPos( cKey ) METHOD GetItemByIdent( uIdent ) @@ -151,7 +151,7 @@ METHOD AddItem( oMenuItem ) CLASS HBDbMenu IF Len( oLastMenu:aItems ) > 0 oLastMenuItem := ATail( oLastMenu:aItems ) oMenuItem:nCol := oLastMenuItem:nCol + ; - Len( StrTran( oLastMenuItem:cPrompt, "~" ) ) + Len( StrTran( oLastMenuItem:cPrompt, "~" ) ) ELSE oMenuItem:nCol := 0 ENDIF @@ -203,8 +203,8 @@ METHOD ClosePopup( nPopup ) CLASS HBDbMenu IF nPopup != 0 oPopup := ::aItems[ nPopup ]:bAction IF HB_ISOBJECT( oPopup ) - RestScreen( oPopup:nTop, oPopup:nLeft, oPopup:nBottom + 1, oPopup:nRight + 2,; - oPopup:cBackImage ) + RestScreen( oPopup:nTop, oPopup:nLeft, oPopup:nBottom + 1, oPopup:nRight + 2, ; + oPopup:cBackImage ) oPopup:cBackImage := NIL ENDIF ::aItems[ nPopup ]:Display( ::cClrPopup, ::cClrHotKey ) @@ -227,17 +227,17 @@ METHOD Display() CLASS HBDbMenu SetColor( ::cClrPopup ) IF ! ::lPopup - hb_dispOutAt( 0, 0, Space( MaxCol() + 1 ), ::cClrPopup ) + hb_DispOutAt( 0, 0, Space( MaxCol() + 1 ), ::cClrPopup ) SetPos( 0, 0 ) ELSE ::cBackImage := SaveScreen( ::nTop, ::nLeft, ::nBottom + 1, ::nRight + 2 ) - hb_dispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, HB_B_SINGLE_UNI ) + hb_DispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, HB_B_SINGLE_UNI ) hb_Shadow( ::nTop, ::nLeft, ::nBottom, ::nRight ) ENDIF FOR n := 1 TO Len( ::aItems ) IF ::aItems[ n ]:cPrompt == "-" // Separator - hb_dispOutAtBox( ::aItems[ n ]:nRow, ::nLeft,; + hb_DispOutAtBox( ::aItems[ n ]:nRow, ::nLeft, ; hb_UTF8ToStrBox( "├" + Replicate( "─", ::nRight - ::nLeft - 1 ) + "┤" ) ) ELSE ::aItems[ n ]:Display( ::cClrPopup, ::cClrHotKey ) @@ -265,7 +265,7 @@ METHOD GetHotKeyPos( cKey ) CLASS HBDbMenu LOCAL n FOR n := 1 TO Len( ::aItems ) - IF Upper( SubStr( ::aItems[ n ]:cPrompt,; + IF Upper( SubStr( ::aItems[ n ]:cPrompt, ; At( "~", ::aItems[ n ]:cPrompt ) + 1, 1 ) ) == cKey RETURN n ENDIF @@ -298,7 +298,7 @@ METHOD GetItemByIdent( uIdent ) CLASS HBDbMenu RETURN oItem ENDIF ELSE - IF VALTYPE( ::aItems[ n ]:Ident ) == VALTYPE( uIdent ) .AND.; + IF ValType( ::aItems[ n ]:Ident ) == ValType( uIdent ) .AND. ; ::aItems[ n ]:Ident == uIdent RETURN ::aItems[ n ] ENDIF @@ -404,7 +404,7 @@ METHOD Refresh() CLASS HBDbMenu DispBegin() IF ! ::lPopup - hb_dispOutAt( 0, 0, Space( MaxCol() + 1 ), ::cClrPopup ) + hb_DispOutAt( 0, 0, Space( MaxCol() + 1 ), ::cClrPopup ) SetPos( 0, 0 ) ENDIF @@ -435,48 +435,48 @@ METHOD ProcessKey( nKey ) CLASS HBDbMenu DO CASE CASE nKey == K_LBUTTONDOWN - IF MRow() == 0 - IF ( nPopup := ::GetItemOrdByCoors( 0, MCol() ) ) != 0 - IF nPopup != ::nOpenPopup - ::ClosePopup( ::nOpenPopup ) - ::ShowPopup( nPopup ) - ENDIF - ENDIF - ELSE - oPopup := ::aItems[ ::nOpenPopup ]:bAction - IF ( nPopup := oPopup:GetItemOrdByCoors( MRow(), MCol() ) ) == 0 - ::Close() - ELSE - oPopup:DeHilite() - oPopup:nOpenPopup := nPopup - oPopup:aItems[ nPopup ]:Display( ::cClrHilite, ::cClrHotFocus ) - ::EvalAction() - ENDIF - ENDIF + IF MRow() == 0 + IF ( nPopup := ::GetItemOrdByCoors( 0, MCol() ) ) != 0 + IF nPopup != ::nOpenPopup + ::ClosePopup( ::nOpenPopup ) + ::ShowPopup( nPopup ) + ENDIF + ENDIF + ELSE + oPopup := ::aItems[ ::nOpenPopup ]:bAction + IF ( nPopup := oPopup:GetItemOrdByCoors( MRow(), MCol() ) ) == 0 + ::Close() + ELSE + oPopup:DeHilite() + oPopup:nOpenPopup := nPopup + oPopup:aItems[ nPopup ]:Display( ::cClrHilite, ::cClrHotFocus ) + ::EvalAction() + ENDIF + ENDIF CASE nKey == K_ESC - ::Close() + ::Close() CASE nKey == K_LEFT - ::GoLeft() + ::GoLeft() CASE nKey == K_RIGHT - ::GoRight() + ::GoRight() CASE nKey == K_DOWN - ::GoDown() + ::GoDown() CASE nKey == K_UP - ::GoUp() + ::GoUp() CASE nKey == K_ENTER - ::EvalAction() + ::EvalAction() CASE nKey == K_HOME - ::GoTop() + ::GoTop() CASE nKey == K_END - ::GoBottom() + ::GoBottom() OTHERWISE @@ -504,11 +504,12 @@ METHOD ProcessKey( nKey ) CLASS HBDbMenu FUNCTION __dbgAltToKey( nKey ) - LOCAL nIndex := AScan( { K_ALT_A, K_ALT_B, K_ALT_C, K_ALT_D, K_ALT_E, K_ALT_F,; - K_ALT_G, K_ALT_H, K_ALT_I, K_ALT_J, K_ALT_K, K_ALT_L,; - K_ALT_M, K_ALT_N, K_ALT_O, K_ALT_P, K_ALT_Q, K_ALT_R,; - K_ALT_S, K_ALT_T, K_ALT_U, K_ALT_V, K_ALT_W, K_ALT_X,; - K_ALT_Y, K_ALT_Z, K_ALT_1, K_ALT_2, K_ALT_3, K_ALT_4,; - K_ALT_5, K_ALT_6, K_ALT_7, K_ALT_8, K_ALT_9, K_ALT_0 }, nKey ) + LOCAL nIndex := AScan( { ; + K_ALT_A, K_ALT_B, K_ALT_C, K_ALT_D, K_ALT_E, K_ALT_F, ; + K_ALT_G, K_ALT_H, K_ALT_I, K_ALT_J, K_ALT_K, K_ALT_L, ; + K_ALT_M, K_ALT_N, K_ALT_O, K_ALT_P, K_ALT_Q, K_ALT_R, ; + K_ALT_S, K_ALT_T, K_ALT_U, K_ALT_V, K_ALT_W, K_ALT_X, ; + K_ALT_Y, K_ALT_Z, K_ALT_1, K_ALT_2, K_ALT_3, K_ALT_4, ; + K_ALT_5, K_ALT_6, K_ALT_7, K_ALT_8, K_ALT_9, K_ALT_0 }, nKey ) RETURN iif( nIndex > 0, SubStr( "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", nIndex, 1 ), "" ) diff --git a/harbour/src/debug/dbgtmitm.prg b/harbour/src/debug/dbgtmitm.prg index fcf6c5d895..3828a14dee 100644 --- a/harbour/src/debug/dbgtmitm.prg +++ b/harbour/src/debug/dbgtmitm.prg @@ -92,12 +92,12 @@ METHOD Display( cClrText, cClrHotKey ) CLASS HBDbMenuItem LOCAL nAt - hb_dispOutAt( ::nRow, ::nCol, StrTran( ::cPrompt, "~" ), cClrText ) + hb_DispOutAt( ::nRow, ::nCol, StrTran( ::cPrompt, "~" ), cClrText ) - hb_dispOutAt( ::nRow, ::nCol + ; - ( nAt := At( "~", ::cPrompt ) ) - 1,; - SubStr( ::cPrompt, nAt + 1, 1 ), cClrHotKey ) + hb_DispOutAt( ::nRow, ::nCol + ; + ( nAt := At( "~", ::cPrompt ) ) - 1, ; + SubStr( ::cPrompt, nAt + 1, 1 ), cClrHotKey ) - hb_dispOutAtBox( ::nRow, ::nCol, iif( ::lChecked, hb_UTF8ToStrBox( "âš" ), "" ), cClrText ) + hb_DispOutAtBox( ::nRow, ::nCol, iif( ::lChecked, hb_UTF8ToStrBox( "âš" ), "" ), cClrText ) RETURN Self diff --git a/harbour/src/debug/dbgtobj.prg b/harbour/src/debug/dbgtobj.prg index a473ad7abf..9ab964ac6d 100644 --- a/harbour/src/debug/dbgtobj.prg +++ b/harbour/src/debug/dbgtobj.prg @@ -91,11 +91,11 @@ METHOD New( oObject, cVarName, lEditable ) CLASS HBDbObject aMethods := {} FOR EACH cMsg IN aMessages IF Left( cMsg, 1 ) == "_" .AND. ; - HB_AScan( aMessages, cMsgAcc := Substr( cMsg, 2 ),,, .T. ) != 0 + hb_AScan( aMessages, cMsgAcc := SubStr( cMsg, 2 ),,, .T. ) != 0 xValue := __dbgObjGetValue( oObject, cMsgAcc ) AAdd( ::pItems, { cMsgAcc, xValue, .T. } ) AAdd( ::AllNames, cMsgAcc ) - ELSEIF HB_AScan( aMessages, "_" + cMsg,,, .T. ) == 0 + ELSEIF hb_AScan( aMessages, "_" + cMsg,,, .T. ) == 0 AAdd( aMethods, cMsg ) ENDIF NEXT @@ -121,7 +121,7 @@ METHOD addWindows( aArray, nRow ) CLASS HBDbObject LOCAL oCol LOCAL nMaxLen - IF nSize < MaxRow()-2 + IF nSize < MaxRow() - 2 IF nRow != NIL oWndSets := HBDbWindow():New( nRow, 5, iif( nRow + nSize + 1 < MaxRow() - 2, nRow + nSize + 1, MaxRow() - 2 ), MaxCol() - 5, ::objname + " is of class: " + ::TheObj:ClassName(), "N/W" ) ELSE @@ -144,19 +144,19 @@ METHOD addWindows( aArray, nRow ) CLASS HBDbObject oBrwSets:ColorSpec := __Dbg():ClrModal() oBrwSets:GoTopBlock := {|| ::Arrayindex := 1 } oBrwSets:GoBottomBlock := {|| ::arrayindex := Len( ::ArrayReference ) } - oBrwSets:SkipBlock := {| nSkip, nPos | nPos := ::arrayindex,; - ::arrayindex := iif( nSkip > 0, Min( ::arrayindex + nSkip, Len( ::arrayReference ) ),; - Max( 1, ::arrayindex + nSkip ) ), ::arrayindex - nPos } + oBrwSets:SkipBlock := {| nSkip, nPos | nPos := ::arrayindex, ; + ::arrayindex := iif( nSkip > 0, Min( ::arrayindex + nSkip, Len( ::arrayReference ) ), ; + Max( 1, ::arrayindex + nSkip ) ), ::arrayindex - nPos } nMaxLen := ArrayMaxLen( ::AllNames ) - oBrwSets:AddColumn( oCol := HBDbColumnNew( "",; - {|| PadR( ::ArrayReference[ ::arrayindex, 1 ], nMaxLen ) } ) ) + oBrwSets:AddColumn( oCol := HBDbColumnNew( "", ; + {|| PadR( ::ArrayReference[ ::arrayindex, 1 ], nMaxLen ) } ) ) oCol:width := nMaxLen oCol:ColorBlock := {|| { iif( ::Arrayindex == oBrwSets:Cargo, 2, 1 ), 2 } } oBrwSets:Freeze := 1 - oBrwSets:AddColumn( oCol := HBDbColumnNew( "", {|| iif( HB_ISSTRING( ::ArrayReference[ ::ArrayIndex, 2 ] ) .AND. !::ArrayReference[ ::ArrayIndex, 3 ],; - ::ArrayReference[ ::ArrayIndex, 2 ],; + oBrwSets:AddColumn( oCol := HBDbColumnNew( "", {|| iif( HB_ISSTRING( ::ArrayReference[ ::ArrayIndex, 2 ] ) .AND. !::ArrayReference[ ::ArrayIndex, 3 ], ; + ::ArrayReference[ ::ArrayIndex, 2 ], ; PadR( __dbgValToStr( __dbgObjGetValue( ::TheObj, ::ArrayReference[ ::arrayindex, 1 ] ) ), nWidth - 12 ) ) } ) ) oBrwSets:Cargo := 1 // Actual highlighted row @@ -165,7 +165,7 @@ METHOD addWindows( aArray, nRow ) CLASS HBDbObject oBrwSets:colPos := 2 ::aWindows[ ::nCurWindow ]:bPainted := {|| oBrwSets:ForceStable() } ::aWindows[ ::nCurWindow ]:bKeyPressed := {| nKey | ::SetsKeyPressed( nKey, oBrwSets, Len( aArray ), ::ArrayReference ) } - ::aWindows[ ::nCurwindow ]:cCaption := ::objname + " is of class: " +::TheObj:ClassName() + ::aWindows[ ::nCurwindow ]:cCaption := ::objname + " is of class: " + ::TheObj:ClassName() SetCursor( SC_NONE ) @@ -196,8 +196,8 @@ METHOD doGet( oBrowse, pItem, nSet ) CLASS HBDbObject cValue := PadR( __dbgValToStr( cValue ), column:Width ) IF __dbgInput( Row(), oBrowse:nLeft + oBrowse:GetColumn( 1 ):width + 1,, @cValue, ; - {| cValue | iif( Type( cValue ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } ) - BEGIN SEQUENCE WITH {| oErr | break( oErr ) } + {| cValue | iif( Type( cValue ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } ) + BEGIN SEQUENCE WITH {| oErr | Break( oErr ) } __dbgObjSetValue( ::TheObj, pitem[ nSet, 1 ], &cValue ) RECOVER USING oErr __dbgAlert( oErr:description ) @@ -273,9 +273,9 @@ METHOD SetsKeyPressed( nKey, oBrwSets, nSets, aArray ) CLASS HBDbObject ELSEIF HB_ISOBJECT( aArray[ nSet, 2 ] ) HBDbObject():New( aArray[ nSet, 2 ], ::pitems[ nSet, 1 ] ) ELSEIF ( HB_ISSTRING( aArray[ nSet, 2 ] ) .AND. ; - !aArray[ nSet, 3 ] ) .OR. ; - HB_ISBLOCK( aArray[ nSet, 2 ] ) .OR. ; - HB_ISPOINTER( aArray[ nSet, 2 ] ) + !aArray[ nSet, 3 ] ) .OR. ; + HB_ISBLOCK( aArray[ nSet, 2 ] ) .OR. ; + HB_ISPOINTER( aArray[ nSet, 2 ] ) __dbgAlert( "Value cannot be edited" ) ELSE IF ::lEditable @@ -283,7 +283,7 @@ METHOD SetsKeyPressed( nKey, oBrwSets, nSets, aArray ) CLASS HBDbObject ::doGet( oBrwSets, ::arrayReference, nSet ) oBrwSets:RefreshCurrent() oBrwSets:ForceStable() - else + ELSE __dbgAlert( "Value cannot be edited" ) ENDIF ENDIF @@ -317,11 +317,11 @@ STATIC FUNCTION __dbgObjGetValue( oObject, cVar, lCanAcc ) LOCAL xResult LOCAL oErr - BEGIN SEQUENCE WITH {|| break() } + BEGIN SEQUENCE WITH {|| Break() } xResult := __dbgSENDMSG( nProcLevel, oObject, cVar ) lCanAcc := .T. RECOVER - BEGIN SEQUENCE WITH {| oErr | break( oErr ) } + BEGIN SEQUENCE WITH {| oErr | Break( oErr ) } /* Try to access variables using class code level */ xResult := __dbgSENDMSG( 0, oObject, cVar ) lCanAcc := .T. @@ -338,10 +338,10 @@ STATIC FUNCTION __dbgObjSetValue( oObject, cVar, xValue ) LOCAL nProcLevel := __Dbg():nProcLevel LOCAL oErr - BEGIN SEQUENCE WITH {|| break() } + BEGIN SEQUENCE WITH {|| Break() } __dbgSENDMSG( nProcLevel, oObject, "_" + cVar, xValue ) RECOVER - BEGIN SEQUENCE WITH {| oErr | break( oErr ) } + BEGIN SEQUENCE WITH {| oErr | Break( oErr ) } /* Try to access variables using class code level */ __dbgSENDMSG( 0, oObject, "_" + cVar, xValue ) RECOVER USING oErr diff --git a/harbour/src/debug/dbgtwin.prg b/harbour/src/debug/dbgtwin.prg index 5fea7fbb8c..47d86ad6fc 100644 --- a/harbour/src/debug/dbgtwin.prg +++ b/harbour/src/debug/dbgtwin.prg @@ -142,8 +142,8 @@ METHOD Clear() CLASS HBDbWindow METHOD Hide() CLASS HBDbWindow - RestScreen( ::nTop, ::nLeft, ::nBottom + iif( ::lShadow, 1, 0 ),; - ::nRight + iif( ::lShadow, 2, 0 ), ::cBackImage ) + RestScreen( ::nTop, ::nLeft, ::nBottom + iif( ::lShadow, 1, 0 ), ; + ::nRight + iif( ::lShadow, 2, 0 ), ::cBackImage ) ::cBackImage := NIL ::lVisible := .F. @@ -152,7 +152,7 @@ METHOD Hide() CLASS HBDbWindow METHOD IsOver( nRow, nCol ) CLASS HBDbWindow RETURN nRow >= ::nTop .AND. nRow <= ::nBottom .AND. ; - nCol >= ::nLeft .AND. nCol <= ::nRight + nCol >= ::nLeft .AND. nCol <= ::nRight METHOD ScrollUp( nLines ) CLASS HBDbWindow @@ -172,8 +172,8 @@ METHOD SetCaption( cCaption ) CLASS HBDbWindow METHOD ShowCaption() CLASS HBDbWindow IF ! Empty( ::cCaption ) - hb_dispOutAt( ::nTop, ::nLeft + ( ( ::nRight - ::nLeft ) / 2 ) - ; - ( ( Len( ::cCaption ) + 2 ) / 2 ),; + hb_DispOutAt( ::nTop, ::nLeft + ( ( ::nRight - ::nLeft ) / 2 ) - ; + ( ( Len( ::cCaption ) + 2 ) / 2 ), ; " " + ::cCaption + " ", ::cColor ) ENDIF @@ -197,8 +197,8 @@ METHOD Refresh() CLASS HBDbWindow DispBegin() - hb_dispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, iif( ::lFocused, HB_B_DOUBLE_UNI, HB_B_SINGLE_UNI ), ::cColor ) - hb_dispOutAtBox( ::nTop, ::nLeft + 1, hb_UTF8ToStrBox( "[â– ]" ), ::cColor ) + hb_DispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, iif( ::lFocused, HB_B_DOUBLE_UNI, HB_B_SINGLE_UNI ), ::cColor ) + hb_DispOutAtBox( ::nTop, ::nLeft + 1, hb_UTF8ToStrBox( "[â– ]" ), ::cColor ) ::ShowCaption( ::cCaption ) @@ -211,13 +211,14 @@ METHOD Refresh() CLASS HBDbWindow RETURN NIL METHOD Show( lFocused ) CLASS HBDbWindow + LOCAL nRow := Row() LOCAL nCol := Col() hb_default( @lFocused, ::lFocused ) - ::cBackImage := SaveScreen( ::nTop, ::nLeft, ::nBottom + iif( ::lShadow, 1, 0 ),; - ::nRight + iif( ::lShadow, 2, 0 ) ) + ::cBackImage := SaveScreen( ::nTop, ::nLeft, ::nBottom + iif( ::lShadow, 1, 0 ), ; + ::nRight + iif( ::lShadow, 2, 0 ) ) SetColor( ::cColor ) hb_Scroll( ::nTop, ::nLeft, ::nBottom, ::nRight ) ::SetFocus( lFocused ) @@ -280,7 +281,7 @@ METHOD LDblClick( nMRow, nMCol ) CLASS HBDbWindow RETURN NIL -METHOD Move() Class HBDbWindow +METHOD Move() CLASS HBDbWindow LOCAL nOldTop := ::nTop LOCAL nOldLeft := ::nLeft @@ -290,7 +291,7 @@ METHOD Move() Class HBDbWindow DO WHILE .T. RestScreen( ,,,, ::cBackImage ) - hb_dispBox( ::nTop, ::nLeft, ::nRight, ::nBottom, Replicate( hb_UTF8ToStrBox( "â–‘" ), 8 ) + " " ) + hb_DispBox( ::nTop, ::nLeft, ::nRight, ::nBottom, Replicate( hb_UTF8ToStrBox( "â–‘" ), 8 ) + " " ) nKey := Inkey( 0 ) diff --git a/harbour/src/debug/dbgwa.prg b/harbour/src/debug/dbgwa.prg index 382c3c3f91..ec66c1d6fa 100644 --- a/harbour/src/debug/dbgwa.prg +++ b/harbour/src/debug/dbgwa.prg @@ -111,10 +111,10 @@ PROCEDURE __dbgShowWorkAreas() aBrw[ 1 ]:ColorSpec := oDlg:cColor aBrw[ 1 ]:GoTopBlock := {|| aBrw[ 1 ]:Cargo := n1 := 1 } aBrw[ 1 ]:GoBottomBlock := {|| aBrw[ 1 ]:Cargo := n1 := Len( aAlias ) } - aBrw[ 1 ]:SkipBlock := {| nSkip, nPos | nPos := n1,; - aBrw[ 1 ]:Cargo := n1 := iif( nSkip > 0, Min( Len( aAlias ), n1 + nSkip ),; - Max( 1, n1 + nSkip ) ),; - n1 - nPos } + aBrw[ 1 ]:SkipBlock := {| nSkip, nPos | nPos := n1, ; + aBrw[ 1 ]:Cargo := n1 := iif( nSkip > 0, Min( Len( aAlias ), n1 + nSkip ), ; + Max( 1, n1 + nSkip ) ), ; + n1 - nPos } aBrw[ 1 ]:AddColumn( oCol := HBDbColumnNew( "", {|| PadR( aAlias[ n1 ][ 2 ], 11 ) } ) ) @@ -131,9 +131,9 @@ PROCEDURE __dbgShowWorkAreas() aBrw[ 2 ]:GoTopBlock := {|| aBrw[ 2 ]:Cargo := n2 := 1 } aBrw[ 2 ]:GoBottomBlock := {|| aBrw[ 2 ]:Cargo := n2 := Len( aInfo ) } aBrw[ 2 ]:SkipBlock := {| nSkip, nPos | nPos := n2, ; - aBrw[ 2 ]:Cargo := n2 := iif( nSkip > 0, Min( Len( aInfo ), n2 + nSkip ), ; - Max( 1, n2 + nSkip ) ), ; - n2 - nPos } + aBrw[ 2 ]:Cargo := n2 := iif( nSkip > 0, Min( Len( aInfo ), n2 + nSkip ), ; + Max( 1, n2 + nSkip ) ), ; + n2 - nPos } aBrw[ 2 ]:AddColumn( oCol := HBDbColumnNew( "", {|| PadR( aInfo[ n2 ], 38 ) } ) ) @@ -141,7 +141,7 @@ PROCEDURE __dbgShowWorkAreas() /* Struc browse */ - aStruc := ( aAlias[ n1 ][ 1 ] )->( DbStruct() ) + aStruc := ( aAlias[ n1 ][ 1 ] )->( dbStruct() ) aBrw[ 3 ] := HBDbBrowser():new( oDlg:nTop + 1, oDlg:nLeft + 52, oDlg:nBottom - 1, oDlg:nLeft + 70 ) @@ -149,14 +149,14 @@ PROCEDURE __dbgShowWorkAreas() aBrw[ 3 ]:ColorSpec := oDlg:cColor aBrw[ 3 ]:GoTopBlock := {|| aBrw[ 3 ]:Cargo := n3 := 1 } aBrw[ 3 ]:GoBottomBlock := {|| aBrw[ 3 ]:Cargo := n3 := Len( aStruc ) } - aBrw[ 3 ]:SkipBlock := {| nSkip, nPos | nPos := n3,; - aBrw[ 3 ]:Cargo := n3 := iif( nSkip > 0, Min( Len( aStruc ), n3 + nSkip ),; - Max( 1, n3 + nSkip ) ), n3 - nPos } + aBrw[ 3 ]:SkipBlock := {| nSkip, nPos | nPos := n3, ; + aBrw[ 3 ]:Cargo := n3 := iif( nSkip > 0, Min( Len( aStruc ), n3 + nSkip ), ; + Max( 1, n3 + nSkip ) ), n3 - nPos } aBrw[ 3 ]:AddColumn( HBDbColumnNew( "", {|| PadR( aStruc[ n3, 1 ], 11 ) + ; - aStruc[ n3, 2 ] + ; - Str( aStruc[ n3, 3 ], 4 ) + ; - Str( aStruc[ n3, 4 ], 3 ) } ) ) + aStruc[ n3, 2 ] + ; + Str( aStruc[ n3, 3 ], 4 ) + ; + Str( aStruc[ n3, 4 ], 3 ) } ) ) /* Show dialog */ @@ -170,31 +170,31 @@ STATIC PROCEDURE DlgWorkAreaPaint( oDlg, aBrw ) /* Display captions */ - hb_dispOutAt( oDlg:nTop, oDlg:nLeft + 5, " Area ", oDlg:cColor ) - hb_dispOutAt( oDlg:nTop, oDlg:nLeft + 28, " Status ", oDlg:cColor ) - hb_dispOutAt( oDlg:nTop, oDlg:nLeft + 56, " Structure ", oDlg:cColor ) + hb_DispOutAt( oDlg:nTop, oDlg:nLeft + 5, " Area ", oDlg:cColor ) + hb_DispOutAt( oDlg:nTop, oDlg:nLeft + 28, " Status ", oDlg:cColor ) + hb_DispOutAt( oDlg:nTop, oDlg:nLeft + 56, " Structure ", oDlg:cColor ) /* Display separator lines */ - hb_dispBox( oDlg:nTop + 1, oDlg:nLeft + 12, oDlg:nBottom - 1, oDlg:nLeft + 12, HB_B_SINGLE_UNI, oDlg:cColor ) - hb_dispOutAtBox( oDlg:nTop, oDlg:nLeft + 12, hb_UTF8ToStrBox( "┬" ), oDlg:cColor ) - hb_dispOutAtBox( oDlg:nBottom, oDlg:nLeft + 12, hb_UTF8ToStrBox( "â”´" ), oDlg:cColor ) + hb_DispBox( oDlg:nTop + 1, oDlg:nLeft + 12, oDlg:nBottom - 1, oDlg:nLeft + 12, HB_B_SINGLE_UNI, oDlg:cColor ) + hb_DispOutAtBox( oDlg:nTop, oDlg:nLeft + 12, hb_UTF8ToStrBox( "┬" ), oDlg:cColor ) + hb_DispOutAtBox( oDlg:nBottom, oDlg:nLeft + 12, hb_UTF8ToStrBox( "â”´" ), oDlg:cColor ) - hb_dispBox( oDlg:nTop + 1, oDlg:nLeft + 51, oDlg:nBottom - 1, oDlg:nLeft + 51, HB_B_SINGLE_UNI, oDlg:cColor ) - hb_dispOutAtBox( oDlg:nTop, oDlg:nLeft + 51, hb_UTF8ToStrBox( "┬" ), oDlg:cColor ) - hb_dispOutAtBox( oDlg:nBottom, oDlg:nLeft + 51, hb_UTF8ToStrBox( "â”´" ), oDlg:cColor ) + hb_DispBox( oDlg:nTop + 1, oDlg:nLeft + 51, oDlg:nBottom - 1, oDlg:nLeft + 51, HB_B_SINGLE_UNI, oDlg:cColor ) + hb_DispOutAtBox( oDlg:nTop, oDlg:nLeft + 51, hb_UTF8ToStrBox( "┬" ), oDlg:cColor ) + hb_DispOutAtBox( oDlg:nBottom, oDlg:nLeft + 51, hb_UTF8ToStrBox( "â”´" ), oDlg:cColor ) - hb_dispBox( oDlg:nTop + 6, oDlg:nLeft + 13, oDlg:nTop + 6, oDlg:nLeft + 50, HB_B_SINGLE_UNI, oDlg:cColor ) - hb_dispOutAtBox( oDlg:nTop + 6, oDlg:nLeft + 12, hb_UTF8ToStrBox( "├" ), oDlg:cColor ) - hb_dispOutAtBox( oDlg:nTop + 6, oDlg:nLeft + 51, hb_UTF8ToStrBox( "┤" ), oDlg:cColor ) + hb_DispBox( oDlg:nTop + 6, oDlg:nLeft + 13, oDlg:nTop + 6, oDlg:nLeft + 50, HB_B_SINGLE_UNI, oDlg:cColor ) + hb_DispOutAtBox( oDlg:nTop + 6, oDlg:nLeft + 12, hb_UTF8ToStrBox( "├" ), oDlg:cColor ) + hb_DispOutAtBox( oDlg:nTop + 6, oDlg:nLeft + 51, hb_UTF8ToStrBox( "┤" ), oDlg:cColor ) /* Display labels */ - hb_dispOutAt( oDlg:nTop + 1, oDlg:nLeft + 13, "Alias: Record: ", oDlg:cColor ) - hb_dispOutAt( oDlg:nTop + 2, oDlg:nLeft + 13, " BOF: Deleted: ", oDlg:cColor ) - hb_dispOutAt( oDlg:nTop + 3, oDlg:nLeft + 13, " EOF: Found: ", oDlg:cColor ) - hb_dispOutAt( oDlg:nTop + 4, oDlg:nLeft + 13, "Filter: ", oDlg:cColor ) - hb_dispOutAt( oDlg:nTop + 5, oDlg:nLeft + 13, " Key: ", oDlg:cColor ) + hb_DispOutAt( oDlg:nTop + 1, oDlg:nLeft + 13, "Alias: Record: ", oDlg:cColor ) + hb_DispOutAt( oDlg:nTop + 2, oDlg:nLeft + 13, " BOF: Deleted: ", oDlg:cColor ) + hb_DispOutAt( oDlg:nTop + 3, oDlg:nLeft + 13, " EOF: Found: ", oDlg:cColor ) + hb_DispOutAt( oDlg:nTop + 4, oDlg:nLeft + 13, "Filter: ", oDlg:cColor ) + hb_DispOutAt( oDlg:nTop + 5, oDlg:nLeft + 13, " Key: ", oDlg:cColor ) /* Stabilize browse */ @@ -243,7 +243,7 @@ STATIC PROCEDURE DlgWorkAreaKey( nKey, oDlg, aBrw, aAlias, aStruc, aInfo ) aBrw[ 3 ]:GoTop() aBrw[ 3 ]:Invalidate() aBrw[ 3 ]:ForceStable() - aStruc := ( aAlias[ aBrw[ 1 ]:Cargo ][ 1 ] )->( DbStruct() ) + aStruc := ( aAlias[ aBrw[ 1 ]:Cargo ][ 1 ] )->( dbStruct() ) aBrw[ 3 ]:Configure() aBrw[ 3 ]:Invalidate() aBrw[ 3 ]:RefreshAll() @@ -309,21 +309,21 @@ STATIC FUNCTION DbfInfo( aInfo ) aInfo := {} - AAdd( aInfo, "[" + hb_NToS( Select( Alias() ) ) + "] " + Alias() ) + AAdd( aInfo, "[" + hb_ntos( Select( Alias() ) ) + "] " + Alias() ) AAdd( aInfo, Space( 4 ) + "Current Driver" ) AAdd( aInfo, Space( 8 ) + rddName() ) AAdd( aInfo, Space( 4 ) + "Workarea Information" ) - AAdd( aInfo, Space( 8 ) + "Select Area: " + hb_NToS( Select() ) ) - AAdd( aInfo, Space( 8 ) + "Record Size: " + hb_NToS( Recsize() ) ) - AAdd( aInfo, Space( 8 ) + "Header Size: " + hb_NToS( Header() ) ) - AAdd( aInfo, Space( 8 ) + "Field Count: " + hb_NToS( FCount() ) ) - AAdd( aInfo, Space( 8 ) + "Last Update: " + DToC( lUpdate() ) ) - AAdd( aInfo, Space( 8 ) + "Index order: " + hb_NToS( IndexOrd() ) ) + AAdd( aInfo, Space( 8 ) + "Select Area: " + hb_ntos( Select() ) ) + AAdd( aInfo, Space( 8 ) + "Record Size: " + hb_ntos( RecSize() ) ) + AAdd( aInfo, Space( 8 ) + "Header Size: " + hb_ntos( Header() ) ) + AAdd( aInfo, Space( 8 ) + "Field Count: " + hb_ntos( FCount() ) ) + AAdd( aInfo, Space( 8 ) + "Last Update: " + DToC( LUpdate() ) ) + AAdd( aInfo, Space( 8 ) + "Index order: " + hb_ntos( IndexOrd() ) ) AAdd( aInfo, Space( 4 ) + "Current Record" ) FOR nFor := 1 TO FCount() - xValue := __Dbg():GetExprValue( "FieldGet(" + hb_NToS( nFor ) + ")" ) + xValue := __Dbg():GetExprValue( "FieldGet(" + hb_ntos( nFor ) + ")" ) xType := ValType( xValue ) SWITCH xType @@ -332,13 +332,13 @@ STATIC FUNCTION DbfInfo( aInfo ) cValue := xValue EXIT CASE "N" - cValue := hb_NToS( xValue ) - EXIT + cValue := hb_ntos( xValue ) + EXIT CASE "D" cValue := DToC( xValue ) EXIT CASE "T" - cValue := hb_TsToStr( xValue ) + cValue := hb_TSToStr( xValue ) EXIT CASE "L" cValue := iif( xValue, ".T.", ".F." ) @@ -374,17 +374,17 @@ STATIC PROCEDURE UpdateInfo( oDlg, cAlias ) dbSelectArea( cAlias ) - hb_dispOutAt( oDlg:nTop + 1, oDlg:nLeft + 20, PadR( cAlias, 11 ), oDlg:cColor ) - hb_dispOutAt( oDlg:nTop + 1, oDlg:nLeft + 42,; - PadR( hb_NToS( RecNo() ) + "/" + hb_NToS( LastRec() ), 9 ),; - oDlg:cColor ) + hb_DispOutAt( oDlg:nTop + 1, oDlg:nLeft + 20, PadR( cAlias, 11 ), oDlg:cColor ) + hb_DispOutAt( oDlg:nTop + 1, oDlg:nLeft + 42, ; + PadR( hb_ntos( RecNo() ) + "/" + hb_ntos( LastRec() ), 9 ), ; + oDlg:cColor ) - hb_dispOutAt( oDlg:nTop + 2, oDlg:nLeft + 21, iif( Bof(), "Yes", "No " ), oDlg:cColor ) - hb_dispOutAt( oDlg:nTop + 2, oDlg:nLeft + 38, iif( Deleted(), "Yes", "No " ), oDlg:cColor ) - hb_dispOutAt( oDlg:nTop + 3, oDlg:nLeft + 21, iif( Eof(), "Yes", "No " ), oDlg:cColor ) - hb_dispOutAt( oDlg:nTop + 3, oDlg:nLeft + 38, iif( Found(), "Yes", "No " ), oDlg:cColor ) - hb_dispOutAt( oDlg:nTop + 4, oDlg:nLeft + 21, PadR( dbFilter(), 29 ), oDlg:cColor ) - hb_dispOutAt( oDlg:nTop + 5, oDlg:nLeft + 21, PadR( ordKey(), 29 ), oDlg:cColor ) + hb_DispOutAt( oDlg:nTop + 2, oDlg:nLeft + 21, iif( Bof(), "Yes", "No " ), oDlg:cColor ) + hb_DispOutAt( oDlg:nTop + 2, oDlg:nLeft + 38, iif( Deleted(), "Yes", "No " ), oDlg:cColor ) + hb_DispOutAt( oDlg:nTop + 3, oDlg:nLeft + 21, iif( Eof(), "Yes", "No " ), oDlg:cColor ) + hb_DispOutAt( oDlg:nTop + 3, oDlg:nLeft + 38, iif( Found(), "Yes", "No " ), oDlg:cColor ) + hb_DispOutAt( oDlg:nTop + 4, oDlg:nLeft + 21, PadR( dbFilter(), 29 ), oDlg:cColor ) + hb_DispOutAt( oDlg:nTop + 5, oDlg:nLeft + 21, PadR( ordKey(), 29 ), oDlg:cColor ) dbSelectArea( nOldArea ) diff --git a/harbour/src/debug/debugger.prg b/harbour/src/debug/debugger.prg index 6d30d23dec..4c19c05eb4 100644 --- a/harbour/src/debug/debugger.prg +++ b/harbour/src/debug/debugger.prg @@ -126,6 +126,7 @@ PROCEDURE __dbgAltDEntry() where ALTD() was called can have no debugger info - stop on first LINE with debugged info */ + __dbgInvokeDebug( Set( _SET_DEBUG ) ) RETURN @@ -252,12 +253,12 @@ CREATE CLASS HBDebugger METHOD BuildBrowseStack() METHOD CallStackProcessKey( nKey ) - METHOD ClrModal() INLINE iif( ::lMonoDisplay, "N/W, W+/W, W/N, W+/N",; - "N/W, R/W, N/BG, R/BG" ) - METHOD GetColors() INLINE iif( ! ::lMonoDisplay, ::aColors,; - { "W+/N", "W+/N", "N/W", "N/W",; - "N/W", "N/W", "W+/N", "N/W",; - "W+/W", "W/N", "W+/N" } ) + METHOD ClrModal() INLINE iif( ::lMonoDisplay, "N/W, W+/W, W/N, W+/N", ; + "N/W, R/W, N/BG, R/BG" ) + METHOD GetColors() INLINE iif( ! ::lMonoDisplay, ::aColors, { ; + "W+/N", "W+/N", "N/W", "N/W", ; + "N/W", "N/W", "W+/N", "N/W", ; + "W+/W", "W/N", "W+/N" } ) METHOD CodeblockTrace() METHOD CodeWindowProcessKey( nKey ) METHOD Colors() @@ -323,10 +324,10 @@ CREATE CLASS HBDebugger METHOD ShowVars() METHOD RedisplayBreakpoints() METHOD LocatePrgPath( cPrgName ) - METHOD Sort() INLINE ASort( ::aVars,,, {| x, y | x[ 1 ] < y[ 1 ] } ),; - ::lSortVars := .T.,; - iif( ::oBrwVars != NIL, ::oBrwVars:RefreshAll(), NIL ),; - iif( ::oWndVars != NIL .AND. ::oWndVars:lVisible, iif( !::lGo .AND. ::oBrwVars != NIL, ::oBrwVars:ForceStable(), NIL ), NIL ) + METHOD Sort() INLINE ASort( ::aVars,,, {| x, y | x[ 1 ] < y[ 1 ] } ), ; + ::lSortVars := .T., ; + iif( ::oBrwVars != NIL, ::oBrwVars:RefreshAll(), NIL ), ; + iif( ::oWndVars != NIL .AND. ::oWndVars:lVisible, iif( !::lGo .AND. ::oBrwVars != NIL, ::oBrwVars:ForceStable(), NIL ), NIL ) METHOD Speed() INLINE ::nSpeed := ::InputBox( "Step delay (in tenths of a second)", ::nSpeed ) @@ -336,8 +337,8 @@ CREATE CLASS HBDebugger METHOD Step() METHOD TabWidth() INLINE ; - ::nTabWidth := ::InputBox( "Tab width", ::nTabWidth ),; - ::oBrwText:nTabWidth := ::nTabWidth, ::oBrwText:RefreshAll() + ::nTabWidth := ::InputBox( "Tab width", ::nTabWidth ), ; + ::oBrwText:nTabWidth := ::nTabWidth, ::oBrwText:RefreshAll() METHOD ToggleBreakPoint( nLine, cFileName ) @@ -402,8 +403,8 @@ METHOD New() CLASS HBDebugger ::oWndCode:bKeyPressed := {| nKey | ::CodeWindowProcessKey( nKey ) } ::oWndCode:bGotFocus := {|| ::oGet:SetFocus() } ::oWndCode:bLostFocus := {|| ::oGet:KillFocus(), SetCursor( SC_NONE ), ; - ::oWndCode:Cargo[ 1 ] := Row(), ; - ::oWndCode:Cargo[ 2 ] := Col() } + ::oWndCode:Cargo[ 1 ] := Row(), ; + ::oWndCode:Cargo[ 2 ] := Col() } AAdd( ::aWindows, ::oWndCode ) @@ -423,8 +424,8 @@ METHOD OpenDebuggerWindow() CLASS HBDebugger ::hUserWindow := hb_gtInfo( HB_GTI_GETWIN ) IF ::hDebuggerWindow == NIL ::hDebuggerWindow := hb_gtInfo( HB_GTI_GETWIN, ; - { "Debugger", DEBUGGER_MINROW, DEBUGGER_MINCOL, ; - DEBUGGER_MAXROW, DEBUGGER_MAXCOL } ) + { "Debugger", DEBUGGER_MINROW, DEBUGGER_MINCOL, ; + DEBUGGER_MAXROW, DEBUGGER_MAXCOL } ) ELSE hb_gtInfo( HB_GTI_SETWIN, ::hDebuggerWindow ) ENDIF @@ -477,7 +478,7 @@ METHOD Activate() CLASS HBDebugger METHOD All() CLASS HBDebugger ::lShowPublics := ::lShowPrivates := ::lShowStatics := ; - ::lShowLocals := ::lShowGlobals := ::lAll := ! ::lAll + ::lShowLocals := ::lShowGlobals := ::lAll := ! ::lAll ::RefreshVars() @@ -521,15 +522,15 @@ METHOD BuildBrowseStack() CLASS HBDebugger ::oBrwStack:ColorSpec := aColors[ 3 ] + "," + aColors[ 4 ] + "," + aColors[ 5 ] + "," + aColors[ 6 ] ::oBrwStack:goTopBlock := {|| ::oBrwStack:Cargo := 1 } ::oBrwStack:goBottomBlock := {|| ::oBrwStack:Cargo := Len( ::aProcStack ) } - ::oBrwStack:skipBlock := {| nSkip, nOld | nOld := ::oBrwStack:Cargo,; - ::oBrwStack:Cargo += nSkip,; - ::oBrwStack:Cargo := Min( Max( ::oBrwStack:Cargo, 1 ),; - Len( ::aProcStack ) ), ::oBrwStack:Cargo - nOld } + ::oBrwStack:skipBlock := {| nSkip, nOld | nOld := ::oBrwStack:Cargo, ; + ::oBrwStack:Cargo += nSkip, ; + ::oBrwStack:Cargo := Min( Max( ::oBrwStack:Cargo, 1 ), ; + Len( ::aProcStack ) ), ::oBrwStack:Cargo - nOld } ::oBrwStack:Cargo := 1 // Actual highligthed row - ::oBrwStack:AddColumn( HBDbColumnNew( "", {|| iif( Len( ::aProcStack ) > 0,; - PadC( ::aProcStack[ ::oBrwStack:Cargo ][ CSTACK_FUNCTION ], 14 ), Space( 14 ) ) } ) ) + ::oBrwStack:AddColumn( HBDbColumnNew( "", {|| iif( Len( ::aProcStack ) > 0, ; + PadC( ::aProcStack[ ::oBrwStack:Cargo ][ CSTACK_FUNCTION ], 14 ), Space( 14 ) ) } ) ) ENDIF RETURN NIL @@ -544,20 +545,20 @@ METHOD BuildCommandWindow() CLASS HBDebugger ::oWndCommand:bGotFocus := {|| ::oGet:SetFocus() } ::oWndCommand:bLostFocus := {|| ::oGet:KillFocus(), SetCursor( SC_NONE ) } ::oWndCommand:bKeyPressed := {| nKey | ::CommandWindowProcessKey( nKey ) } - ::oWndCommand:bPainted := {|| hb_DispOutAt( ::oWndCommand:nBottom - 1,; - ::oWndCommand:nLeft + 1, "> ", __DbgColors()[ 2 ] ),; - ::oGet:setColor( __DbgColors()[ 2 ] ):display(),; - hb_ClrArea( ::oWndCommand:nTop + 1, ::oWndCommand:nLeft + 1,; - ::oWndCommand:nBottom - 2, ::oWndCommand:nRight - 1,; - iif( ::lMonoDisplay, 15, hb_ColorToN( __DbgColors()[ 2 ] ) ) ) } + ::oWndCommand:bPainted := {|| hb_DispOutAt( ::oWndCommand:nBottom - 1, ; + ::oWndCommand:nLeft + 1, "> ", __DbgColors()[ 2 ] ), ; + ::oGet:SetColor( __DbgColors()[ 2 ] ):display(), ; + hb_ClrArea( ::oWndCommand:nTop + 1, ::oWndCommand:nLeft + 1, ; + ::oWndCommand:nBottom - 2, ::oWndCommand:nRight - 1, ; + iif( ::lMonoDisplay, 15, hb_ColorToN( __DbgColors()[ 2 ] ) ) ) } AAdd( ::aWindows, ::oWndCommand ) ::aLastCommands := { "" } ::nCommand := 1 nSize := ::oWndCommand:nRight - ::oWndCommand:nLeft - 3 - ::oGet := HbDbInput():new( ::oWndCommand:nBottom - 1, ::oWndCommand:nLeft + 3,; - nSize, "", __DbgColors()[ 2 ], Max( nSize, 256 ) ) + ::oGet := HbDbInput():new( ::oWndCommand:nBottom - 1, ::oWndCommand:nLeft + 3, ; + nSize, "", __DbgColors()[ 2 ], Max( nSize, 256 ) ) RETURN NIL @@ -711,15 +712,15 @@ METHOD CodeWindowProcessKey( nKey ) CLASS HBDebugger METHOD Colors() CLASS HBDebugger - LOCAL oWndColors := HBDbWindow():New( 4, 5, 16, ::nMaxCol - 5,; - "Debugger Colors[1..11]", ::ClrModal() ) + LOCAL oWndColors := HBDbWindow():New( 4, 5, 16, ::nMaxCol - 5, ; + "Debugger Colors[1..11]", ::ClrModal() ) LOCAL aColors := { ; - "Border", "Text", "Text High", "Text PPO", "Text Selected",; - "Text High Sel.", "Text PPO Sel.", "Menu", "Menu High",; + "Border", "Text", "Text High", "Text PPO", "Text Selected", ; + "Text High Sel.", "Text PPO Sel.", "Menu", "Menu High", ; "Menu Selected", "Menu High Sel." } - LOCAL oBrwColors := HBDbBrowser():New( oWndColors:nTop + 1, oWndColors:nLeft + 1,; - oWndColors:nBottom - 1, oWndColors:nRight - 1 ) + LOCAL oBrwColors := HBDbBrowser():New( oWndColors:nTop + 1, oWndColors:nLeft + 1, ; + oWndColors:nBottom - 1, oWndColors:nRight - 1 ) LOCAL nWidth := oWndColors:nRight - oWndColors:nLeft - 1 LOCAL oCol @@ -733,13 +734,13 @@ METHOD Colors() CLASS HBDebugger oBrwColors:goTopBlock := {|| oBrwColors:cargo[ 1 ] := 1 } oBrwColors:goBottomBlock := {|| oBrwColors:cargo[ 1 ] := Len( oBrwColors:cargo[ 2 ][ 1 ] ) } oBrwColors:skipBlock := {| nPos | ( nPos := ArrayBrowseSkip( nPos, oBrwColors ), oBrwColors:cargo[ 1 ] := ; - oBrwColors:cargo[ 1 ] + nPos, nPos ) } + oBrwColors:cargo[ 1 ] + nPos, nPos ) } oBrwColors:AddColumn( oCol := HBDbColumnNew( "", {|| PadR( aColors[ oBrwColors:Cargo[ 1 ] ], 14 ) } ) ) oCol:defColor := { 1, 2 } AAdd( oBrwColors:Cargo[ 2 ], aColors ) - oBrwColors:AddColumn( oCol := HBDbColumnNew( "",; - {|| PadR( '"' + ::aColors[ oBrwColors:Cargo[ 1 ] ] + '"', nWidth - 15 ) } ) ) + oBrwColors:AddColumn( oCol := HBDbColumnNew( "", ; + {|| PadR( '"' + ::aColors[ oBrwColors:Cargo[ 1 ] ] + '"', nWidth - 15 ) } ) ) AAdd( oBrwColors:Cargo[ 2 ], aColors ) oCol:defColor := { 1, 3 } ocol:width := 50 @@ -747,9 +748,9 @@ METHOD Colors() CLASS HBDebugger oWndColors:bPainted := {|| oBrwColors:ForceStable(), RefreshVarsS( oBrwColors ) } - oWndColors:bKeyPressed := {| nKey | SetsKeyPressed( nKey, oBrwColors,; - Len( aColors ), oWndColors, "Debugger Colors",; - {|| ::EditColor( oBrwColors:Cargo[ 1 ], oBrwColors ) } ) } + oWndColors:bKeyPressed := {| nKey | SetsKeyPressed( nKey, oBrwColors, ; + Len( aColors ), oWndColors, "Debugger Colors", ; + {|| ::EditColor( oBrwColors:Cargo[ 1 ], oBrwColors ) } ) } oWndColors:ShowModal() ::LoadColors() @@ -790,7 +791,7 @@ METHOD CommandWindowProcessKey( nKey ) CLASS HBDebugger ::DoCommand( cCommand ) ENDIF hb_DispOutAt( ::oWndCommand:nBottom - 1, ::oWndCommand:nLeft + 1, "> ", ; - __DbgColors()[ 2 ] ) + __DbgColors()[ 2 ] ) ::oGet:setValue( "" ):display() EXIT OTHERWISE @@ -852,7 +853,7 @@ METHOD DoCommand( cCommand ) CLASS HBDebugger IF lValid ::Inspect( aCmnd[ WP_EXPR ], cResult ) ENDIF - cResult := "" //discard result + cResult := "" // discard result ELSE IF lValid cResult := __dbgValToStr( cResult ) @@ -1029,8 +1030,8 @@ METHOD DoCommand( cCommand ) CLASS HBDebugger n := Val( SubStr( cParam1, n ) ) ENDIF oWindow:Resize( Val( cParam1 ), n, ; - oWindow:nBottom + Val( cParam1 ) - oWindow:nTop, ; - oWindow:nRight + n - oWindow:nLeft ) + oWindow:nBottom + Val( cParam1 ) - oWindow:nTop, ; + oWindow:nRight + n - oWindow:nLeft ) CASE starts( "NEXT", cParam ) ::NextWindow() CASE starts( "SIZE", cParam ) @@ -1038,8 +1039,8 @@ METHOD DoCommand( cCommand ) CLASS HBDebugger IF Val( cParam1 ) >= 2 .AND. n > 0 .AND. Val( SubStr( cParam1, n ) ) > 0 oWindow := ::aWindows[ ::nCurrentWindow ] oWindow:Resize( oWindow:nTop, oWindow:nLeft, ; - Val( cParam1 ) - 1 + oWindow:nTop, ; - Val( SubStr( cParam1, n ) ) - 1 + oWindow:nLeft ) + Val( cParam1 ) - 1 + oWindow:nTop, ; + Val( SubStr( cParam1, n ) ) - 1 + oWindow:nLeft ) ENDIF ENDCASE @@ -1053,11 +1054,11 @@ METHOD DoCommand( cCommand ) CLASS HBDebugger IF ::lActive hb_DispOutAt( ::oWndCommand:nBottom - 1, ::oWndCommand:nLeft + 1, ; - Space( ::oWndCommand:nRight - ::oWndCommand:nLeft - 1 ), ; - __DbgColors()[ 2 ] ) + Space( ::oWndCommand:nRight - ::oWndCommand:nLeft - 1 ), ; + __DbgColors()[ 2 ] ) IF !Empty( cResult ) hb_DispOutAt( ::oWndCommand:nBottom - 1, ::oWndCommand:nLeft + 3, ; - cResult, __DbgColors()[ 2 ] ) + cResult, __DbgColors()[ 2 ] ) ::oWndCommand:ScrollUp( 1 ) ENDIF ENDIF @@ -1086,16 +1087,16 @@ METHOD DoScript( cFileName ) CLASS HBDebugger METHOD EditColor( nColor, oBrwColors ) CLASS HBDebugger - LOCAL cColor := PadR( '"' + ::aColors[ nColor ] + '"',; - oBrwColors:getColumn( 2 ):Width ) + LOCAL cColor := PadR( '"' + ::aColors[ nColor ] + '"', ; + oBrwColors:getColumn( 2 ):Width ) oBrwColors:RefreshCurrent() oBrwColors:ForceStable() IF __dbgInput( Row(), Col() + 15,, @cColor, ; - {| cColor | iif( !( Type( cColor ) == "C" ), ; - ( __dbgAlert( "Must be string" ), .F. ), .T. ) }, ; - SubStr( ::ClrModal(), 5 ) ) + {| cColor | iif( !( Type( cColor ) == "C" ), ; + ( __dbgAlert( "Must be string" ), .F. ), .T. ) }, ; + SubStr( ::ClrModal(), 5 ) ) ::aColors[ nColor ] := &cColor ENDIF @@ -1113,9 +1114,9 @@ METHOD EditSet( nSet, oBrwSets ) CLASS HBDebugger oBrwSets:ForceStable() IF __dbgInput( Row(), Col() + 13,, @cSet, ; - {| cSet | iif( !( Type( cSet ) == cType ), ; - ( __dbgAlert( "Must be of type '" + cType + "'" ), .F. ), .T. ) }, ; - SubStr( ::ClrModal(), 5 ) ) + {| cSet | iif( !( Type( cSet ) == cType ), ; + ( __dbgAlert( "Must be of type '" + cType + "'" ), .F. ), .T. ) }, ; + SubStr( ::ClrModal(), 5 ) ) Set( nSet, &cSet ) ENDIF @@ -1137,15 +1138,15 @@ METHOD EditVar( nVar ) CLASS HBDebugger IF ValType( uVarValue ) $ "AHOP" ::InputBox( cVarName, uVarValue, NIL, .F. ) ELSE - cVarStr := ::InputBox( cVarName, __dbgValToStr( uVarValue ),; - {| u | iif( Type( u ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } ) + cVarStr := ::InputBox( cVarName, __dbgValToStr( uVarValue ), ; + {| u | iif( Type( u ) == "UE", ( __dbgAlert( "Expression error" ), .F. ), .T. ) } ) ENDIF IF LastKey() != K_ESC DO CASE CASE cVarStr == "{ ... }" - //aArray := ::VarGetValue( ::aVars[ nVar ] ) + // aArray := ::VarGetValue( ::aVars[ nVar ] ) IF Len( uVarValue ) > 0 __DbgArrays( uVarValue, cVarName ) ELSE @@ -1156,7 +1157,7 @@ METHOD EditVar( nVar ) CLASS HBDebugger __DbgObject( uVarValue, cVarName ) OTHERWISE - BEGIN SEQUENCE WITH {| oErr | break( oErr ) } + BEGIN SEQUENCE WITH {| oErr | Break( oErr ) } ::VarSetValue( ::aVars[ nVar ], &cVarStr ) RECOVER USING oErr __dbgAlert( oErr:description ) @@ -1207,12 +1208,15 @@ METHOD GetSourceFiles() CLASS HBDebugger METHOD Global() CLASS HBDebugger + ::lShowGlobals := ! ::lShowGlobals ::RefreshVars() + RETURN NIL METHOD Go() CLASS HBDebugger + // we are starting to run again so reset to the deepest call if // displaying stack IF ! ::oBrwStack == NIL @@ -1222,6 +1226,7 @@ METHOD Go() CLASS HBDebugger ::RestoreAppState() __dbgSetGo( ::pInfo ) ::Exit() + RETURN NIL @@ -1423,7 +1428,9 @@ METHOD HandleEvent() CLASS HBDebugger RETURN NIL METHOD Hide() CLASS HBDebugger + ::CloseDebuggerWindow() + RETURN NIL @@ -1435,7 +1442,7 @@ METHOD HideCallStack() CLASS HBDebugger DispBegin() ::oWndStack:Hide() IF ::aWindows[ ::nCurrentWindow ] == ::oWndStack - ::NextWindow() + ::NextWindow() ENDIF ::RemoveWindow( ::oWndStack ) ::oWndStack := NIL @@ -1454,6 +1461,7 @@ METHOD HideCallStack() CLASS HBDebugger METHOD HideVars() CLASS HBDebugger + LOCAL nTop IF ::oWndVars == NIL @@ -1497,8 +1505,9 @@ METHOD InputBox( cMsg, uValue, bValid, lEditable ) CLASS HBDebugger LOCAL nOldRow LOCAL nOldCol LOCAL lExit - LOCAL oWndInput := HBDbWindow():New( nTop, nLeft, nBottom, nRight, cMsg,; - ::oPullDown:cClrPopup ) + LOCAL oWndInput := HBDbWindow():New( nTop, nLeft, nBottom, nRight, cMsg, ; + ::oPullDown:cClrPopup ) + hb_default( @lEditable, .T. ) oWndInput:lShadow := .T. @@ -1516,7 +1525,7 @@ METHOD InputBox( cMsg, uValue, bValid, lEditable ) CLASS HBDebugger uTemp := PadR( uValue, nWidth ) ENDIF __dbgInput( nTop + 1, nLeft + 1, nWidth, @uTemp, bValid, ; - __DbgColors()[ 5 ], Max( Max( nWidth, Len( uTemp ) ), 256 ) ) + __DbgColors()[ 5 ], Max( Max( nWidth, Len( uTemp ) ), 256 ) ) SWITCH cType CASE "C" ; uTemp := AllTrim( uTemp ) ; EXIT CASE "D" ; uTemp := CToD( uTemp ) ; EXIT @@ -1621,13 +1630,13 @@ METHOD ListBox( cCaption, aItems ) CLASS HBDebugger nLeft := ( ::nMaxCol / 2 ) - Min( nMaxWid, ::nMaxCol * 3 / 2 ) / 2 nRight := ( ::nMaxCol / 2 ) + Min( nMaxWid, ::nMaxCol * 3 / 2 ) / 2 oWndList := HBDbWindow():new( nTop, nLeft, nBottom, nRight, cCaption, ; - ::oPullDown:cClrPopup ) + ::oPullDown:cClrPopup ) oWndList:lShadow := .T. oWndList:Show() aColors := __DbgColors() n := __dbgAChoice( nTop + 1, nLeft + 1, nBottom - 1, nRight - 1, aItems, ; - aColors[ 8 ] + "," + aColors[ 10 ] ) + aColors[ 8 ] + "," + aColors[ 10 ] ) oWndList:Hide() RETURN n @@ -1653,7 +1662,7 @@ METHOD LoadCallStack() CLASS HBDebugger // a procedure with debug info ::aProcStack[ i - nDebugLevel + 1 ] := ::aCallStack[ nPos ] ELSE - ::aProcStack[ i - nDebugLevel + 1 ] := { , ProcName( i ) + "(" + hb_ntos( ProcLine( i ) ) + ")", , nLevel, , } + ::aProcStack[ i - nDebugLevel + 1 ] := {, ProcName( i ) + "(" + hb_ntos( ProcLine( i ) ) + ")", , nLevel, , } ENDIF NEXT @@ -1680,7 +1689,9 @@ METHOD LoadColors() CLASS HBDebugger METHOD LoadSettings() CLASS HBDebugger + ::DoScript( ::cSettingsFileName ) + RETURN NIL @@ -1713,7 +1724,7 @@ METHOD LoadVars() CLASS HBDebugger // updates monitored variables IF nCount > 0 m := __mvDbgInfo( HB_MV_PRIVATE_LOCAL, ::nProcLevel ) hSkip := { => } - hb_hAllocate( hSkip, nCount ) + hb_HAllocate( hSkip, nCount ) FOR n := nCount TO 1 STEP -1 xValue := __mvDbgInfo( HB_MV_PRIVATE, n, @cName ) IF ! cName $ hSkip @@ -1766,8 +1777,8 @@ METHOD LoadVars() CLASS HBDebugger // updates monitored variables aVars := ::aProcStack[ ::oBrwStack:Cargo ][ CSTACK_LOCALS ] FOR n := 1 TO Len( aVars ) cName := aVars[ n ][ VAR_NAME ] - m := AScan( aBVars,; // Is there another var with this name ? - {| aVar | aVar[ VAR_NAME ] == cName .AND. Left( aVar[ VAR_TYPE ], 1 ) == "S" } ) + m := AScan( aBVars, ; // Is there another var with this name ? + {| aVar | aVar[ VAR_NAME ] == cName .AND. Left( aVar[ VAR_TYPE ], 1 ) == "S" } ) IF m > 0 aBVars[ m ] := aVars[ n ] ELSE @@ -1789,8 +1800,10 @@ METHOD LoadVars() CLASS HBDebugger // updates monitored variables METHOD Local() CLASS HBDebugger + ::lShowLocals := ! ::lShowLocals ::RefreshVars() + RETURN NIL @@ -1815,6 +1828,7 @@ METHOD Locate( nMode, cValue ) CLASS HBDebugger // Save cursor position to be restored by ::oWndCode:bGotFocus ::oWndCode:cargo[ 1 ] := Row() ::oWndCode:cargo[ 2 ] := Col() + RETURN lFound @@ -1845,10 +1859,12 @@ METHOD MonoDisplay() CLASS HBDebugger METHOD NextRoutine() CLASS HBDebugger + ::RestoreAppScreen() ::RestoreAppState() __dbgSetNextRoutine( ::pInfo ) ::Exit() + RETURN Self @@ -1897,13 +1913,13 @@ METHOD Open() CLASS HBDebugger ENDIF IF !Empty( cFileName ) ; - .AND. ( ValType( ::cPrgName ) == "U" .OR. !hb_FileMatch( cFileName, ::cPrgName ) ) + .AND. ( ValType( ::cPrgName ) == "U" .OR. !hb_FileMatch( cFileName, ::cPrgName ) ) IF ! hb_FileExists( cFileName ) .AND. ! Empty( ::cPathForFiles ) cRealName := ::LocatePrgPath( cFileName ) IF Empty( cRealName ) - __dbgAlert( "File '" + cFileName + "' not found!" ) - RETURN NIL + __dbgAlert( "File '" + cFileName + "' not found!" ) + RETURN NIL ENDIF cFileName := cRealName ENDIF @@ -1911,16 +1927,17 @@ METHOD Open() CLASS HBDebugger hb_FNameSplit( cFileName, NIL, NIL, @cExt ) ::lPPO := ( Lower( cExt ) == ".ppo" ) ::oPulldown:GetItemByIdent( "PPO" ):Checked := ::lPPO - ::oBrwText := HBBrwText():New( ::oWndCode:nTop + 1, ::oWndCode:nLeft + 1,; - ::oWndCode:nBottom - 1, ::oWndCode:nRight - 1, cFileName,; - __DbgColors()[ 2 ] + "," + __DbgColors()[ 5 ] + "," + ; - __DbgColors()[ 3 ] + "," + __DbgColors()[ 6 ], ; - ::lLineNumbers, ::nTabWidth ) + ::oBrwText := HBBrwText():New( ::oWndCode:nTop + 1, ::oWndCode:nLeft + 1, ; + ::oWndCode:nBottom - 1, ::oWndCode:nRight - 1, cFileName, ; + __DbgColors()[ 2 ] + "," + __DbgColors()[ 5 ] + "," + ; + __DbgColors()[ 3 ] + "," + __DbgColors()[ 6 ], ; + ::lLineNumbers, ::nTabWidth ) ::oWndCode:Browser := ::oBrwText ::RedisplayBreakpoints() // check for breakpoints in this file and display them ::oWndCode:SetCaption( ::cPrgName ) ::oWndCode:Refresh() // to force the window caption to update ENDIF + RETURN NIL @@ -1948,10 +1965,10 @@ METHOD OpenPPO() CLASS HBDebugger ENDIF IF lSuccess - ::oBrwText := HBBrwText():New( ::oWndCode:nTop + 1, ::oWndCode:nLeft + 1,; - ::oWndCode:nBottom - 1, ::oWndCode:nRight - 1, ::cPrgName,; - __DbgColors()[ 2 ] + "," + __DbgColors()[ 5 ] + "," + ; - __DbgColors()[ 3 ] + "," + __DbgColors()[ 6 ], ::lLineNumbers, ::nTabWidth ) + ::oBrwText := HBBrwText():New( ::oWndCode:nTop + 1, ::oWndCode:nLeft + 1, ; + ::oWndCode:nBottom - 1, ::oWndCode:nRight - 1, ::cPrgName, ; + __DbgColors()[ 2 ] + "," + __DbgColors()[ 5 ] + "," + ; + __DbgColors()[ 3 ] + "," + __DbgColors()[ 6 ], ::lLineNumbers, ::nTabWidth ) ::oWndCode:Browser := ::oBrwText ::RedisplayBreakpoints() // check for breakpoints in this file and display them ::oWndCode:SetCaption( ::cPrgName ) @@ -1979,9 +1996,9 @@ METHOD OSShell() CLASS HBDebugger #if defined( __PLATFORM__WINDOWS ) .OR. ; defined( __PLATFORM__DOS ) .OR. ; defined( __PLATFORM__OS2 ) - hb_Run( GetEnv( "COMSPEC" ) ) + hb_run( GetEnv( "COMSPEC" ) ) #elif defined( __PLATFORM__UNIX ) - hb_Run( GetEnv( "SHELL" ) ) + hb_run( GetEnv( "SHELL" ) ) #else __dbgAlert( "Not implemented yet!" ) #endif @@ -2006,7 +2023,7 @@ METHOD Quit() CLASS HBDebugger __dbgSetQuit( ::pInfo ) t_oDebugger := NIL - __QUIT() + __Quit() RETURN NIL @@ -2020,6 +2037,7 @@ METHOD PathForFiles( cPathForFiles ) CLASS HBDebugger ::aPathDirs := PathToArray( ::cPathForFiles ) ::Resume() + RETURN Self @@ -2182,10 +2200,12 @@ METHOD RestoreAppScreen() CLASS HBDebugger METHOD RestoreAppState() CLASS HBDebugger + Set( _SET_DIRCASE, ::nAppDirCase ) Set( _SET_FILECASE, ::nAppFileCase ) Set( _SET_TYPEAHEAD, ::nAppTypeAhead ) hb_keySetLast( ::nAppLastKey ) + RETURN NIL @@ -2243,14 +2263,17 @@ METHOD SaveAppScreen() CLASS HBDebugger ::BarDisplay() DispEnd() ENDIF + RETURN NIL METHOD SaveAppState() CLASS HBDebugger + ::nAppDirCase := Set( _SET_DIRCASE, 0 ) ::nAppFileCase := Set( _SET_FILECASE, 0 ) ::nAppTypeAhead := Set( _SET_TYPEAHEAD, 16 ) ::nAppLastKey := LastKey() + RETURN NIL @@ -2328,7 +2351,7 @@ METHOD SaveSettings() CLASS HBDebugger IF ! Empty( ::aBreakPoints ) FOR n := 1 TO Len( ::aBreakPoints ) cInfo += "BP " + hb_ntos( ::aBreakPoints[ n ][ 1 ] ) + " " + ; - AllTrim( ::aBreakPoints[ n ][ 2 ] ) + hb_eol() + AllTrim( ::aBreakPoints[ n ][ 2 ] ) + hb_eol() NEXT ENDIF @@ -2420,21 +2443,21 @@ METHOD ShowCallStack() CLASS HBDebugger ::aWindows[ ::nCurrentWindow ]:Show( .F. ) ENDIF - ::oWndStack := HBDbWindow():New( 1, ::nMaxCol - 15, ::nMaxRow - 6, ::nMaxCol,; - "Calls" ) + ::oWndStack := HBDbWindow():New( 1, ::nMaxCol - 15, ::nMaxRow - 6, ::nMaxCol, ; + "Calls" ) ::oWndStack:bKeyPressed := {| nKey | ::CallStackProcessKey( nKey ) } ::oWndStack:bLButtonDown := {|| ::CallStackProcessKey( K_LBUTTONDOWN ) } AAdd( ::aWindows, ::oWndStack ) - //::nCurrentWindow := Len( ::aWindows ) + // ::nCurrentWindow := Len( ::aWindows ) IF ::oBrwStack == NIL ::BuildBrowseStack() ENDIF ::oWndStack:bPainted := {|| ::oBrwStack:ColorSpec := __DbgColors()[ 2 ] + "," + ; - __DbgColors()[ 5 ] + "," + __DbgColors()[ 4 ] + "," + __DbgColors()[ 6 ],; - ::oBrwStack:RefreshAll(), ::oBrwStack:ForceStable() } + __DbgColors()[ 5 ] + "," + __DbgColors()[ 4 ] + "," + __DbgColors()[ 6 ], ; + ::oBrwStack:RefreshAll(), ::oBrwStack:ForceStable() } ::oWndStack:bGotFocus := {|| SetCursor( SC_NONE ) } ::oWndStack:Show( .F. ) @@ -2462,8 +2485,8 @@ METHOD ShowCodeLine( nProc ) CLASS HBDebugger IF nLine == NIL ::oBrwText := NIL ::oWndCode:Browser := NIL - ::oWndCode:SetCaption( ::aProcStack[ nProc ][ CSTACK_FUNCTION ] +; - ": Code not available" ) + ::oWndCode:SetCaption( ::aProcStack[ nProc ][ CSTACK_FUNCTION ] + ; + ": Code not available" ) ::oWndCode:Refresh() // to force the window caption to update RETURN NIL ENDIF @@ -2475,8 +2498,8 @@ METHOD ShowCodeLine( nProc ) CLASS HBDebugger IF ! Empty( cPrgName ) - IF ! hb_FileMatch( strip_path( cPrgName ), strip_path( ::cPrgName ) ) ; - .OR. ::oBrwText == NIL + IF ! hb_FileMatch( strip_path( cPrgName ), strip_path( ::cPrgName ) ) .OR. ; + ::oBrwText == NIL IF ! hb_FileExists( cPrgName ) .AND. ! Empty( ::cPathForFiles ) cPrgName := ::LocatePrgPath( cPrgName ) @@ -2488,17 +2511,17 @@ METHOD ShowCodeLine( nProc ) CLASS HBDebugger ::oBrwText := NIL ::oWndCode:Browser := NIL ::oWndCode:SetCaption( ::aProcStack[ nProc ][ CSTACK_MODULE ] + ; - " File not found" ) + " File not found" ) ::oWndCode:Refresh() RETURN NIL ENDIF IF ::oBrwText == NIL - ::oBrwText := HBBrwText():New( ::oWndCode:nTop + 1, ::oWndCode:nLeft + 1,; - ::oWndCode:nBottom - 1, ::oWndCode:nRight - 1, cPrgName,; - __DbgColors()[ 2 ] + "," + __DbgColors()[ 5 ] + "," + ; - __DbgColors()[ 3 ] + "," + __DbgColors()[ 6 ], ; - ::lLineNumbers, ::nTabWidth ) + ::oBrwText := HBBrwText():New( ::oWndCode:nTop + 1, ::oWndCode:nLeft + 1, ; + ::oWndCode:nBottom - 1, ::oWndCode:nRight - 1, cPrgName, ; + __DbgColors()[ 2 ] + "," + __DbgColors()[ 5 ] + "," + ; + __DbgColors()[ 3 ] + "," + __DbgColors()[ 6 ], ; + ::lLineNumbers, ::nTabWidth ) ::oWndCode:Browser := ::oBrwText @@ -2546,7 +2569,7 @@ METHOD ShowVars() CLASS HBDebugger ENDIF IF ! ( ::lShowLocals .OR. ::lShowStatics .OR. ::lShowPrivates .OR. ; - ::lShowPublics .OR. ::lShowGlobals ) + ::lShowPublics .OR. ::lShowGlobals ) RETURN NIL ENDIF @@ -2557,8 +2580,8 @@ METHOD ShowVars() CLASS HBDebugger nTop := iif( ::oWndPnt != NIL .AND. ::oWndPnt:lVisible, ::oWndPnt:nBottom + 1, 1 ) nBottom := nTop + Min( MAX_VARS_HEIGHT, Len( ::aVars ) + 1 ) - ::oWndVars := HBDbWindow():New( nTop, 0, nBottom,; - ::nMaxCol - iif( ::oWndStack != NIL, ::oWndStack:nWidth(), 0 ),; + ::oWndVars := HBDbWindow():New( nTop, 0, nBottom, ; + ::nMaxCol - iif( ::oWndStack != NIL, ::oWndStack:nWidth(), 0 ), ; "Monitor:" + ; iif( ::lShowGlobals, " Global", "" ) + iif( ::lShowLocals, " Local", "" ) + ; iif( ::lShowStatics, " Static", "" ) + iif( ::lShowPrivates, " Private", "" ) + ; @@ -2566,17 +2589,17 @@ METHOD ShowVars() CLASS HBDebugger ::oWndVars:bLButtonDown := {| nMRow, nMCol | ::WndVarsLButtonDown( nMRow, nMCol ) } ::oWndVars:bLDblClick := {|| ::EditVar( ::oBrwVars:Cargo[ 1 ] ) } - ::oWndVars:bPainted := {|| iif( Len( ::aVars ) > 0, ( ::oBrwVars:RefreshAll():ForceStable(),RefreshVarsS( ::oBrwVars ) ), ) } + ::oWndVars:bPainted := {|| iif( Len( ::aVars ) > 0, ( ::oBrwVars:RefreshAll():ForceStable(), RefreshVarsS( ::oBrwVars ) ), ) } ::oWndVars:bKeyPressed := {| nKey | iif( Len( ::aVars ) == 0, NIL, ( ; - iif( nKey == K_DOWN, ::oBrwVars:Down(), NIL ) ; - , iif( nKey == K_UP, ::oBrwVars:Up(), NIL ) ; - , iif( nKey == K_PGDN, ::oBrwVars:PageDown(), NIL ) ; - , iif( nKey == K_PGUP, ::oBrwVars:PageUp(), NIL ) ; - , iif( nKey == K_HOME, ::oBrwVars:GoTop(), NIL ) ; - , iif( nKey == K_END, ::oBrwVars:GoBottom(), NIL ) ; - , iif( nKey == K_ENTER, ::EditVar( ::oBrwVars:Cargo[ 1 ] ), NIL ), ; - iif( Len( ::aVars ) > 0, ::oBrwVars:ForceStable(), NIL ) ) ) } + iif( nKey == K_DOWN, ::oBrwVars:Down(), NIL ), ; + iif( nKey == K_UP, ::oBrwVars:Up(), NIL ), ; + iif( nKey == K_PGDN, ::oBrwVars:PageDown(), NIL ), ; + iif( nKey == K_PGUP, ::oBrwVars:PageUp(), NIL ), ; + iif( nKey == K_HOME, ::oBrwVars:GoTop(), NIL ), ; + iif( nKey == K_END, ::oBrwVars:GoBottom(), NIL ), ; + iif( nKey == K_ENTER, ::EditVar( ::oBrwVars:Cargo[ 1 ] ), NIL ), ; + iif( Len( ::aVars ) > 0, ::oBrwVars:ForceStable(), NIL ) ) ) } AAdd( ::aWindows, ::oWndVars ) lWindowCreated := .T. @@ -2584,11 +2607,11 @@ METHOD ShowVars() CLASS HBDebugger nTop := ::oWndVars:nTop ::oWndVars:cCaption := "Monitor:" + ; - iif( ::lShowGlobals, " Global", "" ) + ; - iif( ::lShowLocals, " Local", "" ) + ; - iif( ::lShowStatics, " Static", "" ) + ; - iif( ::lShowPrivates, " Private", "" ) + ; - iif( ::lShowPublics, " Public", "" ) + iif( ::lShowGlobals, " Global", "" ) + ; + iif( ::lShowLocals, " Local", "" ) + ; + iif( ::lShowStatics, " Static", "" ) + ; + iif( ::lShowPrivates, " Private", "" ) + ; + iif( ::lShowPublics, " Public", "" ) nBottom := ::oWndVars:nBottom IF Len( ::aVars ) == 0 @@ -2606,22 +2629,22 @@ METHOD ShowVars() CLASS HBDebugger IF Len( ::aVars ) > 0 .AND. ::oBrwVars == NIL ::oBrwVars := HBDbBrowser():New( nTop + 1, 1, nBottom - 1, ; - ::nMaxCol - iif( ::oWndStack != NIL, ::oWndStack:nWidth(), 0 ) - 1 ) + ::nMaxCol - iif( ::oWndStack != NIL, ::oWndStack:nWidth(), 0 ) - 1 ) aColors := __DbgColors() ::oBrwVars:Cargo := { 1, {} } // Actual highlighted row ::oBrwVars:ColorSpec := aColors[ 2 ] + "," + aColors[ 5 ] + "," + aColors[ 3 ] + "," + aColors[ 6 ] ::oBrwVars:goTopBlock := {|| ::oBrwVars:cargo[ 1 ] := Min( 1, Len( ::aVars ) ) } ::oBrwVars:goBottomBlock := {|| ::oBrwVars:cargo[ 1 ] := Max( 1, Len( ::aVars ) ) } ::oBrwVars:skipBlock := {| nSkip, nOld | ; - nOld := ::oBrwVars:Cargo[ 1 ],; - ::oBrwVars:Cargo[ 1 ] += nSkip,; - ::oBrwVars:Cargo[ 1 ] := Min( Max( ::oBrwVars:Cargo[ 1 ], 1 ), Len( ::aVars ) ),; - ::oBrwVars:Cargo[ 1 ] - nOld } + nOld := ::oBrwVars:Cargo[ 1 ], ; + ::oBrwVars:Cargo[ 1 ] += nSkip, ; + ::oBrwVars:Cargo[ 1 ] := Min( Max( ::oBrwVars:Cargo[ 1 ], 1 ), Len( ::aVars ) ), ; + ::oBrwVars:Cargo[ 1 ] - nOld } oCol := HBDbColumnNew( "", ; - {|| PadR( hb_ntos( ::oBrwVars:Cargo[ 1 ] - 1 ) + ") " + ; - ::VarGetInfo( ::aVars[ Max( ::oBrwVars:Cargo[ 1 ], 1 ) ] ), ; - ::oWndVars:nWidth() - 2 ) } ) + {|| PadR( hb_ntos( ::oBrwVars:Cargo[ 1 ] - 1 ) + ") " + ; + ::VarGetInfo( ::aVars[ Max( ::oBrwVars:Cargo[ 1 ], 1 ) ] ), ; + ::oWndVars:nWidth() - 2 ) } ) ::oBrwVars:AddColumn( oCol ) AAdd( ::oBrwVars:Cargo[ 2 ], ::aVars ) oCol:DefColor := { 1, 2 } @@ -2656,7 +2679,7 @@ METHOD ShowVars() CLASS HBDebugger lRepaint := .T. ELSE IF ::oBrwVars != NIL - ::oBrwVars:RefreshAll():ForceStable() + ::oBrwVars:RefreshAll():ForceStable() ENDIF ::oWndVars:Refresh() ENDIF @@ -2742,7 +2765,7 @@ METHOD ToggleBreakPoint( nLine, cFileName ) CLASS HBDebugger ENDIF nAt := AScan( ::aBreakPoints, {| aBreak | aBreak[ 1 ] == nLine ; - .AND. hb_FileMatch( aBreak[ 2 ], cFileName ) } ) + .AND. hb_FileMatch( aBreak[ 2 ], cFileName ) } ) IF nAt == 0 AAdd( ::aBreakPoints, { nLine, cFileName } ) // it was nLine @@ -2766,7 +2789,7 @@ METHOD ToggleBreakPoint( nLine, cFileName ) CLASS HBDebugger METHOD Trace() CLASS HBDebugger __dbgSetTrace( ::pInfo ) - ::Step() //forces a Step() + ::Step() // forces a Step() RETURN Self @@ -2818,9 +2841,9 @@ METHOD VarGetValue( aVar ) CLASS HBDebugger LOCAL cType := Left( aVar[ VAR_TYPE ], 1 ) DO CASE - CASE cType == "G" ; RETURN __dbgvmVarGGet( aVar[ VAR_LEVEL ], aVar[ VAR_POS ] ) - CASE cType == "L" ; RETURN __dbgvmVarLGet( __dbgprocLevel() - aVar[ VAR_LEVEL ], aVar[ VAR_POS ] ) - CASE cType == "S" ; RETURN __dbgvmVarSGet( aVar[ VAR_LEVEL ], aVar[ VAR_POS ] ) + CASE cType == "G" ; RETURN __dbgVMVarGGet( aVar[ VAR_LEVEL ], aVar[ VAR_POS ] ) + CASE cType == "L" ; RETURN __dbgVMVarLGet( __dbgProcLevel() - aVar[ VAR_LEVEL ], aVar[ VAR_POS ] ) + CASE cType == "S" ; RETURN __dbgVMVarSGet( aVar[ VAR_LEVEL ], aVar[ VAR_POS ] ) OTHERWISE ; RETURN aVar[ VAR_POS ] // Public or Private ENDCASE @@ -2835,19 +2858,19 @@ METHOD VarSetValue( aVar, uValue ) CLASS HBDebugger LOCAL cType := Left( aVar[ VAR_TYPE ], 1 ) IF cType == "G" - __dbgvmVarGSet( aVar[ VAR_LEVEL ], aVar[ VAR_POS ], uValue ) + __dbgVMVarGSet( aVar[ VAR_LEVEL ], aVar[ VAR_POS ], uValue ) ELSEIF cType == "L" - nProcLevel := __dbgprocLevel() - aVar[ VAR_LEVEL ] //skip debugger stack - __dbgvmVarLSet( nProcLevel, aVar[ VAR_POS ], uValue ) + nProcLevel := __dbgProcLevel() - aVar[ VAR_LEVEL ] // skip debugger stack + __dbgVMVarLSet( nProcLevel, aVar[ VAR_POS ], uValue ) ELSEIF cType == "S" - __dbgvmVarSSet( aVar[ VAR_LEVEL ], aVar[ VAR_POS ], uValue ) + __dbgVMVarSSet( aVar[ VAR_LEVEL ], aVar[ VAR_POS ], uValue ) ELSE - // Public or Private - aVar[ VAR_POS ] := uValue - &( aVar[ VAR_NAME ] ) := uValue + // Public or Private + aVar[ VAR_POS ] := uValue + &( aVar[ VAR_NAME ] ) := uValue ENDIF @@ -2856,21 +2879,21 @@ METHOD VarSetValue( aVar, uValue ) CLASS HBDebugger METHOD ViewSets() CLASS HBDebugger - LOCAL oWndSets := HBDbWindow():New( 1, 8, ::nMaxRow - 2, ::nMaxCol - 8,; - "System Settings[1..47]", ::ClrModal() ) + LOCAL oWndSets := HBDbWindow():New( 1, 8, ::nMaxRow - 2, ::nMaxCol - 8, ; + "System Settings[1..47]", ::ClrModal() ) LOCAL aSets := { ; - "Exact", "Fixed", "Decimals", "DateFormat", "Epoch", "Path",; - "Default", "Exclusive", "SoftSeek", "Unique", "Deleted",; - "Cancel", "Debug", "TypeAhead", "Color", "Cursor", "Console",; - "Alternate", "AltFile", "Device", "Extra", "ExtraFile",; - "Printer", "PrintFile", "Margin", "Bell", "Confirm", "Escape",; - "Insert", "Exit", "Intensity", "ScoreBoard", "Delimeters",; - "DelimChars", "Wrap", "Message", "MCenter", "ScrollBreak",; - "EventMask", "VideoMode", "MBlockSize", "MFileExt",; + "Exact", "Fixed", "Decimals", "DateFormat", "Epoch", "Path", ; + "Default", "Exclusive", "SoftSeek", "Unique", "Deleted", ; + "Cancel", "Debug", "TypeAhead", "Color", "Cursor", "Console", ; + "Alternate", "AltFile", "Device", "Extra", "ExtraFile", ; + "Printer", "PrintFile", "Margin", "Bell", "Confirm", "Escape", ; + "Insert", "Exit", "Intensity", "ScoreBoard", "Delimeters", ; + "DelimChars", "Wrap", "Message", "MCenter", "ScrollBreak", ; + "EventMask", "VideoMode", "MBlockSize", "MFileExt", ; "StrictRead", "Optimize", "Autopen", "Autorder", "AutoShare" } - LOCAL oBrwSets := HBDbBrowser():new( oWndSets:nTop + 1, oWndSets:nLeft + 1,; - oWndSets:nBottom - 1, oWndSets:nRight - 1 ) + LOCAL oBrwSets := HBDbBrowser():new( oWndSets:nTop + 1, oWndSets:nLeft + 1, ; + oWndSets:nBottom - 1, oWndSets:nRight - 1 ) LOCAL nWidth := oWndSets:nRight - oWndSets:nLeft - 1 LOCAL oCol @@ -2880,18 +2903,18 @@ METHOD ViewSets() CLASS HBDebugger oBrwSets:goTopBlock := {|| oBrwSets:cargo[ 1 ] := 1 } oBrwSets:goBottomBlock := {|| oBrwSets:cargo[ 1 ] := Len( oBrwSets:cargo[ 2 ][ 1 ] ) } oBrwSets:skipBlock := {| nPos | ( nPos := ArrayBrowseSkip( nPos, oBrwSets ), oBrwSets:cargo[ 1 ] := ; - oBrwSets:cargo[ 1 ] + nPos, nPos ) } + oBrwSets:cargo[ 1 ] + nPos, nPos ) } oBrwSets:AddColumn( oCol := HBDbColumnNew( "", {|| PadR( aSets[ oBrwSets:cargo[ 1 ] ], 12 ) } ) ) AAdd( oBrwSets:Cargo[ 2 ], aSets ) ocol:defcolor := { 1, 2 } - oBrwSets:AddColumn( oCol := HBDbColumnNew( "",; - {|| PadR( __dbgValToStr( Set( oBrwSets:cargo[ 1 ] ) ), nWidth - 13 ) } ) ) + oBrwSets:AddColumn( oCol := HBDbColumnNew( "", ; + {|| PadR( __dbgValToStr( Set( oBrwSets:cargo[ 1 ] ) ), nWidth - 13 ) } ) ) ocol:defcolor := { 1, 3 } ocol:width := 40 oWndSets:bPainted := {|| oBrwSets:ForceStable(), RefreshVarsS( oBrwSets ) } - oWndSets:bKeyPressed := {| nKey | SetsKeyPressed( nKey, oBrwSets, Len( aSets ),; - oWndSets, "System Settings",; - {|| ::EditSet( oBrwSets:Cargo[ 1 ], oBrwSets ) } ) } + oWndSets:bKeyPressed := {| nKey | SetsKeyPressed( nKey, oBrwSets, Len( aSets ), ; + oWndSets, "System Settings", ; + {|| ::EditSet( oBrwSets:Cargo[ 1 ], oBrwSets ) } ) } SetCursor( SC_NONE ) oWndSets:ShowModal() @@ -2960,7 +2983,7 @@ METHOD WatchpointDel( nPos ) CLASS HBDebugger nPos-- ENDIF IF LastKey() != K_ESC - IF nPos >=0 .AND. nPos < Len( ::aWatch ) + IF nPos >= 0 .AND. nPos < Len( ::aWatch ) ::oBrwPnt:gotop() __dbgDelWatch( ::pInfo, nPos ) hb_ADel( ::aWatch, nPos + 1, .T. ) @@ -3049,23 +3072,25 @@ METHOD WatchpointsShow() CLASS HBDebugger nTop := iif( ::oWndVars != NIL .AND. ::oWndVars:lVisible, ::oWndVars:nBottom, 0 ) + 1 - ::oWndPnt := HBDbWindow():New( nTop,; + ::oWndPnt := HBDbWindow():New( nTop, ; 0, ; - nTop + Min( 4, Len( ::aWatch ) ) + 1,; - ::nMaxCol - iif( ::oWndStack != NIL, ::oWndStack:nWidth(), 0 ),; + nTop + Min( 4, Len( ::aWatch ) ) + 1, ; + ::nMaxCol - iif( ::oWndStack != NIL, ::oWndStack:nWidth(), 0 ), ; "Watch" ) -// ::oBrwText:Resize( ::oWndPnt:nBottom + 1 ) -// ::oWndCode:nTop := ::oWndPnt:nBottom + 1 -// ::oBrwText:Resize( ::oWndCode:nTop + 1 ) -// ::oBrwText:RefreshAll() -// ::oWndCode:SetFocus( .T. ) +#if 0 + ::oBrwText:Resize( ::oWndPnt:nBottom + 1 ) + ::oWndCode:nTop := ::oWndPnt:nBottom + 1 + ::oBrwText:Resize( ::oWndCode:nTop + 1 ) + ::oBrwText:RefreshAll() + ::oWndCode:SetFocus( .T. ) -// ::oWndPnt:bLButtonDown := {| nMRow, nMCol | ::WndVarsLButtonDown( nMRow, nMCol ) } -// ::oWndPnt:bLDblClick := {| nMRow, nMCol | ::EditVar( ::oBrwPnt:Cargo[ 1 ] ) } + ::oWndPnt:bLButtonDown := {| nMRow, nMCol | ::WndVarsLButtonDown( nMRow, nMCol ) } + ::oWndPnt:bLDblClick := {| nMRow, nMCol | ::EditVar( ::oBrwPnt:Cargo[ 1 ] ) } +#endif - ::oBrwPnt := HBDbBrowser():New( nTop + 1, 1, ::oWndPnt:nBottom - 1, ::nMaxCol - iif( ::oWndStack != NIL,; - ::oWndStack:nWidth(), 0 ) - 1 ) + ::oBrwPnt := HBDbBrowser():New( nTop + 1, 1, ::oWndPnt:nBottom - 1, ::nMaxCol - iif( ::oWndStack != NIL, ; + ::oWndStack:nWidth(), 0 ) - 1 ) ::oWndPnt:Browser := ::oBrwPnt @@ -3074,35 +3099,35 @@ METHOD WatchpointsShow() CLASS HBDebugger ::oBrwPnt:ColorSpec := aColors[ 2 ] + "," + aColors[ 5 ] + "," + aColors[ 3 ] + "," + aColors[ 6 ] ::oBrwPnt:goTopBlock := {|| ::oBrwPnt:cargo[ 1 ] := Min( 1, Len( ::aWatch ) ) } ::oBrwPnt:goBottomBlock := {|| ::oBrwPnt:cargo[ 1 ] := Len( ::aWatch ) } - ::oBrwPnt:skipBlock := {| nSkip, nOld | nOld := ::oBrwPnt:Cargo[ 1 ],; - ::oBrwPnt:Cargo[ 1 ] += nSkip,; - ::oBrwPnt:Cargo[ 1 ] := Min( Max( ::oBrwPnt:Cargo[ 1 ], 1 ),; - Len( ::aWatch ) ),; - iif( Len( ::aWatch ) > 0, ::oBrwPnt:Cargo[ 1 ] - nOld, 0 ) } + ::oBrwPnt:skipBlock := {| nSkip, nOld | nOld := ::oBrwPnt:Cargo[ 1 ], ; + ::oBrwPnt:Cargo[ 1 ] += nSkip, ; + ::oBrwPnt:Cargo[ 1 ] := Min( Max( ::oBrwPnt:Cargo[ 1 ], 1 ), ; + Len( ::aWatch ) ), ; + iif( Len( ::aWatch ) > 0, ::oBrwPnt:Cargo[ 1 ] - nOld, 0 ) } oCol := HBDbColumnNew( "", ; {|| PadR( iif( Len( ::aWatch ) > 0, ; - hb_ntos( ::oBrwPnt:Cargo[ 1 ] - 1 ) + ") " + ; - ::WatchGetInfo( Max( ::oBrwPnt:Cargo[ 1 ], 1 ) ), ; - " " ), ; - ::oWndPnt:nWidth() - 2 ) } ) + hb_ntos( ::oBrwPnt:Cargo[ 1 ] - 1 ) + ") " + ; + ::WatchGetInfo( Max( ::oBrwPnt:Cargo[ 1 ], 1 ) ), ; + " " ), ; + ::oWndPnt:nWidth() - 2 ) } ) ::oBrwPnt:AddColumn( oCol ) AAdd( ::oBrwPnt:Cargo[ 2 ], ::aWatch ) oCol:DefColor := { 1, 2 } ::oWndPnt:bPainted := {|| iif( Len( ::aWatch ) > 0, ( ::oBrwPnt:RefreshAll():ForceStable(), RefreshVarsS( ::oBrwPnt ) /*, ::RefreshVars()*/ ) , ) } - ::oWndPnt:bKeyPressed := {| nKey | ; - ( iif( nKey == K_DOWN, ::oBrwPnt:Down(), NIL ) ; - , iif( nKey == K_UP, ::oBrwPnt:Up(), NIL ) ; - , iif( nKey == K_PGDN, ::oBrwPnt:PageDown(), NIL ) ; - , iif( nKey == K_PGUP, ::oBrwPnt:PageUp(), NIL ) ; - , iif( nKey == K_HOME, ::oBrwPnt:GoTop(), NIL ) ; - , iif( nKey == K_END, ::oBrwPnt:GoBottom(), NIL ) ; - , iif( nKey == K_DEL, ::WatchpointDel( ::oBrwPnt:Cargo[ 1 ] ), NIL ) ; - , iif( nKey == K_ENTER, ::WatchpointEdit( ::oBrwPnt:Cargo[ 1 ] ), NIL ) ; - , iif( nKey == K_CTRL_ENTER, ::WatchpointInspect( ::oBrwPnt:Cargo[ 1 ] ), NIL ) ; - , ::oBrwPnt:ForceStable() ) } + ::oWndPnt:bKeyPressed := {| nKey | ( ; + iif( nKey == K_DOWN, ::oBrwPnt:Down(), NIL ), ; + iif( nKey == K_UP, ::oBrwPnt:Up(), NIL ), ; + iif( nKey == K_PGDN, ::oBrwPnt:PageDown(), NIL ), ; + iif( nKey == K_PGUP, ::oBrwPnt:PageUp(), NIL ), ; + iif( nKey == K_HOME, ::oBrwPnt:GoTop(), NIL ), ; + iif( nKey == K_END, ::oBrwPnt:GoBottom(), NIL ), ; + iif( nKey == K_DEL, ::WatchpointDel( ::oBrwPnt:Cargo[ 1 ] ), NIL ), ; + iif( nKey == K_ENTER, ::WatchpointEdit( ::oBrwPnt:Cargo[ 1 ] ), NIL ), ; + iif( nKey == K_CTRL_ENTER, ::WatchpointInspect( ::oBrwPnt:Cargo[ 1 ] ), NIL ), ; + ::oBrwPnt:ForceStable() ) } AAdd( ::aWindows, ::oWndPnt ) ::oWndPnt:Show() @@ -3113,7 +3138,7 @@ METHOD WatchpointsShow() CLASS HBDebugger ENDIF DispBegin() IF Len( ::aWatch ) > ::oWndPnt:nBottom - ::oWndPnt:nTop - 1 - //Resize( top, left, bottom, right ) + // Resize( top, left, bottom, right ) ::oWndPnt:Resize( ,, ::oWndPnt:nTop + Min( Len( ::aWatch ) + 1, 4 ) ) lRepaint := .T. ELSEIF Len( ::aWatch ) < ::oWndPnt:nBottom - ::oWndPnt:nTop - 1 @@ -3229,16 +3254,16 @@ STATIC PROCEDURE RefreshVarsS( oBrowse ) STATIC FUNCTION ArrayBrowseSkip( nPos, oBrwSets ) - RETURN iif( oBrwSets:cargo[ 1 ] + nPos < 1, 0 - oBrwSets:cargo[ 1 ] + 1 , ; - iif( oBrwSets:cargo[ 1 ] + nPos > Len( oBrwSets:cargo[ 2 ][ 1 ] ), ; - Len( oBrwSets:cargo[ 2 ][ 1 ] ) - oBrwSets:cargo[ 1 ], nPos ) ) + RETURN iif( oBrwSets:cargo[ 1 ] + nPos < 1, 0 - oBrwSets:cargo[ 1 ] + 1, ; + iif( oBrwSets:cargo[ 1 ] + nPos > Len( oBrwSets:cargo[ 2 ][ 1 ] ), ; + Len( oBrwSets:cargo[ 2 ][ 1 ] ) - oBrwSets:cargo[ 1 ], nPos ) ) STATIC FUNCTION PathToArray( cList ) LOCAL aList := {} - LOCAL cSep := hb_OSPathListSeparator() - LOCAL cDirSep := hb_OSPathDelimiters() + LOCAL cSep := hb_osPathListSeparator() + LOCAL cDirSep := hb_osPathDelimiters() LOCAL nPos IF cList != NIL @@ -3309,6 +3334,7 @@ FUNCTION __dbgInput( nRow, nCol, nWidth, cValue, bValid, cColor, nSize ) FUNCTION __dbgAchoice( nTop, nLeft, nBottom, nRight, aItems, cColors ) + LOCAL oBrw LOCAL oCol LOCAL nRow @@ -3324,8 +3350,8 @@ FUNCTION __dbgAchoice( nTop, nLeft, nBottom, nRight, aItems, cColors ) oBrw:goTopBlock := {|| nRow := 1 } oBrw:goBottomBlock := {|| nRow := Len( aItems ) } oBrw:skipBlock := {| n | n := iif( n < 0, Max( n, 1 - nRow ), ; - Min( Len( aItems ) - nRow, n ) ), ; - nRow += n, n } + Min( Len( aItems ) - nRow, n ) ), ; + nRow += n, n } WHILE .T. oBrw:forceStable() nKey := Inkey( 0 ) @@ -3372,6 +3398,7 @@ FUNCTION __dbgValToStr( uVal ) /* NOTE: This is a copy of hb_CStr() */ FUNCTION __dbgCStr( xVal ) + LOCAL v := ValType( xVal ) SWITCH v diff --git a/harbour/src/debug/tbrwtext.prg b/harbour/src/debug/tbrwtext.prg index 364e543244..c60f05147a 100644 --- a/harbour/src/debug/tbrwtext.prg +++ b/harbour/src/debug/tbrwtext.prg @@ -170,9 +170,9 @@ METHOD SetActiveLine( n ) CLASS HBBrwText METHOD GetLine() CLASS HBBrwText - RETURN PadR( hb_NToS( ::nRow ) + ": " + SubStr( ; - MemoLine( ::aRows[ ::nRow ], ::nWidth + ::nLineOffset, 1, ::nTabWidth, .F. ),; - ::nLineOffset ), ::nWidth ) + RETURN PadR( hb_ntos( ::nRow ) + ": " + SubStr( ; + MemoLine( ::aRows[ ::nRow ], ::nWidth + ::nLineOffset, 1, ::nTabWidth, .F. ), ; + ::nLineOffset ), ::nWidth ) METHOD ToggleBreakPoint( nRow, lSet ) CLASS HBBrwText @@ -306,12 +306,12 @@ METHOD Skip( n ) CLASS HBBrwText IF n > 0 IF ::nRow < ::nRows - nSkipped := MIN( ::nRows - ::nRow, n ) + nSkipped := Min( ::nRows - ::nRow, n ) ::nRow += nSkipped ENDIF ELSEIF n < 0 IF ::nRow > 1 - nSkipped := MAX( 1 - ::nRow, n ) + nSkipped := Max( 1 - ::nRow, n ) ::nRow += nSkipped ENDIF ENDIF @@ -357,4 +357,4 @@ STATIC FUNCTION WhichEOL( cString ) STATIC FUNCTION Text2Array( cString ) - RETURN hb_aTokens( cString, WhichEOL( cString ) ) + RETURN hb_ATokens( cString, WhichEOL( cString ) ) diff --git a/harbour/src/rdd/dbdelim.prg b/harbour/src/rdd/dbdelim.prg index b4a67d1e4b..e84368d18e 100644 --- a/harbour/src/rdd/dbdelim.prg +++ b/harbour/src/rdd/dbdelim.prg @@ -111,8 +111,8 @@ FUNCTION __dbDelim( lExport, cFile, cDelimArg, aFields, bFor, bWhile, nNext, nRe #else - RETURN iif( lExport,; - __dbCopy( cFile, aFields, bFor, bWhile, nNext, nRecord, lRest, "DELIM", , cCodePage, cDelimArg ) ,; - __dbApp( cFile, aFields, bFor, bWhile, nNext, nRecord, lRest, "DELIM", , cCodePage, cDelimArg ) ) + RETURN iif( lExport, ; + __dbCopy( cFile, aFields, bFor, bWhile, nNext, nRecord, lRest, "DELIM",, cCodePage, cDelimArg ), ; + __dbApp( cFile, aFields, bFor, bWhile, nNext, nRecord, lRest, "DELIM",, cCodePage, cDelimArg ) ) #endif diff --git a/harbour/src/rdd/dbfntx/dbfntx0.prg b/harbour/src/rdd/dbfntx/dbfntx0.prg deleted file mode 100644 index d9ca6efe7f..0000000000 --- a/harbour/src/rdd/dbfntx/dbfntx0.prg +++ /dev/null @@ -1,92 +0,0 @@ -/* - * $Id$ - */ - -/* - * Harbour Project source code: - * DBFNTX RDD - * - * Copyright 1999 Bruno Cantero - * www - http://harbour-project.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). - * - * As a special exception, the Harbour Project gives permission for - * additional uses of the text contained in its release of Harbour. - * - * The exception is that, if you link the Harbour libraries with other - * files to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the Harbour library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the Harbour - * Project under the name Harbour. If you copy code from other - * Harbour Project or Free Software Foundation releases into a copy of - * Harbour, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for Harbour, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - * - */ - -/* -#include "error.ch" -#include "rddsys.ch" -#include "dbinfo.ch" - -ANNOUNCE DBFNTX - -PROCEDURE DBFNTXInit - - REQUEST _DBF - REQUEST _DBFNTX - - rddRegister( "DBF", RDT_FULL ) - rddRegister( "DBFNTX", RDT_FULL ) - rddInfo( RDDI_MEMOTYPE, DB_MEMO_DBT, "DBFNTX" ) - - RETURN -*/ - -/* NOTE: Commented out, because in Harbour the INIT order is not guaranteed, - so it can happen that this error handler will be installed *before* - the default error, but it this case it will not work. [vszakats] */ - -/* - -INIT PROCEDURE InitHandler - - LOCAL bOldError := ErrorBlock( {| oError | LockErrHandler( oError, bOldError ) } ) - - RETURN - -STATIC FUNCTION LockErrHandler( oError, bOldError ) - - IF oError:GenCode == EG_LOCK - RETURN .T. - ENDIF - - RETURN Eval( bOldError, oError ) - -*/ diff --git a/harbour/src/rdd/dbjoin.prg b/harbour/src/rdd/dbjoin.prg index 6024d8b295..545c077741 100644 --- a/harbour/src/rdd/dbjoin.prg +++ b/harbour/src/rdd/dbjoin.prg @@ -56,6 +56,7 @@ (cRDD, nConnection, cCodePage). */ FUNCTION __dbJoin( cAlias, cFile, aFields, bFor, cRDD, nConnection, cCodePage ) + LOCAL nMaster := Select() LOCAL nDetail := Select( cAlias ) LOCAL nResult @@ -115,6 +116,7 @@ FUNCTION __dbJoin( cAlias, cFile, aFields, bFor, cRDD, nConnection, cCodePage ) RETURN .T. STATIC FUNCTION __FieldTwo( cAlias, aFields ) + LOCAL aFldTemp LOCAL bFind LOCAL aStruct @@ -131,17 +133,18 @@ STATIC FUNCTION __FieldTwo( cAlias, aFields ) aStruct := {} bFind := {| cFld | cFld == cField } - AEval( dbStruct(), {| aFld | cField := aFld[ DBS_NAME ],; - iif( AScan( aFields, bFind ) == 0, NIL, AAdd( aStruct, aFld ) ) } ) + AEval( dbStruct(), {| aFld | cField := aFld[ DBS_NAME ], ; + iif( AScan( aFields, bFind ) == 0, NIL, AAdd( aStruct, aFld ) ) } ) Select( cAlias ) bFind := {| cFld | "->" $ cFld .AND. SubStr( cFld, At( "->", cFld ) + 2 ) == cField } - AEval( dbStruct(), {| aFld | cField := aFld[ DBS_NAME ],; - iif( AScan( aFields, bFind ) == 0, NIL, AAdd( aStruct, aFld ) ) } ) + AEval( dbStruct(), {| aFld | cField := aFld[ DBS_NAME ], ; + iif( AScan( aFields, bFind ) == 0, NIL, AAdd( aStruct, aFld ) ) } ) RETURN aStruct STATIC FUNCTION __JoinList( nMaster, nDetail, nResult, aStruct ) + LOCAL aList := {} LOCAL nPos LOCAL i @@ -157,6 +160,7 @@ STATIC FUNCTION __JoinList( nMaster, nDetail, nResult, aStruct ) RETURN aList STATIC PROCEDURE __doJoinList( aList ) + LOCAL aJoin IF Len( aList ) > 0 diff --git a/harbour/src/rdd/dbstrux.prg b/harbour/src/rdd/dbstrux.prg index ff61d55136..d0eae4abe9 100644 --- a/harbour/src/rdd/dbstrux.prg +++ b/harbour/src/rdd/dbstrux.prg @@ -73,13 +73,14 @@ FUNCTION __dbCopyXStruct( cFileName ) dbSelectArea( 0 ) __dbCreate( cFileName, NIL, NIL, .F., NIL ) - AEval( aStruct, {| aField | iif( aField[ DBS_TYPE ] == "C" .AND. aField[ DBS_LEN ] > 255,; - ( aField[ DBS_DEC ] := Int( aField[ DBS_LEN ] / 256 ), aField[ DBS_LEN ] := aField[ DBS_LEN ] % 256 ), ),; - dbAppend(),; - FIELD->FIELD_NAME := aField[ DBS_NAME ],; - FIELD->FIELD_TYPE := aField[ DBS_TYPE ],; - FIELD->FIELD_LEN := aField[ DBS_LEN ],; - FIELD->FIELD_DEC := aField[ DBS_DEC ] } ) + AEval( aStruct, {| aField | ; + iif( aField[ DBS_TYPE ] == "C" .AND. aField[ DBS_LEN ] > 255,; + ( aField[ DBS_DEC ] := Int( aField[ DBS_LEN ] / 256 ), aField[ DBS_LEN ] := aField[ DBS_LEN ] % 256 ), ),; + dbAppend(),; + FIELD->FIELD_NAME := aField[ DBS_NAME ],; + FIELD->FIELD_TYPE := aField[ DBS_TYPE ],; + FIELD->FIELD_LEN := aField[ DBS_LEN ],; + FIELD->FIELD_DEC := aField[ DBS_DEC ] } ) /* NOTE: CA-Cl*pper has a bug, where only a plain RECOVER statement is used here (without the USING keyword), so oError will always be NIL. */ @@ -121,18 +122,20 @@ FUNCTION __dbCreate( cFileName, cFileFrom, cRDD, lNew, cAlias, cCodePage, nConne IF Empty( cFileFrom ) - dbCreate( cFileName, { { "FIELD_NAME", "C", 10, 0 },; - { "FIELD_TYPE", "C", 1, 0 },; - { "FIELD_LEN" , "N", 3, 0 },; - { "FIELD_DEC" , "N", 3, 0 } },; - cRDD, .F., cAlias, NIL, cCodePage, nConnection ) + dbCreate( cFileName, { ; + { "FIELD_NAME", "C", 10, 0 }, ; + { "FIELD_TYPE", "C", 1, 0 }, ; + { "FIELD_LEN" , "N", 3, 0 }, ; + { "FIELD_DEC" , "N", 3, 0 } }, ; + cRDD, .F., cAlias, NIL, cCodePage, nConnection ) ELSE dbUseArea( lNew, NIL, cFileFrom, "" ) - dbEval( {|| AAdd( aStruct, { FIELD->FIELD_NAME ,; - FIELD->FIELD_TYPE ,; - FIELD->FIELD_LEN ,; - FIELD->FIELD_DEC } ) } ) + dbEval( {|| AAdd( aStruct, { ; + FIELD->FIELD_NAME ,; + FIELD->FIELD_TYPE ,; + FIELD->FIELD_LEN ,; + FIELD->FIELD_DEC } ) } ) dbCloseArea() IF lNew diff --git a/harbour/src/rdd/hbsix/sxcompat.prg b/harbour/src/rdd/hbsix/sxcompat.prg index 959225b150..71ae154332 100644 --- a/harbour/src/rdd/hbsix/sxcompat.prg +++ b/harbour/src/rdd/hbsix/sxcompat.prg @@ -156,13 +156,13 @@ FUNCTION sxLog( xKeyVal ) CASE "C" CASE "M" SWITCH xKeyVal - CASE "T"; CASE "t"; CASE "Y"; CASE "y" - CASE ".T."; CASE ".t."; CASE ".Y."; CASE ".y." - xKeyVal := .T. - EXIT - OTHERWISE - xKeyVal := .F. - EXIT + CASE "T"; CASE "t"; CASE "Y"; CASE "y" + CASE ".T."; CASE ".t."; CASE ".Y."; CASE ".y." + xKeyVal := .T. + EXIT + OTHERWISE + xKeyVal := .F. + EXIT ENDSWITCH EXIT CASE "N" @@ -175,34 +175,41 @@ FUNCTION sxLog( xKeyVal ) RETURN xKeyVal -FUNCTION Sx_Compress( xVal ) +FUNCTION sx_Compress( xVal ) + LOCAL cType := ValType( xVal ), xRetVal + IF cType $ "CM" - xRetVal := _sx_strCompress( xVal ) + xRetVal := _sx_StrCompress( xVal ) ELSEIF cType == "A" xRetVal := Array( Len( xVal ) ) - aEval( xVal, {| x | xRetVal := Sx_Compress( x ) } ) + AEval( xVal, {| x | xRetVal := sx_Compress( x ) } ) ELSE xRetVal := xVal ENDIF + RETURN xRetVal -FUNCTION Sx_Decompress( xVal ) +FUNCTION sx_Decompress( xVal ) + LOCAL cType := ValType( xVal ), xRetVal + IF cType $ "CM" - xRetVal := _sx_strDecompress( xVal ) + xRetVal := _sx_StrDecompress( xVal ) ELSEIF cType == "A" xRetVal := Array( Len( xVal ) ) - aEval( xVal, {| x | xRetVal := Sx_Decompress( x ) } ) + AEval( xVal, {| x | xRetVal := sx_Decompress( x ) } ) ELSE xRetVal := xVal ENDIF + RETURN xRetVal -FUNCTION Sx_TagInfo( cIndex ) +FUNCTION sx_TagInfo( cIndex ) + LOCAL aInfo, nOrds, nFirst, i - IF Used() .AND. ( nOrds := OrdCount( cIndex ) ) > 0 + IF Used() .AND. ( nOrds := ordCount( cIndex ) ) > 0 aInfo := Array( nOrds, 6 ) IF HB_ISSTRING( cIndex ) nFirst := dbOrderInfo( DBOI_BAGORDER, cIndex ) @@ -221,13 +228,16 @@ FUNCTION Sx_TagInfo( cIndex ) ELSE aInfo := {} ENDIF + RETURN aInfo -FUNCTION Sx_TagCount( xIndex ) +FUNCTION sx_TagCount( xIndex ) + LOCAL nTags := 0, cIndex, nOrder + IF Used() IF HB_ISNUMERIC( xIndex ) - nOrder := Sx_TagOrder( 1, xIndex ) + nOrder := sx_TagOrder( 1, xIndex ) IF nOrder != 0 cIndex := dbOrderInfo( DBOI_FULLPATH,, nOrder ) ENDIF @@ -240,17 +250,20 @@ FUNCTION Sx_TagCount( xIndex ) nTags := ordCount( cIndex ) ENDIF ENDIF + RETURN nTags -FUNCTION Sx_Tags( xIndex ) +FUNCTION sx_Tags( xIndex ) + LOCAL aTagNames := {}, nOrder, nTags + IF Used() IF HB_ISNUMERIC( xIndex ) - nOrder := Sx_TagOrder( 1, xIndex ) + nOrder := sx_TagOrder( 1, xIndex ) ELSEIF HB_ISSTRING( xIndex ) .AND. !Empty( xIndex ) nOrder := dbOrderInfo( DBOI_BAGORDER, xIndex ) ELSE - nOrder := OrdNumber() + nOrder := ordNumber() ENDIF IF nOrder != 0 nTags := ordCount( dbOrderInfo( DBOI_FULLPATH,, nOrder ) ) @@ -259,10 +272,13 @@ FUNCTION Sx_Tags( xIndex ) ENDDO ENDIF ENDIF + RETURN aTagNames -FUNCTION Sx_SetTag( xTag, xIndex ) +FUNCTION sx_SetTag( xTag, xIndex ) + LOCAL lRet := .F., nOrder := 0, nOldOrd, cIndex + IF Used() .AND. ValType( xTag ) $ "CN" IF HB_ISNUMERIC( xTag ) IF Empty( xIndex ) .OR. !ValType( xIndex ) $ "CN" @@ -272,47 +288,50 @@ FUNCTION Sx_SetTag( xTag, xIndex ) nOrder := dbOrderInfo( DBOI_BAGORDER, xIndex ) + xTag - 1 ENDIF ELSE - nOrder := Sx_TagOrder( xTag, xIndex ) + nOrder := sx_TagOrder( xTag, xIndex ) ENDIF ELSE IF Empty( xIndex ) .OR. !ValType( xIndex ) $ "CN" - nOrder := OrdNumber( xTag ) + nOrder := ordNumber( xTag ) ELSEIF HB_ISSTRING( xIndex ) - nOrder := Sx_TagOrder( xTag, xIndex ) + nOrder := sx_TagOrder( xTag, xIndex ) ELSE - nOrder := Sx_TagOrder( 1, xIndex ) + nOrder := sx_TagOrder( 1, xIndex ) IF nOrder != 0 cIndex := dbOrderInfo( DBOI_FULLPATH,, nOrder ) IF Empty( cIndex ) nOrder := 0 ELSE - nOrder := Sx_TagOrder( xTag, cIndex ) + nOrder := sx_TagOrder( xTag, cIndex ) ENDIF ENDIF ENDIF ENDIF IF nOrder != 0 - nOldOrd := OrdNumber() - OrdSetFocus( nOrder ) - lRet := nOrder == OrdNumber() + nOldOrd := ordNumber() + ordSetFocus( nOrder ) + lRet := nOrder == ordNumber() IF ! lRet - OrdSetFocus( nOldOrd ) + ordSetFocus( nOldOrd ) ENDIF ELSEIF Empty( xTag ) - OrdSetFocus( 0 ) + ordSetFocus( 0 ) lRet := .T. ENDIF ENDIF + RETURN lRet -FUNCTION Sx_KillTag( xTag, xIndex ) +FUNCTION sx_KillTag( xTag, xIndex ) + LOCAL lRet := .F., nOrder, cIndex + IF HB_ISLOGICAL( xTag ) IF xTag IF Empty( xIndex ) - cIndex := Sx_IndexName() + cIndex := sx_IndexName() ELSEIF HB_ISNUMERIC( xIndex ) - cIndex := Sx_IndexName( 1, xIndex ) + cIndex := sx_IndexName( 1, xIndex ) ELSEIF HB_ISSTRING( xIndex ) nOrder := dbOrderInfo( DBOI_BAGORDER, xIndex ) IF nOrder != 0 @@ -336,21 +355,21 @@ FUNCTION Sx_KillTag( xTag, xIndex ) nOrder := 0 ENDIF ELSE - nOrder := Sx_TagOrder( xTag, xIndex ) + nOrder := sx_TagOrder( xTag, xIndex ) ENDIF ELSE IF Empty( xIndex ) .OR. !ValType( xIndex ) $ "CN" - nOrder := OrdNumber( xTag ) + nOrder := ordNumber( xTag ) ELSEIF HB_ISSTRING( xIndex ) - nOrder := Sx_TagOrder( xTag, xIndex ) + nOrder := sx_TagOrder( xTag, xIndex ) ELSE - nOrder := Sx_TagOrder( 1, xIndex ) + nOrder := sx_TagOrder( 1, xIndex ) IF nOrder != 0 cIndex := dbOrderInfo( DBOI_FULLPATH,, nOrder ) IF Empty( cIndex ) nOrder := 0 ELSE - nOrder := Sx_TagOrder( xTag, cIndex ) + nOrder := sx_TagOrder( xTag, cIndex ) ENDIF ENDIF ENDIF @@ -359,31 +378,35 @@ FUNCTION Sx_KillTag( xTag, xIndex ) lRet := ordDestroy( nOrder ) ENDIF ENDIF + RETURN lRet -FUNCTION Sx_FileOrder() +FUNCTION sx_FileOrder() RETURN dbOrderInfo( DBOI_BAGNUMBER ) -FUNCTION Sx_SetFileOrd( nIndex ) +FUNCTION sx_SetFileOrd( nIndex ) RETURN iif( HB_ISNUMERIC( nIndex ), ; - OrdSetFocus( Sx_TagOrder( 1, nIndex ) ), ; - OrdSetFocus() ) + ordSetFocus( sx_TagOrder( 1, nIndex ) ), ; + ordSetFocus() ) -FUNCTION RDD_Count() - RETURN Len( RDDList() ) +FUNCTION rdd_Count() + RETURN Len( rddList() ) + +FUNCTION rdd_Name( nRDD ) -FUNCTION RDD_Name( nRDD ) LOCAL aRDD IF HB_ISNUMERIC( nRDD ) .AND. nRDD >= 1 - aRDD := RDDList() + aRDD := rddList() IF nRDD <= Len( aRDD ) RETURN aRDD[ nRDD ] ENDIF ENDIF + RETURN "" -FUNCTION RDD_Info( xID ) +FUNCTION rdd_Info( xID ) + LOCAL aInfo, cRDD IF HB_ISNUMERIC( xID ) @@ -410,46 +433,51 @@ FUNCTION RDD_Info( xID ) aInfo[ 5 ] := hb_rddInfo( RDDI_ORDEREXT, NIL, cRDD ) aInfo[ 6 ] := hb_rddInfo( RDDI_MEMOEXT, NIL, cRDD ) ENDIF + RETURN aInfo -FUNCTION Sx_IsDBT( cRDD ) +FUNCTION sx_IsDBT( cRDD ) RETURN hb_rddInfo( RDDI_MEMOTYPE, NIL, cRDD ) == DB_MEMO_DBT -FUNCTION Sx_MemoExt( cNewExt, cRDD ) +FUNCTION sx_MemoExt( cNewExt, cRDD ) RETURN hb_rddInfo( RDDI_MEMOEXT, cNewExt, cRDD ) -FUNCTION Sx_MemoBlk( nNewBlock, cRDD ) +FUNCTION sx_MemoBlk( nNewBlock, cRDD ) RETURN hb_rddInfo( RDDI_MEMOBLOCKSIZE, nNewBlock, cRDD ) -FUNCTION Sx_SetMemoBlock( nNewBlock, cRDD ) +FUNCTION sx_SetMemoBlock( nNewBlock, cRDD ) RETURN hb_rddInfo( RDDI_MEMOBLOCKSIZE, nNewBlock, cRDD ) -FUNCTION Sx_StrxCheck( lStrict, cRDD ) +FUNCTION sx_StrXCheck( lStrict, cRDD ) RETURN hb_rddInfo( RDDI_STRICTSTRUCT, lStrict, cRDD ) -FUNCTION Sx_LockRetry( nRetry, cRDD ) +FUNCTION sx_LockRetry( nRetry, cRDD ) RETURN hb_rddInfo( RDDI_LOCKRETRY, nRetry, cRDD ) -FUNCTION Sx_AutoOpen( lAuto, cRDD ) +FUNCTION sx_AutoOpen( lAuto, cRDD ) RETURN hb_rddInfo( RDDI_AUTOOPEN, lAuto, cRDD ) -FUNCTION Sx_AutoShare( lAuto, cRDD ) +FUNCTION sx_AutoShare( lAuto, cRDD ) RETURN hb_rddInfo( RDDI_AUTOSHARE, lAuto, cRDD ) -FUNCTION Sx_BLOB2File( cFileName, cFldName ) +FUNCTION sx_Blob2File( cFileName, cFldName ) RETURN dbFileGet( cFldName, cFileName, FILEGET_OVERWRITE ) -FUNCTION Sx_File2BLOB( cFileName, cFldName, nActionCode ) +FUNCTION sx_File2Blob( cFileName, cFldName, nActionCode ) + LOCAL nAction := 0 + IF hb_bitAnd( nActionCode, BLOB_FILECOMPRESS ) != 0 nAction := hb_bitOr( nAction, FILEPUT_COMPRESS ) ENDIF IF hb_bitAnd( nActionCode, BLOB_FILEENCRYPT ) != 0 nAction := hb_bitOr( nAction, FILEPUT_ENCRYPT ) ENDIF + RETURN dbFilePut( cFldName, cFileName, nAction ) -FUNCTION Sx_dbCreate( cFileName, aStruct, cRDD ) +FUNCTION sx_dbCreate( cFileName, aStruct, cRDD ) + LOCAL aField, aDbStruct aDbStruct := AClone( aStruct ) @@ -473,7 +501,8 @@ FUNCTION Sx_dbCreate( cFileName, aStruct, cRDD ) RETURN dbCreate( cFileName, aDbStruct, cRDD ) -FUNCTION Sx_VSigLen( xField ) +FUNCTION sx_VSigLen( xField ) + LOCAL nResult := 0, nField := 0 IF Used() @@ -492,18 +521,19 @@ FUNCTION Sx_VSigLen( xField ) RETURN nResult -FUNCTION Sx_VFGet( cExpr, nLen ) +FUNCTION sx_VFGet( cExpr, nLen ) /* Our RDDs does not use any internal flags to cut V-Fields so * we can simply evaluate given expression */ - */ + IF Used() .AND. PCount() == 2 RETURN PadR( &cExpr, nLen ) ENDIF RETURN NIL -FUNCTION Sx_IsLocked( xRec ) +FUNCTION sx_IsLocked( xRec ) + LOCAL lResult := .F., xRecord IF Used() @@ -513,8 +543,8 @@ FUNCTION Sx_IsLocked( xRec ) * Even if it looks strange and results are not very usable due * to possible race condition then this is what SIX3 exactly does. */ - IF Sx_RLock( xRecord ) - Sx_UnLock( xRecord ) + IF sx_Rlock( xRecord ) + sx_Unlock( xRecord ) ELSE lResult := .T. ENDIF @@ -522,7 +552,8 @@ FUNCTION Sx_IsLocked( xRec ) RETURN lResult -FUNCTION Sx_SetTrigger( nAction, cTriggerName, cRDD /* Harbour extensions */ ) +FUNCTION sx_SetTrigger( nAction, cTriggerName, cRDD /* Harbour extensions */ ) + LOCAL cPrevTrigger := "" IF HB_ISNUMERIC( nAction ) diff --git a/harbour/src/rdd/hbsix/sxini.prg b/harbour/src/rdd/hbsix/sxini.prg index 6f8881bb1e..16e7f6c751 100644 --- a/harbour/src/rdd/hbsix/sxini.prg +++ b/harbour/src/rdd/hbsix/sxini.prg @@ -78,7 +78,8 @@ STATIC FUNCTION _sx_INIlogical( cVal ) RETURN NIL -FUNCTION _sx_INIinit( nArea ) +FUNCTION _sx_IniInit( nArea ) + LOCAL cFile, cPath, cName, cExt, cDrive LOCAL xShared, xReadOnly, xAlias, xTrigger LOCAL hIni, item, sect, h, a @@ -90,8 +91,8 @@ FUNCTION _sx_INIinit( nArea ) IF Left( Type( "SxIniInfo" ), 1 ) == "U" PUBLIC SxIniInfo := { => } - HB_HCaseMatch( SxIniInfo, .F. ) - HB_HAutoAdd( SxIniInfo, HB_HAUTOADD_ASSIGN ) + hb_HCaseMatch( SxIniInfo, .F. ) + hb_HAutoAdd( SxIniInfo, HB_HAUTOADD_ASSIGN ) ENDIF IF nArea == NIL @@ -101,7 +102,7 @@ FUNCTION _sx_INIinit( nArea ) cFile := ( nArea )->( dbInfo( DBI_FULLPATH ) ) hb_FNameSplit( cFile, @cPath, @cName, @cExt, @cDrive ) cFile := hb_FNameMerge( cPath, cName, ".ini", cDrive ) - hIni := hb_IniRead( cFile, .F.,, .F. ) + hIni := hb_iniRead( cFile, .F.,, .F. ) IF !Empty( hIni ) IF hb_HHasKey( hIni, HB_SIX_SECTION ) @@ -122,7 +123,7 @@ FUNCTION _sx_INIinit( nArea ) ENDSWITCH NEXT IF xTrigger != NIL - ( nArea )->( Sx_SetTrigger( TRIGGER_INSTALL, xTrigger ) ) + ( nArea )->( sx_SetTrigger( TRIGGER_INSTALL, xTrigger ) ) ENDIF _sxOpenInit( nArea, xShared, xReadOnly, xAlias ) ENDIF @@ -144,7 +145,7 @@ FUNCTION _sx_INIinit( nArea ) RETURN .F. -FUNCTION Sx_INIheader( cHeaderName, nArea ) +FUNCTION sx_IniHeader( cHeaderName, nArea ) IF nArea == NIL nArea := Select() diff --git a/harbour/src/rdd/hbsix/sxtrig.prg b/harbour/src/rdd/hbsix/sxtrig.prg index e421a64586..afdfa24281 100644 --- a/harbour/src/rdd/hbsix/sxtrig.prg +++ b/harbour/src/rdd/hbsix/sxtrig.prg @@ -53,7 +53,7 @@ #include "hbsxdef.ch" -FUNCTION Sx_DefTrigger( nEvent, nArea, nFieldPos, xTrigVal ) +FUNCTION sx_DefTrigger( nEvent, nArea, nFieldPos, xTrigVal ) HB_SYMBOL_UNUSED( nArea ) HB_SYMBOL_UNUSED( nFieldPos ) @@ -61,8 +61,10 @@ FUNCTION Sx_DefTrigger( nEvent, nArea, nFieldPos, xTrigVal ) SWITCH nEvent CASE EVENT_PREUSE -// _sx_INIinit( nArea ) - Sx_SetTrigger( TRIGGER_REMOVE ) +#if 0 + _sx_INIinit( nArea ) +#endif + sx_SetTrigger( TRIGGER_REMOVE ) EXIT CASE EVENT_POSTUSE EXIT diff --git a/harbour/src/rdd/usrrdd/rdds/arrayrdd.prg b/harbour/src/rdd/usrrdd/rdds/arrayrdd.prg index 65a6bc7b8f..09dfda6675 100644 --- a/harbour/src/rdd/usrrdd/rdds/arrayrdd.prg +++ b/harbour/src/rdd/usrrdd/rdds/arrayrdd.prg @@ -56,9 +56,9 @@ * This is a Array RDD, or Memory RDD. * It works only in memory and actually supports standard dbf commands * excepts relations - - Index and Set Filter Support by Quique - 2011 - + * + * Index and Set Filter Support by Quique - 2011 + * */ #include "rddsys.ch" @@ -127,74 +127,85 @@ STATIC s_nRddID := -1 * Methods INIT and EXIT does not have to execute SUPER methods - these is * always done by low level USRRDD code */ + STATIC FUNCTION AR_INIT( nRDD ) /* Init DBF Hash */ + USRRDD_RDDDATA( nRDD, { => } ) RETURN HB_SUCCESS #if 0 + STATIC FUNCTION AR_RDDDATAINIT() + RETURN { ; - NIL ; /* RDDDATA_DATABASE */ - } + NIL ; /* RDDDATA_DATABASE */ + } + #endif STATIC FUNCTION AR_DATABASEINIT() + RETURN { ; - NIL ,; /* DATABASE_FILENAME */ - {} ,; /* DATABASE_RECORDS */ - {} ,; /* DATABASE_RECINFO */ - 0 ,; /* DATABASE_OPENNUMBER */ - .F. ,; /* DATABASE_LOCKED */ - NIL ,; /* DATABASE_STRUCT - aStruct */ - {} ; /* DATABASE_INDEX */ - } + NIL, ; /* DATABASE_FILENAME */ + {}, ; /* DATABASE_RECORDS */ + {}, ; /* DATABASE_RECINFO */ + 0, ; /* DATABASE_OPENNUMBER */ + .F., ; /* DATABASE_LOCKED */ + NIL, ; /* DATABASE_STRUCT - aStruct */ + {} ; /* DATABASE_INDEX */ + } STATIC FUNCTION AR_WADATAINIT() + RETURN { ; - NIL ,; /* WADATA_DATABASE */ - 0 ,; /* WADATA_WORKAREA */ - NIL ,; /* WADATA_OPENINFO */ - 0 ,; /* WADATA_RECNO */ - .F. ,; /* WADATA_BOF */ - .F. ,; /* WADATA_FORCEBOF - to solve an hack in dbf1.c */ - .F. ,; /* WADATA_EOF */ - .F. ,; /* WADATA_TOP */ - .F. ,; /* WADATA_BOTTOM */ - .F. ,; /* WADATA_FOUND */ - {} ,; /* WADATA_LOCKS */ - 0 ,; /* WADATA_INDEX */ - {} ,; /* WADATA_WAORDINFO */ - 0 ,; /* WADATA_ORDRECNO */ - NIL ; /* WADATA_FILTERINFO */ - } + NIL, ; /* WADATA_DATABASE */ + 0, ; /* WADATA_WORKAREA */ + NIL, ; /* WADATA_OPENINFO */ + 0, ; /* WADATA_RECNO */ + .F., ; /* WADATA_BOF */ + .F., ; /* WADATA_FORCEBOF - to solve an hack in dbf1.c */ + .F., ; /* WADATA_EOF */ + .F., ; /* WADATA_TOP */ + .F., ; /* WADATA_BOTTOM */ + .F., ; /* WADATA_FOUND */ + {}, ; /* WADATA_LOCKS */ + 0, ; /* WADATA_INDEX */ + {}, ; /* WADATA_WAORDINFO */ + 0, ; /* WADATA_ORDRECNO */ + NIL; /* WADATA_FILTERINFO */ + } STATIC FUNCTION AR_RECDATAINIT() + RETURN { ; - .F. ,; /* RECDATA_DELETED */ - 0 ; /* RECDATA_LOCKED - which work area lock? */ - } + .F., ; /* RECDATA_DELETED */ + 0; /* RECDATA_LOCKED - which work area lock? */ + } STATIC FUNCTION AR_INDEXINIT() + RETURN { ; - NIL ,; /* INDEX_TAG */ - NIL ,; /* INDEX_ORCR */ - {} ; /* INDEX_RECORDS */ - } + NIL, ; /* INDEX_TAG */ + NIL, ; /* INDEX_ORCR */ + {} ; /* INDEX_RECORDS */ + } STATIC FUNCTION AR_INDEXKEYINIT() + RETURN { ; - NIL ,; /* INDEXKEY_KEY */ - NIL ; /* INDEXKEY_RECORD */ - } + NIL, ; /* INDEXKEY_KEY */ + NIL ; /* INDEXKEY_RECORD */ + } STATIC FUNCTION AR_WAOIINIT() + RETURN { ; - NIL ,; /* WAOI_SCOPE_0 */ - NIL ; /* WAOI_SCOPE_1 */ - } + NIL, ; /* WAOI_SCOPE_0 */ + NIL ; /* WAOI_SCOPE_1 */ + } /* * methods: NEW and RELEASE receive pointer to work area structure @@ -203,6 +214,7 @@ STATIC FUNCTION AR_WAOIINIT() * these methods does not have to execute SUPER methods - these is * always done by low level USRRDD code */ + STATIC FUNCTION AR_NEW( pWA ) /* @@ -211,12 +223,15 @@ STATIC FUNCTION AR_NEW( pWA ) * we have to emulate it and there is no phantom record so we * cannot return EOF flag directly. */ + USRRDD_AREADATA( pWA, AR_WADATAINIT() ) RETURN HB_SUCCESS /* Creating fields for new DBF - dbCreate() in current workarea */ + STATIC FUNCTION AR_CREATEFIELDS( nWA, aStruct ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL nResult := HB_SUCCESS LOCAL aFieldStruct, aField @@ -252,7 +267,9 @@ STATIC FUNCTION AR_CREATEFIELDS( nWA, aStruct ) RETURN nResult /* Create database from current WA fields definition */ + STATIC FUNCTION AR_CREATE( nWA, aOpenInfo ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL hRDDData := USRRDD_RDDDATA( USRRDD_ID( nWA ) ) LOCAL cName @@ -268,7 +285,7 @@ STATIC FUNCTION AR_CREATE( nWA, aOpenInfo ) /* When there is no ALIAS we will create new one using file name */ IF aOpenInfo[ UR_OI_ALIAS ] == NIL - HB_FNAMESPLIT( cFullName, , @cName ) + hb_FNameSplit( cFullName,, @cName ) aOpenInfo[ UR_OI_ALIAS ] := cName ENDIF @@ -307,6 +324,7 @@ STATIC FUNCTION AR_CREATE( nWA, aOpenInfo ) RETURN nResult STATIC FUNCTION AR_OPEN( nWA, aOpenInfo ) + LOCAL cFullName, cName, hRDDData, aWAData, aDBFData LOCAL aStruct, oError, aFieldStruct, aField, nResult @@ -320,7 +338,7 @@ STATIC FUNCTION AR_OPEN( nWA, aOpenInfo ) /* When there is no ALIAS we will create new one using file name */ IF aOpenInfo[ UR_OI_ALIAS ] == NIL - HB_FNAMESPLIT( cFullName, , @cName ) + hb_FNameSplit( cFullName,, @cName ) aOpenInfo[ UR_OI_ALIAS ] := cName ENDIF @@ -334,7 +352,7 @@ STATIC FUNCTION AR_OPEN( nWA, aOpenInfo ) oError := ErrorNew() oError:GenCode := EG_OPEN oError:SubCode := 1000 - oError:Description := HB_LANGERRMSG( EG_OPEN ) + ", memory file not found" + oError:Description := hb_langErrMsg( EG_OPEN ) + ", memory file not found" oError:FileName := aOpenInfo[ UR_OI_NAME ] oError:CanDefault := .T. NetErr( .T. ) @@ -375,8 +393,8 @@ STATIC FUNCTION AR_OPEN( nWA, aOpenInfo ) oError := ErrorNew() oError:GenCode := EG_OPEN oError:SubCode := 1000 - oError:Description := HB_LANGERRMSG( EG_OPEN ) + "(" + ; - HB_LANGERRMSG( EG_LOCK ) + " - already opened in exclusive mode)" + oError:Description := hb_langErrMsg( EG_OPEN ) + "(" + ; + hb_langErrMsg( EG_LOCK ) + " - already opened in exclusive mode)" oError:FileName := aOpenInfo[ UR_OI_NAME ] oError:CanDefault := .T. NetErr( .T. ) @@ -394,8 +412,8 @@ STATIC FUNCTION AR_OPEN( nWA, aOpenInfo ) oError := ErrorNew() oError:GenCode := EG_OPEN oError:SubCode := 1000 - oError:Description := HB_LANGERRMSG( EG_OPEN ) + "(" + ; - HB_LANGERRMSG( EG_LOCK ) + " - already opened in shared mode)" + oError:Description := hb_langErrMsg( EG_OPEN ) + "(" + ; + hb_langErrMsg( EG_LOCK ) + " - already opened in shared mode)" oError:FileName := aOpenInfo[ UR_OI_NAME ] oError:CanDefault := .T. UR_SUPER_ERROR( nWA, oError ) @@ -413,6 +431,7 @@ STATIC FUNCTION AR_OPEN( nWA, aOpenInfo ) RETURN nResult STATIC FUNCTION AR_CLOSE( nWA ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] @@ -429,6 +448,7 @@ STATIC FUNCTION AR_CLOSE( nWA ) RETURN UR_SUPER_CLOSE( nWA ) STATIC FUNCTION AR_GETVALUE( nWA, nField, xValue ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aRecords := aDBFData[ DATABASE_RECORDS ] @@ -450,6 +470,7 @@ STATIC FUNCTION AR_GETVALUE( nWA, nField, xValue ) RETURN HB_FAILURE STATIC FUNCTION AR_PUTVALUE( nWA, nField, xValue ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aRecords := aDBFData[ DATABASE_RECORDS ] @@ -481,6 +502,7 @@ STATIC FUNCTION AR_PUTVALUE( nWA, nField, xValue ) RETURN HB_FAILURE STATIC FUNCTION AR_GOTO( nWA, nRecord ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aRecords := aDBFData[ DATABASE_RECORDS ] @@ -509,15 +531,18 @@ STATIC FUNCTION AR_GOTO( nWA, nRecord ) ENDIF HB_TRACE( HB_TR_DEBUG, hb_StrFormat( "aWAData[ WADATA_BOF ] = %1$s, aWAData[ WADATA_EOF ] = %2$s, aWAData[ WADATA_RECNO ] = %3$d", ; - hb_ValToExp( aWAData[ WADATA_BOF ] ), hb_ValToExp( aWAData[ WADATA_EOF ] ), aWAData[ WADATA_RECNO ] ) ) + hb_ValToExp( aWAData[ WADATA_BOF ] ), hb_ValToExp( aWAData[ WADATA_EOF ] ), aWAData[ WADATA_RECNO ] ) ) RETURN HB_SUCCESS STATIC FUNCTION AR_GOTOID( nWA, nRecord ) + HB_TRACE( HB_TR_DEBUG, hb_StrFormat( "nWA = %1$d, nRecord = %2$d", nWA, nRecord ) ) + RETURN AR_GOTO( nWA, nRecord ) STATIC FUNCTION AR_GOTOP( nWA ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aRecords := aDBFData[ DATABASE_RECORDS ] @@ -558,6 +583,7 @@ STATIC FUNCTION AR_GOTOP( nWA ) RETURN nResult STATIC FUNCTION AR_GOBOTTOM( nWA ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aRecords := aDBFData[ DATABASE_RECORDS ] @@ -581,8 +607,8 @@ STATIC FUNCTION AR_GOBOTTOM( nWA ) aWAData[ WADATA_ORDRECNO ] := 0 nResult := AR_GOTO( nWA, 0 ) ELSE - aWAData[ WADATA_ORDRECNO ] := Len( aTail( aIndexes[ nIndex, INDEX_RECORDS ] ) ) - nResult := AR_GOTO( nWA, aTail( aIndexes[ nIndex, INDEX_RECORDS ] )[ INDEXKEY_RECORD ] ) + aWAData[ WADATA_ORDRECNO ] := Len( ATail( aIndexes[ nIndex, INDEX_RECORDS ] ) ) + nResult := AR_GOTO( nWA, ATail( aIndexes[ nIndex, INDEX_RECORDS ] )[ INDEXKEY_RECORD ] ) ENDIF ELSE aWAData[ WADATA_ORDRECNO ] := SeekScope( aIndexes[ nIndex ], aWAData[ WADATA_WAORDINFO, nIndex ], .T. ) @@ -614,6 +640,7 @@ STATIC FUNCTION AR_CLEARFILTER( nWA ) RETURN SUCCESS STATIC FUNCTION AR_SKIPFILTER( nWA, nRecords ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aRecInfo := aDBFData[ DATABASE_RECINFO ] @@ -653,6 +680,7 @@ STATIC FUNCTION AR_SKIPFILTER( nWA, nRecords ) RETURN HB_SUCCESS STATIC FUNCTION AR_SKIPRAW( nWA, nRecords ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL nIndex := aWAData[ WADATA_INDEX ] LOCAL aIndexes := aWAData[ WADATA_DATABASE, DATABASE_INDEX ] @@ -730,6 +758,7 @@ STATIC FUNCTION AR_SKIPRAW( nWA, nRecords ) RETURN nResult STATIC FUNCTION AR_BOF( nWA, lBof ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) HB_TRACE( HB_TR_DEBUG, hb_StrFormat( "nWA = %1$d, lBof = %2$s", nWA, hb_ValToExp( lBof ) ) ) @@ -745,6 +774,7 @@ STATIC FUNCTION AR_BOF( nWA, lBof ) RETURN HB_SUCCESS STATIC FUNCTION AR_EOF( nWA, lEof ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) HB_TRACE( HB_TR_DEBUG, hb_StrFormat( "nWA = %1$d, lEof = %2$s", nWA, hb_ValToExp( lEof ) ) ) @@ -754,6 +784,7 @@ STATIC FUNCTION AR_EOF( nWA, lEof ) RETURN HB_SUCCESS STATIC FUNCTION AR_DELETE( nWA ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aRecInfo := aDBFData[ DATABASE_RECINFO ] @@ -768,7 +799,7 @@ STATIC FUNCTION AR_DELETE( nWA ) oError := ErrorNew() oError:GenCode := EG_READONLY oError:SubCode := 1025 /* EDBF_READONLY */ - oError:Description := HB_LANGERRMSG( EG_READONLY ) + oError:Description := hb_langErrMsg( EG_READONLY ) oError:FileName := aOpenInfo[ UR_OI_NAME ] UR_SUPER_ERROR( nWA, oError ) RETURN HB_FAILURE @@ -780,7 +811,7 @@ STATIC FUNCTION AR_DELETE( nWA ) oError := ErrorNew() oError:GenCode := EG_UNLOCKED oError:SubCode := 1022 /* EDBF_UNLOCKED */ - oError:Description := HB_LANGERRMSG( EG_UNLOCKED ) + oError:Description := hb_langErrMsg( EG_UNLOCKED ) oError:FileName := aOpenInfo[ UR_OI_NAME ] UR_SUPER_ERROR( nWA, oError ) RETURN HB_FAILURE @@ -801,6 +832,7 @@ STATIC FUNCTION AR_DELETE( nWA ) RETURN HB_SUCCESS STATIC FUNCTION AR_DELETED( nWA, lDeleted ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aRecInfo := aDBFData[ DATABASE_RECINFO ] @@ -816,6 +848,7 @@ STATIC FUNCTION AR_DELETED( nWA, lDeleted ) RETURN HB_SUCCESS STATIC FUNCTION AR_RECALL( nWA ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aRecInfo := aDBFData[ DATABASE_RECINFO ] @@ -830,7 +863,7 @@ STATIC FUNCTION AR_RECALL( nWA ) oError := ErrorNew() oError:GenCode := EG_READONLY oError:SubCode := 1025 /* EDBF_READONLY */ - oError:Description := HB_LANGERRMSG( EG_READONLY ) + oError:Description := hb_langErrMsg( EG_READONLY ) oError:FileName := aOpenInfo[ UR_OI_NAME ] UR_SUPER_ERROR( nWA, oError ) RETURN HB_FAILURE @@ -841,7 +874,7 @@ STATIC FUNCTION AR_RECALL( nWA ) oError := ErrorNew() oError:GenCode := EG_UNLOCKED oError:SubCode := 1022 /* EDBF_UNLOCKED */ - oError:Description := HB_LANGERRMSG( EG_UNLOCKED ) + oError:Description := hb_langErrMsg( EG_UNLOCKED ) oError:FileName := aOpenInfo[ UR_OI_NAME ] UR_SUPER_ERROR( nWA, oError ) RETURN HB_FAILURE @@ -857,6 +890,7 @@ STATIC FUNCTION AR_RECALL( nWA ) RETURN HB_SUCCESS STATIC FUNCTION AR_APPEND( nWA, nRecords ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aRecords := aDBFData[ DATABASE_RECORDS ] @@ -874,9 +908,11 @@ STATIC FUNCTION AR_APPEND( nWA, nRecords ) oError := ErrorNew() oError:GenCode := EG_READONLY oError:SubCode := 1025 /* EDBF_READONLY */ - oError:Description := HB_LANGERRMSG( EG_READONLY ) + oError:Description := hb_langErrMsg( EG_READONLY ) oError:FileName := aOpenInfo[ UR_OI_NAME ] - /* oError:OsCode := fError() */ +#if 0 + oError:OsCode := FError() +#endif oError:CanDefault := .T. oError:CanRetry := .T. NetErr( .T. ) @@ -903,6 +939,7 @@ STATIC FUNCTION AR_APPEND( nWA, nRecords ) RETURN HB_SUCCESS STATIC FUNCTION AR_LOCK( nWA, aLock ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL nRec := iif( aLock[ UR_LI_RECORD ] == NIL, aWAData[ WADATA_RECNO ], aLock[ UR_LI_RECORD ] ) LOCAL aRecInfo @@ -932,6 +969,7 @@ STATIC FUNCTION AR_LOCK( nWA, aLock ) RETURN HB_SUCCESS STATIC FUNCTION AR_UNLOCK( nWA, nRec ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aRecords := aWAData[ WADATA_LOCKS ] LOCAL aRecInfo := aWAData[ WADATA_DATABASE, DATABASE_RECINFO ] @@ -957,6 +995,7 @@ STATIC FUNCTION AR_UNLOCK( nWA, nRec ) RETURN HB_SUCCESS STATIC FUNCTION AR_RECID( nWA, nRecNo ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aRecords := aDBFData[ DATABASE_RECORDS ] @@ -973,6 +1012,7 @@ STATIC FUNCTION AR_RECID( nWA, nRecNo ) RETURN HB_SUCCESS STATIC FUNCTION AR_RECCOUNT( nWA, nRecords ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aRecords := aDBFData[ DATABASE_RECORDS ] @@ -986,6 +1026,7 @@ STATIC FUNCTION AR_RECCOUNT( nWA, nRecords ) RETURN HB_SUCCESS STATIC FUNCTION AR_PACK( nWA ) + LOCAL oError, nRec, aIndex LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] @@ -1000,7 +1041,7 @@ STATIC FUNCTION AR_PACK( nWA ) oError := ErrorNew() oError:GenCode := EG_UNLOCKED oError:SubCode := 1022 /* EDBF_UNLOCKED */ - oError:Description := HB_LANGERRMSG( EG_UNLOCKED ) + oError:Description := hb_langErrMsg( EG_UNLOCKED ) UR_SUPER_ERROR( nWA, oError ) RETURN FAILURE @@ -1031,6 +1072,7 @@ STATIC FUNCTION AR_PACK( nWA ) RETURN SUCCESS STATIC FUNCTION AR_ZAP( nWA ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aOpenInfo := aWAData[ WADATA_OPENINFO ] @@ -1042,7 +1084,7 @@ STATIC FUNCTION AR_ZAP( nWA ) oError := ErrorNew() oError:GenCode := EG_READONLY oError:SubCode := 1025 /* EDBF_READONLY */ - oError:Description := HB_LANGERRMSG( EG_READONLY ) + oError:Description := hb_langErrMsg( EG_READONLY ) oError:FileName := aOpenInfo[ UR_OI_NAME ] UR_SUPER_ERROR( nWA, oError ) RETURN HB_FAILURE @@ -1052,7 +1094,7 @@ STATIC FUNCTION AR_ZAP( nWA ) oError := ErrorNew() oError:GenCode := EG_SHARED oError:SubCode := 1023 /* EDBF_SHARED */ - oError:Description := HB_LANGERRMSG( EG_SHARED ) + oError:Description := hb_langErrMsg( EG_SHARED ) oError:FileName := aOpenInfo[ UR_OI_NAME ] UR_SUPER_ERROR( nWA, oError ) RETURN HB_FAILURE @@ -1076,6 +1118,7 @@ STATIC FUNCTION AR_FOUND( nWa, lFound ) RETURN HB_SUCCESS STATIC FUNCTION AR_SEEK( nWa, lSoftSeek, xSeek, lLast ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aIndexes := aWAData[ WADATA_DATABASE, DATABASE_INDEX ] LOCAL nIndex := aWAData[ WADATA_INDEX ] @@ -1095,6 +1138,7 @@ STATIC FUNCTION AR_SEEK( nWa, lSoftSeek, xSeek, lLast ) RETURN nResult STATIC FUNCTION AR_INFO( nWA, nMsg, xValue ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] @@ -1114,13 +1158,14 @@ STATIC FUNCTION AR_INFO( nWA, nMsg, xValue ) RETURN HB_SUCCESS STATIC FUNCTION AR_ORDLSTADD( nWA, aOrderInfo ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aIndexes := aDBFData[ DATABASE_INDEX ] HB_SYMBOL_UNUSED( aOrderInfo ) - HB_TRACE( HB_TR_DEBUG, hb_StrFormat( "nWA = %1$d, aOrderInfo = %2$s", nWA, hb_valToExp( aOrderInfo ) ) ) + HB_TRACE( HB_TR_DEBUG, hb_StrFormat( "nWA = %1$d, aOrderInfo = %2$s", nWA, hb_ValToExp( aOrderInfo ) ) ) IF Empty( aIndexes ) aWAData[ WADATA_INDEX ] := 0 @@ -1136,10 +1181,11 @@ STATIC FUNCTION AR_ORDLSTADD( nWA, aOrderInfo ) RETURN HB_SUCCESS STATIC FUNCTION AR_ORDLSTFOCUS( nWA, aOrderInfo ) - local aWAData := USRRDD_AREADATA( nWA ) + + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aDBFData := aWAData[ WADATA_DATABASE ] LOCAL aIndexes := aDBFData[ DATABASE_INDEX ] - local xIndex := aOrderInfo[ UR_ORI_TAG ] + LOCAL xIndex := aOrderInfo[ UR_ORI_TAG ] HB_TRACE( HB_TR_DEBUG, hb_StrFormat( "nWA = %1$d, aOrderInfo = %2$s", nWA, hb_ValToExp( aOrderInfo ) ) ) @@ -1158,11 +1204,12 @@ STATIC FUNCTION AR_ORDLSTFOCUS( nWA, aOrderInfo ) RETURN HB_SUCCESS STATIC FUNCTION AR_ORDCREATE( nWA, aOrderCreate ) + LOCAL aWAData, aDBFData, aOCInfo, nNext LOCAL aIndexes, nContNext, nContStep LOCAL bWhile, nRec, bNext, bEval, bEvalOCI, nStep, nIndex, cIndex, aIndex - HB_TRACE( HB_TR_DEBUG, hb_StrFormat( "nWA = %1$d, aOrderCreate = %2$s", nWA, hb_valToExp( aOrderCreate ) ) ) + HB_TRACE( HB_TR_DEBUG, hb_StrFormat( "nWA = %1$d, aOrderCreate = %2$s", nWA, hb_ValToExp( aOrderCreate ) ) ) aWAData := USRRDD_AREADATA( nWA ) aDBFData := aWAData[ WADATA_DATABASE ] @@ -1170,32 +1217,31 @@ STATIC FUNCTION AR_ORDCREATE( nWA, aOrderCreate ) IF HB_ISARRAY( aOrderCreate[ UR_ORCR_CONDINFO ] ) aOCInfo := aOrderCreate[ UR_ORCR_CONDINFO ] ELSE - aOCInfo := aOrderCreate[ UR_ORCR_CONDINFO ] := ; - { ; - .F., ; /* #define UR_ORC_ACTIVE 1 */ - "" , ; /* #define UR_ORC_CFOR 2 */ - "" , ; /* #define UR_ORC_CWHILE 3 */ - NIL, ; /* #define UR_ORC_BFOR 4 */ - NIL, ; /* #define UR_ORC_BWHILE 5 */ - NIL, ; /* #define UR_ORC_BEVAL 6 */ - 0 , ; /* #define UR_ORC_STEP 7 */ - 0 , ; /* #define UR_ORC_STARTREC 8 */ - 0 , ; /* #define UR_ORC_NEXT 9 */ - 0 , ; /* #define UR_ORC_RECORD 10 */ - .F., ; /* #define UR_ORC_REST 11 */ - .F., ; /* #define UR_ORC_DESCEND 12 */ - .F., ; /* #define UR_ORC_SCOPED 13 */ - .T., ; /* #define UR_ORC_ALL 14 */ - .F., ; /* #define UR_ORC_ADDITIVE 15 */ - .F., ; /* #define UR_ORC_USECURRENT 16 */ - .F., ; /* #define UR_ORC_CUSTOM 17 */ - .F., ; /* #define UR_ORC_NOOPTIMIZE 18 */ - .F., ; /* #define UR_ORC_COMPOUND 19 */ - .F., ; /* #define UR_ORC_USEFILTER 20 */ - .F., ; /* #define UR_ORC_TEMPORARY 21 */ - .F., ; /* #define UR_ORC_EXCLUSIVE 22 */ - NIL ; /* #define UR_ORC_CARGO 23 */ - } + aOCInfo := aOrderCreate[ UR_ORCR_CONDINFO ] := { ; + .F., ; /* #define UR_ORC_ACTIVE 1 */ + "", ; /* #define UR_ORC_CFOR 2 */ + "", ; /* #define UR_ORC_CWHILE 3 */ + NIL, ; /* #define UR_ORC_BFOR 4 */ + NIL, ; /* #define UR_ORC_BWHILE 5 */ + NIL, ; /* #define UR_ORC_BEVAL 6 */ + 0, ; /* #define UR_ORC_STEP 7 */ + 0, ; /* #define UR_ORC_STARTREC 8 */ + 0, ; /* #define UR_ORC_NEXT 9 */ + 0, ; /* #define UR_ORC_RECORD 10 */ + .F., ; /* #define UR_ORC_REST 11 */ + .F., ; /* #define UR_ORC_DESCEND 12 */ + .F., ; /* #define UR_ORC_SCOPED 13 */ + .T., ; /* #define UR_ORC_ALL 14 */ + .F., ; /* #define UR_ORC_ADDITIVE 15 */ + .F., ; /* #define UR_ORC_USECURRENT 16 */ + .F., ; /* #define UR_ORC_CUSTOM 17 */ + .F., ; /* #define UR_ORC_NOOPTIMIZE 18 */ + .F., ; /* #define UR_ORC_COMPOUND 19 */ + .F., ; /* #define UR_ORC_USEFILTER 20 */ + .F., ; /* #define UR_ORC_TEMPORARY 21 */ + .F., ; /* #define UR_ORC_EXCLUSIVE 22 */ + NIL ; /* #define UR_ORC_CARGO 23 */ + } ENDIF nNext := aOCInfo[ UR_ORC_NEXT ] @@ -1255,8 +1301,8 @@ STATIC FUNCTION AR_ORDCREATE( nWA, aOrderCreate ) DO WHILE !aWAData[ WADATA_EOF ] .AND. Eval( bEval ) .AND. Eval( bNext ) .AND. Eval( bWhile ) HB_TRACE( HB_TR_DEBUG, hb_StrFormat( "aWAData[ WADATA_INDEX ] = %1$s, Eval( aIndex[ INDEX_ORCR, UR_ORCR_BKEY ] ) = %2$s, aIndex = %3$s, aWAData = %4$s", ; - hb_ValToExp( aWAData[ WADATA_INDEX ] ), hb_ValToExp( Eval( aIndex[ INDEX_ORCR, UR_ORCR_BKEY ] ) ), ; - hb_ValToExp( hb_ValToExp( aIndex ) ), hb_ValToExp( aWAData ) ) ) + hb_ValToExp( aWAData[ WADATA_INDEX ] ), hb_ValToExp( Eval( aIndex[ INDEX_ORCR, UR_ORCR_BKEY ] ) ), ; + hb_ValToExp( hb_ValToExp( aIndex ) ), hb_ValToExp( aWAData ) ) ) ModifyIndex( aWAData[ WADATA_INDEX ], Eval( aIndex[ INDEX_ORCR, UR_ORCR_BKEY ] ), aIndex, aWAData ) AR_GOTO( nWA, ++nRec ) ENDDO @@ -1264,6 +1310,7 @@ STATIC FUNCTION AR_ORDCREATE( nWA, aOrderCreate ) RETURN AR_GOTOP( nWA ) STATIC FUNCTION AR_ORDINFO( nWA, nMsg, aOrderInfo ) + LOCAL aWAData := USRRDD_AREADATA( nWA ) LOCAL aIndexes := aWAData[ WADATA_DATABASE, DATABASE_INDEX ] LOCAL nIndex, nPos @@ -1382,13 +1429,16 @@ STATIC FUNCTION AR_ORDINFO( nWA, nMsg, aOrderInfo ) RETURN HB_SUCCESS STATIC FUNCTION AR_DUMMY() + RETURN HB_SUCCESS /* * This function have to exist in all RDD and then name have to be in * format: _GETFUNCTABLE */ + FUNCTION ARRAYRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, pSuperRddID ) + LOCAL cSuperRDD := NIL /* NO SUPER RDD */ LOCAL aMyFunc[ UR_METHODCOUNT ] @@ -1432,10 +1482,12 @@ FUNCTION ARRAYRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, pSu aMyFunc[ UR_ORDINFO ] := ( @AR_ORDINFO() ) RETURN USRRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, ; - cSuperRDD, aMyFunc, pSuperRddID ) + cSuperRDD, aMyFunc, pSuperRddID ) INIT PROCEDURE ARRAYRDD_INIT() + rddRegister( "ARRAYRDD", RDT_FULL ) + RETURN /* -------------------------------------------------- */ @@ -1445,7 +1497,9 @@ INIT PROCEDURE ARRAYRDD_INIT() /* hb_EraseArrayRdd() function is equivalent of FErase() function, but works here in memory */ + FUNCTION hb_EraseArrayRdd( cFullName ) + LOCAL nReturn := HB_FAILURE LOCAL aDBFData, oError LOCAL hRDDData @@ -1468,8 +1522,8 @@ FUNCTION hb_EraseArrayRdd( cFullName ) oError:GenCode := EG_UNSUPPORTED oError:SubCode := 1000 /* EDBF_UNSUPPORTED */ - oError:Description := HB_LANGERRMSG( EG_UNSUPPORTED ) + " (" + ; - "database in use)" + oError:Description := hb_langErrMsg( EG_UNSUPPORTED ) + " (" + ; + "database in use)" oError:FileName := cFullName oError:CanDefault := .T. Throw( oError ) @@ -1490,8 +1544,8 @@ FUNCTION hb_EraseArrayRdd( cFullName ) oError:GenCode := EG_UNSUPPORTED oError:SubCode := 1000 /* EDBF_UNSUPPORTED */ - oError:Description := HB_LANGERRMSG( EG_UNSUPPORTED ) + " (" + ; - "ARRAYRDD not inizialized)" + oError:Description := hb_langErrMsg( EG_UNSUPPORTED ) + " (" + ; + "ARRAYRDD not inizialized)" oError:FileName := cFullName oError:CanDefault := .T. /* UR_SUPER_ERROR( 0, oError ) */ @@ -1506,8 +1560,8 @@ FUNCTION hb_EraseArrayRdd( cFullName ) oError:GenCode := EG_UNSUPPORTED oError:SubCode := 1000 /* EDBF_UNSUPPORTED */ - oError:Description := HB_LANGERRMSG( EG_UNSUPPORTED ) + " (" + ; - "ARRAYRDD not in use)" + oError:Description := hb_langErrMsg( EG_UNSUPPORTED ) + " (" + ; + "ARRAYRDD not in use)" oError:FileName := cFullName oError:CanDefault := .T. Throw( oError ) @@ -1522,7 +1576,9 @@ FUNCTION hb_EraseArrayRdd( cFullName ) hb_FileArrayRdd( cFullName ) --> lExist This function is equivalent of File() function, but works here in memory */ + FUNCTION hb_FileArrayRdd( cFullName ) + LOCAL nReturn := HB_FAILURE LOCAL oError LOCAL hRDDData @@ -1545,8 +1601,8 @@ FUNCTION hb_FileArrayRdd( cFullName ) oError:GenCode := EG_UNSUPPORTED oError:SubCode := 1000 /* EDBF_UNSUPPORTED */ - oError:Description := HB_LANGERRMSG( EG_UNSUPPORTED ) + " (" + ; - "ARRAYRDD not inizialized)" + oError:Description := hb_langErrMsg( EG_UNSUPPORTED ) + " (" + ; + "ARRAYRDD not inizialized)" oError:FileName := cFullName oError:CanDefault := .T. Throw( oError ) @@ -1560,8 +1616,8 @@ FUNCTION hb_FileArrayRdd( cFullName ) oError:GenCode := EG_UNSUPPORTED oError:SubCode := 1000 /* EDBF_UNSUPPORTED */ - oError:Description := HB_LANGERRMSG( EG_UNSUPPORTED ) + " (" + ; - "ARRAYRDD not in use)" + oError:Description := hb_langErrMsg( EG_UNSUPPORTED ) + " (" + ; + "ARRAYRDD not in use)" oError:FileName := cFullName oError:CanDefault := .T. Throw( oError ) @@ -1573,6 +1629,7 @@ FUNCTION hb_FileArrayRdd( cFullName ) RETURN nReturn == HB_SUCCESS FUNCTION hb_SetArrayRdd( aArray ) + LOCAL aRecInfo LOCAL nWA := Select() LOCAL aDBFData := USRRDD_AREADATA( nWA )[ WADATA_DATABASE ] @@ -1587,6 +1644,7 @@ FUNCTION hb_SetArrayRdd( aArray ) RETURN NIL STATIC FUNCTION BlankRecord( aStruct ) + LOCAL nLenStruct := Len( aStruct ) LOCAL aRecord := Array( nLenStruct ) LOCAL nField @@ -1598,6 +1656,7 @@ STATIC FUNCTION BlankRecord( aStruct ) RETURN aRecord STATIC FUNCTION PutValue( xValue, cType, nLen, nDec ) + LOCAL xVal DO CASE @@ -1614,6 +1673,7 @@ STATIC FUNCTION PutValue( xValue, cType, nLen, nDec ) RETURN xVal STATIC FUNCTION EmptyValue( cType, nLen, nDec ) + LOCAL xVal hb_default( @nLen, 0 ) @@ -1640,7 +1700,9 @@ STATIC FUNCTION EmptyValue( cType, nLen, nDec ) * * Decode a value from a list. *******************/ -STATIC FUNCTION HB_Decode(...) + +STATIC FUNCTION HB_Decode( ... ) + LOCAL aParams, nParams, xDefault LOCAL xVal, cKey, xRet LOCAL aValues, aResults, n, i, nPos, nLen @@ -1667,8 +1729,7 @@ STATIC FUNCTION HB_Decode(...) /* Ok because I have no other value than default, I will check if it is a complex value */ /* like an array or an hash, so I can get it to decode values */ IF xDefault != NIL .AND. ; - ( HB_ISARRAY( xDefault ) .OR. ; - HB_ISHASH( xDefault ) ) + ( HB_ISARRAY( xDefault ) .OR. HB_ISHASH( xDefault ) ) /* If it is an array I will restart this function creating a linear call */ IF HB_ISARRAY( xDefault ) .AND. Len( xDefault ) > 0 @@ -1713,8 +1774,8 @@ STATIC FUNCTION HB_Decode(...) ENDIF - /* If it is an hash, translate it in an array */ - ELSEIF HB_ISHASH( xDefault ) + ELSEIF HB_ISHASH( xDefault ) /* If it is an hash, translate it in an array */ + aParams := Array( Len( xDefault ) * 2 ) i := 1 @@ -1770,6 +1831,7 @@ STATIC FUNCTION HB_Decode(...) RETURN xRet STATIC FUNCTION DecEmptyValue( xVal ) + LOCAL xRet LOCAL cType := ValType( xVal ) @@ -1813,10 +1875,11 @@ STATIC FUNCTION DecEmptyValue( xVal ) RETURN xRet STATIC FUNCTION ModifyIndex( nIndex, xValue, aIndex, aWAData, xValorAnt ) + LOCAL nPos, aOCInfo, lFor, lDel HB_TRACE( HB_TR_DEBUG, hb_StrFormat( "nIndex = %1$d, xValue = %2$s, aIndex = %3$s, aWAData = %4$s, xValorAnt = %5$s", ; - nIndex, hb_ValToExp( xValue ), hb_ValToExp( aIndex ), hb_ValToExp( aWAData ), hb_ValToExp( xValorAnt ) ) ) + nIndex, hb_ValToExp( xValue ), hb_ValToExp( aIndex ), hb_ValToExp( aWAData ), hb_ValToExp( xValorAnt ) ) ) aOCInfo := aIndex[ INDEX_ORCR, UR_ORCR_CONDINFO ] lFor := ( aOCInfo[ UR_ORC_BFOR ] == NIL .OR. Eval( aOCInfo[ UR_ORC_BFOR ] ) ) @@ -1858,6 +1921,7 @@ STATIC FUNCTION ModifyIndex( nIndex, xValue, aIndex, aWAData, xValorAnt ) RETURN NIL STATIC FUNCTION Seek( xSeek, lSoft, lLast, aIndexInfo, nRec ) + LOCAL nPos, bFirst, bBefore, bAfter, bAjust LOCAL aIndex := aIndexInfo[ INDEX_RECORDS ] LOCAL nIni := 1 @@ -1882,7 +1946,7 @@ STATIC FUNCTION Seek( xSeek, lSoft, lLast, aIndexInfo, nRec ) bAjust := {|| !aIndex[ nPos, INDEXKEY_KEY ] <= xSeek } ELSE bFirst := {|| aIndex[ 2, INDEXKEY_KEY ] <= xSeek } - bBefore := {|| !aIndex[ nPos, INDEXKEY_KEY ] <= xSeek} + bBefore := {|| !aIndex[ nPos, INDEXKEY_KEY ] <= xSeek } bAfter := {|| xSeek > aIndex[ nPos, INDEXKEY_KEY ] } bAjust := {|| !aIndex[ nPos, INDEXKEY_KEY ] >= xSeek } ENDIF @@ -1942,6 +2006,7 @@ STATIC FUNCTION Seek( xSeek, lSoft, lLast, aIndexInfo, nRec ) RETURN nPos STATIC FUNCTION SeekScope( aIndex, aOrdInfo, lBottom ) + LOCAL nPos := Seek( aOrdInfo[ WAOI_SCOPE_0 ], .T., lBottom, aIndex ) IF nPos > 0 .AND. !aIndex[ INDEX_RECORDS, nPos, INDEXKEY_KEY ] == aOrdInfo[ WAOI_SCOPE_1 ] /* TOFIX: == comparison? */ diff --git a/harbour/src/rdd/usrrdd/rdds/dbtcdx.prg b/harbour/src/rdd/usrrdd/rdds/dbtcdx.prg index b5c31ef128..79a49dab34 100644 --- a/harbour/src/rdd/usrrdd/rdds/dbtcdx.prg +++ b/harbour/src/rdd/usrrdd/rdds/dbtcdx.prg @@ -68,10 +68,13 @@ REQUEST DBFFPT ANNOUNCE DBTCDX FUNCTION DBTCDX_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, pSuperRddID ) + RETURN USRRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, ; - "DBFCDX", {}, pSuperRddID ) /* We are inheriting from DBFCDX */ + "DBFCDX", {}, pSuperRddID ) /* We are inheriting from DBFCDX */ INIT PROCEDURE DBTCDX_INIT() + rddRegister( "DBTCDX", RDT_FULL ) rddInfo( RDDI_MEMOTYPE, DB_MEMO_DBT, "DBTCDX" ) + RETURN diff --git a/harbour/src/rdd/usrrdd/rdds/fptcdx.prg b/harbour/src/rdd/usrrdd/rdds/fptcdx.prg index 7b32ae199d..5005411b65 100644 --- a/harbour/src/rdd/usrrdd/rdds/fptcdx.prg +++ b/harbour/src/rdd/usrrdd/rdds/fptcdx.prg @@ -68,10 +68,13 @@ REQUEST DBFFPT ANNOUNCE FPTCDX FUNCTION FPTCDX_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, pSuperRddID ) + RETURN USRRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, ; - "DBFCDX", {}, pSuperRddID ) /* We are inheriting from DBFCDX */ + "DBFCDX", {}, pSuperRddID ) /* We are inheriting from DBFCDX */ INIT PROCEDURE FPTCDX_INIT() + rddRegister( "FPTCDX", RDT_FULL ) rddInfo( RDDI_MEMOTYPE, DB_MEMO_FPT, "FPTCDX" ) + RETURN diff --git a/harbour/src/rdd/usrrdd/rdds/hscdx.prg b/harbour/src/rdd/usrrdd/rdds/hscdx.prg index ce2138cb98..e8cef5a125 100644 --- a/harbour/src/rdd/usrrdd/rdds/hscdx.prg +++ b/harbour/src/rdd/usrrdd/rdds/hscdx.prg @@ -91,6 +91,7 @@ STATIC FUNCTION _HSX_CLOSE( nWA ) LOCAL aWData := USRRDD_AREADATA( nWA ), nHSX /* close all HSX indexes */ + FOR EACH nHSX IN aWData[ 2 ] hs_Close( nHSX ) NEXT @@ -120,7 +121,7 @@ STATIC FUNCTION _HSX_GOCOLD( nWA ) nKeyNo := hs_Add( nHSX, "" ) ENDDO IF nKeyNo >= nRecNo - hs_Replace( nHSX, , nRecNo ) + hs_Replace( nHSX,, nRecNo ) ENDIF NEXT ENDIF @@ -261,6 +262,7 @@ FUNCTION HSX_GET( nSlot ) RETURN -1 /* Force linking DBFCDX from which our RDD inherits */ + REQUEST DBFCDX /* diff --git a/harbour/src/rdd/usrrdd/rdds/logrdd.prg b/harbour/src/rdd/usrrdd/rdds/logrdd.prg index dbf5bffee3..4face55f45 100644 --- a/harbour/src/rdd/usrrdd/rdds/logrdd.prg +++ b/harbour/src/rdd/usrrdd/rdds/logrdd.prg @@ -54,8 +54,6 @@ * A simple RDD which introduce logging to file. It inheriths from * any existent RDD but if you write / replace / delete something * on tables it writes changes in a log file. - * An example is avalaible at - * harbour/src/rdd/usrrdd/example/exlog.prg */ #include "rddsys.ch" @@ -72,31 +70,36 @@ #define ARRAY_USERLOGBLOCK 7 ANNOUNCE LOGRDD -DYNAMIC HB_LOGRDDINHERIT /* To be defined at user level */ + +DYNAMIC HB_LOGRDDINHERIT /* To be defined at user level */ STATIC s_nRddID := -1 STATIC FUNCTION LOGRDD_INIT( nRDD ) + LOCAL lActive, cFileName, cTag, cRDDName /* Defaults */ + cFileName := "changes.log" lActive := .F. - cTag := NETNAME() + "\" + hb_USERNAME() + cTag := NetName() + "\" + hb_UserName() cRDDName := hb_LogRddInherit() /* Log File will be open later so user can change parameters */ /* Store data in RDD cargo */ - /* cFileName, nHandle, cTag, lActive, cRDDName, bMsgLogBlock, bUserLogBlock */ + /* cFileName, nHandle, cTag, lActive, cRDDName, bMsgLogBlock, bUserLogBlock */ USRRDD_RDDDATA( nRDD, { cFileName, NIL, cTag, lActive, cRDDName, NIL, NIL } ) RETURN HB_SUCCESS STATIC FUNCTION LOGRDD_EXIT( nRDD ) + LOCAL aRDDData := USRRDD_RDDDATA( nRDD ) /* Closing log file */ + IF aRDDData[ ARRAY_FHANDLE ] != NIL FClose( aRDDData[ ARRAY_FHANDLE ] ) aRDDData[ ARRAY_FHANDLE ] := NIL @@ -105,85 +108,119 @@ STATIC FUNCTION LOGRDD_EXIT( nRDD ) RETURN HB_SUCCESS // Create database from current WA fields definition + STATIC FUNCTION LOGRDD_CREATE( nWA, aOpenInfo ) + LOCAL nResult := UR_SUPER_CREATE( nWA, aOpenInfo ) + IF nResult == HB_SUCCESS ToLog( "CREATE", nWA, aOpenInfo ) ENDIF + RETURN nResult // Creating fields for new DBF - dbCreate() in current workarea + STATIC FUNCTION LOGRDD_CREATEFIELDS( nWA, aStruct ) + LOCAL nResult := UR_SUPER_CREATEFIELDS( nWA, aStruct ) + IF nResult == HB_SUCCESS ToLog( "CREATEFIELDS", nWA, aStruct ) ENDIF + RETURN nResult // Open workarea + STATIC FUNCTION LOGRDD_OPEN( nWA, aOpenInfo ) + LOCAL nResult := UR_SUPER_OPEN( nWA, aOpenInfo ) + IF nResult == HB_SUCCESS ToLog( "OPEN", nWA, aOpenInfo ) ENDIF + RETURN nResult // Close workarea + STATIC FUNCTION LOGRDD_CLOSE( nWA ) + LOCAL cFile := dbInfo( DBI_FULLPATH ) LOCAL cAlias := Alias() LOCAL nResult := UR_SUPER_CLOSE( nWA ) + IF nResult == HB_SUCCESS ToLog( "CLOSE", nWA, cFile, cAlias ) ENDIF + RETURN nResult STATIC FUNCTION LOGRDD_APPEND( nWA, lUnlockAll ) + LOCAL nResult := UR_SUPER_APPEND( nWA, lUnlockAll ) + IF nResult == HB_SUCCESS ToLog( "APPEND", nWA, lUnlockAll ) ENDIF + RETURN nResult STATIC FUNCTION LOGRDD_DELETE( nWA ) + LOCAL nResult := UR_SUPER_DELETE( nWA ) + IF nResult == HB_SUCCESS ToLog( "DELETE", nWA ) ENDIF + RETURN nResult STATIC FUNCTION LOGRDD_RECALL( nWA ) + LOCAL nResult := UR_SUPER_RECALL( nWA ) + IF nResult == HB_SUCCESS ToLog( "RECALL", nWA ) ENDIF + RETURN nResult STATIC FUNCTION LOGRDD_PUTVALUE( nWA, nField, xValue ) + LOCAL xOldValue := FieldGet( nField ) LOCAL nResult := UR_SUPER_PUTVALUE( nWA, nField, xValue ) - //Log Only Changes + // Log Only Changes + IF !( xOldValue == xValue ) ToLog( "PUTVALUE", nWA, nField, xValue, xOldValue ) ENDIF + RETURN nResult STATIC FUNCTION LOGRDD_ZAP( nWA ) + LOCAL nResult := UR_SUPER_ZAP( nWA ) + IF nResult == HB_SUCCESS ToLog( "ZAP", nWA ) ENDIF + RETURN nResult /* Force linking DBFCDX from which our RDD inherits */ + REQUEST DBFCDX /* * This function have to exist in all RDD and then name have to be in * format: _GETFUNCTABLE */ + FUNCTION LOGRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, pSuperRddID ) + LOCAL cSuperRDD := hb_LogRddInherit() /* We are inheriting from a User Defined RDD */ LOCAL aMyFunc[ UR_METHODCOUNT ] @@ -201,11 +238,13 @@ FUNCTION LOGRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, pSupe aMyFunc[ UR_PUTVALUE ] := ( @LOGRDD_PUTVALUE() ) aMyFunc[ UR_ZAP ] := ( @LOGRDD_ZAP() ) -RETURN USRRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, ; - cSuperRDD, aMyFunc, pSuperRddID ) + RETURN USRRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, ; + cSuperRDD, aMyFunc, pSuperRddID ) INIT PROCEDURE _LOGRDD_INIT() + rddRegister( "LOGRDD", RDT_FULL ) + RETURN /* -------------------------------------------------- */ @@ -213,6 +252,7 @@ INIT PROCEDURE _LOGRDD_INIT() /* -------------------------------------------------- */ FUNCTION hb_LogRddLogFileName( cFileName ) + LOCAL aRDDData LOCAL cOldFileName @@ -227,9 +267,11 @@ FUNCTION hb_LogRddLogFileName( cFileName ) ENDIF ENDIF + RETURN cOldFileName FUNCTION hb_LogRddTag( cTag ) + LOCAL aRDDData LOCAL cOldTag @@ -244,9 +286,11 @@ FUNCTION hb_LogRddTag( cTag ) ENDIF ENDIF + RETURN cOldTag FUNCTION hb_LogRddActive( lActive ) + LOCAL aRDDData LOCAL lOldActive @@ -261,9 +305,11 @@ FUNCTION hb_LogRddActive( lActive ) ENDIF ENDIF + RETURN lOldActive FUNCTION hb_LogRddMsgLogBlock( bMsgLogBlock ) + LOCAL aRDDData LOCAL bOldMsgLogBlock @@ -278,9 +324,11 @@ FUNCTION hb_LogRddMsgLogBlock( bMsgLogBlock ) ENDIF ENDIF + RETURN bOldMsgLogBlock FUNCTION hb_LogRddUserLogBlock( bUserLogBlock ) + LOCAL aRDDData LOCAL bOldUserLogBlock @@ -295,6 +343,7 @@ FUNCTION hb_LogRddUserLogBlock( bUserLogBlock ) ENDIF ENDIF + RETURN bOldUserLogBlock FUNCTION hb_LogRddValueToText( uValue ) @@ -307,7 +356,7 @@ FUNCTION hb_LogRddValueToText( uValue ) cText := hb_StrToExp( uValue ) CASE cType == "N" - cText := hb_NToS( uValue ) + cText := hb_ntos( uValue ) CASE cType == "D" cText := DToS( uValue ) @@ -324,12 +373,13 @@ FUNCTION hb_LogRddValueToText( uValue ) /* -------------------------------------------------- */ STATIC PROCEDURE OpenLogFile( nWA ) + LOCAL aRDDData := USRRDD_RDDDATA( USRRDD_ID( nWA ) ) LOCAL cFileName := aRDDData[ ARRAY_FILENAME ] LOCAL nHandle := aRDDData[ ARRAY_FHANDLE ] LOCAL lActive := aRDDData[ ARRAY_ACTIVE ] - //TraceLog( "nHandle " + cStr( nHandle ) ) + // TraceLog( "nHandle " + cStr( nHandle ) ) IF lActive .AND. nHandle == NIL @@ -354,49 +404,54 @@ STATIC PROCEDURE OpenLogFile( nWA ) aRDDData[ ARRAY_FHANDLE ] := nHandle ENDIF + RETURN STATIC FUNCTION ToString( cCmd, nWA, xPar1, xPar2, xPar3 ) + LOCAL cString DO CASE - CASE cCmd == "CREATE" - // Parameters received: xPar1 = aOpenInfo - cString := xPar1[ UR_OI_NAME ] - CASE cCmd == "CREATEFIELDS" - // Parameters received: xPar1 = aStruct - cString := hb_ValToExp( xPar1 ) - CASE cCmd == "OPEN" - // Parameters received: xPar1 = aOpenInfo - cString := 'Table : "' + xPar1[ UR_OI_NAME ] + '", Alias : "' + Alias() + '", WorkArea : ' + hb_ntos( nWA ) - CASE cCmd == "CLOSE" - // Parameters received: xPar1 = cTableName, xPar2 = cAlias - cString := 'Table : "' + xPar1 + '", Alias : "' + xPar2 + '", WorkArea : ' + hb_ntos( nWA ) - CASE cCmd == "APPEND" - // Parameters received: xPar1 = lUnlockAll - cString := Alias() + "->RecNo() = " + hb_ntos( RecNo() ) - CASE cCmd == "DELETE" - // Parameters received: none - cString := Alias() + "->RecNo() = " + hb_ntos( RecNo() ) - CASE cCmd == "RECALL" - // Parameters received: none - cString := Alias() + "->RecNo() = " + hb_ntos( RecNo() ) - CASE cCmd == "PUTVALUE" - // Parameters received: xPar1 = nField, xPar2 = xValue, xPar3 = xOldValue - HB_SYMBOL_UNUSED( xPar3 ) // Here don't log previous value - cString := Alias() + "(" + hb_ntos( RecNo() ) + ")->" + PadR( FieldName( xPar1 ), 10 ) + " := " + hb_LogRddValueToText( xPar2 ) - CASE cCmd == "ZAP" - // Parameters received: none - cString := 'Alias : "' + Alias() + ' Table : "' + dbInfo( DBI_FULLPATH ) + '"' + CASE cCmd == "CREATE" + // Parameters received: xPar1 = aOpenInfo + cString := xPar1[ UR_OI_NAME ] + CASE cCmd == "CREATEFIELDS" + // Parameters received: xPar1 = aStruct + cString := hb_ValToExp( xPar1 ) + CASE cCmd == "OPEN" + // Parameters received: xPar1 = aOpenInfo + cString := 'Table : "' + xPar1[ UR_OI_NAME ] + '", Alias : "' + Alias() + '", WorkArea : ' + hb_ntos( nWA ) + CASE cCmd == "CLOSE" + // Parameters received: xPar1 = cTableName, xPar2 = cAlias + cString := 'Table : "' + xPar1 + '", Alias : "' + xPar2 + '", WorkArea : ' + hb_ntos( nWA ) + CASE cCmd == "APPEND" + // Parameters received: xPar1 = lUnlockAll + cString := Alias() + "->RecNo() = " + hb_ntos( RecNo() ) + CASE cCmd == "DELETE" + // Parameters received: none + cString := Alias() + "->RecNo() = " + hb_ntos( RecNo() ) + CASE cCmd == "RECALL" + // Parameters received: none + cString := Alias() + "->RecNo() = " + hb_ntos( RecNo() ) + CASE cCmd == "PUTVALUE" + // Parameters received: xPar1 = nField, xPar2 = xValue, xPar3 = xOldValue + HB_SYMBOL_UNUSED( xPar3 ) // Here don't log previous value + cString := Alias() + "(" + hb_ntos( RecNo() ) + ")->" + PadR( FieldName( xPar1 ), 10 ) + " := " + hb_LogRddValueToText( xPar2 ) + CASE cCmd == "ZAP" + // Parameters received: none + cString := 'Alias : "' + Alias() + ' Table : "' + dbInfo( DBI_FULLPATH ) + '"' ENDCASE + RETURN cString STATIC PROCEDURE ToLog( cCmd, nWA, xPar1, xPar2, xPar3 ) + LOCAL aRDDData := USRRDD_RDDDATA( USRRDD_ID( nWA ) ) LOCAL lActive := aRDDData[ ARRAY_ACTIVE ] LOCAL nHandle, cTag, cRDDName, bMsgLogBlock, bUserLogBlock, cLog // Check if logging system is active + IF lActive cTag := aRDDData[ ARRAY_TAG ] @@ -438,4 +493,5 @@ STATIC PROCEDURE ToLog( cCmd, nWA, xPar1, xPar2, xPar3 ) ENDIF ENDIF + RETURN diff --git a/harbour/src/rdd/usrrdd/rdds/rlcdx.prg b/harbour/src/rdd/usrrdd/rdds/rlcdx.prg index 8aa859d49f..a4fbd68848 100644 --- a/harbour/src/rdd/usrrdd/rdds/rlcdx.prg +++ b/harbour/src/rdd/usrrdd/rdds/rlcdx.prg @@ -183,6 +183,7 @@ STATIC FUNCTION RLCDX_APPEND( nWA, lUnlockAll ) LOCAL aWData, nResult, xRecId, i /* Never unlock other records, they have to be explicitly unlocked */ + lUnlockAll := .F. nResult := UR_SUPER_APPEND( nWA, lUnlockAll ) @@ -196,7 +197,7 @@ STATIC FUNCTION RLCDX_APPEND( nWA, lUnlockAll ) IF ( i := AScan( aWData[ 2 ], {| x | x[ 1 ] == xRecID } ) ) != 0 ++aWData[ 2, i, 2 ] ELSE - AADD( aWData[ 2 ], { xRecID, 1 } ) + AAdd( aWData[ 2 ], { xRecID, 1 } ) ENDIF ENDIF ENDIF @@ -204,6 +205,7 @@ STATIC FUNCTION RLCDX_APPEND( nWA, lUnlockAll ) RETURN nResult /* Force linking DBFCDX from which our RDD inherits */ + REQUEST DBFCDX /* diff --git a/harbour/src/rdd/usrrdd/rdds/smtcdx.prg b/harbour/src/rdd/usrrdd/rdds/smtcdx.prg index e0ea23a651..8fdeb89bf8 100644 --- a/harbour/src/rdd/usrrdd/rdds/smtcdx.prg +++ b/harbour/src/rdd/usrrdd/rdds/smtcdx.prg @@ -68,10 +68,13 @@ REQUEST DBFFPT ANNOUNCE SMTCDX FUNCTION SMTCDX_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, pSuperRddID ) + RETURN USRRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, ; - "DBFCDX", {}, pSuperRddID ) /* We are inheriting from DBFCDX */ + "DBFCDX", {}, pSuperRddID ) /* We are inheriting from DBFCDX */ INIT PROCEDURE SMTCDX_INIT() + rddRegister( "SMTCDX", RDT_FULL ) rddInfo( RDDI_MEMOTYPE, DB_MEMO_SMT, "SMTCDX" ) + RETURN diff --git a/harbour/src/rdd/usrrdd/rdds/vfpcdx.prg b/harbour/src/rdd/usrrdd/rdds/vfpcdx.prg index 3371c6da0e..eb8793f992 100644 --- a/harbour/src/rdd/usrrdd/rdds/vfpcdx.prg +++ b/harbour/src/rdd/usrrdd/rdds/vfpcdx.prg @@ -61,7 +61,9 @@ REQUEST DBFFPT ANNOUNCE VFPCDX FUNCTION VFPCDX_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, pSuperRddID ) + /* We are inheriting from DBFCDX */ + RETURN USRRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, "DBFCDX", {}, pSuperRddID ) INIT PROCEDURE VFPCDX_INIT() diff --git a/harbour/src/rtl/achoice.prg b/harbour/src/rtl/achoice.prg index 3209b678b1..38d5f0d8f0 100644 --- a/harbour/src/rtl/achoice.prg +++ b/harbour/src/rtl/achoice.prg @@ -41,7 +41,8 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo LOCAL nAtTop // The number of the item at the top LOCAL nItems := 0 // The number of items LOCAL nGap // The number of lines between top and current lines - // Block used to search for items + + // Block used to search for items LOCAL lUserFunc // Is a user function to be used? LOCAL nUserFunc // Return value from user function LOCAL nSaveCsr @@ -234,7 +235,7 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo ELSE DispBegin() DispLine( acItems[ nPos ], nTop + ( nPos - nAtTop ), nLeft, Ach_Select( alSelect, nPos ), .F., nNumCols ) - hb_scroll( nTop, nLeft, nBottom, nRight, ( nNewPos - ( nAtTop + nNumRows - 1 ) ) ) + hb_Scroll( nTop, nLeft, nBottom, nRight, ( nNewPos - ( nAtTop + nNumRows - 1 ) ) ) nAtTop := nNewPos nPos := Max( nPos, nAtTop + nNumRows - 1 ) DO WHILE nPos > nNewPos @@ -274,7 +275,7 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo ELSE DispBegin() DispLine( acItems[ nPos ], nTop + ( nPos - nAtTop ), nLeft, Ach_Select( alSelect, nPos ), .F., nNumCols ) - hb_scroll( nTop, nLeft, nBottom, nRight, ( nNewPos - ( nAtTop + nNumRows - 1 ) ) ) + hb_Scroll( nTop, nLeft, nBottom, nRight, ( nNewPos - ( nAtTop + nNumRows - 1 ) ) ) nAtTop := nNewPos - nNumRows + 1 nPos := Max( nPos, nAtTop ) DO WHILE nPos < nNewPos @@ -620,7 +621,7 @@ STATIC PROCEDURE DispPage( acItems, alSelect, nTop, nLeft, nRight, nNumRows, nPo DispLine( acItems[ nIndex ], nRow, nLeft, Ach_Select( alSelect, nIndex ), nIndex == nPos, nRight - nLeft + 1 ) ELSE ColorSelect( CLR_STANDARD ) - hb_dispOutAt( nRow, nLeft, Space( nRight - nLeft + 1 ) ) + hb_DispOutAt( nRow, nLeft, Space( nRight - nLeft + 1 ) ) ENDIF NEXT @@ -631,9 +632,9 @@ STATIC PROCEDURE DispPage( acItems, alSelect, nTop, nLeft, nRight, nNumRows, nPo STATIC PROCEDURE DispLine( cLine, nRow, nCol, lSelect, lHiLite, nNumCols ) ColorSelect( iif( lSelect .AND. HB_ISSTRING( cLine ), ; - iif( lHiLite, CLR_ENHANCED, CLR_STANDARD ), CLR_UNSELECTED ) ) + iif( lHiLite, CLR_ENHANCED, CLR_STANDARD ), CLR_UNSELECTED ) ) - hb_dispOutAt( nRow, nCol, iif( HB_ISSTRING( cLine ), PadR( cLine, nNumCols ), Space( nNumCols ) ) ) + hb_DispOutAt( nRow, nCol, iif( HB_ISSTRING( cLine ), PadR( cLine, nNumCols ), Space( nNumCols ) ) ) IF lHiLite SetPos( nRow, nCol ) ENDIF @@ -674,7 +675,9 @@ STATIC FUNCTION Ach_Limits( nFrstItem, nLastItem, nItems, alSelect, acItems ) RETURN nMode STATIC FUNCTION Ach_Select( alSelect, nPos ) + LOCAL sel + IF nPos >= 1 .AND. nPos <= Len( alSelect ) sel := alSelect[ nPos ] IF HB_ISSTRING( sel ) .AND. !Empty( sel ) @@ -684,4 +687,5 @@ STATIC FUNCTION Ach_Select( alSelect, nPos ) RETURN sel ENDIF ENDIF + RETURN .T. diff --git a/harbour/src/rtl/alert.prg b/harbour/src/rtl/alert.prg index 6b3bdfac58..b396b104c7 100644 --- a/harbour/src/rtl/alert.prg +++ b/harbour/src/rtl/alert.prg @@ -41,6 +41,7 @@ STATIC s_lNoAlert #endif FUNCTION Alert( cMessage, aOptions, cColorNorm ) + LOCAL cColorHigh LOCAL aOptionsOK LOCAL cOption @@ -71,8 +72,8 @@ FUNCTION Alert( cMessage, aOptions, cColorNorm ) cColorNorm := "W+/R" // first pair color (Box line and Text) cColorHigh := "W+/B" // second pair color (Options buttons) ELSE - cColorHigh := StrTran( StrTran( iif( At( "/", cColorNorm ) == 0, "N", SubStr( cColorNorm, At( "/", cColorNorm ) + 1 ) ) + "/" +; - iif( At( "/", cColorNorm ) == 0, cColorNorm, Left( cColorNorm, At( "/", cColorNorm ) - 1 ) ), "+", "" ), "*", "" ) + cColorHigh := StrTran( StrTran( iif( At( "/", cColorNorm ) == 0, "N", SubStr( cColorNorm, At( "/", cColorNorm ) + 1 ) ) + "/" + ; + iif( At( "/", cColorNorm ) == 0, cColorNorm, Left( cColorNorm, At( "/", cColorNorm ) - 1 ) ), "+", "" ), "*", "" ) ENDIF aOptionsOK := {} @@ -85,8 +86,7 @@ FUNCTION Alert( cMessage, aOptions, cColorNorm ) IF Len( aOptionsOK ) == 0 aOptionsOK := { "Ok" } #ifdef HB_CLP_STRICT - /* NOTE: Clipper allows only four options [vszakats] */ - ELSEIF Len( aOptionsOK ) > 4 + ELSEIF Len( aOptionsOK ) > 4 /* NOTE: Clipper allows only four options [vszakats] */ ASize( aOptionsOK, 4 ) #endif ENDIF @@ -97,6 +97,7 @@ FUNCTION Alert( cMessage, aOptions, cColorNorm ) /* NOTE: nDelay parameter is a Harbour extension over Alert(). */ FUNCTION hb_Alert( xMessage, aOptions, cColorNorm, nDelay ) + LOCAL cMessage LOCAL cColorHigh LOCAL aOptionsOK @@ -138,8 +139,8 @@ FUNCTION hb_Alert( xMessage, aOptions, cColorNorm, nDelay ) cColorNorm := "W+/R" // first pair color (Box line and Text) cColorHigh := "W+/B" // second pair color (Options buttons) ELSE - cColorHigh := StrTran( StrTran( iif( At( "/", cColorNorm ) == 0, "N", SubStr( cColorNorm, At( "/", cColorNorm ) + 1 ) ) + "/" +; - iif( At( "/", cColorNorm ) == 0, cColorNorm, Left( cColorNorm, At( "/", cColorNorm ) - 1 ) ), "+", "" ), "*", "" ) + cColorHigh := StrTran( StrTran( iif( At( "/", cColorNorm ) == 0, "N", SubStr( cColorNorm, At( "/", cColorNorm ) + 1 ) ) + "/" + ; + iif( At( "/", cColorNorm ) == 0, cColorNorm, Left( cColorNorm, At( "/", cColorNorm ) - 1 ) ), "+", "" ), "*", "" ) ENDIF aOptionsOK := {} @@ -152,8 +153,7 @@ FUNCTION hb_Alert( xMessage, aOptions, cColorNorm, nDelay ) IF Len( aOptionsOK ) == 0 aOptionsOK := { "Ok" } #ifdef HB_CLP_STRICT - /* NOTE: Clipper allows only four options [vszakats] */ - ELSEIF Len( aOptionsOK ) > 4 + ELSEIF Len( aOptionsOK ) > 4 /* NOTE: Clipper allows only four options [vszakats] */ ASize( aOptionsOK, 4 ) #endif ENDIF @@ -162,7 +162,7 @@ FUNCTION hb_Alert( xMessage, aOptions, cColorNorm, nDelay ) #ifdef HB_CLP_UNDOC -PROCEDURE __NONOALERT() +PROCEDURE __NoNoAlert() s_lNoAlert := .F. diff --git a/harbour/src/rtl/altd.prg b/harbour/src/rtl/altd.prg index f3ac6a923e..d22f60d2e3 100644 --- a/harbour/src/rtl/altd.prg +++ b/harbour/src/rtl/altd.prg @@ -66,7 +66,7 @@ PROCEDURE AltD( nAction ) where ALTD() was called can have no debugger info - stop on first LINE with debugged info */ - __dbgINVOKEDEBUG( Set( _SET_DEBUG ) ) + __dbgInvokeDebug( Set( _SET_DEBUG ) ) ELSEIF HB_ISNUMERIC( nAction ) diff --git a/harbour/src/rtl/browse.prg b/harbour/src/rtl/browse.prg index 986edfc7dc..2d470958d1 100644 --- a/harbour/src/rtl/browse.prg +++ b/harbour/src/rtl/browse.prg @@ -80,21 +80,21 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) nOldCursor := SetCursor( SC_NONE ) cOldScreen := SaveScreen( nTop, nLeft, nBottom, nRight ) - hb_dispBox( nTop, nLeft, nBottom, nRight, HB_B_DOUBLE_SINGLE_UNI ) - hb_dispOutAtBox( nTop + 3, nLeft, hb_UTF8ToStrBox( "╞" ) ) - hb_dispOutAtBox( nTop + 3, nRight, hb_UTF8ToStrBox( "╡" ) ) - hb_dispOutAt( nTop + 1, nLeft + 1, Space( nRight - nLeft - 1 ) ) + hb_DispBox( nTop, nLeft, nBottom, nRight, HB_B_DOUBLE_SINGLE_UNI ) + hb_DispOutAtBox( nTop + 3, nLeft, hb_UTF8ToStrBox( "╞" ) ) + hb_DispOutAtBox( nTop + 3, nRight, hb_UTF8ToStrBox( "╡" ) ) + hb_DispOutAt( nTop + 1, nLeft + 1, Space( nRight - nLeft - 1 ) ) oBrw := TBrowseDB( nTop + 2, nLeft + 1, nBottom - 1, nRight - 1 ) oBrw:HeadSep := " " + hb_UTF8ToStrBox( "â•" ) oBrw:SkipBlock := {| nRecs | Skipped( nRecs, lAppend ) } - FOR n := 1 to FCount() + FOR n := 1 TO FCount() oBrw:AddColumn( TBColumnNew( FieldName( n ), FieldBlock( FieldName( n ) ) ) ) NEXT IF Eof() - DbGoTop() + dbGoTop() ENDIF oBrw:ForceStable() @@ -128,7 +128,7 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) oBrw:Down() oBrw:ForceStable() oBrw:ColorRect( { oBrw:RowPos, 1, oBrw:RowPos, oBrw:ColCount }, ; - { 2, 2 } ) + { 2, 2 } ) ENDIF StatLine( oBrw, lAppend ) @@ -149,7 +149,7 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) #ifdef HB_COMPAT_C53 CASE K_LBUTTONDOWN CASE K_LDBLCLK - TBMOUSE( oBrw, MRow(), MCol() ) + TBMouse( oBrw, MRow(), MCol() ) EXIT #endif #ifndef HB_CLP_STRICT @@ -241,16 +241,16 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) CASE K_INS IF lAppend SetCursor( iif( ReadInsert( ! ReadInsert() ), ; - SC_NORMAL, SC_INSERT ) ) + SC_NORMAL, SC_INSERT ) ) ENDIF EXIT CASE K_DEL IF RecNo() != LastRec() + 1 IF Deleted() - DbRecall() + dbRecall() ELSE - DbDelete() + dbDelete() ENDIF ENDIF EXIT @@ -297,18 +297,18 @@ STATIC PROCEDURE StatLine( oBrw, lAppend ) LOCAL nRecNo := RecNo() LOCAL nLastRec := LastRec() - hb_dispOutAt( nTop, nRight - 27, "Record " ) + hb_DispOutAt( nTop, nRight - 27, "Record " ) IF nLastRec == 0 .AND. ! lAppend - hb_dispOutAt( nTop, nRight - 20, " " ) + hb_DispOutAt( nTop, nRight - 20, " " ) ELSEIF nRecNo == nLastRec + 1 - hb_dispOutAt( nTop, nRight - 40, " " ) - hb_dispOutAt( nTop, nRight - 20, " " ) + hb_DispOutAt( nTop, nRight - 40, " " ) + hb_DispOutAt( nTop, nRight - 20, " " ) ELSE - hb_dispOutAt( nTop, nRight - 40, iif( Deleted(), "", " " ) ) - hb_dispOutAt( nTop, nRight - 20, PadR( hb_ntos( nRecNo ) + "/" + ; - hb_ntos( nLastRec ), 16 ) + ; - iif( oBrw:HitTop, "", " " ) ) + hb_DispOutAt( nTop, nRight - 40, iif( Deleted(), "", " " ) ) + hb_DispOutAt( nTop, nRight - 20, PadR( hb_ntos( nRecNo ) + "/" + ; + hb_ntos( nLastRec ), 16 ) + ; + iif( oBrw:HitTop, "", " " ) ) ENDIF RETURN @@ -327,17 +327,17 @@ STATIC FUNCTION DoGet( oBrw, lAppend ) lScore := Set( _SET_SCOREBOARD, .F. ) lExit := Set( _SET_EXIT, .T. ) bIns := SetKey( K_INS, {|| SetCursor( iif( ReadInsert( ! ReadInsert() ), ; - SC_NORMAL, SC_INSERT ) ) } ) + SC_NORMAL, SC_INSERT ) ) } ) nCursor := SetCursor( iif( ReadInsert(), SC_INSERT, SC_NORMAL ) ) - IF !Empty( cIndexKey := IndexKey( 0 ) ) + IF ! Empty( cIndexKey := IndexKey( 0 ) ) xKeyValue := &cIndexKey ENDIF oCol := oBrw:GetColumn( oBrw:ColPos ) xValue := Eval( oCol:Block ) oGet := GetNew( Row(), Col(), ; - {| xNewVal | iif( PCount() == 0, xValue, xValue := xNewVal ) }, ; - "mGetVar", NIL, oBrw:ColorSpec ) + {| xNewVal | iif( PCount() == 0, xValue, xValue := xNewVal ) }, ; + "mGetVar", NIL, oBrw:ColorSpec ) lSuccess := .F. IF ReadModal( { oGet } ) IF lAppend .AND. RecNo() == LastRec() + 1 @@ -345,11 +345,11 @@ STATIC FUNCTION DoGet( oBrw, lAppend ) ENDIF Eval( oCol:Block, xValue ) - IF !lAppend .AND. !Empty( cForExp := OrdFor( IndexOrd() ) ) .AND. ; + IF ! lAppend .AND. ! Empty( cForExp := ordFor( IndexOrd() ) ) .AND. ; ! &cForExp dbGoTop() ENDIF - IF !lAppend .AND. !Empty( cIndexKey ) .AND. ! xKeyValue == &cIndexKey + IF ! lAppend .AND. ! Empty( cIndexKey ) .AND. ! xKeyValue == &cIndexKey lSuccess := .T. ENDIF ENDIF @@ -364,7 +364,7 @@ STATIC FUNCTION DoGet( oBrw, lAppend ) IF lAppend oBrw:ColorRect( { oBrw:RowPos, 1, oBrw:RowPos, oBrw:ColCount }, ; - { 2, 2 } ) + { 2, 2 } ) ENDIF SetCursor( nCursor ) @@ -392,7 +392,7 @@ STATIC FUNCTION ExitKey( lAppend ) OTHERWISE nKey := iif( nKey == K_ENTER .OR. ; - !( hb_keyChar( nKey ) == "" ), K_RIGHT, 0 ) + !( hb_keyChar( nKey ) == "" ), K_RIGHT, 0 ) ENDSWITCH RETURN nKey @@ -405,7 +405,7 @@ STATIC PROCEDURE FreshOrder( oBrw ) oBrw:ForceStable() IF nRec != LastRec() + 1 - DO WHILE RecNo() != nRec .AND. !BOF() + DO WHILE RecNo() != nRec .AND. !Bof() oBrw:Up() oBrw:ForceStable() ENDDO diff --git a/harbour/src/rtl/cdpapi.c b/harbour/src/rtl/cdpapi.c index 575eee3942..9ef198bcb5 100644 --- a/harbour/src/rtl/cdpapi.c +++ b/harbour/src/rtl/cdpapi.c @@ -58,8 +58,8 @@ /* MT macros */ -#define HB_CDP_LOCK hb_threadEnterCriticalSection( &s_cdpMtx ); -#define HB_CDP_UNLOCK hb_threadLeaveCriticalSection( &s_cdpMtx ); +#define HB_CDP_LOCK() hb_threadEnterCriticalSection( &s_cdpMtx ) +#define HB_CDP_UNLOCK() hb_threadLeaveCriticalSection( &s_cdpMtx ) static HB_CRITICAL_NEW( s_cdpMtx ); @@ -158,7 +158,7 @@ void hb_cdpBuildTransTable( PHB_UNITABLE uniTable ) HB_WCHAR wcMax = 0; int i; - HB_CDP_LOCK + HB_CDP_LOCK(); if( uniTable->uniTrans == NULL ) { HB_UCHAR * uniTrans; @@ -181,7 +181,7 @@ void hb_cdpBuildTransTable( PHB_UNITABLE uniTable ) uniTable->wcMax = wcMax; uniTable->uniTrans = uniTrans; } - HB_CDP_UNLOCK + HB_CDP_UNLOCK(); } /* diff --git a/harbour/src/rtl/cdpdet.prg b/harbour/src/rtl/cdpdet.prg index 1678dcd676..8a526dce1c 100644 --- a/harbour/src/rtl/cdpdet.prg +++ b/harbour/src/rtl/cdpdet.prg @@ -53,28 +53,30 @@ #include "hbextcdp.ch" FUNCTION hb_cdpTerm() + LOCAL cCP LOCAL cLang - #if defined( __PLATFORM__WINDOWS ) - cCP := __CPWinToCPStd( __wapi_GetOEMCP() ) - cLang := hb_UserLang() - #elif defined( __PLATFORM__UNIX ) - IF ! Empty( GetEnv( "LANG" ) ) - __UnixParseLangCP( GetEnv( "LANG" ), @cCP, @cLang ) - ELSE - __UnixParseLangCP( GetEnv( "LC_CTYPE" ), @cCP, @cLang ) - ENDIF - cCP := __CPUnixToCPStd( cCP ) - #elif defined( __PLATFORM__DOS ) - /* TODO */ - cCP := NIL - cLang := NIL - #elif defined( __PLATFORM__OS2 ) - /* TODO */ - cCP := NIL - cLang := NIL - #endif +#if defined( __PLATFORM__WINDOWS ) + + cCP := __CPWinToCPStd( __wapi_GetOEMCP() ) + cLang := hb_UserLang() +#elif defined( __PLATFORM__UNIX ) + IF ! Empty( GetEnv( "LANG" ) ) + __UnixParseLangCP( GetEnv( "LANG" ), @cCP, @cLang ) + ELSE + __UnixParseLangCP( GetEnv( "LC_CTYPE" ), @cCP, @cLang ) + ENDIF + cCP := __CPUnixToCPStd( cCP ) +#elif defined( __PLATFORM__DOS ) + /* TODO */ + cCP := NIL + cLang := NIL +#elif defined( __PLATFORM__OS2 ) + /* TODO */ + cCP := NIL + cLang := NIL +#endif IF ! Empty( cCP := __CPStdToHarbour( cCP, cLang ) ) RETURN cCP @@ -83,28 +85,30 @@ FUNCTION hb_cdpTerm() RETURN NIL FUNCTION hb_cdpOS() + LOCAL cCP LOCAL cLang - #if defined( __PLATFORM__WINDOWS ) - cCP := __CPWinToCPStd( __wapi_GetACP() ) - cLang := hb_UserLang() - #elif defined( __PLATFORM__UNIX ) - IF ! Empty( GetEnv( "LANG" ) ) - __UnixParseLangCP( GetEnv( "LANG" ), @cCP, @cLang ) - ELSE - __UnixParseLangCP( GetEnv( "LC_CTYPE" ), @cCP, @cLang ) - ENDIF - cCP := __CPUnixToCPStd( cCP ) - #elif defined( __PLATFORM__DOS ) - /* TODO */ - cCP := NIL - cLang := NIL - #elif defined( __PLATFORM__OS2 ) - /* TODO */ - cCP := NIL - cLang := NIL - #endif +#if defined( __PLATFORM__WINDOWS ) + + cCP := __CPWinToCPStd( __wapi_GetACP() ) + cLang := hb_UserLang() +#elif defined( __PLATFORM__UNIX ) + IF ! Empty( GetEnv( "LANG" ) ) + __UnixParseLangCP( GetEnv( "LANG" ), @cCP, @cLang ) + ELSE + __UnixParseLangCP( GetEnv( "LC_CTYPE" ), @cCP, @cLang ) + ENDIF + cCP := __CPUnixToCPStd( cCP ) +#elif defined( __PLATFORM__DOS ) + /* TODO */ + cCP := NIL + cLang := NIL +#elif defined( __PLATFORM__OS2 ) + /* TODO */ + cCP := NIL + cLang := NIL +#endif IF ! Empty( cCP := __CPStdToHarbour( cCP, cLang ) ) RETURN cCP @@ -153,6 +157,7 @@ STATIC FUNCTION __CPWinToCPStd( nCPWin ) /* [language[_territory][.codeset][@modifier]] */ /* TODO: handle "C"/"POSIX" values and values starting with "/" */ STATIC FUNCTION __UnixParseLangCP( cString, /* @ */ cCP, /* @ */ cLang ) + LOCAL tmp IF ( tmp := At( ".", cString ) ) > 0 @@ -218,6 +223,7 @@ STATIC FUNCTION __CPUnixToCPStd( cCPUnix ) #endif STATIC FUNCTION __CPStdToHarbour( cCPStd, cCtryStd ) + LOCAL cCP LOCAL cCtryHb LOCAL cdp @@ -252,6 +258,7 @@ STATIC FUNCTION __CPStdToHarbour( cCPStd, cCtryStd ) RETURN cCP STATIC FUNCTION __CtryStdToCtry( cCtryStd ) + LOCAL cCtryHb := Left( hb_cdpSelect(), 2 ) IF HB_ISSTRING( cCtryStd ) diff --git a/harbour/src/rtl/checkbox.prg b/harbour/src/rtl/checkbox.prg index 783e42bf6d..50d806c3ee 100644 --- a/harbour/src/rtl/checkbox.prg +++ b/harbour/src/rtl/checkbox.prg @@ -195,12 +195,12 @@ METHOD display() CLASS CHECKBOX DispBegin() - hb_dispOutAt( ::nRow, ::nCol + 1, iif( ::lBuffer, SubStr( cStyle, 2, 1 ), SubStr( cStyle, 3, 1 ) ),; - hb_ColorIndex( ::cColorSpec, iif( ::lHasFocus, 1, 0 ) ) ) + hb_DispOutAt( ::nRow, ::nCol + 1, iif( ::lBuffer, SubStr( cStyle, 2, 1 ), SubStr( cStyle, 3, 1 ) ), ; + hb_ColorIndex( ::cColorSpec, iif( ::lHasFocus, 1, 0 ) ) ) cColor := hb_ColorIndex( ::cColorSpec, 2 ) - hb_dispOutAt( ::nRow, ::nCol, Left( cStyle, 1 ), cColor ) - hb_dispOutAt( ::nRow, ::nCol + 2, Right( cStyle, 1 ), cColor ) + hb_DispOutAt( ::nRow, ::nCol, Left( cStyle, 1 ), cColor ) + hb_DispOutAt( ::nRow, ::nCol + 2, Right( cStyle, 1 ), cColor ) IF !Empty( cCaption := ::cCaption ) @@ -215,11 +215,11 @@ METHOD display() CLASS CHECKBOX cColor := hb_ColorIndex( ::cColorSpec, 3 ) ENDIF - hb_dispOutAt( ::nCapRow, ::nCapCol, cCaption, cColor ) + hb_DispOutAt( ::nCapRow, ::nCapCol, cCaption, cColor ) IF !::lHasFocus .AND. nPos != 0 - hb_dispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cCaption, nPos, 1 ), ; - hb_ColorIndex( ::cColorSpec, 3 ) ) + hb_DispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cCaption, nPos, 1 ), ; + hb_ColorIndex( ::cColorSpec, 3 ) ) ENDIF ENDIF @@ -274,7 +274,7 @@ METHOD col( nCol ) CLASS CHECKBOX METHOD colorSpec( cColorSpec ) CLASS CHECKBOX IF cColorSpec != NIL - ::cColorSpec := __eInstVar53( Self, "COLORSPEC", cColorSpec, "C", 1001,; + ::cColorSpec := __eInstVar53( Self, "COLORSPEC", cColorSpec, "C", 1001, ; {|| !Empty( hb_ColorIndex( cColorSpec, 3 ) ) .AND. Empty( hb_ColorIndex( cColorSpec, 4 ) ) } ) ENDIF @@ -342,15 +342,17 @@ METHOD New( nRow, nCol, cCaption ) CLASS CHECKBOX ::cColorSpec := "W/N,W+/N,W/N,W+/N" ELSE cColor := SetColor() - ::cColorSpec := hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," +; - hb_ColorIndex( cColor, CLR_ENHANCED ) + "," +; - hb_ColorIndex( cColor, CLR_STANDARD ) + "," +; - hb_ColorIndex( cColor, CLR_BACKGROUND ) + ::cColorSpec := ; + hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," + ; + hb_ColorIndex( cColor, CLR_ENHANCED ) + "," + ; + hb_ColorIndex( cColor, CLR_STANDARD ) + "," + ; + hb_ColorIndex( cColor, CLR_BACKGROUND ) ENDIF RETURN Self FUNCTION _CHECKBOX_( lState, cCaption, cMessage, cColorSpec, bFBlock, bSBlock, cStyle, aBitmaps ) + LOCAL o := HBCheckBox():New( Row(), Col(), cCaption ) o:select( lState ) diff --git a/harbour/src/rtl/color53.prg b/harbour/src/rtl/color53.prg index 68e595b4a5..bd52835829 100644 --- a/harbour/src/rtl/color53.prg +++ b/harbour/src/rtl/color53.prg @@ -53,6 +53,7 @@ #ifdef HB_COMPAT_C53 FUNCTION GetClrPair( cColor, nColor ) + LOCAL nPos IF ( nPos := GetPairPos( cColor, nColor ) ) == 0 @@ -62,6 +63,7 @@ FUNCTION GetClrPair( cColor, nColor ) RETURN SubStr( cColor, nPos, GetPairLen( cColor, nColor ) ) FUNCTION SetClrPair( cColor, nColor, cNewColor ) + LOCAL nPos IF ( nPos := GetPairPos( cColor, nColor ) ) == 0 @@ -71,6 +73,7 @@ FUNCTION SetClrPair( cColor, nColor, cNewColor ) RETURN Stuff( cColor, nPos, GetPairLen( cColor, nColor ), cNewColor ) FUNCTION GetPairPos( cColor, nColor ) + LOCAL nPos := 1 LOCAL nSep LOCAL n @@ -85,6 +88,7 @@ FUNCTION GetPairPos( cColor, nColor ) RETURN nPos FUNCTION GetPairLen( cColor, nColor ) + LOCAL nPos := GetPairPos( cColor, nColor ) LOCAL nLen @@ -97,6 +101,7 @@ FUNCTION GetPairLen( cColor, nColor ) RETURN iif( nLen == 0, Len( cColor ) - nPos + 1, nLen - 1 ) FUNCTION GetClrFore( cColor ) + LOCAL nPos IF ( nPos := At( "/", cColor ) ) == 0 @@ -106,6 +111,7 @@ FUNCTION GetClrFore( cColor ) RETURN SubStr( cColor, 1, nPos - 1 ) FUNCTION GetClrBack( cColor ) + LOCAL nPos IF ( nPos := At( "/", cColor ) ) == 0 @@ -114,39 +120,39 @@ FUNCTION GetClrBack( cColor ) RETURN SubStr( cColor, nPos + 1 ) -FUNCTION RADGRDefCo( cColor ) - RETURN iif( IsDefColor(),; - ApplyDefau( cColor, "W/N", "W/N", "W+/N" ),; +FUNCTION RadGrDefCo( cColor ) + RETURN iif( IsDefColor(), ; + ApplyDefau( cColor, "W/N", "W/N", "W+/N" ), ; ApplyDefau( cColor, 3, 1, 4 ) ) -FUNCTION RADITDefCo( cColor ) - RETURN iif( IsDefColor(),; - ApplyDefau( cColor, "W/N", "W+/N", "W+/N", "N/W", "W/N", "W/N", "W+/N" ),; +FUNCTION RadItDefCo( cColor ) + RETURN iif( IsDefColor(), ; + ApplyDefau( cColor, "W/N", "W+/N", "W+/N", "N/W", "W/N", "W/N", "W+/N" ), ; ApplyDefau( cColor, 5, 5, 2, 2, 1, 1, 4 ) ) -FUNCTION LISTBDefCo( cColor ) - RETURN iif( IsDefColor(),; - ApplyDefau( cColor, "W/N", "W+/N", "W+/N", "N/W", "W/N", "W/N", "W+/N" ),; +FUNCTION ListBDefCo( cColor ) + RETURN iif( IsDefColor(), ; + ApplyDefau( cColor, "W/N", "W+/N", "W+/N", "N/W", "W/N", "W/N", "W+/N" ), ; ApplyDefau( cColor, 5, 5, 5, 2, 3, 1, 4 ) ) -FUNCTION COMBODefCo( cColor ) - RETURN iif( IsDefColor(),; - ApplyDefau( cColor, "W/N", "W+/N", "W+/N", "N/W", "W/N", "W/N", "W+/N", "W/N" ),; +FUNCTION ComboDefCo( cColor ) + RETURN iif( IsDefColor(), ; + ApplyDefau( cColor, "W/N", "W+/N", "W+/N", "N/W", "W/N", "W/N", "W+/N", "W/N" ), ; ApplyDefau( cColor, 5, 5, 5, 2, 3, 1, 4, 1 ) ) -FUNCTION CHECKDefCo( cColor ) - RETURN iif( IsDefColor(),; - ApplyDefau( cColor, "W/N", "W+/N", "W/N", "W+/N" ),; +FUNCTION CheckDefCo( cColor ) + RETURN iif( IsDefColor(), ; + ApplyDefau( cColor, "W/N", "W+/N", "W/N", "W+/N" ), ; ApplyDefau( cColor, 5, 2, 1, 4 ) ) -FUNCTION BUTTNDefCo( cColor ) - RETURN iif( IsDefColor(),; - ApplyDefau( cColor, "W/N", "N/W", "W+/N", "W+/N" ),; +FUNCTION ButtnDefCo( cColor ) + RETURN iif( IsDefColor(), ; + ApplyDefau( cColor, "W/N", "N/W", "W+/N", "W+/N" ), ; ApplyDefau( cColor, 5, 2, 1, 4 ) ) -FUNCTION MENUDefCol( cColor ) - RETURN iif( IsDefColor(),; - ApplyDefau( cColor, "N/W", "W/N", "W+/W", "W+/N", "N+/W", "W/N" ),; +FUNCTION MenuDefCol( cColor ) + RETURN iif( IsDefColor(), ; + ApplyDefau( cColor, "N/W", "W/N", "W+/W", "W+/N", "N+/W", "W/N" ), ; ApplyDefau( cColor, 5, 2, 4, 2, 1, 3 ) ) FUNCTION ApplyDefau( cColor, xClr1, xClr2, xClr3, xClr4, xClr5, xClr6, xClr7, xClr8 ) @@ -170,21 +176,21 @@ FUNCTION ApplyDefau( cColor, xClr1, xClr2, xClr3, xClr4, xClr5, xClr6, xClr7, xC cSetColor := SetColor() - aSetColor := {; - GetClrPair( cSetColor, 1 ) ,; - GetClrPair( cSetColor, 2 ) ,; - GetClrPair( cSetColor, 3 ) ,; - GetClrPair( cSetColor, 4 ) ,; + aSetColor := { ; + GetClrPair( cSetColor, 1 ), ; + GetClrPair( cSetColor, 2 ), ; + GetClrPair( cSetColor, 3 ), ; + GetClrPair( cSetColor, 4 ), ; GetClrPair( cSetColor, 5 ) } - aNewColor := {; - xClr1 ,; - xClr2 ,; - xClr3 ,; - xClr4 ,; - xClr5 ,; - xClr6 ,; - xClr7 ,; + aNewColor := { ; + xClr1, ; + xClr2, ; + xClr3, ; + xClr4, ; + xClr5, ; + xClr6, ; + xClr7, ; xClr8 } nColors := PCount() - 1 diff --git a/harbour/src/rtl/dbedit.prg b/harbour/src/rtl/dbedit.prg index 322dfde007..260a08422a 100644 --- a/harbour/src/rtl/dbedit.prg +++ b/harbour/src/rtl/dbedit.prg @@ -63,11 +63,11 @@ /* NOTE: Harbour is multithreading ready and Clipper only reentrant safe [vszakats] */ -FUNCTION DBEDIT( nTop, nLeft, nBottom, nRight, ; - acColumns, xUserFunc, ; - xColumnSayPictures, xColumnHeaders, ; - xHeadingSeparators, xColumnSeparators, ; - xFootingSeparators, xColumnFootings ) +FUNCTION dbEdit( nTop, nLeft, nBottom, nRight, ; + acColumns, xUserFunc, ; + xColumnSayPictures, xColumnHeaders, ; + xHeadingSeparators, xColumnSeparators, ; + xFootingSeparators, xColumnFootings ) LOCAL nOldCUrsor, nKey, lContinue, nPos, nAliasPos, nColCount LOCAL lDoIdleCall, lAppend, lFlag @@ -79,7 +79,7 @@ FUNCTION DBEDIT( nTop, nLeft, nBottom, nRight, ; IF !Used() RETURN .F. - ELSEIF EOF() + ELSEIF Eof() dbGoBottom() ENDIF @@ -96,7 +96,7 @@ FUNCTION DBEDIT( nTop, nLeft, nBottom, nRight, ; nRight := MaxCol() ENDIF - oBrowse := TBrowseDb( nTop, nLeft, nBottom, nRight ) + oBrowse := TBrowseDB( nTop, nLeft, nBottom, nRight ) oBrowse:headSep := iif( HB_ISSTRING( xHeadingSeparators ), xHeadingSeparators, hb_UTF8ToStrBox( "â•╤â•" ) ) oBrowse:colSep := iif( HB_ISSTRING( xColumnSeparators ), xColumnSeparators, hb_UTF8ToStrBox( " │ " ) ) oBrowse:footSep := iif( HB_ISSTRING( xFootingSeparators ), xFootingSeparators, "" ) @@ -128,7 +128,7 @@ FUNCTION DBEDIT( nTop, nLeft, nBottom, nRight, ; cBlock := acColumns[ nPos ] IF ( nAliasPos := At( "->", cBlock ) ) > 0 cHeading := SubStr( cBlock, 1, nAliasPos - 1 ) + "->;" + ; - SubStr( cBlock, nAliasPos + 2 ) + SubStr( cBlock, nAliasPos + 2 ) ELSE cHeading := cBlock ENDIF @@ -200,14 +200,16 @@ FUNCTION DBEDIT( nTop, nLeft, nBottom, nRight, ; DO WHILE lContinue DO WHILE ! oBrowse:stabilize() - nKey := Nextkey() + nKey := NextKey() #ifdef HB_COMPAT_C53 IF nKey != 0 .AND. nKey != K_MOUSEMOVE -#else - IF nKey != 0 -#endif EXIT ENDIF +#else + IF nKey != 0 + EXIT + ENDIF +#endif ENDDO IF ( nKey := Inkey() ) == 0 @@ -294,10 +296,11 @@ STATIC FUNCTION CallUser( oBrowse, xUserFunc, nKey, lAppend, lFlag ) LOCAL nPrevRecNo LOCAL nAction - LOCAL nMode := iif( nKey != 0, DE_EXCEPT, ; - iif( !lAppend .AND. IsDbEmpty(), DE_EMPTY, ; - iif( oBrowse:hitBottom, DE_HITBOTTOM, ; - iif( oBrowse:hitTop, DE_HITTOP, DE_IDLE ) ) ) ) + LOCAL nMode := ; + iif( nKey != 0, DE_EXCEPT, ; + iif( !lAppend .AND. IsDbEmpty(), DE_EMPTY, ; + iif( oBrowse:hitBottom, DE_HITBOTTOM, ; + iif( oBrowse:hitTop, DE_HITTOP, DE_IDLE ) ) ) ) oBrowse:forceStable() @@ -312,14 +315,14 @@ STATIC FUNCTION CallUser( oBrowse, xUserFunc, nKey, lAppend, lFlag ) &xUserFunc( nMode, oBrowse:colPos ), ; iif( nKey == K_ENTER .OR. nKey == K_ESC, DE_ABORT, DE_CONT ) ) ) - IF !lAppend .AND. EOF() .AND. !IsDbEmpty() + IF !lAppend .AND. Eof() .AND. !IsDbEmpty() dbSkip( -1 ) ENDIF #ifdef HB_CLP_UNDOC IF nAction == DE_APPEND - IF ( lAppend := !( lAppend .AND. EOF() ) ) + IF ( lAppend := !( lAppend .AND. Eof() ) ) dbGoBottom() oBrowse:down() ELSE @@ -337,10 +340,10 @@ STATIC FUNCTION CallUser( oBrowse, xUserFunc, nKey, lAppend, lFlag ) lAppend := .F. IF ( Set( _SET_DELETED ) .AND. Deleted() ) .OR. ; - ( !Empty( dbfilter() ) .AND. !&( dbFilter() ) ) + ( !Empty( dbFilter() ) .AND. !&( dbFilter() ) ) dbSkip() ENDIF - IF EOF() + IF Eof() dbGoBottom() ENDIF @@ -366,7 +369,7 @@ STATIC FUNCTION CallUser( oBrowse, xUserFunc, nKey, lAppend, lFlag ) STATIC FUNCTION IsDbEmpty() RETURN LastRec() == 0 .OR. ; - ( BOF() .AND. ( EOF() .OR. RecNo() == LastRec() + 1 ) ) + ( Bof() .AND. ( Eof() .OR. RecNo() == LastRec() + 1 ) ) /* Helper function: TBrowse skipBlock */ STATIC FUNCTION Skipped( nRecs, lAppend ) @@ -375,7 +378,7 @@ STATIC FUNCTION Skipped( nRecs, lAppend ) IF LastRec() != 0 IF nRecs == 0 - IF EOF() .AND. !lAppend + IF Eof() .AND. !lAppend dbSkip( -1 ) nSkipped := -1 ELSE diff --git a/harbour/src/rtl/devoutp.prg b/harbour/src/rtl/devoutp.prg index 8bc2f0f134..5475687cbe 100644 --- a/harbour/src/rtl/devoutp.prg +++ b/harbour/src/rtl/devoutp.prg @@ -52,7 +52,7 @@ PROCEDURE DevOutPict( xValue, cPicture, cColor ) - IF Valtype( xValue ) $ "CMNDL" + IF ValType( xValue ) $ "CMNDL" DevOut( Transform( xValue, cPicture ), cColor ) ENDIF diff --git a/harbour/src/rtl/dircmd.prg b/harbour/src/rtl/dircmd.prg index a247bcf2ef..a09f978da4 100644 --- a/harbour/src/rtl/dircmd.prg +++ b/harbour/src/rtl/dircmd.prg @@ -56,6 +56,7 @@ #define _DIR_HEADER 1 PROCEDURE __Dir( cFileMask ) + LOCAL cPath LOCAL cName LOCAL cExt @@ -63,17 +64,17 @@ PROCEDURE __Dir( cFileMask ) IF Empty( cFileMask ) /* NOTE: Although Cl*pper has this string in the national language - modul, it will not use it from there. + module, it will not use it from there. This is hard wired to English. So this is a small incompatibility. */ #ifdef HB_CLP_STRICT QOut( "Database Files # Records Last Update Size" ) #else - QOut( __NatMsg( _DIR_HEADER ) ) + QOut( __natMsg( _DIR_HEADER ) ) #endif - AEval( Directory( hb_FNameMerge( Set( _SET_DEFAULT ), "*", ".dbf" ) ),; + AEval( Directory( hb_FNameMerge( Set( _SET_DEFAULT ), "*", ".dbf" ) ), ; {| aDirEntry | PutDbf( aDirEntry ) } ) ELSE @@ -82,7 +83,7 @@ PROCEDURE __Dir( cFileMask ) cPath := Set( _SET_DEFAULT ) ENDIF - AEval( Directory( hb_FNameMerge( cPath, cName, cExt ) ),; + AEval( Directory( hb_FNameMerge( cPath, cName, cExt ) ), ; {| aDirEntry | PutNormal( aDirEntry ) } ) ENDIF @@ -91,6 +92,7 @@ PROCEDURE __Dir( cFileMask ) RETURN STATIC PROCEDURE PutDBF( aDirEntry ) + LOCAL fhnd LOCAL buffer LOCAL nRecCount := 0 @@ -102,12 +104,13 @@ STATIC PROCEDURE PutDBF( aDirEntry ) IF FRead( fhnd, @buffer, 8 ) == 8 .AND. ; AScan( { 0x03, 0x06, 0x30, 0x31, 0x83, 0x86, 0xE5, 0xE6, 0xF5, 0xF6 }, ; - Asc( buffer ) ) != 0 + hb_BCode( buffer ) ) != 0 - nRecCount := Bin2L( SubStr( buffer, 5, 4 ) ) - dLastUpdate := hb_SToD( StrZero( Asc( SubStr( buffer, 2, 1 ) ) + 1900, 4 ) +; - StrZero( Asc( SubStr( buffer, 3, 1 ) ), 2 ) +; - StrZero( Asc( SubStr( buffer, 4, 1 ) ), 2 ) ) + nRecCount := Bin2L( hb_BSubStr( buffer, 5, 4 ) ) + dLastUpdate := hb_SToD( ; + StrZero( hb_BCode( hb_BSubStr( buffer, 2, 1 ) ) + 1900, 4 ) + ; + StrZero( hb_BCode( hb_BSubStr( buffer, 3, 1 ) ), 2 ) + ; + StrZero( hb_BCode( hb_BSubStr( buffer, 4, 1 ) ), 2 ) ) ENDIF @@ -115,14 +118,15 @@ STATIC PROCEDURE PutDBF( aDirEntry ) ENDIF - QOut( PadR( aDirEntry[ F_NAME ], 15 ) +; - Str( nRecCount, 12 ) + " " +; - DToC( dLastUpdate ) +; - Str( aDirEntry[ F_SIZE ], 12 ) ) + QOut( PadR( aDirEntry[ F_NAME ], 15 ) + ; + Str( nRecCount, 12 ) + " " + ; + DToC( dLastUpdate ) + ; + Str( aDirEntry[ F_SIZE ], 12 ) ) RETURN STATIC PROCEDURE PutNormal( aDirEntry ) + LOCAL cName LOCAL cExt @@ -131,9 +135,9 @@ STATIC PROCEDURE PutNormal( aDirEntry ) /* strict DOS like formatting, it does not play well with long file names * which do not stick to 8.3 MS-DOS convention */ - QOut( PadR( cName, 8 ) + " " +; - PadR( Substr( cExt, 2 ), 3 ) + " " +; - Str( aDirEntry[ F_SIZE ], 8 ) + " " +; - DToC( aDirEntry[ F_DATE ] ) ) + QOut( PadR( cName, 8 ) + " " + ; + PadR( SubStr( cExt, 2 ), 3 ) + " " + ; + Str( aDirEntry[ F_SIZE ], 8 ) + " " + ; + DToC( aDirEntry[ F_DATE ] ) ) RETURN diff --git a/harbour/src/rtl/dirscan.prg b/harbour/src/rtl/dirscan.prg index b1db9aab75..46592489c7 100644 --- a/harbour/src/rtl/dirscan.prg +++ b/harbour/src/rtl/dirscan.prg @@ -66,8 +66,8 @@ STATIC FUNCTION hb_doScan( cPath, cMask, cAttr, cPathSep ) ENDIF IF !( aFile[ F_NAME ] == "." .OR. aFile[ F_NAME ] == ".." .OR. aFile[ F_NAME ] == "" ) AEval( hb_DoScan( cPath + aFile[ F_NAME ] + cPathSep, cMask, cAttr, cPathSep ), ; - {| x | x[ F_NAME ] := aFile[ F_NAME ] + cPathSep + x[ F_NAME ], ; - AAdd( aResult, x ) } ) + {| x | x[ F_NAME ] := aFile[ F_NAME ] + cPathSep + x[ F_NAME ], ; + AAdd( aResult, x ) } ) ENDIF ELSEIF lMatch AAdd( aResult, aFile ) @@ -90,6 +90,6 @@ FUNCTION hb_DirScan( cPath, cFileMask, cAttr ) ENDIF RETURN HB_DoScan( cFilePath, ; - iif( Empty( cFileMask ), hb_osFileMask(), cFileMask ), ; - iif( HB_ISSTRING( cAttr ), cAttr, "" ), ; - hb_ps() ) + iif( Empty( cFileMask ), hb_osFileMask(), cFileMask ), ; + iif( HB_ISSTRING( cAttr ), cAttr, "" ), ; + hb_ps() ) diff --git a/harbour/src/rtl/errsys.prg b/harbour/src/rtl/errsys.prg index 6221b8d1eb..42cd564997 100644 --- a/harbour/src/rtl/errsys.prg +++ b/harbour/src/rtl/errsys.prg @@ -59,6 +59,7 @@ PROCEDURE ErrorSys() RETURN STATIC FUNCTION DefError( oError ) + LOCAL cMessage LOCAL cDOSError @@ -97,7 +98,7 @@ STATIC FUNCTION DefError( oError ) cMessage := ErrorMessage( oError ) IF ! Empty( oError:osCode ) - cDOSError := "(DOS Error " + hb_NToS( oError:osCode ) + ")" + cDOSError := "(DOS Error " + hb_ntos( oError:osCode ) + ")" ENDIF // Build buttons @@ -152,7 +153,7 @@ STATIC FUNCTION DefError( oError ) OutErr( hb_eol() ) OutErr( "Called from " + ProcName( n ) + ; - "(" + hb_NToS( ProcLine( n ) ) + ") " ) + "(" + hb_ntos( ProcLine( n ) ) + ") " ) ENDDO @@ -175,7 +176,7 @@ STATIC FUNCTION ErrorMessage( oError ) // add subsystem's error code if available IF HB_ISNUMERIC( oError:subCode ) - cMessage += "/" + hb_NToS( oError:subCode ) + cMessage += "/" + hb_ntos( oError:subCode ) ELSE cMessage += "/???" ENDIF diff --git a/harbour/src/rtl/getlist.prg b/harbour/src/rtl/getlist.prg index 5572ba4f07..29be5f8cd3 100644 --- a/harbour/src/rtl/getlist.prg +++ b/harbour/src/rtl/getlist.prg @@ -74,6 +74,7 @@ FUNCTION __GetListActive() RETURN t_oGetListActive FUNCTION __GetListLast( oGetListLast ) + THREAD STATIC t_oGetListLast IF oGetListLast != NIL diff --git a/harbour/src/rtl/getsys.prg b/harbour/src/rtl/getsys.prg index dfe9250d67..c9aa0fd7a4 100644 --- a/harbour/src/rtl/getsys.prg +++ b/harbour/src/rtl/getsys.prg @@ -82,7 +82,7 @@ FUNCTION ReadModal( GetList ) oGetList := HBGetList():New( GetList ) - oSaveGetList := __GetListActive( ) + oSaveGetList := __GetListActive() #ifdef HB_COMPAT_C53 // oSaveGetList:ReadStats( SLUPDATED, .F. ) // oSaveGetList:ReadStats( SXREADVAR, ReadVar( "" ) ) @@ -126,6 +126,7 @@ PROCEDURE GetReader( oGet ) #endif FUNCTION GetActive( oGet ) + LOCAL oGetList := __GetListActive() LOCAL oGetActiveOld @@ -155,6 +156,7 @@ FUNCTION GetActive( oGet ) RETURN NIL PROCEDURE GetDoSetKey( bKeyBlock, oGet ) + LOCAL oGetList := __GetListActive() IF oGetList != NIL @@ -165,11 +167,13 @@ PROCEDURE GetDoSetKey( bKeyBlock, oGet ) #ifdef HB_COMPAT_C53 PROCEDURE GetApplyKey( oGet, nKey, oGetList, oMenu, aMsg ) + IF ! HB_ISOBJECT( oGetList ) oGetList := __GetListActive() ENDIF #else PROCEDURE GetApplyKey( oGet, nKey ) + LOCAL oGetList := __GetListActive() #endif @@ -205,6 +209,7 @@ FUNCTION GetPostValidate( oGet, aMsg ) #else FUNCTION GetPostValidate( oGet ) #endif + LOCAL oGetList := __GetListActive() IF oGetList != NIL @@ -224,11 +229,13 @@ FUNCTION ReadInsert( lInsert ) RETURN Set( _SET_INSERT, lInsert ) FUNCTION Updated() + LOCAL oGetList := __GetListLast() RETURN iif( oGetList != NIL, oGetList:Updated(), .F. ) PROCEDURE __KillRead() + LOCAL oGetList := __GetListActive() IF oGetList != NIL @@ -238,6 +245,7 @@ PROCEDURE __KillRead() RETURN FUNCTION ReadUpdated( lUpdated ) + LOCAL oGetList := __GetListLast() IF oGetList != NIL @@ -251,6 +259,7 @@ FUNCTION ReadUpdated( lUpdated ) RETURN .F. FUNCTION ReadKill( lKill ) + LOCAL oGetList := __GetListActive() IF oGetList != NIL @@ -264,6 +273,7 @@ FUNCTION ReadKill( lKill ) RETURN .F. FUNCTION ReadFormat( bFormat ) + LOCAL oGetList := __GetListActive() IF oGetList != NIL @@ -277,6 +287,7 @@ FUNCTION ReadFormat( bFormat ) RETURN NIL PROCEDURE __SetFormat( bFormat ) + LOCAL oGetList := __GetListActive() IF oGetList != NIL @@ -296,6 +307,7 @@ PROCEDURE __SetFormat( bFormat ) #define _GET_RANGE_TO 11 FUNCTION RangeCheck( oGet, xDummy, xLow, xHigh ) + LOCAL xValue LOCAL cMessage @@ -313,15 +325,15 @@ FUNCTION RangeCheck( oGet, xDummy, xLow, xHigh ) IF Set( _SET_SCOREBOARD ) - cMessage := Left( __NatMsg( _GET_RANGE_FROM ) + LTrim( Transform( xLow, "" ) ) + ; - __NatMsg( _GET_RANGE_TO ) + LTrim( Transform( xHigh, "" ) ), MaxCol() ) + cMessage := Left( __natMsg( _GET_RANGE_FROM ) + LTrim( Transform( xLow, "" ) ) + ; + __natMsg( _GET_RANGE_TO ) + LTrim( Transform( xHigh, "" ) ), MaxCol() ) - hb_dispOutAt( SCORE_ROW, Min( 60, MaxCol() - Len( cMessage ) ), cMessage ) + hb_DispOutAt( SCORE_ROW, Min( 60, MaxCol() - Len( cMessage ) ), cMessage ) DO WHILE NextKey() == 0 ENDDO - hb_dispOutAt( SCORE_ROW, Min( 60, MaxCol() - Len( cMessage ) ), Space( Len( cMessage ) ) ) + hb_DispOutAt( SCORE_ROW, Min( 60, MaxCol() - Len( cMessage ) ), Space( Len( cMessage ) ) ) ENDIF diff --git a/harbour/src/rtl/getsys53.prg b/harbour/src/rtl/getsys53.prg index 35fd0b8492..17debad7ff 100644 --- a/harbour/src/rtl/getsys53.prg +++ b/harbour/src/rtl/getsys53.prg @@ -88,11 +88,13 @@ PROCEDURE GUIApplyKey( oGet, oGUI, oGetList, nKey, oMenu, aMsg ) RETURN FUNCTION GUIPreValidate( oGet, oGUI, aMsg ) + LOCAL oGetList := __GetListActive() RETURN iif( oGetList != NIL, oGetList:GUIPreValidate( oGet, oGUI, aMsg ), .F. ) FUNCTION GUIPostValidate( oGet, oGUI, aMsg ) + LOCAL oGetList := __GetListActive() RETURN iif( oGetList != NIL, oGetList:GUIPostValidate( oGet, oGUI, aMsg ), .F. ) @@ -138,6 +140,7 @@ FUNCTION HitTest( oGetList, nMRow, nMCol, aMsg ) RETURN iif( oGetList != NIL, oGetlist:hitTest( nMRow, nMCol, aMsg ), 0 ) PROCEDURE ShowGetMsg( oGet, aMsg ) + LOCAL oGetList := __GetListActive() IF oGetList != NIL @@ -147,6 +150,7 @@ PROCEDURE ShowGetMsg( oGet, aMsg ) RETURN PROCEDURE EraseGetMsg( oGet, aMsg ) + LOCAL oGetList := __GetListActive() HB_SYMBOL_UNUSED( oGet ) @@ -158,6 +162,7 @@ PROCEDURE EraseGetMsg( oGet, aMsg ) RETURN FUNCTION ReadStats( nElement, xNewValue ) + LOCAL oGetList := __GetListActive() IF oGetList != NIL diff --git a/harbour/src/rtl/getsyshb.prg b/harbour/src/rtl/getsyshb.prg index 7c03df270b..a137bbc02c 100644 --- a/harbour/src/rtl/getsyshb.prg +++ b/harbour/src/rtl/getsyshb.prg @@ -51,6 +51,7 @@ */ FUNCTION hb_GetReadVar( oGet ) + LOCAL cName := hb_asciiUpper( oGet:name ) LOCAL xSubScript @@ -67,7 +68,7 @@ FUNCTION hb_GetReadVar( oGet ) cName += '[t"' + hb_TSToStr( xSubScript, .T. ) + '"]' EXIT OTHERWISE - cName += "[" + hb_NToS( xSubScript ) + "]" + cName += "[" + hb_ntos( xSubScript ) + "]" ENDSWITCH NEXT ENDIF diff --git a/harbour/src/rtl/gui.prg b/harbour/src/rtl/gui.prg index f2b7092b45..0ace43b2e2 100644 --- a/harbour/src/rtl/gui.prg +++ b/harbour/src/rtl/gui.prg @@ -55,9 +55,10 @@ #define LLG_VIDEO_TXT 3 FUNCTION _IsGraphic() - RETURN Set( _SET_VIDEOMODE ) != NIL .AND. ; - Set( _SET_VIDEOMODE ) != 0 .AND. ; - Set( _SET_VIDEOMODE ) != LLG_VIDEO_TXT + RETURN ; + Set( _SET_VIDEOMODE ) != NIL .AND. ; + Set( _SET_VIDEOMODE ) != 0 .AND. ; + Set( _SET_VIDEOMODE ) != LLG_VIDEO_TXT FUNCTION _SetVideoMode( nMode ) @@ -70,6 +71,7 @@ FUNCTION _SetVideoMode( nMode ) compatibility function. [vszakats] */ FUNCTION _GetNumCol( cColor ) + LOCAL nPos IF ( nPos := At( "/", cColor ) ) > 0 @@ -89,11 +91,13 @@ FUNCTION IsDefColor() /* Removes the accelerator marker from a caption string */ FUNCTION __Caption( cCaption ) + LOCAL nPos RETURN iif( ( nPos := At( "&", cCaption ) ) > 0, Stuff( cCaption, nPos, 1, "" ), cCaption ) FUNCTION __CapLength( cCaption ) + LOCAL nCaptionLen := Len( cCaption ) LOCAL nPos diff --git a/harbour/src/rtl/hbadler.c b/harbour/src/rtl/hbadler.c index 7e78c5cf39..76fb1fd315 100644 --- a/harbour/src/rtl/hbadler.c +++ b/harbour/src/rtl/hbadler.c @@ -60,10 +60,10 @@ #define NMAX 5552 /* largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ #define LOOP_DO1( buf, i ) s1 += buf[ i ]; s2 += s1 -#define LOOP_DO2( buf, i ) LOOP_DO1( buf, i ); LOOP_DO1( buf, i + 1 ); -#define LOOP_DO4( buf, i ) LOOP_DO2( buf, i ); LOOP_DO2( buf, i + 2 ); -#define LOOP_DO8( buf, i ) LOOP_DO4( buf, i ); LOOP_DO4( buf, i + 4 ); -#define LOOP_DO16( buf, i ) LOOP_DO8( buf, i ); LOOP_DO8( buf, i + 8 ); +#define LOOP_DO2( buf, i ) { LOOP_DO1( buf, i ); LOOP_DO1( buf, i + 1 ); } +#define LOOP_DO4( buf, i ) { LOOP_DO2( buf, i ); LOOP_DO2( buf, i + 2 ); } +#define LOOP_DO8( buf, i ) { LOOP_DO4( buf, i ); LOOP_DO4( buf, i + 4 ); } +#define LOOP_DO16( buf, i ) { LOOP_DO8( buf, i ); LOOP_DO8( buf, i + 8 ); } HB_U32 hb_adler32( HB_U32 adler, const void * buf, HB_SIZE len ) { diff --git a/harbour/src/rtl/hbdoc.prg b/harbour/src/rtl/hbdoc.prg index 07928d1a58..b3d694f8c7 100644 --- a/harbour/src/rtl/hbdoc.prg +++ b/harbour/src/rtl/hbdoc.prg @@ -59,6 +59,7 @@ #define _HBDOC_ADD_MSG( a, m ) IF HB_ISARRAY( a ); AAdd( a, m ); ENDIF FUNCTION __hbdoc_FromSource( cFile, aErrMsg ) + LOCAL aEntry := {} IF HB_ISSTRING( cFile ) @@ -68,6 +69,7 @@ FUNCTION __hbdoc_FromSource( cFile, aErrMsg ) RETURN aEntry FUNCTION __hbdoc_DirLastModified( cDir ) + LOCAL aFile LOCAL cDocDir @@ -103,6 +105,7 @@ FUNCTION __hbdoc_DirLastModified( cDir ) RETURN tLast FUNCTION __hbdoc_LoadDir( cDir, cName, aErrMsg ) + LOCAL hMeta LOCAL nCount LOCAL aFile @@ -141,6 +144,7 @@ FUNCTION __hbdoc_LoadDir( cDir, cName, aErrMsg ) RETURN aEntry STATIC PROCEDURE __hbdoc__read_langdir( aEntry, cDir, hMeta, aErrMsg ) + LOCAL aFile LOCAL nCount @@ -158,11 +162,12 @@ STATIC PROCEDURE __hbdoc__read_langdir( aEntry, cDir, hMeta, aErrMsg ) RETURN STATIC PROCEDURE __hbdoc__read_file( aEntry, cFileName, hMeta, aErrMsg ) - LOCAL aFilenameTemplateMap := {; - "FUNCTION" => "func_" ,; - "C FUNCTION" => "cfunc_" ,; - "CLASS" => "class_" ,; - "COMMAND" => "cmd_" ,; + + LOCAL aFilenameTemplateMap := { ; + "FUNCTION" => "func_" , ; + "C FUNCTION" => "cfunc_" , ; + "CLASS" => "class_" , ; + "COMMAND" => "cmd_" , ; "PP" => "pp_" } LOCAL tmp @@ -185,6 +190,7 @@ STATIC PROCEDURE __hbdoc__read_file( aEntry, cFileName, hMeta, aErrMsg ) RETURN STATIC PROCEDURE __hbdoc__read_stream( aEntry, cFile, cFileName, hMeta, aErrMsg ) + LOCAL hEntry := NIL LOCAL cLine LOCAL cSection @@ -258,10 +264,12 @@ STATIC PROCEDURE __hbdoc__read_stream( aEntry, cFile, cFileName, hMeta, aErrMsg RETURN FUNCTION __hbdoc_ToSource( aEntry ) + LOCAL cSource := "" LOCAL hEntry LOCAL item LOCAL cLine + LOCAL cLineOut IF HB_ISARRAY( aEntry ) FOR EACH hEntry IN aEntry @@ -272,7 +280,8 @@ FUNCTION __hbdoc_ToSource( aEntry ) !( Left( item:__enumKey(), 1 ) == "_" ) cSource += " $" + item:__enumKey() + "$" + hb_eol() FOR EACH cLine IN hb_ATokens( StrTran( item, Chr( 13 ) ), Chr( 10 ) ) - cSource += " " + iif( Len( cLine ) == 0, "", Space( 4 ) + cLine ) + hb_eol() + cLineOut := iif( Len( cLine ) == 0, "", Space( 4 ) + cLine ) + cSource += iif( Empty( cLineOut ), "", " " + cLineOut ) + hb_eol() NEXT ENDIF NEXT @@ -284,6 +293,7 @@ FUNCTION __hbdoc_ToSource( aEntry ) RETURN cSource FUNCTION __hbdoc_FilterOut( cFile ) + LOCAL lEntry := .F. LOCAL cLine LOCAL cOK := "" @@ -337,16 +347,20 @@ FUNCTION __hbdoc_FilterOut( cFile ) * previously-saved files is required, only a naive approach of using * version 1 is taken. */ -#define _HBDOC_SIGNATURE ( HB_BCHAR( 0xC0 ) + ; - HB_BCHAR( 0x48 ) + ; - HB_BCHAR( 0x42 ) + ; - HB_BCHAR( 0x44 ) + ; - HB_BCHAR( 0x01 ) + ; - HB_BCHAR( 0x00 ) ) -#define _HBDOC_SIG_LEN 6 + #define _HBDOC_EXT ".hbd" +#define _HBDOC_SIG_LEN 6 +#define _HBDOC_SIGNATURE ( ; + hb_BChar( 0xC0 ) + ; + hb_BChar( 0x48 ) + ; + hb_BChar( 0x42 ) + ; + hb_BChar( 0x44 ) + ; + hb_BChar( 0x01 ) + ; + hb_BChar( 0x00 ) ) + FUNCTION __hbdoc_SaveHBD( cFileName, aEntry ) + LOCAL fhnd IF HB_ISSTRING( cFileName ) .AND. ; @@ -359,7 +373,7 @@ FUNCTION __hbdoc_SaveHBD( cFileName, aEntry ) fhnd := hb_FCreate( cFileName, FC_NORMAL, FO_CREAT + FO_TRUNC + FO_READWRITE + FO_EXCLUSIVE ) IF fhnd != F_ERROR FWrite( fhnd, _HBDOC_SIGNATURE ) - FWrite( fhnd, hb_ZCompress( hb_serialize( aEntry ) ) ) + FWrite( fhnd, hb_ZCompress( hb_Serialize( aEntry ) ) ) FClose( fhnd ) RETURN .T. ENDIF @@ -368,6 +382,7 @@ FUNCTION __hbdoc_SaveHBD( cFileName, aEntry ) RETURN .F. FUNCTION __hbdoc_LoadHBD( cFileName ) + LOCAL fhnd LOCAL aEntry := NIL @@ -391,7 +406,7 @@ FUNCTION __hbdoc_LoadHBD( cFileName ) FRead( fhnd, @cBuffer, hb_BLen( cBuffer ) ) FClose( fhnd ) - aEntry := hb_deserialize( hb_ZUncompress( cBuffer ) ) + aEntry := hb_Deserialize( hb_ZUncompress( cBuffer ) ) cBuffer := NIL IF ! HB_ISARRAY( aEntry ) diff --git a/harbour/src/rtl/hbfilehi.prg b/harbour/src/rtl/hbfilehi.prg index c9f54bc712..4a9df77fd0 100644 --- a/harbour/src/rtl/hbfilehi.prg +++ b/harbour/src/rtl/hbfilehi.prg @@ -54,6 +54,7 @@ /* NOTE: Can hurt if there are symlinks on the way. */ FUNCTION hb_PathNormalize( cPath ) + LOCAL aDir LOCAL cDir @@ -66,15 +67,19 @@ FUNCTION hb_PathNormalize( cPath ) aDir := hb_ATokens( cPath, hb_ps() ) FOR EACH cDir IN aDir DESCEND + IF cDir == "." .OR. ; ( Empty( cDir ) .AND. ; - cDir:__enumIndex() < Len( cDir:__enumBase() ) .AND. ; - ( cDir:__enumIndex() > 2 .OR. ; - ( cDir:__enumIndex() == 2 .AND. ! Empty( aDir[ 1 ] ) ) ) ) + cDir:__enumIndex() < Len( cDir:__enumBase() ) .AND. ; + ( cDir:__enumIndex() > 2 .OR. ; + ( cDir:__enumIndex() == 2 .AND. ! Empty( aDir[ 1 ] ) ) ) ) + hb_ADel( aDir, cDir:__enumIndex(), .T. ) + ELSEIF !( cDir == ".." ) .AND. ; ! Empty( cDir ) .AND. ; ! _ISDRIVESPEC( cDir ) + IF cDir:__enumIndex() < Len( cDir:__enumBase() ) .AND. ; aDir[ cDir:__enumIndex() + 1 ] == ".." hb_ADel( aDir, cDir:__enumIndex() + 1, .T. ) @@ -99,6 +104,7 @@ FUNCTION hb_PathNormalize( cPath ) RETURN cPath FUNCTION hb_PathJoin( cPathA, cPathR ) + LOCAL cDirA LOCAL cDirR, cDriveR, cNameR, cExtR @@ -125,6 +131,7 @@ FUNCTION hb_PathJoin( cPathA, cPathR ) RETURN hb_FNameMerge( cDirA + cDirR, cNameR, cExtR ) FUNCTION hb_PathRelativize( cPathBase, cPathTarget, lForceRelative ) + LOCAL tmp LOCAL aPathBase @@ -143,8 +150,8 @@ FUNCTION hb_PathRelativize( cPathBase, cPathTarget, lForceRelative ) lForceRelative := .T. ENDIF - cPathBase := hb_PathJoin( hb_dirBase(), hb_DirSepAdd( cPathBase ) ) - cPathTarget := hb_PathJoin( hb_dirBase(), cPathTarget ) + cPathBase := hb_PathJoin( hb_DirBase(), hb_DirSepAdd( cPathBase ) ) + cPathTarget := hb_PathJoin( hb_DirBase(), cPathTarget ) /* TODO: Optimize to operate on strings instead of arrays */ @@ -173,9 +180,9 @@ FUNCTION hb_PathRelativize( cPathBase, cPathTarget, lForceRelative ) /* Different drive spec. There is no way to solve that using relative dirs. */ IF ! Empty( hb_osDriveSeparator() ) .AND. ; - tmp == 1 .AND. ; - ( Right( aPathBase[ 1 ] , Len( hb_osDriveSeparator() ) ) == hb_osDriveSeparator() .OR. ; - Right( aPathTarget[ 1 ], Len( hb_osDriveSeparator() ) ) == hb_osDriveSeparator() ) + tmp == 1 .AND. ( ; + Right( aPathBase[ 1 ] , Len( hb_osDriveSeparator() ) ) == hb_osDriveSeparator() .OR. ; + Right( aPathTarget[ 1 ], Len( hb_osDriveSeparator() ) ) == hb_osDriveSeparator() ) RETURN cPathTarget ENDIF @@ -187,6 +194,7 @@ FUNCTION hb_PathRelativize( cPathBase, cPathTarget, lForceRelative ) RETURN cPathTarget STATIC FUNCTION s_FN_ToArray( cPath, /* @ */ cFileName ) + LOCAL cDir, cName, cExt hb_FNameSplit( cPath, @cDir, @cName, @cExt ) @@ -198,6 +206,7 @@ STATIC FUNCTION s_FN_ToArray( cPath, /* @ */ cFileName ) RETURN hb_ATokens( cDir, hb_ps() ) STATIC FUNCTION s_FN_FromArray( aPath, nFrom, cFileName, cDirPrefix ) + LOCAL nTo := Len( aPath ) LOCAL cDir LOCAL tmp @@ -243,13 +252,15 @@ FUNCTION hb_DirSepDel( cDir ) IF Empty( hb_osDriveSeparator() ) DO WHILE Len( cDir ) > 1 .AND. Right( cDir, 1 ) == hb_ps() .AND. ; - !( cDir == hb_ps() + hb_ps() ) + !( cDir == hb_ps() + hb_ps() ) + cDir := hb_StrShrink( cDir, 1 ) ENDDO ELSE DO WHILE Len( cDir ) > 1 .AND. Right( cDir, 1 ) == hb_ps() .AND. ; - !( cDir == hb_ps() + hb_ps() ) .AND. ; - !( Right( cDir, Len( hb_osDriveSeparator() ) + 1 ) == hb_osDriveSeparator() + hb_ps() ) + !( cDir == hb_ps() + hb_ps() ) .AND. ; + !( Right( cDir, Len( hb_osDriveSeparator() ) + 1 ) == hb_osDriveSeparator() + hb_ps() ) + cDir := hb_StrShrink( cDir, 1 ) ENDDO ENDIF @@ -257,6 +268,7 @@ FUNCTION hb_DirSepDel( cDir ) RETURN cDir FUNCTION hb_DirBuild( cDir ) + LOCAL cDirTemp LOCAL cDirItem LOCAL tmp @@ -302,6 +314,7 @@ FUNCTION hb_DirBuild( cDir ) RETURN .T. FUNCTION hb_DirUnbuild( cDir ) + LOCAL cDirTemp LOCAL tmp diff --git a/harbour/src/rtl/hbi18n2.prg b/harbour/src/rtl/hbi18n2.prg index a2481a0288..2df9276425 100644 --- a/harbour/src/rtl/hbi18n2.prg +++ b/harbour/src/rtl/hbi18n2.prg @@ -74,16 +74,16 @@ STATIC FUNCTION __I18N_fileName( cFileName ) RETURN cFileName - STATIC FUNCTION __I18N_strEncode( cStr ) - RETURN substr( hb_strToExp( cStr, .T. ), 2 ) + RETURN SubStr( hb_StrToExp( cStr, .T. ), 2 ) STATIC FUNCTION __I18N_strDecode( cLine, cValue, lCont ) + LOCAL lRet := .F. LOCAL cText - cText := hb_strCdecode( cLine, @lCont ) + cText := hb_StrCDecode( cLine, @lCont ) IF cText != NIL lRet := .T. IF cValue == NIL @@ -98,7 +98,8 @@ STATIC FUNCTION __I18N_strDecode( cLine, cValue, lCont ) #define _BOM_VALUE 0xFEFF #define _UTF8_BOM hb_utf8CHR( _BOM_VALUE ) /* e"\xEF\xBB\xBF" */ -FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) +FUNCTION __i18n_potArrayLoad( cFile, cErrorMsg ) + LOCAL cLine, cValue LOCAL nMode, nIndex, nOldIndex, nLine, n LOCAL aTrans, aItem, aLines @@ -106,30 +107,30 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) LOCAL hFile __I18N_fileName( @cFile ) - hFile := fopen( cFile, FO_READ ) + hFile := FOpen( cFile, FO_READ ) IF hFile == -1 cErrorMsg := "cannot open file: " + cFile RETURN NIL ENDIF - cValue := Space( fseek( hFile, 0, FS_END ) ) - fseek( hFile, 0, FS_SET ) - n := fread( hFile, @cValue, hb_BLen( cValue ) ) - fclose( hFile ) + cValue := Space( FSeek( hFile, 0, FS_END ) ) + FSeek( hFile, 0, FS_SET ) + n := FRead( hFile, @cValue, hb_BLen( cValue ) ) + FClose( hFile ) IF n != hb_BLen( cValue ) cErrorMsg := "cannot read from file: " + cFile RETURN NIL ENDIF /* Strip UTF-8 BOM */ - IF hb_utf8ASC( cValue ) == _BOM_VALUE + IF hb_utf8Asc( cValue ) == _BOM_VALUE cValue := SubStr( cValue, Len( _UTF8_BOM ) + 1 ) ENDIF IF !hb_eol() == _I18N_EOL - cValue := strtran( cValue, hb_eol(), _I18N_EOL ) + cValue := StrTran( cValue, hb_eol(), _I18N_EOL ) ENDIF - IF !hb_eol() == chr( 13 ) + chr( 10 ) - cValue := strtran( cValue, chr( 13 ) + chr( 10 ), _I18N_EOL ) + IF !hb_eol() == Chr( 13 ) + Chr( 10 ) + cValue := StrTran( cValue, Chr( 13 ) + Chr( 10 ), _I18N_EOL ) ENDIF - aLines := hb_aTokens( cValue, _I18N_EOL ) + aLines := hb_ATokens( cValue, _I18N_EOL ) lCont := .F. nLine := 0 @@ -139,7 +140,7 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) aItem := _I18N_ITEM cValue := NIL FOR EACH cLine IN aLines - cLine := alltrim( cLine ) + cLine := AllTrim( cLine ) ++nLine IF lCont cValue += hb_eol() @@ -151,26 +152,26 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) ELSE aItem[ _I18N_SOURCE ] += " " ENDIF - aItem[ _I18N_SOURCE ] += strtran( ltrim( substr( cLine, 3 ) ), "\", "/" ) -/* + aItem[ _I18N_SOURCE ] += StrTran( LTrim( SubStr( cLine, 3 ) ), "\", "/" ) +#if 0 ELSEIF LEFTEQUAL( cLine, "#," ) // flags - cLine := ltrim( substr( cLine, 3 ) ) + cLine := LTrim( SubStr( cLine, 3 ) ) IF cLine == "c-format" ELSE cErrorMsg := "unsupported flag: " + cLine EXIT ENDIF -*/ +#endif ENDIF cLine := "" ELSEIF LEFTEQUAL( cLine, "msgctxt " ) .AND. nMode == _I18N_NONE - cLine := ltrim( substr( cLine, 9 ) ) + cLine := LTrim( SubStr( cLine, 9 ) ) nMode := _I18N_CONTEXT cValue := NIL ELSEIF LEFTEQUAL( cLine, "msgid " ) .AND. ; - ( nMode == _I18N_NONE .OR. nMode == _I18N_CONTEXT ) + ( nMode == _I18N_NONE .OR. nMode == _I18N_CONTEXT ) nIndex := 1 - cLine := ltrim( substr( cLine, 7 ) ) + cLine := LTrim( SubStr( cLine, 7 ) ) IF nMode == _I18N_CONTEXT IF cValue == NIL cErrorMsg := "undefined msgctxt value" @@ -184,13 +185,13 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) nOldIndex := nIndex nIndex := 2 n := 13 - IF IsDigit( substr( cLine, n, 1 ) ) - nIndex := VAL( substr( cLine, n ) ) + 1 + IF IsDigit( SubStr( cLine, n, 1 ) ) + nIndex := Val( SubStr( cLine, n ) ) + 1 IF nIndex < 1 cErrorMsg := "wrong plural form index" EXIT ENDIF - WHILE IsDigit( substr( cLine, n, 1 ) ) + WHILE IsDigit( SubStr( cLine, n, 1 ) ) ++n ENDDO ENDIF @@ -204,11 +205,11 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) ENDIF aItem[ _I18N_PLURAL ] := .T. AAdd( aItem[ _I18N_MSGID ], cValue ) - cLine := ltrim( substr( cLine, n ) ) + cLine := LTrim( SubStr( cLine, n ) ) cValue := NIL ELSEIF LEFTEQUAL( cLine, "msgstr " ) .AND. nMode == _I18N_MSGID nIndex := 0 - cLine := ltrim( substr( cLine, 8 ) ) + cLine := LTrim( SubStr( cLine, 8 ) ) nMode := _I18N_MSGSTR IF cValue == NIL cErrorMsg := "undefined msgid value" @@ -217,37 +218,37 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) AAdd( aItem[ _I18N_MSGID ], cValue ) cValue := NIL ELSEIF LEFTEQUAL( cLine, "msgstr[" ) .AND. ; - ( nMode == _I18N_MSGID .OR. nMode == _I18N_MSGSTR ) + ( nMode == _I18N_MSGID .OR. nMode == _I18N_MSGSTR ) nOldIndex := iif( nMode == _I18N_MSGSTR, nIndex, -1 ) nIndex := 0 n := 8 - IF IsDigit( substr( cLine, n, 1 ) ) - nIndex := VAL( substr( cLine, n ) ) - WHILE IsDigit( substr( cLine, n, 1 ) ) + IF IsDigit( SubStr( cLine, n, 1 ) ) + nIndex := Val( SubStr( cLine, n ) ) + WHILE IsDigit( SubStr( cLine, n, 1 ) ) ++n ENDDO ENDIF - WHILE substr( cLine, n, 1 ) == " " + WHILE SubStr( cLine, n, 1 ) == " " ++n ENDDO - IF !substr( cLine, n, 1 ) == "]" + IF !SubStr( cLine, n, 1 ) == "]" nIndex := -1 ENDIF - cLine := ltrim( substr( cLine, n + 1 ) ) + cLine := LTrim( SubStr( cLine, n + 1 ) ) IF nIndex < 0 .OR. nIndex != nOldIndex + 1 cErrorMsg := "wrong translation index" EXIT ENDIF IF cValue == NIL cErrorMsg := "undefined " + iif( nMode == _I18N_MSGID, ; - "msgid", "msgstr" ) + " value" + "msgid", "msgstr" ) + " value" EXIT ENDIF aItem[ _I18N_PLURAL ] := .T. AAdd( aItem[ nMode ], cValue ) nMode := _I18N_MSGSTR cValue := NIL - ELSEIF EMPTY( cLine ) .AND. nMode == _I18N_MSGSTR + ELSEIF Empty( cLine ) .AND. nMode == _I18N_MSGSTR IF cValue == NIL cErrorMsg := "undefined msgstr value" EXIT @@ -260,10 +261,10 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) ENDIF ENDIF - IF lCont .OR. !EMPTY( cLine ) + IF lCont .OR. ! Empty( cLine ) IF ( nMode != _I18N_CONTEXT .AND. ; - nMode != _I18N_MSGID .AND. ; - nMode != _I18N_MSGSTR ) .OR. ; + nMode != _I18N_MSGID .AND. ; + nMode != _I18N_MSGSTR ) .OR. ; ! __I18N_strDecode( cLine, @cValue, @lCont ) cErrorMsg := "unrecognized line" EXIT @@ -285,25 +286,25 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) cErrorMsg := "unclosed translation definition" ENDIF ENDIF - IF cErrorMsg == NIL .AND. EMPTY( aTrans ) + IF cErrorMsg == NIL .AND. Empty( aTrans ) cErrorMsg := "cannot find any translation rules" ENDIF IF cErrorMsg != NIL - cErrorMsg := cFile + ":" + hb_nToS( nLine ) + ";" + cErrorMsg + cErrorMsg := cFile + ":" + hb_ntos( nLine ) + ";" + cErrorMsg aTrans := NIL ENDIF RETURN aTrans - STATIC FUNCTION IsBOM_UTF8( cFileName ) + LOCAL fhnd := FOpen( cFileName, FO_READ ) LOCAL cBuffer LOCAL nLen IF fhnd != F_ERROR - nLen := HB_BLen( _UTF8_BOM ) + nLen := hb_BLen( _UTF8_BOM ) cBuffer := Space( nLen ) FRead( fhnd, @cBuffer, nLen ) FClose( fhnd ) @@ -314,8 +315,8 @@ STATIC FUNCTION IsBOM_UTF8( cFileName ) RETURN .F. +FUNCTION __i18n_potArraySave( cFile, aTrans, cErrorMsg, lVersionNo, lSourceRef ) -FUNCTION __I18N_POTARRAYSAVE( cFile, aTrans, cErrorMsg, lVersionNo, lSourceRef ) LOCAL aItem LOCAL hFile LOCAL lRet, lPlural @@ -333,9 +334,9 @@ FUNCTION __I18N_POTARRAYSAVE( cFile, aTrans, cErrorMsg, lVersionNo, lSourceRef ) cEol := hb_eol() cFlg := "#, c-format" + cEol cPOT := iif( hb_FileExists( cFile ) .AND. IsBOM_UTF8( cFile ), _UTF8_BOM + cEol, "" ) + ; /* Put it in separate line to less confuse non-BOM aware parsers */ - "#" + cEol + ; - "# This file is generated by " + iif( lVersionNo, hb_version(), "Harbour" ) + cEol + ; - "#" + cEol + "#" + cEol + ; + "# This file is generated by " + iif( lVersionNo, hb_Version(), "Harbour" ) + cEol + ; + "#" + cEol FOR EACH aItem IN aTrans cPOT += cEol IF lSourceRef .AND. !Empty( aItem[ _I18N_SOURCE ] ) @@ -355,7 +356,7 @@ FUNCTION __I18N_POTARRAYSAVE( cFile, aTrans, cErrorMsg, lVersionNo, lSourceRef ) ELSEIF msg:__enumIndex() == 2 cPOT += "msgid_plural " ELSE - cPOT += "msgid_plural" + hb_nToS( msg:__enumIndex() - 1 ) + " " + cPOT += "msgid_plural" + hb_ntos( msg:__enumIndex() - 1 ) + " " ENDIF cPOT += __I18N_strEncode( msg ) cPOT += cEol @@ -363,7 +364,7 @@ FUNCTION __I18N_POTARRAYSAVE( cFile, aTrans, cErrorMsg, lVersionNo, lSourceRef ) lPlural := aItem[ _I18N_PLURAL ] .OR. Len( aItem[ _I18N_MSGSTR ] ) > 1 FOR EACH msg IN aItem[ _I18N_MSGSTR ] IF lPlural - cPOT += "msgstr[" + hb_nToS( msg:__enumIndex() - 1 ) + "] " + cPOT += "msgstr[" + hb_ntos( msg:__enumIndex() - 1 ) + "] " ELSE cPOT += "msgstr " ENDIF @@ -373,20 +374,20 @@ FUNCTION __I18N_POTARRAYSAVE( cFile, aTrans, cErrorMsg, lVersionNo, lSourceRef ) NEXT __I18N_fileName( @cFile ) - hFile := fcreate( cFile ) + hFile := FCreate( cFile ) IF hFile == -1 cErrorMsg := "cannot create translation file: " + cFile - ELSEIF fwrite( hFile, cPOT ) != hb_BLen( cPOT ) + ELSEIF FWrite( hFile, cPOT ) != hb_BLen( cPOT ) cErrorMsg := "cannot write to file: " + cFile ELSE lRet := .T. ENDIF - fclose( hFile ) + FClose( hFile ) RETURN lRet +FUNCTION __i18n_potArrayToHash( aTrans, lEmpty, hI18N ) -FUNCTION __I18N_POTARRAYTOHASH( aTrans, lEmpty, hI18N ) LOCAL aItem LOCAL cContext LOCAL hTrans, hContext @@ -410,19 +411,19 @@ FUNCTION __I18N_POTARRAYTOHASH( aTrans, lEmpty, hI18N ) IF Empty( aItem[ _I18N_MSGSTR, 1 ] ) IF ! aItem[ _I18N_MSGID, 1 ] $ hContext hContext[ aItem[ _I18N_MSGID, 1 ] ] := iif( aItem[ _I18N_PLURAL ], ; - AClone( aItem[ _I18N_MSGID ] ), aItem[ _I18N_MSGID, 1 ] ) + AClone( aItem[ _I18N_MSGID ] ), aItem[ _I18N_MSGID, 1 ] ) ENDIF ELSE hContext[ aItem[ _I18N_MSGID, 1 ] ] := iif( aItem[ _I18N_PLURAL ], ; - AClone( aItem[ _I18N_MSGSTR ] ), aItem[ _I18N_MSGSTR, 1 ] ) + AClone( aItem[ _I18N_MSGSTR ] ), aItem[ _I18N_MSGSTR, 1 ] ) ENDIF ENDIF NEXT RETURN hI18N +FUNCTION __i18n_potArrayTrans( aTrans, hI18N ) -FUNCTION __I18N_POTARRAYTRANS( aTrans, hI18N ) LOCAL aItem LOCAL hContext LOCAL cContext @@ -440,10 +441,10 @@ FUNCTION __I18N_POTARRAYTRANS( aTrans, hI18N ) xTrans := hContext[ aItem[ _I18N_MSGID, 1 ] ] IF aItem[ _I18N_PLURAL ] aItem[ _I18N_MSGSTR ] := iif( HB_ISARRAY( xTrans ), ; - AClone( xTrans ), { xTrans } ) + AClone( xTrans ), { xTrans } ) ELSE aItem[ _I18N_MSGSTR ] := iif( HB_ISARRAY( xTrans ), ; - { xTrans[ 1 ] }, { xTrans } ) + { xTrans[ 1 ] }, { xTrans } ) ENDIF ENDIF ENDIF @@ -452,23 +453,23 @@ FUNCTION __I18N_POTARRAYTRANS( aTrans, hI18N ) RETURN aTrans +FUNCTION __i18n_hashJoin( hTrans, hTrans2 ) -FUNCTION __I18N_HASHJOIN( hTrans, hTrans2 ) LOCAL hContext, hCtx, hDstCtx LOCAL xTrans hContext := hTrans[ "CONTEXT" ] FOR EACH hCtx in hTrans2[ "CONTEXT" ] IF ! hCtx:__enumKey() $ hContext - hContext[ hCtx:__enumKey() ] := hb_hClone( hCtx ) + hContext[ hCtx:__enumKey() ] := hb_HClone( hCtx ) ELSE hDstCtx := hContext[ hCtx:__enumKey() ] FOR EACH xTrans IN hCtx IF !Empty( xTrans ) .AND. ; - ( ! xTrans:__enumKey() $ hDstCtx .OR. ; - Empty( hDstCtx[ xTrans:__enumKey() ] ) ) + ( ! xTrans:__enumKey() $ hDstCtx .OR. ; + Empty( hDstCtx[ xTrans:__enumKey() ] ) ) hDstCtx[ xTrans:__enumKey() ] := iif( HB_ISARRAY( xTrans ), ; - AClone( xTrans ), xTrans ) + AClone( xTrans ), xTrans ) ENDIF NEXT ENDIF @@ -476,8 +477,8 @@ FUNCTION __I18N_HASHJOIN( hTrans, hTrans2 ) RETURN hTrans +FUNCTION __i18n_potArrayJoin( aTrans, aTrans2, hIndex ) -FUNCTION __I18N_POTARRAYJOIN( aTrans, aTrans2, hIndex ) LOCAL aItem, aDest, aSrc LOCAL ctx @@ -503,8 +504,8 @@ FUNCTION __I18N_POTARRAYJOIN( aTrans, aTrans2, hIndex ) IF Empty( aDest[ _I18N_SOURCE ] ) aDest[ _I18N_SOURCE ] := aItem[ _I18N_SOURCE ] ELSE - aSrc := hb_aTokens( aDest[ _I18N_SOURCE ] ) - FOR EACH ctx IN hb_aTokens( aItem[ _I18N_SOURCE ] ) + aSrc := hb_ATokens( aDest[ _I18N_SOURCE ] ) + FOR EACH ctx IN hb_ATokens( aItem[ _I18N_SOURCE ] ) IF hb_AScan( aSrc, ctx,,, .T. ) == 0 aDest[ _I18N_SOURCE ] += " " aDest[ _I18N_SOURCE ] += ctx @@ -514,8 +515,8 @@ FUNCTION __I18N_POTARRAYJOIN( aTrans, aTrans2, hIndex ) ENDIF IF !Empty( aItem[ _I18N_MSGSTR ] ) .AND. ; ( Empty( aDest[ _I18N_MSGSTR ] ) .OR. ; - ( LEN( aDest[ _I18N_MSGSTR ] ) == 1 .AND. ; - Empty( aDest[ _I18N_MSGSTR, 1 ] ) ) ) + ( Len( aDest[ _I18N_MSGSTR ] ) == 1 .AND. ; + Empty( aDest[ _I18N_MSGSTR, 1 ] ) ) ) aDest[ _I18N_MSGSTR ] := AClone( aItem[ _I18N_MSGSTR ] ) ENDIF ENDIF @@ -523,27 +524,27 @@ FUNCTION __I18N_POTARRAYJOIN( aTrans, aTrans2, hIndex ) RETURN aTrans +FUNCTION hb_i18n_LoadPOT( cFile, pI18N, cErrorMsg ) -FUNCTION HB_I18N_LOADPOT( cFile, pI18N, cErrorMsg ) LOCAL aTrans LOCAL hI18N - aTrans := __I18N_POTARRAYLOAD( cFile, @cErrorMsg ) + aTrans := __i18n_potArrayLoad( cFile, @cErrorMsg ) IF aTrans != NIL IF HB_ISPOINTER( pI18N ) - hI18N := __I18N_HASHTABLE( pI18N ) + hI18N := __i18n_hashTable( pI18N ) ENDIF IF hI18N == NIL - pI18N := __I18N_HASHTABLE( __I18N_POTARRAYTOHASH( aTrans ) ) + pI18N := __i18n_hashTable( __i18n_potArrayToHash( aTrans ) ) ELSE - __I18N_POTARRAYTOHASH( aTrans, __I18N_HASHTABLE( pI18N ) ) + __i18n_potArrayToHash( aTrans, __i18n_hashTable( pI18N ) ) ENDIF ENDIF RETURN pI18N +FUNCTION hb_i18n_SavePOT( cFile, pI18N, cErrorMsg ) -FUNCTION HB_I18N_SAVEPOT( cFile, pI18N, cErrorMsg ) LOCAL hI18N LOCAL hFile LOCAL lRet := .T. @@ -551,7 +552,7 @@ FUNCTION HB_I18N_SAVEPOT( cFile, pI18N, cErrorMsg ) LOCAL context, trans, msgctxt, msgstr IF HB_ISPOINTER( pI18N ) - hI18N := __I18N_HASHTABLE( pI18N ) + hI18N := __i18n_hashTable( pI18N ) ENDIF IF hI18N == NIL cErrorMsg := "wrong translation set item" @@ -559,12 +560,13 @@ FUNCTION HB_I18N_SAVEPOT( cFile, pI18N, cErrorMsg ) ELSE cEol := hb_eol() cFlg := "#, c-format" + cEol - cPOT := "#" + cEol + ; - "# This file is generated by " + hb_version() + cEol + ; - "#" + cEol + cPOT := ; + "#" + cEol + ; + "# This file is generated by " + hb_Version() + cEol + ; + "#" + cEol FOR EACH context IN hI18N[ "CONTEXT" ] msgctxt := iif( context:__enumKey() == "", NIL, ; - "msgctxt " + __I18N_strEncode( context:__enumKey() ) + cEol ) + "msgctxt " + __I18N_strEncode( context:__enumKey() ) + cEol ) FOR EACH trans IN context cPOT += cEol + cFlg IF msgctxt != NIL @@ -576,7 +578,7 @@ FUNCTION HB_I18N_SAVEPOT( cFile, pI18N, cErrorMsg ) IF HB_ISARRAY( trans ) FOR EACH msgstr IN trans cPOT += "msgstr[" - cPOT += hb_nToS( msgstr:__enumIndex() - 1 ) + cPOT += hb_ntos( msgstr:__enumIndex() - 1 ) cPOT += "] " cPOT += __I18N_strEncode( msgstr ) cPOT += cEol @@ -590,15 +592,15 @@ FUNCTION HB_I18N_SAVEPOT( cFile, pI18N, cErrorMsg ) NEXT __I18N_fileName( @cFile ) - hFile := fcreate( cFile ) + hFile := FCreate( cFile ) IF hFile == -1 cErrorMsg := "cannot create translation file: " + cFile lRet := .F. - ELSEIF fwrite( hFile, cPOT ) != hb_BLen( cPOT ) + ELSEIF FWrite( hFile, cPOT ) != hb_BLen( cPOT ) cErrorMsg := "cannot write to file: " + cFile lRet := .F. ENDIF - fclose( hFile ) + FClose( hFile ) ENDIF diff --git a/harbour/src/rtl/hbini.prg b/harbour/src/rtl/hbini.prg index 959512eaf9..6004af7682 100644 --- a/harbour/src/rtl/hbini.prg +++ b/harbour/src/rtl/hbini.prg @@ -76,12 +76,10 @@ #include "fileio.ch" - STATIC s_cLineComment := ";" STATIC s_cHalfLineComment := "#" - -PROCEDURE hb_IniSetComment( cLc, cHlc ) +PROCEDURE hb_iniSetComment( cLc, cHlc ) IF HB_ISSTRING( cLc ) s_cLineComment := cLc @@ -93,7 +91,8 @@ PROCEDURE hb_IniSetComment( cLc, cHlc ) RETURN -FUNCTION HB_IniNew( lAutoMain ) +FUNCTION hb_iniNew( lAutoMain ) + LOCAL hIni := { => } hb_HKeepOrder( hIni, .T. ) @@ -109,10 +108,12 @@ FUNCTION HB_IniNew( lAutoMain ) RETURN hIni -FUNCTION hb_IniRead( cFileSpec, lKeyCaseSens, cSplitters, lAutoMain ) - RETURN hb_IniReadStr( iif( HB_ISSTRING( cFileSpec ), hb_IniFileLow( cFileSpec ), "" ), lKeyCaseSens, cSplitters, lAutoMain ) +FUNCTION hb_iniRead( cFileSpec, lKeyCaseSens, cSplitters, lAutoMain ) + + RETURN hb_iniReadStr( iif( HB_ISSTRING( cFileSpec ), hb_IniFileLow( cFileSpec ), "" ), lKeyCaseSens, cSplitters, lAutoMain ) + +FUNCTION hb_iniReadStr( cData, lKeyCaseSens, cSplitters, lAutoMain ) -FUNCTION hb_IniReadStr( cData, lKeyCaseSens, cSplitters, lAutoMain ) LOCAL hIni := { => } hb_HKeepOrder( hIni, .T. ) @@ -141,10 +142,11 @@ FUNCTION hb_IniReadStr( cData, lKeyCaseSens, cSplitters, lAutoMain ) RETURN hb_IniStringLow( hIni, cData, lKeyCaseSens, cSplitters, lAutoMain ) STATIC FUNCTION hb_IniFileLow( cFileSpec ) + LOCAL cFile, nLen LOCAL hFile LOCAL cData - LOCAL aFiles := hb_aTokens( cFileSpec, hb_OSPathListSeparator() ) + LOCAL aFiles := hb_ATokens( cFileSpec, hb_osPathListSeparator() ) IF Empty( aFiles ) aFiles := { cFileSpec } @@ -173,6 +175,7 @@ STATIC FUNCTION hb_IniFileLow( cFileSpec ) RETURN cData STATIC FUNCTION hb_IniStringLow( hIni, cData, lKeyCaseSens, cSplitters, lAutoMain ) + LOCAL nLen LOCAL aKeyVal, hCurrentSection LOCAL nLineEnd @@ -289,13 +292,13 @@ STATIC FUNCTION hb_IniStringLow( hIni, cData, lKeyCaseSens, cSplitters, lAutoMai RETURN hIni +FUNCTION hb_iniWrite( xFileName, hIni, cCommentBegin, cCommentEnd, lAutoMain ) -FUNCTION hb_IniWrite( xFileName, hIni, cCommentBegin, cCommentEnd, lAutoMain ) LOCAL hFile LOCAL lClose LOCAL cBuffer - cBuffer := hb_IniWriteStr( hIni, cCommentBegin, cCommentEnd, lAutoMain ) + cBuffer := hb_iniWriteStr( hIni, cCommentBegin, cCommentEnd, lAutoMain ) // if cBuffer == NIL I have to stop here IF ! HB_ISSTRING( cBuffer ) @@ -329,7 +332,8 @@ FUNCTION hb_IniWrite( xFileName, hIni, cCommentBegin, cCommentEnd, lAutoMain ) RETURN .T. -FUNCTION hb_IniWriteStr( hIni, cCommentBegin, cCommentEnd, lAutoMain ) +FUNCTION hb_iniWriteStr( hIni, cCommentBegin, cCommentEnd, lAutoMain ) + LOCAL cNewLine := hb_eol() LOCAL cSection LOCAL cBuffer := "" @@ -355,14 +359,14 @@ FUNCTION hb_IniWriteStr( hIni, cCommentBegin, cCommentEnd, lAutoMain ) IF lAutoMain /* When automain is on, write the main section */ hb_HEval( hIni[ "MAIN" ], ; - {| cKey, xVal | cBuffer += hb_CStr( cKey ) + " = " + ; - hb_CStr( xVal ) + cNewLine } ) + {| cKey, xVal | cBuffer += hb_CStr( cKey ) + " = " + ; + hb_CStr( xVal ) + cNewLine } ) ELSE /* When automain is off, just write all the toplevel variables. */ - hb_HEval( hIni, {| cKey, xVal | iif( ! HB_ISHASH( xVal ),; - cBuffer += hb_CStr( cKey ) + " = " + ; - hb_CStr( xVal ) + cNewLine, /* nothing */ ) } ) + hb_HEval( hIni, {| cKey, xVal | iif( ! HB_ISHASH( xVal ), ; + cBuffer += hb_CStr( cKey ) + " = " + ; + hb_CStr( xVal ) + cNewLine, /* nothing */ ) } ) ENDIF FOR EACH cSection IN hIni @@ -383,8 +387,8 @@ FUNCTION hb_IniWriteStr( hIni, cCommentBegin, cCommentEnd, lAutoMain ) cBuffer += cNewLine + "[" + hb_CStr( cSection:__enumKey ) + "]" + cNewLine hb_HEval( cSection, ; - {| cKey, xVal | cBuffer += hb_CStr( cKey ) + "=" + ; - hb_CStr( xVal ) + cNewLine } ) + {| cKey, xVal | cBuffer += hb_CStr( cKey ) + "=" + ; + hb_CStr( xVal ) + cNewLine } ) NEXT IF HB_ISSTRING( cCommentEnd ) .AND. ! Empty( cCommentEnd ) diff --git a/harbour/src/rtl/hbsocket.c b/harbour/src/rtl/hbsocket.c index 95a44f8b43..f3ee2b04d5 100644 --- a/harbour/src/rtl/hbsocket.c +++ b/harbour/src/rtl/hbsocket.c @@ -808,8 +808,8 @@ typedef union } HB_SOCKADDR_STORAGE; /* MT macros */ -#define HB_SOCKET_LOCK hb_threadEnterCriticalSection( &s_sockMtx ); -#define HB_SOCKET_UNLOCK hb_threadLeaveCriticalSection( &s_sockMtx ); +#define HB_SOCKET_LOCK() hb_threadEnterCriticalSection( &s_sockMtx ) +#define HB_SOCKET_UNLOCK() hb_threadLeaveCriticalSection( &s_sockMtx ) static HB_CRITICAL_NEW( s_sockMtx ); static int s_iSessions; @@ -838,7 +838,7 @@ int hb_socketInit( void ) { int ret = 0; - HB_SOCKET_LOCK + HB_SOCKET_LOCK(); if( ++s_iSessions == 1 ) { #if defined( HB_OS_WIN ) @@ -848,14 +848,14 @@ int hb_socketInit( void ) ret = sock_init(); #endif } - HB_SOCKET_UNLOCK + HB_SOCKET_UNLOCK(); return ret; } void hb_socketCleanup( void ) { - HB_SOCKET_LOCK + HB_SOCKET_LOCK(); if( --s_iSessions == 0 ) { #if defined( HB_OS_WIN ) @@ -864,7 +864,7 @@ void hb_socketCleanup( void ) sock_exit(); #endif } - HB_SOCKET_UNLOCK + HB_SOCKET_UNLOCK(); } static void hb_socketSetOsError( int err ) diff --git a/harbour/src/rtl/input.prg b/harbour/src/rtl/input.prg index 68d2a67dcb..98f292ff68 100644 --- a/harbour/src/rtl/input.prg +++ b/harbour/src/rtl/input.prg @@ -53,6 +53,7 @@ #ifdef HB_CLP_UNDOC FUNCTION __Input( xPrompt ) + LOCAL cString := __Accept( xPrompt ) RETURN iif( Empty( cString ), NIL, &cString ) diff --git a/harbour/src/rtl/langcomp.prg b/harbour/src/rtl/langcomp.prg index 7366ed6d74..d27eb835e7 100644 --- a/harbour/src/rtl/langcomp.prg +++ b/harbour/src/rtl/langcomp.prg @@ -57,12 +57,13 @@ REQUEST HB_CODEPAGE_UTF8 These cannot have a compatibility puller symbol in langlgcy.prg, which in turn pulls all CP modules, so we're pulling them from here. */ - REQUEST HB_CODEPAGE_CS852 - REQUEST HB_CODEPAGE_DE850 - REQUEST HB_CODEPAGE_EL737 +REQUEST HB_CODEPAGE_CS852 +REQUEST HB_CODEPAGE_DE850 +REQUEST HB_CODEPAGE_EL737 #endif FUNCTION hb_langSelect( cLangID, cCP ) + LOCAL tmp LOCAL cCPDef LOCAL cLangIDBase @@ -182,6 +183,7 @@ FUNCTION hb_langSelect( cLangID, cCP ) RETURN __hb_langSelect( cLangID ) STATIC FUNCTION __LangStdToLangHb( cLangStd ) + LOCAL cLangHb := "" IF HB_ISSTRING( cLangStd ) diff --git a/harbour/src/rtl/libname.prg b/harbour/src/rtl/libname.prg index 8f5efa5a9f..d913c9a799 100644 --- a/harbour/src/rtl/libname.prg +++ b/harbour/src/rtl/libname.prg @@ -50,7 +50,8 @@ * */ -FUNCTION hb_LibName( cLibName, cLibDir ) +FUNCTION hb_libName( cLibName, cLibDir ) + LOCAL cDir, cName, cExt IF HB_ISSTRING( cLibName ) diff --git a/harbour/src/rtl/listbox.prg b/harbour/src/rtl/listbox.prg index a0537eb277..d89756d1fe 100644 --- a/harbour/src/rtl/listbox.prg +++ b/harbour/src/rtl/listbox.prg @@ -166,7 +166,7 @@ ENDCLASS METHOD addItem( cText, cData ) CLASS LISTBOX - IF HB_ISSTRING( cText ) .AND. Valtype( cData ) $ "CU" + IF HB_ISSTRING( cText ) .AND. ValType( cData ) $ "CU" AAdd( ::aItems, { cText, cData } ) @@ -257,11 +257,11 @@ METHOD display() CLASS LISTBOX IF ::lDropDown - hb_dispOutAt( nTop, nLeft,; - iif( ::nValue == 0, Space( nSize - 1 ), PadR( ::aItems[ ::nValue ][ _ITEM_cTEXT ], nSize - 1 ) ),; + hb_DispOutAt( nTop, nLeft, ; + iif( ::nValue == 0, Space( nSize - 1 ), PadR( ::aItems[ ::nValue ][ _ITEM_cTEXT ], nSize - 1 ) ), ; cColorAny ) - hb_dispOutAt( nTop++, nLeft + nSize - 1, ::cStyle, hb_ColorIndex( ::cColorSpec, 7 ) ) + hb_DispOutAt( nTop++, nLeft + nSize - 1, ::cStyle, hb_ColorIndex( ::cColorSpec, 7 ) ) nEnd-- ENDIF @@ -270,8 +270,8 @@ METHOD display() CLASS LISTBOX IF !Empty( cHotBox ) cColorScrl := hb_ColorIndex( ::cColorSpec, 4 ) - hb_scroll( nTop, nLeft, ::nBottom, ::nRight,,, cColorScrl ) - hb_dispBox( nTop, nLeft, ::nBottom, ::nRight, cHotBox, cColorScrl ) + hb_Scroll( nTop, nLeft, ::nBottom, ::nRight,,, cColorScrl ) + hb_DispBox( nTop, nLeft, ::nBottom, ::nRight, cHotBox, cColorScrl ) IF ::oVScroll != NIL ::oVScroll:display() @@ -289,7 +289,7 @@ METHOD display() CLASS LISTBOX ENDIF FOR nItem := ::nTopItem TO nEnd - hb_dispOutAt( nTop++, nLeft, PadR( ::aItems[ nItem ][ _ITEM_cTEXT ], nSize ), iif( nItem == ::nValue, cColor4, cColor3 ) ) + hb_DispOutAt( nTop++, nLeft, PadR( ::aItems[ nItem ][ _ITEM_cTEXT ], nSize ), iif( nItem == ::nValue, cColor4, cColor3 ) ) NEXT ENDIF @@ -302,17 +302,16 @@ METHOD display() CLASS LISTBOX cCaption := Stuff( cCaption, nPos, 1, "" ) ENDIF - hb_dispOutAt( ::nCapRow, ::nCapCol - 1, cCaption, hb_ColorIndex( ::cColorSpec, 5 ) ) + hb_DispOutAt( ::nCapRow, ::nCapCol - 1, cCaption, hb_ColorIndex( ::cColorSpec, 5 ) ) IF nPos != 0 - hb_dispOutAt( ::nCapRow, ::nCapCol + nPos - 2, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, 6 ) ) + hb_DispOutAt( ::nCapRow, ::nCapCol + nPos - 2, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, 6 ) ) ENDIF ENDIF DispEnd() - RETURN Self METHOD findText( cText, nPos, lCaseSensitive, lExact ) CLASS LISTBOX @@ -518,6 +517,7 @@ METHOD insItem( nPos, cText, cData ) RETURN Self METHOD killFocus() CLASS LISTBOX + LOCAL nOldMCur IF ::lHasFocus @@ -557,11 +557,13 @@ METHOD open() CLASS LISTBOX IF ! ::lIsOpen - ::aSaveScr := { ::nTop + 1,; - ::nLeft,; - ::nBottom,; - ::nRight,; - Savescreen( ::nTop + 1, ::nLeft, ::nBottom, ::nRight ) } + ::aSaveScr := { ; + ::nTop + 1,; + ::nLeft,; + ::nBottom,; + ::nRight,; + Savescreen( ::nTop + 1, ::nLeft, ::nBottom, ::nRight ) } + ::lIsOpen := .T. ::display() ENDIF @@ -690,12 +692,12 @@ METHOD select( xPos ) CLASS LISTBOX LOCAL nValue LOCAL nPos - LOCAL cType := Valtype( xPos ) + LOCAL cType := ValType( xPos ) DO CASE CASE cType == "C" nPos := ::findData( xPos ) - IF !( Valtype( ::xBuffer ) $ "CU" ) + IF !( ValType( ::xBuffer ) $ "CU" ) ::xBuffer := nPos ELSEIF ::nValue == 0 ::xBuffer := xPos @@ -712,7 +714,7 @@ METHOD select( xPos ) CLASS LISTBOX RETURN ::nValue OTHERWISE nPos := xPos - IF Valtype( ::xBuffer ) $ "NU" + IF ValType( ::xBuffer ) $ "NU" ::xBuffer := nPos ELSEIF nPos == 0 ::xBuffer := "" @@ -905,9 +907,9 @@ METHOD coldBox( cColdBox ) CLASS LISTBOX METHOD colorSpec( cColorSpec ) CLASS LISTBOX IF cColorSpec != NIL - ::cColorSpec := __eInstVar53( Self, "COLORSPEC", cColorSpec, "C", 1001,; - iif( ::lDropDown,; - {|| !Empty( hb_ColorIndex( cColorSpec, 7 ) ) .AND. Empty( hb_ColorIndex( cColorSpec, 8 ) ) },; + ::cColorSpec := __eInstVar53( Self, "COLORSPEC", cColorSpec, "C", 1001, ; + iif( ::lDropDown, ; + {|| !Empty( hb_ColorIndex( cColorSpec, 7 ) ) .AND. Empty( hb_ColorIndex( cColorSpec, 8 ) ) }, ; {|| !Empty( hb_ColorIndex( cColorSpec, 6 ) ) .AND. Empty( hb_ColorIndex( cColorSpec, 7 ) ) } ) ) ENDIF @@ -1081,13 +1083,14 @@ METHOD New( nTop, nLeft, nBottom, nRight, lDropDown ) ::cColorSpec := "W/N,W+/N,W+/N,N/W,W/N,W/N,W+/N,W/N" ELSE cColor := SetColor() - ::cColorSpec := hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," +; - hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," +; - hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," +; - hb_ColorIndex( cColor, CLR_ENHANCED ) + "," +; - hb_ColorIndex( cColor, CLR_BORDER ) + "," +; - hb_ColorIndex( cColor, CLR_STANDARD ) + "," +; - hb_ColorIndex( cColor, CLR_BACKGROUND ) + ::cColorSpec := ; + hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," + ; + hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," + ; + hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," + ; + hb_ColorIndex( cColor, CLR_ENHANCED ) + "," + ; + hb_ColorIndex( cColor, CLR_BORDER ) + "," + ; + hb_ColorIndex( cColor, CLR_STANDARD ) + "," + ; + hb_ColorIndex( cColor, CLR_BACKGROUND ) ENDIF RETURN Self diff --git a/harbour/src/rtl/memoedit.prg b/harbour/src/rtl/memoedit.prg index 2e1437dc52..6a9f796ca8 100644 --- a/harbour/src/rtl/memoedit.prg +++ b/harbour/src/rtl/memoedit.prg @@ -163,7 +163,7 @@ METHOD KeyboardHook( nKey ) CLASS HBMemoEditor nRow := Row() nCol := Col() - hb_dispOutAt( 0, MaxCol() - 18, "Abort Edit? (Y/N)" ) + hb_DispOutAt( 0, MaxCol() - 18, "Abort Edit? (Y/N)" ) SetPos( 0, MaxCol() - 1 ) nYesNoKey := Inkey( 0 ) @@ -271,21 +271,22 @@ METHOD MoveCursor( nKey ) CLASS HBMemoEditor RETURN .F. -/*----------------------------------------------------------------------------------------*/ +/* ------------------------------------------ */ -FUNCTION MemoEdit( cString,; - nTop,; - nLeft,; - nBottom,; - nRight,; - lEditMode,; - xUserFunction,; - nLineLength,; - nTabSize,; - nTextBuffRow,; - nTextBuffColumn,; - nWindowRow,; - nWindowColumn ) +FUNCTION MemoEdit( ; + cString,; + nTop,; + nLeft,; + nBottom,; + nRight,; + lEditMode,; + xUserFunction,; + nLineLength,; + nTabSize,; + nTextBuffRow,; + nTextBuffColumn,; + nWindowRow,; + nWindowColumn ) LOCAL oEd diff --git a/harbour/src/rtl/memvarbl.prg b/harbour/src/rtl/memvarbl.prg index 47f5c341b2..93026bb3e4 100644 --- a/harbour/src/rtl/memvarbl.prg +++ b/harbour/src/rtl/memvarbl.prg @@ -52,10 +52,10 @@ #include "hbmemvar.ch" -FUNCTION MEMVARBLOCK( cMemvar ) +FUNCTION MemVarBlock( cMemvar ) - IF HB_ISSTRING( cMemvar ) .AND. __mvEXIST( cMemvar ) - RETURN {| x | iif( x == NIL, __mvGET( cMemvar ), __mvPUT( cMemvar, x ) ) } + IF HB_ISSTRING( cMemvar ) .AND. __mvExist( cMemvar ) + RETURN {| x | iif( x == NIL, __mvGet( cMemvar ), __mvPut( cMemvar, x ) ) } ENDIF RETURN NIL diff --git a/harbour/src/rtl/memvarhb.prg b/harbour/src/rtl/memvarhb.prg index fe8ae3b4ad..b068534ab0 100644 --- a/harbour/src/rtl/memvarhb.prg +++ b/harbour/src/rtl/memvarhb.prg @@ -65,16 +65,20 @@ * previously-saved files is required, only a naive approach of using * version 1 is taken. */ -#define _HBMEM_SIGNATURE ( HB_BCHAR( 0xC0 ) + ; - HB_BCHAR( 0x48 ) + ; - HB_BCHAR( 0x42 ) + ; - HB_BCHAR( 0x56 ) + ; - HB_BCHAR( 0x01 ) + ; - HB_BCHAR( 0x00 ) ) -#define _HBMEM_SIG_LEN 6 + #define _HBMEM_EXT ".hbv" -FUNCTION HB_MVSAVE( cFileName, cMask, lIncludeMask ) +#define _HBMEM_SIG_LEN 6 +#define _HBMEM_SIGNATURE ( ; + hb_BChar( 0xC0 ) + ; + hb_BChar( 0x48 ) + ; + hb_BChar( 0x42 ) + ; + hb_BChar( 0x56 ) + ; + hb_BChar( 0x01 ) + ; + hb_BChar( 0x00 ) ) + +FUNCTION hb_mvSave( cFileName, cMask, lIncludeMask ) + LOCAL nCount LOCAL xValue LOCAL cName @@ -145,7 +149,7 @@ FUNCTION HB_MVSAVE( cFileName, cMask, lIncludeMask ) IF fhnd != F_ERROR FWrite( fhnd, _HBMEM_SIGNATURE ) - FWrite( fhnd, hb_serialize( aVars ) ) + FWrite( fhnd, hb_Serialize( aVars ) ) FClose( fhnd ) ENDIF ELSE @@ -165,7 +169,8 @@ FUNCTION HB_MVSAVE( cFileName, cMask, lIncludeMask ) RETURN NIL -FUNCTION HB_MVRESTORE( cFileName, lAdditive, cMask, lIncludeMask ) +FUNCTION hb_mvRestore( cFileName, lAdditive, cMask, lIncludeMask ) + LOCAL item LOCAL cName LOCAL lMatch @@ -242,7 +247,7 @@ FUNCTION HB_MVRESTORE( cFileName, lAdditive, cMask, lIncludeMask ) FRead( fhnd, @cBuffer, Len( cBuffer ) ) FClose( fhnd ) - aVars := hb_deserialize( cBuffer ) + aVars := hb_Deserialize( cBuffer ) cBuffer := NIL IF HB_ISARRAY( aVars ) diff --git a/harbour/src/rtl/menusys.prg b/harbour/src/rtl/menusys.prg index 1a9097f911..4d58f9e1c5 100644 --- a/harbour/src/rtl/menusys.prg +++ b/harbour/src/rtl/menusys.prg @@ -78,7 +78,8 @@ FUNCTION ShowMsg( aMsg, lMode ) * ShortCut processing for initial Get or Menu Item. * ***/ -FUNCTION IsShortCut( oMenu, nKey, nID ) +FUNCTION IsShortcut( oMenu, nKey, nID ) + LOCAL nItem LOCAL nTotal LOCAL nShortCut @@ -138,6 +139,7 @@ FUNCTION IsShortCut( oMenu, nKey, nID ) * ***/ FUNCTION IsQuick( oMenu, nKey, nID ) + LOCAL nItem LOCAL nTotal LOCAL nShortCut diff --git a/harbour/src/rtl/menuto.prg b/harbour/src/rtl/menuto.prg index bac0d6319a..47b2c027c8 100644 --- a/harbour/src/rtl/menuto.prg +++ b/harbour/src/rtl/menuto.prg @@ -72,9 +72,10 @@ FUNCTION __MenuTo( bBlock, cVariable ) LOCAL cFrontColor // Detect if a memvar was passed - lDeclared := !__mvEXIST( cVariable ) + lDeclared := ! __mvExist( cVariable ) + IF lDeclared - __mvPUBLIC( cVariable ) + __mvPublic( cVariable ) ENDIF n := Eval( bBlock ) @@ -145,9 +146,9 @@ FUNCTION __MenuTo( bBlock, cVariable ) q := n IF t_aLevel[ t_nPointer - 1, n, 5 ] != NIL - aColor := COLORARRAY( t_aLevel[ t_nPointer - 1, n, 5 ] ) - cFrontColor := iif( Empty( aColor[ 1 ] ), NIL, aColor[ 1 ] ) - cBackColor := iif( Len( aColor ) > 1, aColor[ 2 ], NIL ) + aColor := COLORARRAY( t_aLevel[ t_nPointer - 1, n, 5 ] ) + cFrontColor := iif( Empty( aColor[ 1 ] ), NIL, aColor[ 1 ] ) + cBackColor := iif( Len( aColor ) > 1, aColor[ 2 ], NIL ) ENDIF IF Set( _SET_INTENSITY ) @@ -157,14 +158,14 @@ FUNCTION __MenuTo( bBlock, cVariable ) ENDIF // highlight the prompt - DispOutAt( t_aLevel[ nPointer - 1, n, 1 ],; - t_aLevel[ nPointer - 1, n, 2 ],; - t_aLevel[ nPointer - 1, n, 3 ],; - cBackColor ) + DispOutAt( t_aLevel[ nPointer - 1, n, 1 ], ; + t_aLevel[ nPointer - 1, n, 2 ], ; + t_aLevel[ nPointer - 1, n, 3 ], ; + cBackColor ) IF Set( _SET_INTENSITY ) IF cFrontColor == NIL // Only select Color Enhace if no color was passed - ColorSelect( CLR_STANDARD ) + ColorSelect( CLR_STANDARD ) ENDIF ENDIF @@ -203,11 +204,11 @@ FUNCTION __MenuTo( bBlock, cVariable ) CASE K_LBUTTONDOWN CASE K_LDBLCLK IF ( nMouseClik := HitTest( t_aLevel[ nPointer - 1 ], ; - MRow(), MCol() ) ) > 0 + MRow(), MCol() ) ) > 0 n := nMouseClik ENDIF IF nKey == K_LDBLCLK - lExit := .T. + lExit := .T. ENDIF EXIT #endif @@ -251,10 +252,11 @@ FUNCTION __MenuTo( bBlock, cVariable ) ENDSWITCH IF n != 0 - DispOutAt( t_aLevel[ nPointer - 1, q, 1 ],; - t_aLevel[ nPointer - 1, q, 2 ],; - t_aLevel[ nPointer - 1, q, 3 ],; - cFrontColor ) + DispOutAt( ; + t_aLevel[ nPointer - 1, q, 1 ], ; + t_aLevel[ nPointer - 1, q, 2 ], ; + t_aLevel[ nPointer - 1, q, 3 ], ; + cFrontColor ) ENDIF ENDDO @@ -271,7 +273,7 @@ FUNCTION __MenuTo( bBlock, cVariable ) Eval( bBlock, n ) IF lDeclared - __mvXRELEASE( cVariable ) + __mvXRelease( cVariable ) ENDIF SetPos( MaxRow() - 1, 0 ) diff --git a/harbour/src/rtl/objfunc.prg b/harbour/src/rtl/objfunc.prg index 5d09a045bc..2148163c1c 100644 --- a/harbour/src/rtl/objfunc.prg +++ b/harbour/src/rtl/objfunc.prg @@ -75,8 +75,9 @@ FUNCTION __objHasData( oObject, cSymbol ) __errRT_BASE( EG_ARG, 3101, NIL, ProcName( 0 ) ) ENDIF - RETURN __objHasMsg( oObject, cSymbol ) .AND. ; - __objHasMsg( oObject, "_" + cSymbol ) + RETURN ; + __objHasMsg( oObject, cSymbol ) .AND. ; + __objHasMsg( oObject, "_" + cSymbol ) FUNCTION __objHasMethod( oObject, cSymbol ) @@ -84,10 +85,12 @@ FUNCTION __objHasMethod( oObject, cSymbol ) __errRT_BASE( EG_ARG, 3101, NIL, ProcName( 0 ) ) ENDIF - RETURN __objHasMsg( oObject, cSymbol ) .AND. ; - !__objHasMsg( oObject, "_" + cSymbol ) + RETURN ; + __objHasMsg( oObject, cSymbol ) .AND. ; + ! __objHasMsg( oObject, "_" + cSymbol ) FUNCTION __objGetMsgList( oObject, lDataMethod, nClassType ) + LOCAL aInfo LOCAL aData LOCAL n @@ -110,7 +113,7 @@ FUNCTION __objGetMsgList( oObject, lDataMethod, nClassType ) n := 1 nLen := Len( aInfo ) - DO WHILE n <= nLen .AND. !( Substr( aInfo[ n ], 1, 1 ) == "_" ) + DO WHILE n <= nLen .AND. !( SubStr( aInfo[ n ], 1, 1 ) == "_" ) /* If in range and no set function found yet (set functions begin with a leading underscore). */ @@ -138,7 +141,8 @@ FUNCTION __objGetMethodList( oObject ) RETURN __objGetMsgList( oObject, .F. ) -FUNCTION __objGetValueList( oObject, aExcept ) +FUNCTION __objGetValueLIST( oObject, aExcept ) + LOCAL aDataSymbol LOCAL nLen LOCAL aData @@ -157,7 +161,7 @@ FUNCTION __objGetValueList( oObject, aExcept ) nLen := Len( aDataSymbol ) aData := {} - FOR n := 1 to nLen + FOR n := 1 TO nLen cSymbol := aDataSymbol[ n ] IF AScan( aExcept, {| tmp | tmp == cSymbol } ) == 0 AAdd( aData, { cSymbol, __objSendMsg( oObject, cSymbol ) } ) @@ -197,6 +201,7 @@ FUNCTION __objAddInline( oObject, cSymbol, bInline ) RETURN oObject FUNCTION __objAddData( oObject, cSymbol ) + LOCAL nSeq, hClass IF ! HB_ISOBJECT( oObject ) .OR. ! HB_ISSTRING( cSymbol ) @@ -256,6 +261,7 @@ FUNCTION __objDelData( oObject, cSymbol ) RETURN oObject FUNCTION __objDerivedFrom( oObject, xSuper ) + LOCAL cClassName IF ! HB_ISOBJECT( oObject ) @@ -273,6 +279,7 @@ FUNCTION __objDerivedFrom( oObject, xSuper ) RETURN __clsParent( oObject:ClassH, cClassName ) FUNCTION __objGetProperties( oObject, lAllExported ) + LOCAL msg LOCAL aMsgList := __clsGetProperties( oObject:classH, lAllExported ) diff --git a/harbour/src/rtl/profiler.prg b/harbour/src/rtl/profiler.prg index d8d496aa91..c7b23946db 100644 --- a/harbour/src/rtl/profiler.prg +++ b/harbour/src/rtl/profiler.prg @@ -99,7 +99,7 @@ #include "hbclass.ch" #include "fileio.ch" -//////////////////////////////////////////////////////////////////////////// +// --------------------------------------------------------- // Class: HBProfileEntity CREATE CLASS HBProfileEntity @@ -119,7 +119,7 @@ CREATE CLASS HBProfileEntity ENDCLASS -///// +// METHOD init( cName, aInfo ) CLASS HBProfileEntity @@ -145,7 +145,7 @@ METHOD describe() CLASS HBProfileEntity RETURN "Base Entity" -//////////////////////////////////////////////////////////////////////////// +// --------------------------------------------------------- // Class: HBProfileFunction CREATE CLASS HBProfileFunction INHERIT HBProfileEntity @@ -156,13 +156,13 @@ CREATE CLASS HBProfileFunction INHERIT HBProfileEntity ENDCLASS -///// +// METHOD describe() CLASS HBProfileFunction RETURN "Function" -//////////////////////////////////////////////////////////////////////////// +// --------------------------------------------------------- // Class: HBProfileMethod CREATE CLASS HBProfileMethod INHERIT HBProfileEntity @@ -173,13 +173,13 @@ CREATE CLASS HBProfileMethod INHERIT HBProfileEntity ENDCLASS -///// +// METHOD describe() CLASS HBProfileMethod RETURN "Method" -//////////////////////////////////////////////////////////////////////////// +// --------------------------------------------------------- // Class: HBProfileOPCode CREATE CLASS HBProfileOPCode INHERIT HBProfileEntity @@ -190,13 +190,13 @@ CREATE CLASS HBProfileOPCode INHERIT HBProfileEntity ENDCLASS -///// +// METHOD describe() CLASS HBProfileOPCode RETURN "OPCode" -//////////////////////////////////////////////////////////////////////////// +// --------------------------------------------------------- // Class: HBProfile CREATE CLASS HBProfile @@ -225,7 +225,7 @@ CREATE CLASS HBProfile ENDCLASS -///// +// METHOD init() CLASS HBProfile @@ -416,7 +416,7 @@ METHOD totalSeconds() CLASS HBProfile RETURN nSeconds -//////////////////////////////////////////////////////////////////////////// +// --------------------------------------------------------- // Class: HBProfileLowLevel CREATE CLASS HBProfileLowLevel INHERIT HBProfile @@ -431,7 +431,7 @@ CREATE CLASS HBProfileLowLevel INHERIT HBProfile ENDCLASS -///// +// METHOD gather() CLASS HBProfileLowLevel @@ -464,7 +464,7 @@ METHOD gatherOPCodes() CLASS HBProfileLowLevel RETURN Self -//////////////////////////////////////////////////////////////////////////// +// --------------------------------------------------------- // Class: HBProfileReport CREATE CLASS HBProfileReport @@ -486,7 +486,7 @@ CREATE CLASS HBProfileReport ENDCLASS -///// +// METHOD init( oProfile ) CLASS HBProfileReport @@ -545,7 +545,7 @@ METHOD generate( bFilter ) CLASS HBProfileReport RETURN Self -//////////////////////////////////////////////////////////////////////////// +// --------------------------------------------------------- // Class: HBProfileReportToFile CREATE CLASS HBProfileReportToFile INHERIT HBProfileReport @@ -562,7 +562,7 @@ CREATE CLASS HBProfileReportToFile INHERIT HBProfileReport ENDCLASS -///// +// METHOD writeLines( aLines ) CLASS HBProfileReportToFile @@ -591,7 +591,7 @@ METHOD generate( bFilter, cFile ) CLASS HBProfileReportToFile RETURN Self -//////////////////////////////////////////////////////////////////////////// +// --------------------------------------------------------- // Class: HBProfileReportToArray CREATE CLASS HBProfileReportToArray INHERIT HBProfileReport @@ -608,7 +608,7 @@ CREATE CLASS HBProfileReportToArray INHERIT HBProfileReport ENDCLASS -///// +// METHOD writeLines( aLines ) CLASS HBProfileReportToArray @@ -623,7 +623,7 @@ METHOD generate( bFilter ) CLASS HBProfileReportToArray RETURN ::aReport -//////////////////////////////////////////////////////////////////////////// +// --------------------------------------------------------- // Class: HBProfileReportToString CREATE CLASS HBProfileReportToString INHERIT HBProfileReportToArray @@ -634,7 +634,7 @@ CREATE CLASS HBProfileReportToString INHERIT HBProfileReportToArray ENDCLASS -///// +// METHOD generate( bFilter ) CLASS HBProfileReportToString @@ -644,7 +644,7 @@ METHOD generate( bFilter ) CLASS HBProfileReportToString RETURN cReport -//////////////////////////////////////////////////////////////////////////// +// --------------------------------------------------------- // Class: HBProfileReportToTBrowse CREATE CLASS HBProfileReportToTBrowse INHERIT HBProfileReportToArray @@ -664,7 +664,7 @@ CREATE CLASS HBProfileReportToTBrowse INHERIT HBProfileReportToArray ENDCLASS -///// +// METHOD emitHeader() CLASS HBProfileReportToTBrowse diff --git a/harbour/src/rtl/pushbtn.prg b/harbour/src/rtl/pushbtn.prg index 429e712371..271b1690d5 100644 --- a/harbour/src/rtl/pushbtn.prg +++ b/harbour/src/rtl/pushbtn.prg @@ -233,20 +233,20 @@ METHOD display() CLASS PUSHBUTTON nCol++ IF Len( cStyle ) == 2 - hb_dispOutAt( ::nRow, ::nCol, SubStr( cStyle, 1, 1 ), cColor ) - hb_dispOutAt( ::nRow, ::nCol + Len( cCaption ) + 1, SubStr( cStyle, 2, 1 ), cColor ) + hb_DispOutAt( ::nRow, ::nCol, SubStr( cStyle, 1, 1 ), cColor ) + hb_DispOutAt( ::nRow, ::nCol + Len( cCaption ) + 1, SubStr( cStyle, 2, 1 ), cColor ) ELSE nRow++ - hb_dispBox( ::nRow, ::nCol, ::nRow + 2, ::nCol + Len( cCaption ) + 1, cStyle, cColor ) + hb_DispBox( ::nRow, ::nCol, ::nRow + 2, ::nCol + Len( cCaption ) + 1, cStyle, cColor ) ENDIF ENDIF IF !Empty( cCaption ) - hb_dispOutAt( nRow, nCol, cCaption, cColor ) + hb_DispOutAt( nRow, nCol, cCaption, cColor ) IF nPos != 0 - hb_dispOutAt( nRow, nCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, 3 ) ) + hb_DispOutAt( nRow, nCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, 3 ) ) ENDIF ENDIF @@ -356,10 +356,11 @@ METHOD New( nRow, nCol, cCaption ) CLASS PUSHBUTTON ::cColorSpec := "W/N,N/W,W+/N,W+/N" ELSE cColor := SetColor() - ::cColorSpec := hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," +; - hb_ColorIndex( cColor, CLR_ENHANCED ) + "," +; - hb_ColorIndex( cColor, CLR_STANDARD ) + "," +; - hb_ColorIndex( cColor, CLR_BACKGROUND ) + ::cColorSpec := ; + hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," + ; + hb_ColorIndex( cColor, CLR_ENHANCED ) + "," + ; + hb_ColorIndex( cColor, CLR_STANDARD ) + "," + ; + hb_ColorIndex( cColor, CLR_BACKGROUND ) ENDIF RETURN Self @@ -368,6 +369,7 @@ FUNCTION PushButton( nRow, nCol, cCaption ) RETURN HBPushButton():New( nRow, nCol, cCaption ) FUNCTION _PUSHBUTT_( cCaption, cMessage, cColorSpec, bFBlock, bSBlock, cStyle, nSizeX, nSizeY, nCapXOff, nCapYOff, cBitmap, nBmpXOff, nBmpYOff ) + LOCAL o := HBPushButton():New( Row(), Col(), cCaption ) o:message := cMessage diff --git a/harbour/src/rtl/radiobtn.prg b/harbour/src/rtl/radiobtn.prg index c1ddf9eccf..b9c2ba88db 100644 --- a/harbour/src/rtl/radiobtn.prg +++ b/harbour/src/rtl/radiobtn.prg @@ -162,9 +162,9 @@ METHOD display() CLASS RADIOBUTTN DispBegin() cColor := iif( ::lBuffer, hb_ColorIndex( ::cColorSpec, 3 ), hb_ColorIndex( ::cColorSpec, 1 ) ) - hb_dispOutAt( ::nRow, ::nCol, Left( cStyle, 1 ) +; - iif( ::lBuffer, SubStr( cStyle, 2, 1 ), SubStr( cStyle, 3, 1 ) ) +; - Right( cStyle, 1 ), cColor ) + hb_DispOutAt( ::nRow, ::nCol, Left( cStyle, 1 ) + ; + iif( ::lBuffer, SubStr( cStyle, 2, 1 ), SubStr( cStyle, 3, 1 ) ) + ; + Right( cStyle, 1 ), cColor ) IF !Empty( cOldCaption := ::cCaption ) @@ -175,10 +175,10 @@ METHOD display() CLASS RADIOBUTTN cOldCaption := Stuff( cOldCaption, nPos, 1, "" ) ENDIF - hb_dispOutAt( ::nCapRow, ::nCapCol, cOldCaption, hb_ColorIndex( ::cColorSpec, 4 ) ) + hb_DispOutAt( ::nCapRow, ::nCapCol, cOldCaption, hb_ColorIndex( ::cColorSpec, 4 ) ) IF nPos != 0 - hb_dispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cOldCaption, nPos, 1 ), iif( ::lHasfocus, hb_ColorIndex( ::cColorSpec, 6 ), hb_ColorIndex( ::cColorSpec, 5 ) ) ) + hb_DispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cOldCaption, nPos, 1 ), iif( ::lHasfocus, hb_ColorIndex( ::cColorSpec, 6 ), hb_ColorIndex( ::cColorSpec, 5 ) ) ) ENDIF ENDIF @@ -193,7 +193,7 @@ METHOD isAccel( xKey ) CLASS RADIOBUTTN IF HB_ISSTRING( xKey ) cKey := xKey ELSEIF HB_ISNUMERIC( xKey ) - cKey := hb_KeyChar( xKey ) + cKey := hb_keyChar( xKey ) ELSE RETURN .F. ENDIF @@ -279,7 +279,7 @@ METHOD col( nCol ) CLASS RADIOBUTTN METHOD colorSpec( cColorSpec ) CLASS RADIOBUTTN IF cColorSpec != NIL - ::cColorSpec := __eInstVar53( Self, "COLORSPEC", cColorSpec, "C", 1001,; + ::cColorSpec := __eInstVar53( Self, "COLORSPEC", cColorSpec, "C", 1001, ; {|| !Empty( hb_ColorIndex( cColorSpec, 6 ) ) .AND. Empty( hb_ColorIndex( cColorSpec, 7 ) ) } ) ENDIF @@ -344,13 +344,14 @@ METHOD New( nRow, nCol, cCaption, cData ) CLASS RADIOBUTTN ::cColorSpec := "W/N,W+/N,W+/N,N/W,W/N,W/N,W+/N" ELSE cColor := SetColor() - ::cColorSpec := hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," +; - hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," +; - hb_ColorIndex( cColor, CLR_ENHANCED ) + "," +; - hb_ColorIndex( cColor, CLR_ENHANCED ) + "," +; - hb_ColorIndex( cColor, CLR_STANDARD ) + "," +; - hb_ColorIndex( cColor, CLR_STANDARD ) + "," +; - hb_ColorIndex( cColor, CLR_BACKGROUND ) + ::cColorSpec := ; + hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," + ; + hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," + ; + hb_ColorIndex( cColor, CLR_ENHANCED ) + "," + ; + hb_ColorIndex( cColor, CLR_ENHANCED ) + "," + ; + hb_ColorIndex( cColor, CLR_STANDARD ) + "," + ; + hb_ColorIndex( cColor, CLR_STANDARD ) + "," + ; + hb_ColorIndex( cColor, CLR_BACKGROUND ) ENDIF RETURN Self diff --git a/harbour/src/rtl/radiogrp.prg b/harbour/src/rtl/radiogrp.prg index 85d9fc425d..665724aafd 100644 --- a/harbour/src/rtl/radiogrp.prg +++ b/harbour/src/rtl/radiogrp.prg @@ -177,9 +177,9 @@ METHOD display() CLASS RADIOGROUP ENDIF IF !Empty( cSelBox ) - hb_dispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, cSelBox, hb_ColorIndex( ::cColorSpec, 0 ) ) + hb_DispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, cSelBox, hb_ColorIndex( ::cColorSpec, 0 ) ) ELSEIF !Empty( cUnSelBox ) - hb_dispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, cUnSelBox, hb_ColorIndex( ::cColorSpec, 0 ) ) + hb_DispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, cUnSelBox, hb_ColorIndex( ::cColorSpec, 0 ) ) ENDIF IF !Empty( cCaption := ::cCaption ) @@ -192,10 +192,10 @@ METHOD display() CLASS RADIOGROUP ENDIF ENDIF - hb_dispOutAt( ::nCapRow, ::nCapCol, cCaption, hb_ColorIndex( ::cColorSpec, 1 ) ) + hb_DispOutAt( ::nCapRow, ::nCapCol, cCaption, hb_ColorIndex( ::cColorSpec, 1 ) ) IF nPos != 0 - hb_dispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, 2 ) ) + hb_DispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, 2 ) ) ENDIF ENDIF @@ -213,7 +213,7 @@ METHOD getAccel( xValue ) CLASS RADIOGROUP IF HB_ISSTRING( xValue ) cValue := xValue ELSEIF HB_ISNUMERIC( xValue ) - cValue := hb_KeyChar( xValue ) + cValue := hb_keyChar( xValue ) ELSE RETURN 0 ENDIF @@ -386,6 +386,7 @@ METHOD setFocus() CLASS RADIOGROUP RETURN Self METHOD nextItem() CLASS RADIOGROUP + LOCAL nValue IF ::lHasFocus .AND. ::nItemCount > 0 @@ -478,6 +479,7 @@ METHOD setStyle( cStyle ) CLASS RADIOGROUP RETURN Self METHOD changeButton( nUnselect, nSelect ) CLASS RADIOGROUP + LOCAL nOldMCur := MSetCursor( .F. ) IF nUnselect != nSelect @@ -551,7 +553,7 @@ METHOD coldBox( cColdBox ) CLASS RADIOGROUP METHOD colorSpec( cColorSpec ) CLASS RADIOGROUP IF cColorSpec != NIL - ::cColorSpec := __eInstVar53( Self, "COLORSPEC", cColorSpec, "C", 1001,; + ::cColorSpec := __eInstVar53( Self, "COLORSPEC", cColorSpec, "C", 1001, ; {|| !Empty( hb_ColorIndex( cColorSpec, 2 ) ) .AND. Empty( hb_ColorIndex( cColorSpec, 3 ) ) } ) ENDIF @@ -642,9 +644,10 @@ METHOD New( nTop, nLeft, nBottom, nRight ) CLASS RADIOGROUP ::cColorSpec := "W/N,W/N,W+/N" ELSE cColor := SetColor() - ::cColorSpec := hb_ColorIndex( cColor, CLR_BORDER ) + "," + ; - hb_ColorIndex( cColor, CLR_STANDARD ) + "," + ; - hb_ColorIndex( cColor, CLR_BACKGROUND ) + ::cColorSpec := ; + hb_ColorIndex( cColor, CLR_BORDER ) + "," + ; + hb_ColorIndex( cColor, CLR_STANDARD ) + "," + ; + hb_ColorIndex( cColor, CLR_BACKGROUND ) ENDIF RETURN Self diff --git a/harbour/src/rtl/readkey.prg b/harbour/src/rtl/readkey.prg index 30294bccf9..b30cf0c4f1 100644 --- a/harbour/src/rtl/readkey.prg +++ b/harbour/src/rtl/readkey.prg @@ -53,6 +53,7 @@ #include "inkey.ch" FUNCTION ReadKey() + LOCAL nKey := LastKey() SWITCH nKey diff --git a/harbour/src/rtl/savebuff.prg b/harbour/src/rtl/savebuff.prg index bbe20802c8..4b0f0ae002 100644 --- a/harbour/src/rtl/savebuff.prg +++ b/harbour/src/rtl/savebuff.prg @@ -53,16 +53,16 @@ #include "hbgtinfo.ch" FUNCTION __XSaveGetChar( cSaveScreen, nPos ) - RETURN iif( hb_gtInfo( HB_GTI_COMPATBUFFER ),; - Chr( hb_BPeek( cSaveScreen, nPos * 2 + 1 ) ),; + RETURN iif( hb_gtInfo( HB_GTI_COMPATBUFFER ), ; + Chr( hb_BPeek( cSaveScreen, nPos * 2 + 1 ) ), ; hb_UChar( hb_BPeek( cSaveScreen, nPos * 4 + 2 ) * 256 + hb_BPeek( cSaveScreen, nPos * 4 + 1 ) ) ) FUNCTION __XSaveGetColor( cSaveScreen, nPos ) - RETURN iif( hb_gtInfo( HB_GTI_COMPATBUFFER ),; - hb_BPeek( cSaveScreen, nPos * 2 + 2 ),; + RETURN iif( hb_gtInfo( HB_GTI_COMPATBUFFER ), ; + hb_BPeek( cSaveScreen, nPos * 2 + 2 ), ; hb_BPeek( cSaveScreen, nPos * 4 + 3 ) ) FUNCTION __XSaveGetAttr( cSaveScreen, nPos ) - RETURN iif( hb_gtInfo( HB_GTI_COMPATBUFFER ),; - 0,; + RETURN iif( hb_gtInfo( HB_GTI_COMPATBUFFER ), ; + 0, ; hb_BPeek( cSaveScreen, nPos * 4 + 4 ) ) diff --git a/harbour/src/rtl/scrollbr.prg b/harbour/src/rtl/scrollbr.prg index 13ac6820c9..0730d47587 100644 --- a/harbour/src/rtl/scrollbr.prg +++ b/harbour/src/rtl/scrollbr.prg @@ -133,21 +133,21 @@ METHOD display() CLASS SCROLLBAR IF ::nOrient == SCROLL_VERTICAL FOR nPos := nStart + 1 TO nEnd - hb_dispOutAt( nPos, nOffset, SubStr( cStyle, 2, 1 ), cColor ) + hb_DispOutAt( nPos, nOffset, SubStr( cStyle, 2, 1 ), cColor ) NEXT cColor := hb_ColorIndex( ::cColorSpec, 1 ) - hb_dispOutAt( nStart, nOffset, SubStr( cStyle, 1, 1 ), cColor ) - hb_dispOutAt( nStart + ::nThumbPos, nOffset, SubStr( cStyle, 3, 1 ), cColor ) - hb_dispOutAt( nEnd + 1, nOffset, SubStr( cStyle, 4, 1 ), cColor ) + hb_DispOutAt( nStart, nOffset, SubStr( cStyle, 1, 1 ), cColor ) + hb_DispOutAt( nStart + ::nThumbPos, nOffset, SubStr( cStyle, 3, 1 ), cColor ) + hb_DispOutAt( nEnd + 1, nOffset, SubStr( cStyle, 4, 1 ), cColor ) ELSE - hb_dispOutAt( nOffset, nStart + 1, Replicate( SubStr( cStyle, 2, 1 ), nEnd - nStart ), cColor ) + hb_DispOutAt( nOffset, nStart + 1, Replicate( SubStr( cStyle, 2, 1 ), nEnd - nStart ), cColor ) cColor := hb_ColorIndex( ::cColorSpec, 1 ) - hb_dispOutAt( nOffset, nStart, SubStr( cStyle, 1, 1 ), cColor ) - hb_dispOutAt( nOffset, nStart + ::nThumbPos, SubStr( cStyle, 3, 1 ), cColor ) - hb_dispOutAt( nOffset, nEnd + 1, SubStr( cStyle, 4, 1 ), cColor ) + hb_DispOutAt( nOffset, nStart, SubStr( cStyle, 1, 1 ), cColor ) + hb_DispOutAt( nOffset, nStart + ::nThumbPos, SubStr( cStyle, 3, 1 ), cColor ) + hb_DispOutAt( nOffset, nEnd + 1, SubStr( cStyle, 4, 1 ), cColor ) ENDIF @@ -171,11 +171,11 @@ METHOD update() CLASS SCROLLBAR DispBegin() IF ::nOrient == SCROLL_VERTICAL - hb_dispOutAt( ::nStart + nOldThumbPos, ::nOffSet, SubStr( ::cStyle, 2, 1), hb_ColorIndex( ::cColorSpec, 0 ) ) - hb_dispOutAt( ::nStart + ::nThumbPos, ::nOffset, SubStr( ::cStyle, 3, 1 ), hb_ColorIndex( ::cColorSpec, 1 ) ) + hb_DispOutAt( ::nStart + nOldThumbPos, ::nOffSet, SubStr( ::cStyle, 2, 1 ), hb_ColorIndex( ::cColorSpec, 0 ) ) + hb_DispOutAt( ::nStart + ::nThumbPos, ::nOffset, SubStr( ::cStyle, 3, 1 ), hb_ColorIndex( ::cColorSpec, 1 ) ) ELSE - hb_dispOutAt( ::nOffset, ::nStart + nOldThumbPos, SubStr( ::cStyle, 2, 1 ), hb_ColorIndex( ::cColorSpec, 0 ) ) - hb_dispOutAt( ::nOffset, ::nStart + ::nThumbPos, SubStr( ::cStyle, 3, 1 ), hb_ColorIndex( ::cColorSpec, 1 ) ) + hb_DispOutAt( ::nOffset, ::nStart + nOldThumbPos, SubStr( ::cStyle, 2, 1 ), hb_ColorIndex( ::cColorSpec, 0 ) ) + hb_DispOutAt( ::nOffset, ::nStart + ::nThumbPos, SubStr( ::cStyle, 3, 1 ), hb_ColorIndex( ::cColorSpec, 1 ) ) ENDIF DispEnd() @@ -430,8 +430,9 @@ METHOD New( nStart, nEnd, nOffset, bSBlock, nOrient ) CLASS SCROLLBAR ENDIF cColor := SetColor() - ::cColorSpec := hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," + ; - hb_ColorIndex( cColor, CLR_ENHANCED ) + ::cColorSpec := ; + hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," + ; + hb_ColorIndex( cColor, CLR_ENHANCED ) RETURN Self diff --git a/harbour/src/rtl/sha1.c b/harbour/src/rtl/sha1.c index 6a5e71fd48..e5bff6c129 100644 --- a/harbour/src/rtl/sha1.c +++ b/harbour/src/rtl/sha1.c @@ -55,11 +55,11 @@ static sha1_quadbyte rol( sha1_quadbyte value, int bits ) ^block->l[(i+2)&15]^block->l[i&15],1)) /* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ -#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); -#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); -#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); -#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); -#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); +#define R0(v,w,x,y,z,i) { z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); } +#define R1(v,w,x,y,z,i) { z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); } +#define R2(v,w,x,y,z,i) { z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); } +#define R3(v,w,x,y,z,i) { z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); } +#define R4(v,w,x,y,z,i) { z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); } typedef union _BYTE64QUAD16 { sha1_byte c[64]; diff --git a/harbour/src/rtl/tbrowse.prg b/harbour/src/rtl/tbrowse.prg index 3bb5110df0..bc226e3417 100644 --- a/harbour/src/rtl/tbrowse.prg +++ b/harbour/src/rtl/tbrowse.prg @@ -113,10 +113,12 @@ CREATE CLASS TBROWSE /* The first 18 instance variables are exactly the same as in Clipper * so also some code which access them directly by array indexes should work */ + /* === Start of CA-Cl*pper compatible TBrowse instance area === */ VAR cargo AS USUAL EXPORTED // 01. User-definable variable -PROTECTED: + PROTECTED: + VAR n_Top AS NUMERIC INIT 0 // 02. Top row number for the TBrowse display VAR n_Left AS NUMERIC INIT 0 // 03. Leftmost column for the TBrowse display VAR n_Bottom AS NUMERIC INIT 0 // 04. Bottom row number for the TBrowse display @@ -143,7 +145,7 @@ PROTECTED: #endif /* === End of CA-Cl*pper compatible TBrowse instance area === */ -EXPORTED: + EXPORTED: #ifdef HB_COMPAT_C53 #ifdef HB_BRW_STATICMOUSE @@ -245,7 +247,8 @@ EXPORTED: METHOD new( nTop, nLeft, nBottom, nRight ) // constructor, NOTE: This method is a Harbour extension [vszakats] -PROTECTED: + PROTECTED: + VAR nRowPos AS INTEGER INIT 1 // current cursor row position VAR nColPos AS INTEGER INIT 1 // current cursor column position VAR nLeftVisible AS INTEGER INIT 0 // indicates position of leftmost unfrozen column in display @@ -330,6 +333,7 @@ STATIC FUNCTION _SKIP_RESULT( xResult ) STATIC PROCEDURE _DISP_FHSEP( nRow, nType, cColor, aColData ) + LOCAL aCol LOCAL cSep LOCAL nLen @@ -359,7 +363,7 @@ STATIC PROCEDURE _DISP_FHSEP( nRow, nType, cColor, aColData ) cSep := Replicate( Right( cSep, 1 ), nWidth + ; aCol[ _TBCI_FROZENSPACE ] ) ELSE - cSep := Substr( cSep, aCol[ _TBCI_SEPWIDTH ] + 1, nWidth ) + cSep := SubStr( cSep, aCol[ _TBCI_SEPWIDTH ] + 1, nWidth ) IF ( nLen -= aCol[ _TBCI_SEPWIDTH ] + nWidth ) < 0 cSep += Replicate( Right( cSep, 1 ), -nLen ) ENDIF @@ -377,7 +381,7 @@ STATIC PROCEDURE _DISP_FHSEP( nRow, nType, cColor, aColData ) ENDIF IF aCol[ _TBCI_FROZENSPACE ] > 0 cSep := Stuff( cSep, aCol[ _TBCI_SEPWIDTH ] + 1, 0, ; - Replicate( Substr( cSep, aCol[ _TBCI_SEPWIDTH ] + 1, 1 ), ; + Replicate( SubStr( cSep, aCol[ _TBCI_SEPWIDTH ] + 1, 1 ), ; aCol[ _TBCI_FROZENSPACE ] ), cSep ) ENDIF ENDIF @@ -386,7 +390,7 @@ STATIC PROCEDURE _DISP_FHSEP( nRow, nType, cColor, aColData ) ELSEIF aCol[ _TBCI_LASTSPACE ] < 0 cSep := Left( cSep, Len( cSep ) + aCol[ _TBCI_LASTSPACE ] ) ENDIF - hb_dispOutAtBox( nRow, aCol[ _TBCI_COLPOS ] - aCol[ _TBCI_FROZENSPACE ], ; + hb_DispOutAtBox( nRow, aCol[ _TBCI_COLPOS ] - aCol[ _TBCI_FROZENSPACE ], ; cSep, cColor ) ELSEIF aCol[ _TBCI_CELLWIDTH ] > 0 lFirst := .F. @@ -405,7 +409,7 @@ STATIC PROCEDURE _DISP_FHNAME( nRow, nHeight, nLeft, nRight, nType, nColor, aCol LOCAL nWidth LOCAL lFirst := .T. - hb_dispBox( nRow, nLeft, nRow + nHeight - 1, nRight, ; + hb_DispBox( nRow, nLeft, nRow + nHeight - 1, nRight, ; Space( 9 ), aColors[ _TBC_CLR_STANDARD ] ) FOR EACH aCol IN aColData @@ -422,7 +426,7 @@ STATIC PROCEDURE _DISP_FHNAME( nRow, nHeight, nLeft, nRight, nType, nColor, aCol nWidth += aCol[ _TBCI_LASTSPACE ] ENDIF FOR nPos := 1 TO nHeight - hb_dispOutAt( nRow + nPos - 1, nCol, ; + hb_DispOutAt( nRow + nPos - 1, nCol, ; PadR( hb_tokenGet( cName, nPos, _TBR_CHR_LINEDELIMITER ), nWidth ), ; iif( aCol[ _TBCI_DEFCOLOR ][ nColor ] == 0, "N/N", ; aColors[ aCol[ _TBCI_DEFCOLOR ][ nColor ] ] ) ) @@ -442,7 +446,7 @@ METHOD dispFrames() CLASS TBROWSE DispBegin() IF ::lInvalid .AND. !Empty( ::cBorder ) - hb_dispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, ::cBorder, ::colorValue( _TBC_CLR_STANDARD ) ) + hb_DispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, ::cBorder, ::colorValue( _TBC_CLR_STANDARD ) ) ENDIF IF ::nHeadHeight > 0 @@ -486,7 +490,7 @@ METHOD dispRow( nRow ) CLASS TBROWSE nRowPos := ::n_Top + ::nHeadHeight + iif( ::lHeadSep, 1, 0 ) + nRow - 1 cStdColor := ::colorValue( _TBC_CLR_STANDARD ) - hb_dispBox( nRowPos, ::n_Left, nRowPos, ::n_Right, Space( 9 ), cStdColor ) + hb_DispBox( nRowPos, ::n_Left, nRowPos, ::n_Right, Space( 9 ), cStdColor ) lFirst := .T. FOR EACH aCol, cValue, aColors IN ::aColData, ::aCellValues[ nRow ], ::aCellColors[ nRow ] @@ -495,21 +499,21 @@ METHOD dispRow( nRow ) CLASS TBROWSE IF lFirst lFirst := .F. ELSEIF aCol[ _TBCI_SEPWIDTH ] > 0 - hb_dispOutAtBox( nRowPos, aCol[ _TBCI_COLPOS ] - aCol[ _TBCI_FROZENSPACE ], ; + hb_DispOutAtBox( nRowPos, aCol[ _TBCI_COLPOS ] - aCol[ _TBCI_FROZENSPACE ], ; aCol[ _TBCI_COLSEP ], cStdColor ) nColPos += aCol[ _TBCI_SEPWIDTH ] ENDIF nColPos += aCol[ _TBCI_CELLPOS ] cColor := ::colorValue( aColors[ _TBC_CLR_STANDARD ] ) IF aCol[ _TBCI_LASTSPACE ] < 0 - hb_dispOutAt( nRowPos, nColPos, ; + hb_DispOutAt( nRowPos, nColPos, ; Left( cValue, ::n_Right - nColPos + 1 ), cColor ) ELSE #ifdef HB_CLP_STRICT - hb_dispOutAt( nRowPos, nColPos, ; + hb_DispOutAt( nRowPos, nColPos, ; Left( cValue, aCol[ _TBCI_COLWIDTH ] - aCol[ _TBCI_CELLPOS ] ), cColor ) #else - hb_dispOutAt( nRowPos, nColPos, cValue, cColor ) + hb_DispOutAt( nRowPos, nColPos, cValue, cColor ) #endif ENDIF ENDIF @@ -569,7 +573,7 @@ METHOD scrollBuffer( nRows ) CLASS TBROWSE IF nRows >= nRowCount .OR. nRows <= -nRowCount AFill( ::aCellStatus, .F. ) ELSE - hb_scroll( ::n_Top + ::nHeadHeight + iif( ::lHeadSep, 1, 0 ), ::n_Left, ; + hb_Scroll( ::n_Top + ::nHeadHeight + iif( ::lHeadSep, 1, 0 ), ::n_Left, ; ::n_Bottom - ::nFootHeight - iif( ::lFootSep, 1, 0 ), ::n_Right, ; nRows,, ::colorValue( _TBC_CLR_STANDARD ) ) IF nRows > 0 @@ -587,10 +591,10 @@ METHOD scrollBuffer( nRows ) CLASS TBROWSE ENDDO ELSEIF nRows < 0 DO WHILE ++nRows <= 0 - HB_AIns( ::aCellValues, 1, ATail( ::aCellValues ), .F. ) - HB_AIns( ::aCellColors, 1, ATail( ::aCellColors ), .F. ) - HB_AIns( ::aCellStatus, 1, .F., .F. ) - HB_AIns( ::aDispStatus, 1, .T., .F. ) + hb_AIns( ::aCellValues, 1, ATail( ::aCellValues ), .F. ) + hb_AIns( ::aCellColors, 1, ATail( ::aCellColors ), .F. ) + hb_AIns( ::aCellStatus, 1, .F., .F. ) + hb_AIns( ::aDispStatus, 1, .T., .F. ) ENDDO ENDIF ENDIF @@ -902,7 +906,7 @@ METHOD cellColor( nRow, nCol ) CLASS TBROWSE STATIC FUNCTION _DECODECOLORS( cColorSpec ) LOCAL aColors := {} - LOCAL nColors := hb_TokenCount( cColorSpec, "," ) + LOCAL nColors := hb_tokenCount( cColorSpec, "," ) LOCAL cColor LOCAL nPos @@ -918,7 +922,7 @@ STATIC FUNCTION _DECODECOLORS( cColorSpec ) * as CA-Cl*pper but some new GTs may accept extended color * definitions and use a little bit different rules. [druzus] */ - IF nPos <= 2 .AND. hb_colorToN( cColor ) == -1 + IF nPos <= 2 .AND. hb_ColorToN( cColor ) == -1 cColor := iif( nPos == 1, "W/N", "N/W" ) ENDIF AAdd( aColors, cColor ) @@ -944,6 +948,7 @@ STATIC FUNCTION _DECODECOLORS( cColorSpec ) * but only when browser shows head/foot separator(s). [druzus] */ STATIC FUNCTION _COLDEFCOLORS( aDefColorsIdx, nMaxColorIndex ) + LOCAL aColorsIdx := { _TBC_CLR_STANDARD, _TBC_CLR_SELECTED, ; _TBC_CLR_STANDARD, _TBC_CLR_STANDARD } LOCAL nColorIndex @@ -972,6 +977,7 @@ STATIC FUNCTION _COLDEFCOLORS( aDefColorsIdx, nMaxColorIndex ) * are significant. [druzus] */ STATIC FUNCTION _CELLCOLORS( aCol, xValue, nMaxColorIndex ) + LOCAL aColors := { aCol[ _TBCI_DEFCOLOR ][ _TBC_CLR_STANDARD ], ; aCol[ _TBCI_DEFCOLOR ][ _TBC_CLR_SELECTED ] } LOCAL xColor := Eval( aCol[ _TBCI_COLOBJECT ]:colorBlock, xValue ) @@ -1256,7 +1262,7 @@ METHOD configure( nMode ) CLASS TBROWSE IF ! HB_ISNUMERIC( nMode ) .OR. nMode == 0 .OR. nMode > _TBR_CONF_ALL nMode := _TBR_CONF_ALL ENDIF - ::nConfigure := HB_BITOR( ::nConfigure, nMode ) + ::nConfigure := hb_bitOr( ::nConfigure, nMode ) RETURN Self @@ -1415,7 +1421,7 @@ METHOD doConfigure() CLASS TBROWSE /* update headings to maximum size and missing head/foot separators */ FOR EACH aCol IN ::aColData - aCol[ _TBCI_HEADING ] := Replicate( _TBR_CHR_LINEDELIMITER, nHeadHeight - hb_TokenCount( aCol[ _TBCI_HEADING ], _TBR_CHR_LINEDELIMITER ) ) + ; + aCol[ _TBCI_HEADING ] := Replicate( _TBR_CHR_LINEDELIMITER, nHeadHeight - hb_tokenCount( aCol[ _TBCI_HEADING ], _TBR_CHR_LINEDELIMITER ) ) + ; aCol[ _TBCI_HEADING ] IF lHeadSep .AND. aCol[ _TBCI_HEADSEP ] == "" aCol[ _TBCI_HEADSEP ] := " " @@ -1486,7 +1492,7 @@ STATIC PROCEDURE _GENLIMITRTE() oError:genCode := EG_LIMIT oError:subSystem := "TBROWSE" oError:subCode := 0 - oError:description := hb_LangErrMsg( EG_LIMIT ) + oError:description := hb_langErrMsg( EG_LIMIT ) oError:canRetry := .F. oError:canDefault := .F. oError:fileName := "" @@ -1513,9 +1519,9 @@ STATIC FUNCTION _DECODE_FH( cName, nHeight, nWidth ) IF Right( cName, 1 ) == _TBR_CHR_LINEDELIMITER cName := Left( cName, Len( cName ) - 1 ) ENDIF - nHeight := hb_TokenCount( cName, _TBR_CHR_LINEDELIMITER ) + nHeight := hb_tokenCount( cName, _TBR_CHR_LINEDELIMITER ) FOR i := 1 TO nHeight - nWidth := Max( nWidth, Len( hb_TokenGet( cName, i, _TBR_CHR_LINEDELIMITER ) ) ) + nWidth := Max( nWidth, Len( hb_tokenGet( cName, i, _TBR_CHR_LINEDELIMITER ) ) ) NEXT ENDIF @@ -1531,6 +1537,7 @@ STATIC FUNCTION _DECODE_FH( cName, nHeight, nWidth ) STATIC FUNCTION _MAXFREEZE( nColumns, aColData, nWidth ) + LOCAL aCol LOCAL lFirst LOCAL nCol, nColWidth, nTot @@ -1572,6 +1579,7 @@ STATIC FUNCTION _MAXFREEZE( nColumns, aColData, nWidth ) STATIC FUNCTION _NEXTCOLUMN( aColData, nCol ) + LOCAL aCol DO WHILE nCol <= Len( aColData ) @@ -1586,6 +1594,7 @@ STATIC FUNCTION _NEXTCOLUMN( aColData, nCol ) STATIC FUNCTION _PREVCOLUMN( aColData, nCol ) + LOCAL aCol DO WHILE nCol >= 1 @@ -1600,6 +1609,7 @@ STATIC FUNCTION _PREVCOLUMN( aColData, nCol ) STATIC FUNCTION _SETCOLUMNS( nFrom, nTo, nStep, aColData, nFirst, nWidth, lFirst ) + LOCAL aCol LOCAL nCol, nColWidth LOCAL nLast := 0 @@ -1830,7 +1840,7 @@ METHOD hiLite() CLASS TBROWSE IF ::n_Col + Len( cValue ) > _TBR_COORD( ::n_Right ) cValue := Left( cValue, _TBR_COORD( ::n_Right ) - ::n_Col + 1 ) ENDIF - hb_dispOutAt( ::n_Row, ::n_Col, cValue, cColor ) + hb_DispOutAt( ::n_Row, ::n_Col, cValue, cColor ) SetPos( ::n_Row, ::n_Col ) ::lHiLited := .T. ENDIF @@ -1857,7 +1867,7 @@ METHOD deHilite() CLASS TBROWSE IF ::n_Col + Len( cValue ) > _TBR_COORD( ::n_Right ) cValue := Left( cValue, _TBR_COORD( ::n_Right ) - ::n_Col + 1 ) ENDIF - hb_dispOutAt( ::n_Row, ::n_Col, cValue, cColor ) + hb_DispOutAt( ::n_Row, ::n_Col, cValue, cColor ) SetPos( ::n_Row, ::n_Col ) ENDIF ENDIF @@ -2143,13 +2153,13 @@ METHOD delColumn( nColumn ) CLASS TBROWSE /* NOTE: CA-Cl*pper doesn't check the parameters. */ #ifndef HB_CLP_STRICT IF nColumn >= 1 .AND. nColumn <= ::colCount -#else - IF .T. /* It's optimized by compiler without any RT overhead */ #endif oCol := ::columns[ nColumn ] hb_ADel( ::columns, nColumn, .T. ) ::configure( _TBR_CONF_COLUMNS ) +#ifndef HB_CLP_STRICT ENDIF +#endif RETURN oCol @@ -2160,12 +2170,12 @@ METHOD insColumn( nColumn, oCol ) CLASS TBROWSE /* NOTE: CA-Cl*pper doesn't check the parameters. */ #ifndef HB_CLP_STRICT IF nColumn >= 1 .AND. nColumn <= ::colCount + 1 -#else - IF .T. /* It's optimized by compiler without any RT overhead */ #endif - HB_AIns( ::columns, nColumn, oCol, .T. ) + hb_AIns( ::columns, nColumn, oCol, .T. ) ::configure( _TBR_CONF_COLUMNS ) +#ifndef HB_CLP_STRICT ENDIF +#endif RETURN oCol @@ -2185,13 +2195,13 @@ METHOD setColumn( nColumn, oCol ) CLASS TBROWSE #ifndef HB_CLP_STRICT IF nColumn >= 1 .AND. nColumn <= ::colCount -#else - IF .T. /* It's optimized by compiler without any RT overhead */ #endif oPrevCol := ::columns[ nColumn ] ::columns[ nColumn ] := oCol ::configure( _TBR_CONF_COLUMNS ) +#ifndef HB_CLP_STRICT ENDIF +#endif ENDIF /* NOTE: CA-Cl*pper 5.2 NG says this will return the previously set @@ -2273,22 +2283,22 @@ METHOD goBottomBlock( bBlock ) CLASS TBROWSE METHOD nTop( nTop ) CLASS TBROWSE IF nTop != NIL - #ifdef HB_COMPAT_C53 - ::n_Top := __eInstVar53( Self, "NTOP", nTop, "N", 1001 ) - IF !Empty( ::cBorder ) - ::n_Top++ - ENDIF - #else - ::n_Top := __eInstVar53( Self, "NTOP", nTop, "N", 1001, {| o, x | HB_SYMBOL_UNUSED( o ), x >= 0 } ) - #endif +#ifdef HB_COMPAT_C53 + ::n_Top := __eInstVar53( Self, "NTOP", nTop, "N", 1001 ) + IF !Empty( ::cBorder ) + ::n_Top++ + ENDIF +#else + ::n_Top := __eInstVar53( Self, "NTOP", nTop, "N", 1001, {| o, x | HB_SYMBOL_UNUSED( o ), x >= 0 } ) +#endif ::configure( _TBR_CONF_COLUMNS ) ENDIF - #ifdef HB_COMPAT_C53 - IF !Empty( ::cBorder ) - RETURN ::n_Top - 1 - ENDIF - #endif +#ifdef HB_COMPAT_C53 + IF !Empty( ::cBorder ) + RETURN ::n_Top - 1 + ENDIF +#endif RETURN ::n_Top @@ -2296,22 +2306,22 @@ METHOD nTop( nTop ) CLASS TBROWSE METHOD nLeft( nLeft ) CLASS TBROWSE IF nLeft != NIL - #ifdef HB_COMPAT_C53 - ::n_Left := __eInstVar53( Self, "NLEFT", nLeft, "N", 1001 ) - IF !Empty( ::cBorder ) - ::n_Left++ - ENDIF - #else - ::n_Left := __eInstVar53( Self, "NLEFT", nLeft, "N", 1001, {| o, x | HB_SYMBOL_UNUSED( o ), x >= 0 } ) - #endif +#ifdef HB_COMPAT_C53 + ::n_Left := __eInstVar53( Self, "NLEFT", nLeft, "N", 1001 ) + IF !Empty( ::cBorder ) + ::n_Left++ + ENDIF +#else + ::n_Left := __eInstVar53( Self, "NLEFT", nLeft, "N", 1001, {| o, x | HB_SYMBOL_UNUSED( o ), x >= 0 } ) +#endif ::configure( _TBR_CONF_COLUMNS ) ENDIF - #ifdef HB_COMPAT_C53 - IF !Empty( ::cBorder ) - RETURN ::n_Left - 1 - ENDIF - #endif +#ifdef HB_COMPAT_C53 + IF !Empty( ::cBorder ) + RETURN ::n_Left - 1 + ENDIF +#endif RETURN ::n_Left @@ -2320,19 +2330,19 @@ METHOD nBottom( nBottom ) CLASS TBROWSE IF nBottom != NIL ::n_Bottom := __eInstVar53( Self, "NBOTTOM", nBottom, "N", 1001, {| o, x | x >= o:nTop } ) - #ifdef HB_COMPAT_C53 - IF !Empty( ::cBorder ) - ::n_Bottom-- - ENDIF - #endif +#ifdef HB_COMPAT_C53 + IF !Empty( ::cBorder ) + ::n_Bottom-- + ENDIF +#endif ::configure( _TBR_CONF_COLUMNS ) ENDIF - #ifdef HB_COMPAT_C53 - IF !Empty( ::cBorder ) - RETURN ::n_Bottom + 1 - ENDIF - #endif +#ifdef HB_COMPAT_C53 + IF !Empty( ::cBorder ) + RETURN ::n_Bottom + 1 + ENDIF +#endif RETURN ::n_Bottom @@ -2341,19 +2351,19 @@ METHOD nRight( nRight ) CLASS TBROWSE IF nRight != NIL ::n_Right := __eInstVar53( Self, "NRIGHT", nRight, "N", 1001, {| o, x | x >= o:nLeft } ) - #ifdef HB_COMPAT_C53 - IF !Empty( ::cBorder ) - ::n_Right-- - ENDIF - #endif +#ifdef HB_COMPAT_C53 + IF !Empty( ::cBorder ) + ::n_Right-- + ENDIF +#endif ::configure( _TBR_CONF_COLUMNS ) ENDIF - #ifdef HB_COMPAT_C53 - IF !Empty( ::cBorder ) - RETURN ::n_Right + 1 - ENDIF - #endif +#ifdef HB_COMPAT_C53 + IF !Empty( ::cBorder ) + RETURN ::n_Right + 1 + ENDIF +#endif RETURN ::n_Right @@ -2546,6 +2556,7 @@ METHOD mRowPos() CLASS TBROWSE METHOD mColPos() CLASS TBROWSE + LOCAL mRow, mCol IF ::nConfigure != 0 diff --git a/harbour/src/rtl/tbrowsys.prg b/harbour/src/rtl/tbrowsys.prg index 7e5084147c..cc70545562 100644 --- a/harbour/src/rtl/tbrowsys.prg +++ b/harbour/src/rtl/tbrowsys.prg @@ -56,63 +56,48 @@ #include "tbrowse.ch" FUNCTION TApplyKey( nKey, oBrowse ) - RETURN oBrowse:applyKey( nKey ) -FUNCTION TBAddCol() - /* TODO */ +FUNCTION TBAddCol() /* TODO */ RETURN NIL -FUNCTION TBBBlock() - /* TODO */ +FUNCTION TBBBlock() /* TODO */ RETURN NIL -FUNCTION TBClose() - /* TODO */ +FUNCTION TBClose() /* TODO */ RETURN NIL -FUNCTION TBCreate() - /* TODO */ +FUNCTION TBCreate() /* TODO */ RETURN NIL -FUNCTION TBDelCol() - /* TODO */ +FUNCTION TBDelCol() /* TODO */ RETURN NIL -FUNCTION TBDisplay() - /* TODO */ +FUNCTION TBDisplay() /* TODO */ RETURN NIL -FUNCTION TBEditCell() - /* TODO */ +FUNCTION TBEditCell() /* TODO */ RETURN NIL -FUNCTION TBFBlock() - /* TODO */ +FUNCTION TBFBlock() /* TODO */ RETURN NIL -FUNCTION TBGoBot() - /* TODO */ +FUNCTION TBGoBot() /* TODO */ RETURN NIL -FUNCTION TBGoTop() - /* TODO */ +FUNCTION TBGoTop() /* TODO */ RETURN NIL -FUNCTION TBInsCol() - /* TODO */ +FUNCTION TBInsCol() /* TODO */ RETURN NIL -FUNCTION TBModal() - /* TODO */ +FUNCTION TBModal() /* TODO */ RETURN NIL -FUNCTION TBSBlock() - /* TODO */ +FUNCTION TBSBlock() /* TODO */ RETURN NIL -FUNCTION TBSkip() - /* TODO */ +FUNCTION TBSkip() /* TODO */ RETURN NIL #endif diff --git a/harbour/src/rtl/tclass.prg b/harbour/src/rtl/tclass.prg index e54d586cc2..1183f4ea78 100644 --- a/harbour/src/rtl/tclass.prg +++ b/harbour/src/rtl/tclass.prg @@ -176,14 +176,14 @@ STATIC FUNCTION New( cClassName, xSuper, sClassFunc, lModuleFriendly ) ELSEIF Empty( xSuper ) ::asSuper := {} ELSEIF HB_ISSTRING( xSuper ) - ::asSuper := { __DynsN2Sym( xSuper ) } + ::asSuper := { __dynSN2Sym( xSuper ) } ELSEIF HB_ISARRAY( xSuper ) ::asSuper := {} FOR EACH i IN xSuper IF HB_ISSYMBOL( i ) AAdd( ::asSuper, i ) ELSEIF HB_ISSTRING( i ) .AND. ! Empty( i ) - AAdd( ::asSuper, __DynsN2Sym( i ) ) + AAdd( ::asSuper, __dynSN2Sym( i ) ) ENDIF NEXT ENDIF @@ -230,14 +230,14 @@ STATIC PROCEDURE Create( /* MetaClass */ ) __clsAddMsg( hClass, "__SUPER", 0, HB_OO_MSG_SUPER, ahSuper[ 1 ], HB_OO_CLSTP_EXPORTED ) ENDIF ENDIF - __clsAddMsg( hClass, "REALCLASS" , 0, HB_OO_MSG_REALCLASS, 0 , HB_OO_CLSTP_EXPORTED ) + __clsAddMsg( hClass, "REALCLASS", 0, HB_OO_MSG_REALCLASS, 0, HB_OO_CLSTP_EXPORTED ) // We will work here on the MetaClass object to add the Class Method // as needed - //FOR EACH n IN ::aClsMethods + // FOR EACH n IN ::aClsMethods // // do it - //NEXT - //// + // NEXT + // // /* local messages... */ @@ -253,7 +253,7 @@ STATIC PROCEDURE Create( /* MetaClass */ ) HB_OO_MSG_METHOD, NIL, n[ HB_OO_MTHD_SCOPE ] ) NEXT - nClassBegin := __CLS_CNTCLSDATA( hClass ) + nClassBegin := __cls_CntClsData( hClass ) FOR EACH n IN ::aClsDatas __clsAddMsg( hClass, n[ HB_OO_CLSD_SYMBOL ] , n:__enumIndex() + nClassBegin,; HB_OO_MSG_CLSACCESS, n[ HB_OO_CLSD_VALUE ], n[ HB_OO_CLSD_SCOPE ] ) @@ -297,6 +297,7 @@ STATIC PROCEDURE Create( /* MetaClass */ ) RETURN STATIC FUNCTION Instance() + LOCAL Self := QSelf() RETURN __clsInst( ::hClass ) @@ -336,11 +337,11 @@ STATIC PROCEDURE AddData( cData, xInit, cType, nScope, lNoinit ) STATIC PROCEDURE AddMultiData( cType, xInit, nScope, aData, lNoInit ) - LOCAL data + LOCAL cData - FOR EACH data IN aData - IF HB_ISSTRING( data ) - QSelf():AddData( data, xInit, cType, nScope, lNoInit ) + FOR EACH cData IN aData + IF HB_ISSTRING( cData ) + QSelf():AddData( cData, xInit, cType, nScope, lNoInit ) ENDIF NEXT @@ -383,11 +384,11 @@ STATIC PROCEDURE AddClassData( cData, xInit, cType, nScope, lNoInit ) STATIC PROCEDURE AddMultiClsData( cType, xInit, nScope, aData, lNoInit ) - LOCAL data + LOCAL cData - FOR EACH data IN aData - IF HB_ISSTRING( data ) - QSelf():AddClassData( data, xInit, cType, nScope, lNoInit ) + FOR EACH cData IN aData + IF HB_ISSTRING( cData ) + QSelf():AddClassData( cData, xInit, cType, nScope, lNoInit ) ENDIF NEXT @@ -443,7 +444,7 @@ STATIC PROCEDURE AddFriendClass( ... ) LOCAL Self := QSelf() - AEval( HB_AParams(), {| sClass | AAdd( ::asFriendClass, sClass ) } ) + AEval( hb_AParams(), {| sClass | AAdd( ::asFriendClass, sClass ) } ) RETURN @@ -451,7 +452,7 @@ STATIC PROCEDURE AddFriendFunc( ... ) LOCAL Self := QSelf() - AEval( HB_AParams(), {| sFunc | AAdd( ::asFriendFunc, sFunc ) } ) + AEval( hb_AParams(), {| sFunc | AAdd( ::asFriendFunc, sFunc ) } ) RETURN diff --git a/harbour/src/rtl/teditor.prg b/harbour/src/rtl/teditor.prg index b0d30213b2..673d20130d 100644 --- a/harbour/src/rtl/teditor.prg +++ b/harbour/src/rtl/teditor.prg @@ -110,9 +110,9 @@ CREATE CLASS HBEditor MESSAGE RefreshWindow() METHOD display() // for compatibility - METHOD New( cString, nTop, nLeft, nBottom,; // Converts a string to an array of strings splitting input string at EOL boundaries - nRight, lEditMode, nLineLength, nTabSize,; - nTextRow, nTextCol, nWndRow, nWndCol ) + METHOD New( cString, nTop, nLeft, nBottom, ; // Converts a string to an array of strings splitting input string at EOL boundaries + nRight, lEditMode, nLineLength, nTabSize, ; + nTextRow, nTextCol, nWndRow, nWndCol ) PROTECTED: @@ -182,7 +182,7 @@ METHOD Resize( nTop, nLeft, nBottom, nRight ) CLASS HBEditor ::nNumRows := ::nBottom - ::nTop + 1 IF ( ::nRow - ::nFirstRow ) > ::nNumRows - //current row is outide the editor window - display it at the top + // current row is outide the editor window - display it at the top ::nFirstRow := ::nRow ENDIF // FirstCol/Row of current text visible inside editor window @@ -425,12 +425,12 @@ METHOD display() CLASS HBEditor DispBegin() FOR i := 0 TO Min( ::nNumRows - 1, ::naTextLen - 1 ) - hb_dispOutAt( ::nTop + i, ::nLeft, PadR( SubStr( ::GetLine( ::nFirstRow + i ), ::nFirstCol, ::nNumCols ), ::nNumCols, " " ), ::LineColor( ::nFirstRow + i ) ) + hb_DispOutAt( ::nTop + i, ::nLeft, PadR( SubStr( ::GetLine( ::nFirstRow + i ), ::nFirstCol, ::nNumCols ), ::nNumCols, " " ), ::LineColor( ::nFirstRow + i ) ) NEXT // Clear rest of editor window (needed when deleting lines of text) IF ::naTextLen < ::nNumRows - hb_scroll( ::nTop + ::naTextLen, ::nLeft, ::nBottom, ::nRight,,, ::cColorSpec ) + hb_Scroll( ::nTop + ::naTextLen, ::nLeft, ::nBottom, ::nRight,,, ::cColorSpec ) ENDIF ::SetPos( nORow, nOCol ) @@ -442,7 +442,7 @@ METHOD display() CLASS HBEditor // Redraws current screen line METHOD RefreshLine() CLASS HBEditor - hb_dispOutAt( ::Row(), ::nLeft, PadR( SubStr( ::GetLine( ::nRow ), ::nFirstCol, ::nNumCols ), ::nNumCols, " " ), ::LineColor( ::nRow ) ) + hb_DispOutAt( ::Row(), ::nLeft, PadR( SubStr( ::GetLine( ::nRow ), ::nFirstCol, ::nNumCols ), ::nNumCols, " " ), ::LineColor( ::nRow ) ) RETURN Self @@ -454,7 +454,7 @@ METHOD RefreshColumn() CLASS HBEditor DispBegin() FOR i := 0 TO Min( ::nNumRows - 1, ::naTextLen - 1 ) - hb_dispOutAt( ::nTop + i, ::Col(), SubStr( ::GetLine( ::nFirstRow + i ), ::nCol, 1 ), ::LineColor( ::nFirstRow + i ) ) + hb_DispOutAt( ::nTop + i, ::Col(), SubStr( ::GetLine( ::nFirstRow + i ), ::nCol, 1 ), ::LineColor( ::nFirstRow + i ) ) NEXT DispEnd() @@ -483,7 +483,7 @@ METHOD MoveCursor( nKey ) CLASS HBEditor ENDIF IF ::Row() == ::nBottom IF ::nRow < ::naTextLen - hb_scroll( ::nTop, ::nLeft, ::nBottom, ::nRight, 1 ) + hb_Scroll( ::nTop, ::nLeft, ::nBottom, ::nRight, 1 ) ::nFirstRow++ ::nRow++ ::RefreshLine() @@ -530,7 +530,7 @@ METHOD MoveCursor( nKey ) CLASS HBEditor ENDIF IF ::Row() == ::nTop IF ::nRow > 1 - hb_scroll( ::nTop, ::nLeft, ::nBottom, ::nRight, -1 ) + hb_Scroll( ::nTop, ::nLeft, ::nBottom, ::nRight, -1 ) ::nFirstRow-- ::nRow-- ::RefreshLine() @@ -570,7 +570,7 @@ METHOD MoveCursor( nKey ) CLASS HBEditor CASE K_RIGHT IF ::Col() == ::nRight IF ::nCol <= iif( ::lWordWrap, ::nWordWrapCol, ::LineLen( ::nRow ) ) - hb_scroll( ::nTop, ::nLeft, ::nBottom, ::nRight,, 1 ) + hb_Scroll( ::nTop, ::nLeft, ::nBottom, ::nRight,, 1 ) ::nFirstCol++ ::nCol++ ::RefreshColumn() @@ -594,7 +594,7 @@ METHOD MoveCursor( nKey ) CLASS HBEditor CASE K_LEFT IF ::Col() == ::nLeft IF ::nCol > 1 - hb_scroll( ::nTop, ::nLeft, ::nBottom, ::nRight,, -1 ) + hb_Scroll( ::nTop, ::nLeft, ::nBottom, ::nRight,, -1 ) ::nFirstCol-- ::nCol-- ::RefreshColumn() @@ -706,7 +706,7 @@ METHOD Edit( nPassedKey ) CLASS HBEditor ENDIF DO CASE - CASE Len( cKey := hb_KeyChar( nKey ) ) > 0 + CASE Len( cKey := hb_keyChar( nKey ) ) > 0 ::lDirty := .T. // If I'm past EOL I need to add as much spaces as I need to reach ::nCol IF ::nCol > ::LineLen( ::nRow ) @@ -866,8 +866,9 @@ METHOD SetColor( cColorString ) CLASS HBEditor METHOD Hilite() CLASS HBEditor // Swap CLR_STANDARD and CLR_ENHANCED - LOCAL cEnhanced := hb_TokenGet( ::cColorSpec, 2, "," ) + "," +; - hb_TokenGet( ::cColorSpec, 1, "," ) + LOCAL cEnhanced := ; + hb_tokenGet( ::cColorSpec, 2, "," ) + "," + ; + hb_tokenGet( ::cColorSpec, 1, "," ) ::SetColor( cEnhanced + Right( ::cColorSpec, Len( ::cColorSpec ) - Len( cEnhanced ) ) ) @@ -876,8 +877,9 @@ METHOD Hilite() CLASS HBEditor METHOD DeHilite() CLASS HBEditor // Swap CLR_STANDARD and CLR_ENHANCED back to their original position inside cColorSpec - LOCAL cStandard := hb_TokenGet( ::cColorSpec, 2, "," ) + "," +; - hb_TokenGet( ::cColorSpec, 1, "," ) + LOCAL cStandard := ; + hb_tokenGet( ::cColorSpec, 2, "," ) + "," + ; + hb_tokenGet( ::cColorSpec, 1, "," ) ::SetColor( cStandard + Right( ::cColorSpec, Len( ::cColorSpec ) - Len( cStandard ) ) ) @@ -979,7 +981,7 @@ METHOD BrowseText( nPassedKey ) nKey := nPassedKey ENDIF - IF ( bKeyBlock := Setkey( nKey ) ) != NIL + IF ( bKeyBlock := SetKey( nKey ) ) != NIL Eval( bKeyBlock ) LOOP ENDIF @@ -1079,7 +1081,7 @@ METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabS ENDIF // Empty area of screen which will hold editor window - hb_scroll( nTop, nLeft, nBottom, nRight ) + hb_Scroll( nTop, nLeft, nBottom, nRight ) // Set cursor upper left corner ::SetPos( ::nTop + nWndRow, ::nLeft + nWndCol ) @@ -1120,7 +1122,7 @@ STATIC FUNCTION Text2Array( cString, nWordWrapCol ) DO WHILE nRetLen < ncSLen - cLine := hb_TokenPtr( @cString, @nTokPos, cEOL ) + cLine := hb_tokenPtr( @cString, @nTokPos, cEOL ) nRetLen += Len( cLine ) + nEOLLen diff --git a/harbour/src/rtl/tget.prg b/harbour/src/rtl/tget.prg index 00fb739911..c0b005a993 100644 --- a/harbour/src/rtl/tget.prg +++ b/harbour/src/rtl/tget.prg @@ -222,6 +222,7 @@ CREATE CLASS GET ENDCLASS METHOD assign() CLASS GET + LOCAL xValue IF ::hasFocus @@ -304,9 +305,9 @@ METHOD display() CLASS GET ENDIF ENDIF - hb_dispOutAt( ::nCapRow, ::nCapCol, cCaption, hb_ColorIndex( ::cColorSpec, GET_CLR_CAPTION ) ) + hb_DispOutAt( ::nCapRow, ::nCapCol, cCaption, hb_ColorIndex( ::cColorSpec, GET_CLR_CAPTION ) ) IF nPos > 0 - hb_dispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_ACCEL ) ) + hb_DispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_ACCEL ) ) ENDIF /* should we set fixed cursor position here? @@ -326,8 +327,8 @@ METHOD display() CLASS GET IF !::lSuppDisplay .OR. nDispPos != ::nOldPos - hb_dispOutAt( ::nRow, ::nCol,; - iif( ::lHideInput, PadR( Replicate( SubStr( ::cStyle, 1, 1 ), Len( RTrim( cBuffer ) ) ), ::nDispLen ), SubStr( cBuffer, nDispPos, ::nDispLen ) ),; + hb_DispOutAt( ::nRow, ::nCol, ; + iif( ::lHideInput, PadR( Replicate( SubStr( ::cStyle, 1, 1 ), Len( RTrim( cBuffer ) ) ), ::nDispLen ), SubStr( cBuffer, nDispPos, ::nDispLen ) ), ; hb_ColorIndex( ::cColorSpec, iif( ::hasFocus, GET_CLR_ENHANCED, GET_CLR_UNSELECTED ) ) ) nRowPos := ::nRow @@ -335,12 +336,12 @@ METHOD display() CLASS GET IF Set( _SET_DELIMITERS ) .AND. !::hasFocus #ifdef HB_COMPAT_C53 - hb_dispOutAt( nRowPos, ::nCol - 1, SubStr( Set( _SET_DELIMCHARS ), 1, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_UNSELECTED ) ) - hb_dispOutAt( nRowPos, nColPos , SubStr( Set( _SET_DELIMCHARS ), 2, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_UNSELECTED ) ) + hb_DispOutAt( nRowPos, ::nCol - 1, SubStr( Set( _SET_DELIMCHARS ), 1, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_UNSELECTED ) ) + hb_DispOutAt( nRowPos, nColPos , SubStr( Set( _SET_DELIMCHARS ), 2, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_UNSELECTED ) ) #else /* NOTE: C5.2 will use the default color. We're replicating this here. [vszakats] */ - hb_dispOutAt( nRowPos, ::nCol - 1, SubStr( Set( _SET_DELIMCHARS ), 1, 1 ) ) - hb_dispOutAt( nRowPos, nColPos , SubStr( Set( _SET_DELIMCHARS ), 2, 1 ) ) + hb_DispOutAt( nRowPos, ::nCol - 1, SubStr( Set( _SET_DELIMCHARS ), 1, 1 ) ) + hb_DispOutAt( nRowPos, nColPos , SubStr( Set( _SET_DELIMCHARS ), 2, 1 ) ) #endif ++nColPos ENDIF @@ -778,7 +779,7 @@ METHOD toDecPos() CLASS GET IF ::type == "N" .AND. ::lMinus .AND. ::unTransform() == 0 ::backSpace() - ::overStrike("-") + ::overStrike( "-" ) ENDIF ::display() @@ -912,12 +913,12 @@ METHOD setColorSpec( cColorSpec ) CLASS GET IF HB_ISSTRING( cColorSpec ) #ifdef HB_COMPAT_C53 - ::cColorSpec := hb_NToColor( nClrUns := Max( hb_ColorToN( hb_ColorIndex( cColorSpec, GET_CLR_UNSELECTED ) ), 0 ) ) +; - "," + hb_NToColor( iif( ( nClrOth := hb_ColorToN( hb_ColorIndex( cColorSpec, GET_CLR_ENHANCED ) ) ) != -1, nClrOth, nClrUns ) ) +; - "," + hb_NToColor( iif( ( nClrOth := hb_ColorToN( hb_ColorIndex( cColorSpec, GET_CLR_CAPTION ) ) ) != -1, nClrOth, nClrUns ) ) +; + ::cColorSpec := hb_NToColor( nClrUns := Max( hb_ColorToN( hb_ColorIndex( cColorSpec, GET_CLR_UNSELECTED ) ), 0 ) ) + ; + "," + hb_NToColor( iif( ( nClrOth := hb_ColorToN( hb_ColorIndex( cColorSpec, GET_CLR_ENHANCED ) ) ) != -1, nClrOth, nClrUns ) ) + ; + "," + hb_NToColor( iif( ( nClrOth := hb_ColorToN( hb_ColorIndex( cColorSpec, GET_CLR_CAPTION ) ) ) != -1, nClrOth, nClrUns ) ) + ; "," + hb_NToColor( iif( ( nClrOth := hb_ColorToN( hb_ColorIndex( cColorSpec, GET_CLR_ACCEL ) ) ) != -1, nClrOth, nClrUns ) ) #else - ::cColorSpec := hb_NToColor( nClrUns := Max( hb_ColorToN( hb_ColorIndex( cColorSpec, GET_CLR_UNSELECTED ) ), 0 ) ) +; + ::cColorSpec := hb_NToColor( nClrUns := Max( hb_ColorToN( hb_ColorIndex( cColorSpec, GET_CLR_UNSELECTED ) ), 0 ) ) + ; "," + hb_NToColor( iif( ( nClrOth := hb_ColorToN( hb_ColorIndex( cColorSpec, GET_CLR_ENHANCED ) ) ) != -1, nClrOth, nClrUns ) ) #endif @@ -931,15 +932,17 @@ METHOD setColorSpec( cColorSpec ) CLASS GET replicate some original C5.3 behaviour. */ ELSE IF Set( _SET_INTENSITY ) - ::cColorSpec := hb_ColorIndex( SetColor(), CLR_UNSELECTED ) + "," +; - hb_ColorIndex( SetColor(), CLR_ENHANCED ) + "," +; - hb_ColorIndex( SetColor(), CLR_STANDARD ) + "," +; - hb_ColorIndex( SetColor(), CLR_BACKGROUND ) + ::cColorSpec := ; + hb_ColorIndex( SetColor(), CLR_UNSELECTED ) + "," + ; + hb_ColorIndex( SetColor(), CLR_ENHANCED ) + "," + ; + hb_ColorIndex( SetColor(), CLR_STANDARD ) + "," + ; + hb_ColorIndex( SetColor(), CLR_BACKGROUND ) ELSE - ::cColorSpec := hb_ColorIndex( SetColor(), CLR_STANDARD ) + "," +; - hb_ColorIndex( SetColor(), CLR_STANDARD ) + "," +; - hb_ColorIndex( SetColor(), CLR_STANDARD ) + "," +; - hb_ColorIndex( SetColor(), CLR_STANDARD ) + ::cColorSpec := ; + hb_ColorIndex( SetColor(), CLR_STANDARD ) + "," + ; + hb_ColorIndex( SetColor(), CLR_STANDARD ) + "," + ; + hb_ColorIndex( SetColor(), CLR_STANDARD ) + "," + ; + hb_ColorIndex( SetColor(), CLR_STANDARD ) ENDIF #endif ENDIF @@ -1188,8 +1191,8 @@ METHOD PutMask( xValue, lEdit ) CLASS GET cBuffer += " " ENDIF - IF ( ( "C" $ cPicFunc .AND. xValue < 0 ) .OR.; - ( "X" $ cPicFunc .AND. xValue >= 0 ) ) .AND.; + IF ( ( "C" $ cPicFunc .AND. xValue < 0 ) .OR. ; + ( "X" $ cPicFunc .AND. xValue >= 0 ) ) .AND. ; !( "X" $ cPicFunc .AND. "C" $ cPicFunc ) cBuffer += " " ENDIF @@ -1291,12 +1294,12 @@ METHOD unTransform() CLASS GET NEXT ELSE IF "E" $ ::cPicFunc - cBuffer := Left( cBuffer, ::FirstEditable() - 1 ) +; - StrTran( StrTran( SubStr( cBuffer, ::FirstEditable(), ::LastEditable() - ::FirstEditable() + 1 ), ".", " " ), ",", "." ) +; + cBuffer := Left( cBuffer, ::FirstEditable() - 1 ) + ; + StrTran( StrTran( SubStr( cBuffer, ::FirstEditable(), ::LastEditable() - ::FirstEditable() + 1 ), ".", " " ), ",", "." ) + ; SubStr( cBuffer, ::LastEditable() + 1 ) ELSE - cBuffer := Left( cBuffer, ::FirstEditable() - 1 ) +; - StrTran( SubStr( cBuffer, ::FirstEditable(), ::LastEditable() - ::FirstEditable() + 1 ), ",", " " ) +; + cBuffer := Left( cBuffer, ::FirstEditable() - 1 ) + ; + StrTran( SubStr( cBuffer, ::FirstEditable(), ::LastEditable() - ::FirstEditable() + 1 ), ",", " " ) + ; SubStr( cBuffer, ::LastEditable() + 1 ) ENDIF @@ -1598,7 +1601,7 @@ METHOD backSpaceLow() CLASS GET IF nMinus > 0 .AND. !( SubStr( ::cPicMask, nMinus, 1 ) == "(" ) - ::cBuffer := SubStr( ::cBuffer, 1, nMinus - 1 ) + " " +; + ::cBuffer := SubStr( ::cBuffer, 1, nMinus - 1 ) + " " + ; SubStr( ::cBuffer, nMinus + 1 ) ::lEdit := .T. @@ -1640,7 +1643,7 @@ METHOD deleteLow() CLASS GET ENDIF ::cBuffer := PadR( SubStr( ::cBuffer, 1, ::nPos - 1 ) + ; - SubStr( ::cBuffer, ::nPos + 1, nMaxLen - ::nPos ) + " " +; + SubStr( ::cBuffer, ::nPos + 1, nMaxLen - ::nPos ) + " " + ; SubStr( ::cBuffer, nMaxLen + 1 ), ::nMaxLen ) ::lChanged := .T. @@ -1759,9 +1762,9 @@ METHOD Input( cChar ) CLASS GET IF ! Empty( ::cPicMask ) cPic := hb_asciiUpper( SubStr( ::cPicMask, ::nPos, 1 ) ) -// cChar := Transform( cChar, cPic ) -// Above line eliminated because some get picture template symbols for -// numeric input not work in text input. eg: $ and * + // cChar := Transform( cChar, cPic ) + // Above line eliminated because some get picture template symbols for + // numeric input not work in text input. eg: $ and * DO CASE CASE cPic == "A" @@ -1943,19 +1946,21 @@ METHOD New( nRow, nCol, bVarBlock, cVarName, cPicture, cColorSpec ) CLASS GET cVarName := "" ENDIF IF bVarBlock == NIL - bVarBlock := iif( HB_ISSTRING( cVarName ), MemvarBlock( cVarName ), NIL ) + bVarBlock := iif( HB_ISSTRING( cVarName ), MemVarBlock( cVarName ), NIL ) ENDIF #ifdef HB_COMPAT_C53 IF cColorSpec == NIL - cColorSpec := hb_ColorIndex( SetColor(), CLR_UNSELECTED ) + "," +; - hb_ColorIndex( SetColor(), CLR_ENHANCED ) + "," +; - hb_ColorIndex( SetColor(), CLR_STANDARD ) + "," +; - iif( IsDefColor(), iif( Set( _SET_INTENSITY ), "W+/N", "W/N" ), hb_ColorIndex( SetColor(), CLR_BACKGROUND ) ) + cColorSpec := ; + hb_ColorIndex( SetColor(), CLR_UNSELECTED ) + "," + ; + hb_ColorIndex( SetColor(), CLR_ENHANCED ) + "," + ; + hb_ColorIndex( SetColor(), CLR_STANDARD ) + "," + ; + iif( IsDefColor(), iif( Set( _SET_INTENSITY ), "W+/N", "W/N" ), hb_ColorIndex( SetColor(), CLR_BACKGROUND ) ) ENDIF #else IF cColorSpec == NIL - cColorSpec := hb_ColorIndex( SetColor(), CLR_UNSELECTED ) + "," +; - hb_ColorIndex( SetColor(), CLR_ENHANCED ) + cColorSpec := ; + hb_ColorIndex( SetColor(), CLR_UNSELECTED ) + "," + ; + hb_ColorIndex( SetColor(), CLR_ENHANCED ) ENDIF #endif diff --git a/harbour/src/rtl/tgetint.prg b/harbour/src/rtl/tgetint.prg index 3c030916d2..7adcfd0a01 100644 --- a/harbour/src/rtl/tgetint.prg +++ b/harbour/src/rtl/tgetint.prg @@ -53,42 +53,42 @@ REQUEST HB_PVALUE REQUEST PCOUNT -FUNCTION __GET( bSetGet, cVarName, cPicture, bValid, bWhen ) +FUNCTION __Get( bSetGet, cVarName, cPicture, bValid, bWhen ) LOCAL oGet IF bSetGet == NIL IF FieldPos( cVarName ) > 0 bSetGet := hb_macroBlock( "iif(PCount()==0,FIELD->" + cVarName + ",FIELD->" + cVarName + ":=hb_PValue(1))" ) - ELSEIF __MVEXIST( cVarName ) - bSetGet := {| _1 | iif( _1 == NIL, __MVGET( cVarName ), __MVPUT( cVarName, _1 ) ) } + ELSEIF __mvExist( cVarName ) + bSetGet := {| _1 | iif( _1 == NIL, __mvGet( cVarName ), __mvPut( cVarName, _1 ) ) } ELSE bSetGet := hb_macroBlock( "iif(PCount()==0," + cVarName + "," + cVarName + ":=hb_PValue(1))" ) ENDIF ENDIF - oGet := GetNew( , , bSetGet, cVarName, cPicture ) + oGet := GetNew(,, bSetGet, cVarName, cPicture ) oGet:PreBlock := bWhen oGet:PostBlock := bValid RETURN oGet -FUNCTION __GETA( bGetArray, cVarName, cPicture, bValid, bWhen, aIndex ) +FUNCTION __GetA( bGetArray, cVarName, cPicture, bValid, bWhen, aIndex ) LOCAL oGet IF bGetArray == NIL IF FieldPos( cVarName ) > 0 bGetArray := hb_macroBlock( "FIELD->" + cVarName ) - ELSEIF __MVEXIST( cVarName ) - bGetArray := {|| __MVGET( cVarName ) } + ELSEIF __mvExist( cVarName ) + bGetArray := {|| __mvGet( cVarName ) } ELSE bGetArray := hb_macroBlock( cVarName ) ENDIF ENDIF - oGet := GetNew( , , bGetArray, cVarName, cPicture ) + oGet := GetNew(,, bGetArray, cVarName, cPicture ) oGet:SubScript := aIndex oGet:PreBlock := bWhen diff --git a/harbour/src/rtl/tgetlist.prg b/harbour/src/rtl/tgetlist.prg index dfd4bde8a0..576a292988 100644 --- a/harbour/src/rtl/tgetlist.prg +++ b/harbour/src/rtl/tgetlist.prg @@ -186,7 +186,7 @@ METHOD ReadModal() CLASS HBGetList cMsgColor := GetClrPair( SetColor(), 1 ) ENDIF - hb_scroll( nMsgRow, nMsgLeft, nMsgRow, nMsgRight ) + hb_Scroll( nMsgRow, nMsgLeft, nMsgRow, nMsgRight ) ::cMsgSaveS := SaveScreen( nMsgRow, nMsgLeft, nMsgRow, nMsgRight ) ENDIF @@ -352,7 +352,7 @@ METHOD GetApplyKey( nKey, oGet, oMenu, aMsg ) CLASS HBGetList ELSEIF ( nHotItem := oMenu:getAccel( nKey ) ) != 0 ::nMenuID := MenuModal( oMenu, nHotItem, aMsg[ MSGROW ], aMsg[ MSGLEFT ], aMsg[ MSGRIGHT ], aMsg[ MSGCOLOR ] ) nKey := 0 - ELSEIF IsShortCut( oMenu, nKey ) + ELSEIF IsShortcut( oMenu, nKey ) nKey := 0 ENDIF #else @@ -810,7 +810,7 @@ METHOD ShowScoreboard() CLASS HBGetList IF Set( _SET_SCOREBOARD ) - hb_dispOutAt( SCORE_ROW, SCORE_COL, iif( Set( _SET_INSERT ), __NatMsg( _GET_INSERT_ON ), __NatMsg( _GET_INSERT_OFF ) ) ) + hb_DispOutAt( SCORE_ROW, SCORE_COL, iif( Set( _SET_INSERT ), __natMsg( _GET_INSERT_ON ), __natMsg( _GET_INSERT_OFF ) ) ) ENDIF @@ -820,12 +820,12 @@ METHOD DateMsg() CLASS HBGetList IF Set( _SET_SCOREBOARD ) - hb_dispOutAt( SCORE_ROW, SCORE_COL, __NatMsg( _GET_INVD_DATE ) ) + hb_DispOutAt( SCORE_ROW, SCORE_COL, __natMsg( _GET_INVD_DATE ) ) DO WHILE NextKey() == 0 ENDDO - hb_dispOutAt( SCORE_ROW, SCORE_COL, Space( Len( __NatMsg( _GET_INVD_DATE ) ) ) ) + hb_DispOutAt( SCORE_ROW, SCORE_COL, Space( Len( __natMsg( _GET_INVD_DATE ) ) ) ) ENDIF @@ -954,7 +954,7 @@ METHOD GUIApplyKey( oGet, oGUI, nKey, oMenu, aMsg ) CLASS HBGetList ELSEIF ( nHotItem := oMenu:getAccel( nKey ) ) != 0 ::nMenuID := MenuModal( oMenu, nHotItem, aMsg[ MSGROW ], aMsg[ MSGLEFT ], aMsg[ MSGRIGHT ], aMsg[ MSGCOLOR ] ) nKey := 0 - ELSEIF IsShortCut( oMenu, nKey ) + ELSEIF IsShortcut( oMenu, nKey ) nKey := 0 ENDIF @@ -1241,7 +1241,7 @@ METHOD TBApplyKey( oGet, oTB, nKey, oMenu, aMsg ) CLASS HBGetList ELSEIF ( nHotItem := oMenu:getAccel( nKey ) ) != 0 ::nMenuID := MenuModal( oMenu, nHotItem, aMsg[ MSGROW ], aMsg[ MSGLEFT ], aMsg[ MSGRIGHT ], aMsg[ MSGCOLOR ] ) nKey := 0 - ELSEIF IsShortCut( oMenu, nKey ) + ELSEIF IsShortcut( oMenu, nKey ) nKey := 0 ENDIF @@ -1365,7 +1365,7 @@ METHOD TBReader( oGet, oMenu, aMsg ) CLASS HBGetList ENDDO IF nKey == 0 - nKey := Inkey(0) + nKey := Inkey( 0 ) ENDIF nProcessed := oTB:ApplyKey( nKey ) @@ -1568,6 +1568,7 @@ METHOD HitTest( nMRow, nMCol, aMsg ) CLASS HBGetList #define SNSVCURSOR 17 METHOD ReadStats( nElement, xNewValue ) CLASS HBGetList + LOCAL xRetVal SWITCH nElement @@ -1630,7 +1631,7 @@ METHOD ShowGetMsg( oGet, aMsg ) CLASS HBGetList IF !Empty( cMsg ) lMOldState := MSetCursor( .F. ) - hb_dispOutAt( aMsg[ MSGROW ], aMsg[ MSGLEFT ], PadC( cMsg, aMsg[ MSGRIGHT ] - aMsg[ MSGLEFT ] + 1 ), aMsg[ MSGCOLOR ] ) + hb_DispOutAt( aMsg[ MSGROW ], aMsg[ MSGLEFT ], PadC( cMsg, aMsg[ MSGRIGHT ] - aMsg[ MSGLEFT ] + 1 ), aMsg[ MSGCOLOR ] ) MSetCursor( lMOldState ) ENDIF ENDIF diff --git a/harbour/src/rtl/tlabel.prg b/harbour/src/rtl/tlabel.prg index 7ef998c9e6..bf4d14e2e7 100644 --- a/harbour/src/rtl/tlabel.prg +++ b/harbour/src/rtl/tlabel.prg @@ -202,7 +202,7 @@ METHOD New( cLBLName, lPrinter, cAltFile, lNoConsole, bFor, ; ::aBandToPrint := {} ::nCurrentCol := 1 ::cBlank := "" - ::lOneMoreBand :=.T. + ::lOneMoreBand := .T. // clean up Set( _SET_PRINTER, lPrintOn ) // Set the printer back to prior state @@ -222,10 +222,12 @@ METHOD New( cLBLName, lPrinter, cAltFile, lNoConsole, bFor, ; RETURN Self METHOD ExecuteLabel() CLASS HBLabelForm + LOCAL nField, nMoreLines, aBuffer := {}, cBuffer LOCAL v // Load the current record into aBuffer + FOR nField := 1 TO Len( ::aLabelData[ LBL_FIELDS ] ) IF ::aLabelData[ LBL_FIELDS, nField ] != NIL @@ -300,12 +302,14 @@ METHOD ExecuteLabel() CLASS HBLabelForm RETURN Self METHOD SampleLabels() CLASS HBLabelForm + LOCAL cKey, lMoreSamples := .T., nField LOCAL aBand := {} // Create the sample label row + ASize( aBand, ::aLabelData[ LBL_HEIGHT ] ) - AFill( aBand, Space( ::aLabelData[ LBL_LMARGIN ] ) +; + AFill( aBand, Space( ::aLabelData[ LBL_LMARGIN ] ) + ; Replicate( Replicate( "*", ; ::aLabelData[ LBL_WIDTH ] ) + ; Space( ::aLabelData[ LBL_SPACES ] ), ; @@ -325,7 +329,7 @@ METHOD SampleLabels() CLASS HBLabelForm ENDIF // Prompt for more - DispOutAt( Row(), 0, __NatMsg( _LF_SAMPLES ) + " (" + __NatMsg( _LF_YN ) + ")" ) + DispOutAt( Row(), 0, __natMsg( _LF_SAMPLES ) + " (" + __natMsg( _LF_YN ) + ")" ) cKey := hb_keyChar( Inkey( 0 ) ) DispOutAt( Row(), Col(), cKey ) IF Row() == MaxRow() @@ -334,7 +338,7 @@ METHOD SampleLabels() CLASS HBLabelForm ELSE SetPos( Row() + 1, 0 ) ENDIF - IF __NatIsNegative( cKey ) // Don't give sample labels + IF __natIsNegative( cKey ) // Don't give sample labels lMoreSamples := .F. ENDIF ENDDO @@ -342,6 +346,7 @@ METHOD SampleLabels() CLASS HBLabelForm RETURN Self METHOD LoadLabel( cLblFile ) CLASS HBLabelForm + LOCAL i // Counters LOCAL cBuff := Space( BUFFSIZE ) // File buffer LOCAL nHandle // File handle @@ -357,6 +362,7 @@ METHOD LoadLabel( cLblFile ) CLASS HBLabelForm // Create and initialize default label array LOCAL aLabel[ LBL_COUNT ] + aLabel[ LBL_REMARK ] := Space( 60 ) // Label remark aLabel[ LBL_HEIGHT ] := 5 // Label height aLabel[ LBL_WIDTH ] := 35 // Label width @@ -413,12 +419,12 @@ METHOD LoadLabel( cLblFile ) CLASS HBLabelForm // Load label dimension into aLabel aLabel[ LBL_REMARK ] := hb_BSubStr( cBuff, REMARKOFFSET, REMARKSIZE ) - aLabel[ LBL_HEIGHT ] := BIN2W( hb_BSubStr( cBuff, HEIGHTOFFSET, HEIGHTSIZE ) ) - aLabel[ LBL_WIDTH ] := BIN2W( hb_BSubStr( cBuff, WIDTHOFFSET, WIDTHSIZE ) ) - aLabel[ LBL_LMARGIN ] := BIN2W( hb_BSubStr( cBuff, LMARGINOFFSET, LMARGINSIZE ) ) - aLabel[ LBL_LINES ] := BIN2W( hb_BSubStr( cBuff, LINESOFFSET, LINESSIZE ) ) - aLabel[ LBL_SPACES ] := BIN2W( hb_BSubStr( cBuff, SPACESOFFSET, SPACESSIZE ) ) - aLabel[ LBL_ACROSS ] := BIN2W( hb_BSubStr( cBuff, ACROSSOFFSET, ACROSSSIZE ) ) + aLabel[ LBL_HEIGHT ] := Bin2W( hb_BSubStr( cBuff, HEIGHTOFFSET, HEIGHTSIZE ) ) + aLabel[ LBL_WIDTH ] := Bin2W( hb_BSubStr( cBuff, WIDTHOFFSET, WIDTHSIZE ) ) + aLabel[ LBL_LMARGIN ] := Bin2W( hb_BSubStr( cBuff, LMARGINOFFSET, LMARGINSIZE ) ) + aLabel[ LBL_LINES ] := Bin2W( hb_BSubStr( cBuff, LINESOFFSET, LINESSIZE ) ) + aLabel[ LBL_SPACES ] := Bin2W( hb_BSubStr( cBuff, SPACESOFFSET, SPACESSIZE ) ) + aLabel[ LBL_ACROSS ] := Bin2W( hb_BSubStr( cBuff, ACROSSOFFSET, ACROSSSIZE ) ) FOR i := 1 TO aLabel[ LBL_HEIGHT ] diff --git a/harbour/src/rtl/tmenuitm.prg b/harbour/src/rtl/tmenuitm.prg index 924bf275e9..41e604a9dc 100644 --- a/harbour/src/rtl/tmenuitm.prg +++ b/harbour/src/rtl/tmenuitm.prg @@ -203,7 +203,7 @@ FUNCTION MenuItem( cCaption, boData, nShortcut, cMessage, nID ) #ifdef HB_CLP_UNDOC -FUNCTION __miColumn( o, nColumn ) +FUNCTION __MIColumn( o, nColumn ) IF HB_ISOBJECT( o ) .AND. o:ClassName() == "MENUITEM" @@ -216,7 +216,7 @@ FUNCTION __miColumn( o, nColumn ) RETURN -1 -FUNCTION __miRow( o, nRow ) +FUNCTION __MIRow( o, nRow ) IF HB_ISOBJECT( o ) .AND. o:ClassName() == "MENUITEM" diff --git a/harbour/src/rtl/tmenusys.prg b/harbour/src/rtl/tmenusys.prg index 929828859c..8baa79ba07 100644 --- a/harbour/src/rtl/tmenusys.prg +++ b/harbour/src/rtl/tmenusys.prg @@ -141,7 +141,7 @@ METHOD Modal( nSelection, nMsgRow, nMsgLeft, nMsgRight, cMsgColor, GetList ) CLA ::cMsgColor := GetClrPair( SetColor(), 1 ) ENDIF - hb_scroll( ::nMsgRow, ::nMsgLeft, ::nMsgRow, ::nMsgRight ) + hb_Scroll( ::nMsgRow, ::nMsgLeft, ::nMsgRow, ::nMsgRight ) ::cMsgSaveS := SaveScreen( ::nMsgRow, ::nMsgLeft, ::nMsgRow, ::nMsgRight ) @@ -166,7 +166,7 @@ METHOD Modal( nSelection, nMsgRow, nMsgLeft, nMsgRight, cMsgColor, GetList ) CLA ELSEIF ( nSelection := oTopMenu:getAccel( nKey ) ) != 0 - ELSEIF IsShortCut( oTopMenu, nKey, @nReturn ) + ELSEIF IsShortcut( oTopMenu, nKey, @nReturn ) RETURN nReturn ELSE @@ -406,7 +406,7 @@ METHOD Modal( nSelection, nMsgRow, nMsgLeft, nMsgRight, cMsgColor, GetList ) CLA ENDIF - CASE IsShortCut( oTopMenu, nKey, @nReturn ) + CASE IsShortcut( oTopMenu, nKey, @nReturn ) IF nReturn != 0 EXIT @@ -463,6 +463,7 @@ METHOD Modal( nSelection, nMsgRow, nMsgLeft, nMsgRight, cMsgColor, GetList ) CLA * ***/ METHOD PushMenu() CLASS HBMenuSys + LOCAL oNewMenu := ::oMenu:getItem( ::oMenu:current ) IF HB_ISOBJECT( oNewMenu ) .AND. oNewMenu:IsPopUp @@ -503,6 +504,7 @@ METHOD PopMenu() CLASS HBMenuSys * ***/ METHOD PopChild( nNewLevel ) CLASS HBMenuSys + LOCAL oOldMenuItem LOCAL nCurrent @@ -540,6 +542,7 @@ METHOD PopAll() CLASS HBMenuSys * ***/ METHOD Execute() CLASS HBMenuSys + LOCAL oNewMenu := ::oMenu:getItem( ::oMenu:current ) LOCAL lPas := .T. @@ -612,6 +615,7 @@ METHOD MHitTest( oNewMenu, nNewLevel, nNewItem ) CLASS HBMenuSys * ***/ METHOD ShowMsg( lMode ) CLASS HBMenuSys + LOCAL nCurrent LOCAL cMsg @@ -628,7 +632,7 @@ METHOD ShowMsg( lMode ) CLASS HBMenuSys ( nCurrent := ::oMenu:current ) != 0 .AND. ; !Empty( cMsg := ::oMenu:getItem( nCurrent ):message ) - hb_dispOutAt( ::nMsgRow, ::nMsgLeft, PadC( cMsg, ::nMsgRight - ::nMsgLeft + 1 ), ::cMsgColor ) + hb_DispOutAt( ::nMsgRow, ::nMsgLeft, PadC( cMsg, ::nMsgRight - ::nMsgLeft + 1 ), ::cMsgColor ) ENDIF ::cOldMessage := cMsg @@ -642,12 +646,14 @@ METHOD ShowMsg( lMode ) CLASS HBMenuSys This format contradicts the one in the official docs. */ METHOD GetMsgArray() CLASS HBMenuSys - RETURN { , ::nMsgRow, ::nMsgLeft, ::nMsgRight, ::cMsgColor, , , , , } + RETURN {, ::nMsgRow, ::nMsgLeft, ::nMsgRight, ::cMsgColor, , , , , } /* -------------------------------------------- */ METHOD New( oMenu ) CLASS HBMenuSys + ::oMenu := oMenu + RETURN Self #endif diff --git a/harbour/src/rtl/tobject.prg b/harbour/src/rtl/tobject.prg index 1cd41e443a..023effa700 100644 --- a/harbour/src/rtl/tobject.prg +++ b/harbour/src/rtl/tobject.prg @@ -75,10 +75,11 @@ #include "error.ch" FUNCTION HBObject() + STATIC s_oClass LOCAL oClass - IF s_oClass == NIL .and. __clsLockDef( @s_oClass ) + IF s_oClass == NIL .AND. __clsLockDef( @s_oClass ) BEGIN SEQUENCE @@ -146,7 +147,7 @@ FUNCTION HBObject() ALWAYS - __clsUnlockDef( @s_oClass, oClass ) ;; + __clsUnlockDef( @s_oClass, oClass ) END SEQUENCE @@ -161,7 +162,9 @@ FUNCTION HBObject() RETURN s_oClass:Instance() STATIC FUNCTION HBObject_New( ... ) + QSelf():Init( ... ) + RETURN QSelf() STATIC FUNCTION HBObject_Init() diff --git a/harbour/src/rtl/tpersist.prg b/harbour/src/rtl/tpersist.prg index 5272adacad..c87aa52071 100644 --- a/harbour/src/rtl/tpersist.prg +++ b/harbour/src/rtl/tpersist.prg @@ -79,7 +79,7 @@ METHOD LoadFromText( cObjectText, lIgnoreErrors ) CLASS HBPersistent ENDIF bError := iif( HB_ISLOGICAL( lIgnoreErrors ) .AND. lIgnoreErrors, ; - {| e | break( e ) }, errorBlock() ) + {| e | Break( e ) }, ErrorBlock() ) FOR EACH cLine IN hb_ATokens( StrTran( cObjectText, Chr( 13 ) ), Chr( 10 ) ) @@ -91,7 +91,7 @@ METHOD LoadFromText( cObjectText, lIgnoreErrors ) CLASS HBPersistent CASE Empty( cLine ) .OR. Left( cLine, 2 ) == "//" /* ignore comments and empty lines */ - CASE hb_asciiUpper( LTrim( hb_TokenGet( cLine, 1 ) ) ) == "OBJECT" + CASE hb_asciiUpper( LTrim( hb_tokenGet( cLine, 1 ) ) ) == "OBJECT" IF lStart lStart := .F. ELSE @@ -102,10 +102,10 @@ METHOD LoadFromText( cObjectText, lIgnoreErrors ) CLASS HBPersistent AAdd( aObjects, &( cLine ) ) ENDIF - CASE hb_asciiUpper( LTrim( hb_TokenGet( cLine, 1 ) ) ) == "ENDOBJECT" + CASE hb_asciiUpper( LTrim( hb_tokenGet( cLine, 1 ) ) ) == "ENDOBJECT" ASize( aObjects, Len( aObjects ) - 1 ) - CASE hb_asciiUpper( LTrim( hb_TokenGet( cLine, 1 ) ) ) == "ARRAY" + CASE hb_asciiUpper( LTrim( hb_tokenGet( cLine, 1 ) ) ) == "ARRAY" cLine := SubStr( cLine, At( "::", cLine ) ) MEMVAR->oSelf := ATail( aObjects ) cLine := StrTran( cLine, "::", "oSelf:",, 1 ) @@ -160,7 +160,7 @@ METHOD SaveToText( cObjectName, nIndent ) CLASS HBPersistent "OBJECT " + iif( nIndent != 0, "::", "" ) + cObjectName + " AS " + ; ::ClassName() + hb_eol() - aProperties := __ClsGetProperties( ::ClassH ) + aProperties := __clsGetProperties( ::ClassH ) FOR n := 1 TO Len( aProperties ) uValue := __objSendMsg( Self, aProperties[ n ] ) @@ -213,7 +213,7 @@ METHOD SaveToText( cObjectName, nIndent ) CLASS HBPersistent STATIC FUNCTION ArrayToText( aArray, cName, nIndent ) LOCAL cArray := hb_eol() + Space( nIndent ) + "ARRAY ::" + cName + ; - " LEN " + hb_NToS( Len( aArray ) ) + hb_eol() + " LEN " + hb_ntos( Len( aArray ) ) + hb_eol() LOCAL n LOCAL uValue @@ -224,13 +224,13 @@ STATIC FUNCTION ArrayToText( aArray, cName, nIndent ) CASE "A" nIndent += 3 cArray += ArrayToText( uValue, cName + "[ " + ; - hb_NToS( n ) + " ]", nIndent ) + hb_eol() + hb_ntos( n ) + " ]", nIndent ) + hb_eol() nIndent -= 3 EXIT CASE "O" IF __objDerivedFrom( uValue, "HBPERSISTENT" ) - cArray += uValue:SaveToText( cName + "[ " + hb_NToS( n ) + ; + cArray += uValue:SaveToText( cName + "[ " + hb_ntos( n ) + ; " ]", nIndent ) ENDIF EXIT @@ -245,7 +245,7 @@ STATIC FUNCTION ArrayToText( aArray, cName, nIndent ) cArray += hb_eol() ENDIF cArray += Space( nIndent ) + " ::" + cName + ; - + "[ " + hb_NToS( n ) + " ]" + " := " + ; + + "[ " + hb_ntos( n ) + " ]" + " := " + ; hb_ValToExp( uValue ) + hb_eol() ENDSWITCH NEXT diff --git a/harbour/src/rtl/tpopup.prg b/harbour/src/rtl/tpopup.prg index 3c501334b4..0577b076c1 100644 --- a/harbour/src/rtl/tpopup.prg +++ b/harbour/src/rtl/tpopup.prg @@ -159,6 +159,7 @@ METHOD close( lCloseChild ) CLASS POPUPMENU RETURN Self METHOD delItem( nPos ) CLASS POPUPMENU + LOCAL nLen LOCAL aItems LOCAL nWidth @@ -171,13 +172,13 @@ METHOD delItem( nPos ) CLASS POPUPMENU ASize( ::aItems, --::nItemCount ) IF ::nWidth == nLen + 2 - aItems := ::aItems - nLen := ::nItemCount - nWidth := 0 - FOR nPos := 1 TO nLen - nWidth := Max( __CapMetrics( aItems[ nPos ] ), nWidth ) - NEXT - ::nWidth := nWidth + aItems := ::aItems + nLen := ::nItemCount + nWidth := 0 + FOR nPos := 1 TO nLen + nWidth := Max( __CapMetrics( aItems[ nPos ] ), nWidth ) + NEXT + ::nWidth := nWidth ENDIF ENDIF @@ -210,7 +211,7 @@ METHOD display() CLASS POPUPMENU DispBegin() - hb_dispBox( nTop, nLeft, ::nBottom, ::nRight, ; + hb_DispBox( nTop, nLeft, ::nBottom, ::nRight, ; SubStr( ::cBorder, 1, 8 ) + " ", ; hb_ColorIndex( ::cColorSpec, 5 ) ) @@ -227,7 +228,7 @@ METHOD display() CLASS POPUPMENU // to use it for flag purposes. IF aItems[ nPos ]:caption == HB_MENU_SEPARATOR_UNI - hb_dispOutAtBox( nTop, nLeft - 1, SubStr( ::cBorder, 9, 1 ) + Replicate( SubStr( ::cBorder, 10, 1 ), nWidth ) + SubStr( ::cBorder, 11, 1 ), hb_ColorIndex( ::cColorSpec, 5 ) ) + hb_DispOutAtBox( nTop, nLeft - 1, SubStr( ::cBorder, 9, 1 ) + Replicate( SubStr( ::cBorder, 10, 1 ), nWidth ) + SubStr( ::cBorder, 11, 1 ), hb_ColorIndex( ::cColorSpec, 5 ) ) ELSE cCaption := PadR( aItems[ nPos ]:caption, nWidth - 1 ) @@ -267,10 +268,10 @@ METHOD display() CLASS POPUPMENU cCaption := Stuff( cCaption, nHotKeyPos, 1, "" ) ENDIF - hb_dispOutAt( nTop, nLeft, cCaption, hb_ColorIndex( ::cColorSpec, iif( nPos == nCurrent, 1, iif( aItems[ nPos ]:enabled, 0, 4 ) ) ) ) + hb_DispOutAt( nTop, nLeft, cCaption, hb_ColorIndex( ::cColorSpec, iif( nPos == nCurrent, 1, iif( aItems[ nPos ]:enabled, 0, 4 ) ) ) ) IF aItems[ nPos ]:enabled .AND. nHotKeyPos != 0 - hb_dispOutAt( nTop, nLeft + nHotKeyPos - 1, SubStr( cCaption, nHotKeyPos, 1 ), hb_ColorIndex( ::cColorSpec, iif( nPos == nCurrent, 3, 2 ) ) ) + hb_DispOutAt( nTop, nLeft + nHotKeyPos - 1, SubStr( cCaption, nHotKeyPos, 1 ), hb_ColorIndex( ::cColorSpec, iif( nPos == nCurrent, 3, 2 ) ) ) ENDIF ENDIF NEXT @@ -282,13 +283,14 @@ METHOD display() CLASS POPUPMENU RETURN Self METHOD getAccel( xKey ) CLASS POPUPMENU + LOCAL cKey LOCAL item IF HB_ISSTRING( xKey ) cKey := xKey ELSEIF HB_ISNUMERIC( xKey ) - cKey := hb_KeyChar( xKey ) + cKey := hb_keyChar( xKey ) ELSE RETURN 0 ENDIF @@ -305,6 +307,7 @@ METHOD getAccel( xKey ) CLASS POPUPMENU RETURN 0 METHOD getFirst() CLASS POPUPMENU + LOCAL nPos LOCAL nLen := ::nItemCount LOCAL aItems := ::aItems @@ -321,6 +324,7 @@ METHOD getItem( nPos ) CLASS POPUPMENU RETURN iif( nPos >= 1 .AND. nPos <= ::nItemCount, ::aItems[ nPos ], NIL ) METHOD getLast() CLASS POPUPMENU + LOCAL nPos LOCAL nLen := ::nItemCount LOCAL aItems := ::aItems @@ -334,6 +338,7 @@ METHOD getLast() CLASS POPUPMENU RETURN 0 METHOD getNext() CLASS POPUPMENU + LOCAL nPos IF ::nCurrent < ::nItemCount @@ -347,6 +352,7 @@ METHOD getNext() CLASS POPUPMENU RETURN 0 METHOD getPrev() CLASS POPUPMENU + LOCAL nPos IF ::nCurrent > 1 @@ -363,6 +369,7 @@ METHOD getPrev() CLASS POPUPMENU 1) when a menuitem is disabled it will ignore the key [jlalin] */ METHOD getShortCt( nKey ) CLASS POPUPMENU + LOCAL nPos LOCAL nLen := ::nItemCount LOCAL aItems := ::aItems @@ -379,6 +386,7 @@ METHOD getShortCt( nKey ) CLASS POPUPMENU 1) when a menuitem is disabled it will ignore the click [jlalin] */ METHOD hitTest( nMRow, nMCol ) CLASS POPUPMENU + LOCAL nPos ::setMetrics() @@ -492,12 +500,14 @@ METHOD select( nPos ) CLASS POPUPMENU ::nCurrent != nPos .AND. ; ::aItems[ nPos ]:enabled ) .OR. nPos == 0 -// IF ::isOpen() .AND. ; -// ::nCurrent > 0 .AND. ; -// ::aItems[ ::nCurrent ]:isPopUp() -// -// ::aItems[ ::nCurrent ]:data:close() -// ENDIF +#if 0 + IF ::isOpen() .AND. ; + ::nCurrent > 0 .AND. ; + ::aItems[ ::nCurrent ]:isPopUp() + + ::aItems[ ::nCurrent ]:data:close() + ENDIF +#endif ::nCurrent := nPos ENDIF @@ -561,7 +571,7 @@ METHOD bottom( nBottom ) CLASS POPUPMENU METHOD colorSpec( cColorSpec ) CLASS POPUPMENU IF cColorSpec != NIL - ::cColorSpec := __eInstVar53( Self, "COLORSPEC", cColorSpec, "C", 1001,; + ::cColorSpec := __eInstVar53( Self, "COLORSPEC", cColorSpec, "C", 1001, ; {|| !Empty( hb_ColorIndex( cColorSpec, 5 ) ) .AND. Empty( hb_ColorIndex( cColorSpec, 6 ) ) } ) ENDIF @@ -619,6 +629,7 @@ METHOD width() CLASS POPUPMENU RETURN ::nWidth METHOD New( nTop, nLeft, nBottom, nRight ) CLASS POPUPMENU + LOCAL cColor IF HB_ISNUMERIC( nTop ) @@ -638,17 +649,18 @@ METHOD New( nTop, nLeft, nBottom, nRight ) CLASS POPUPMENU ::cColorSpec := "N/W,W/N,W+/W,W+/N,N+/W,W/N" ELSE cColor := SetColor() - ::cColorSpec := hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," +; - hb_ColorIndex( cColor, CLR_ENHANCED ) + "," +; - hb_ColorIndex( cColor, CLR_BACKGROUND ) + "," +; - hb_ColorIndex( cColor, CLR_ENHANCED ) + "," +; - hb_ColorIndex( cColor, CLR_STANDARD ) + "," +; - hb_ColorIndex( cColor, CLR_BORDER ) + ::cColorSpec := ; + hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," + ; + hb_ColorIndex( cColor, CLR_ENHANCED ) + "," + ; + hb_ColorIndex( cColor, CLR_BACKGROUND ) + "," + ; + hb_ColorIndex( cColor, CLR_ENHANCED ) + "," + ; + hb_ColorIndex( cColor, CLR_STANDARD ) + "," + ; + hb_ColorIndex( cColor, CLR_BORDER ) ENDIF RETURN Self -FUNCTION PopUp( nTop, nLeft, nBottom, nRight ) - RETURN HBPopUpMenu():New( nTop, nLeft, nBottom, nRight ) +FUNCTION Popup( nTop, nLeft, nBottom, nRight ) + RETURN HBPopupMenu():New( nTop, nLeft, nBottom, nRight ) #endif diff --git a/harbour/src/rtl/tpopuphb.prg b/harbour/src/rtl/tpopuphb.prg index 698d852d09..aa10be0751 100644 --- a/harbour/src/rtl/tpopuphb.prg +++ b/harbour/src/rtl/tpopuphb.prg @@ -76,6 +76,7 @@ METHOD shadowed( lShadowed ) CLASS hb_POPUPMENU RETURN ::lShadowed METHOD setCoors( nRow, nCol, lTop ) CLASS hb_POPUPMENU + LOCAL oItem LOCAL nDif diff --git a/harbour/src/rtl/treport.prg b/harbour/src/rtl/treport.prg index 252c678a03..6c3ed22a7a 100644 --- a/harbour/src/rtl/treport.prg +++ b/harbour/src/rtl/treport.prg @@ -86,8 +86,7 @@ #define RCT_TEXT 2 // Character, contains text column expression #define RCT_TYPE 3 // Character, type of expression #define RCT_HEADER 4 // Array of column heading strings -#define RCT_WIDTH 5 // Numeric, column width including decimals and - // decimal point +#define RCT_WIDTH 5 // Numeric, column width including decimals and decimal point #define RCT_DECIMALS 6 // Numeric, number of decimal places #define RCT_TOTAL 7 // Logical, total this column, .T.=Yes .F.=No #define RCT_PICT 8 // Character, picture string @@ -163,19 +162,19 @@ CREATE CLASS HBReportForm VAR cOffsetsBuff AS STRING VAR cLengthsBuff AS STRING - METHOD New( cFrmName AS STRING,; - lPrinter AS LOGICAL,; - cAltFile AS STRING,; - lNoConsole AS LOGICAL,; - bFor AS CODEBLOCK,; - bWhile AS CODEBLOCK,; - nNext AS NUMERIC,; - nRecord AS NUMERIC,; - lRest AS LOGICAL,; - lPlain AS LOGICAL,; - cHeading AS STRING,; - lBEject AS LOGICAL,; - lSummary AS LOGICAL ) + METHOD New( cFrmName AS STRING, ; + lPrinter AS LOGICAL, ; + cAltFile AS STRING, ; + lNoConsole AS LOGICAL, ; + bFor AS CODEBLOCK, ; + bWhile AS CODEBLOCK, ; + nNext AS NUMERIC, ; + nRecord AS NUMERIC, ; + lRest AS LOGICAL, ; + lPlain AS LOGICAL, ; + cHeading AS STRING, ; + lBEject AS LOGICAL, ; + lSummary AS LOGICAL ) METHOD ExecuteReport() METHOD ReportHeader() @@ -187,19 +186,19 @@ CREATE CLASS HBReportForm ENDCLASS -METHOD New( cFrmName AS STRING,; - lPrinter AS LOGICAL,; - cAltFile AS STRING,; - lNoConsole AS LOGICAL,; - bFor AS CODEBLOCK,; - bWhile AS CODEBLOCK,; - nNext AS NUMERIC,; - nRecord AS NUMERIC,; - lRest AS LOGICAL,; - lPlain AS LOGICAL,; - cHeading AS STRING,; - lBEject AS LOGICAL,; - lSummary AS LOGICAL ) CLASS HBReportForm +METHOD New( cFrmName AS STRING, ; + lPrinter AS LOGICAL, ; + cAltFile AS STRING, ; + lNoConsole AS LOGICAL, ; + bFor AS CODEBLOCK, ; + bWhile AS CODEBLOCK, ; + nNext AS NUMERIC, ; + nRecord AS NUMERIC, ; + lRest AS LOGICAL, ; + lPlain AS LOGICAL, ; + cHeading AS STRING, ; + lBEject AS LOGICAL, ; + lSummary AS LOGICAL ) CLASS HBReportForm LOCAL lPrintOn, lConsoleOn // Status of PRINTER and CONSOLE LOCAL cExtraFile, lExtraState // Status of EXTRA @@ -211,6 +210,7 @@ METHOD New( cFrmName AS STRING,; LOCAL lAnySubTotals // Resolve parameters + IF cFRMName == NIL err := ErrorNew() err:severity := ES_ERROR @@ -290,7 +290,7 @@ METHOD New( cFrmName AS STRING,; // set the column total elements to 0 if they are to be totaled, otherwise // leave them NIL ::aReportTotals := Array( Len( ::aReportData[ RPT_GROUPS ] ) + 1, ; - Len( ::aReportData[ RPT_COLUMNS ] ) ) + Len( ::aReportData[ RPT_COLUMNS ] ) ) // Column total elements FOR nCol := 1 TO Len( ::aReportData[ RPT_COLUMNS ] ) @@ -338,8 +338,8 @@ METHOD New( cFrmName AS STRING,; // Print the first line ::PrintIt( Space( ::aReportData[ RPT_LMARGIN ] ) + ; - iif( nGroup == 1, __NatMsg( _RFRM_SUBTOTAL ),; - __NatMsg( _RFRM_SUBSUBTOTAL ) ) ) + iif( nGroup == 1, __natMsg( _RFRM_SUBTOTAL ), ; + __natMsg( _RFRM_SUBSUBTOTAL ) ) ) // Print the second line QQOut( Space( ::aReportData[ RPT_LMARGIN ] ) ) @@ -349,7 +349,7 @@ METHOD New( cFrmName AS STRING,; ENDIF IF ::aReportData[ RPT_COLUMNS, nCol, RCT_TOTAL ] QQOut( Transform( ::aReportTotals[ nGroup + 1, nCol ], ; - ::aReportData[ RPT_COLUMNS, nCol, RCT_PICT ] ) ) + ::aReportData[ RPT_COLUMNS, nCol, RCT_PICT ] ) ) ELSE QQOut( Space( ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ) ) ENDIF @@ -383,7 +383,7 @@ METHOD New( cFrmName AS STRING,; ENDIF // Print the first line - ::PrintIt( Space( ::aReportData[ RPT_LMARGIN ] ) + __NatMsg( _RFRM_TOTAL ) ) + ::PrintIt( Space( ::aReportData[ RPT_LMARGIN ] ) + __natMsg( _RFRM_TOTAL ) ) // Print the second line QQOut( Space( ::aReportData[ RPT_LMARGIN ] ) ) @@ -474,40 +474,40 @@ METHOD ReportHeader() CLASS HBReportForm IF ! ::aReportData[ RPT_PLAIN ] IF ::aReportData[ RPT_HEADING ] == "" - AAdd( aPageHeader, __NatMsg( _RFRM_PAGENO ) + Str( ::nPageNumber, 6 ) ) + AAdd( aPageHeader, __natMsg( _RFRM_PAGENO ) + Str( ::nPageNumber, 6 ) ) ELSE - aTempPgHeader := ParseHeader( ::aReportData[ RPT_HEADING ],; + aTempPgHeader := ParseHeader( ::aReportData[ RPT_HEADING ], ; Occurs( ";", ::aReportData[ RPT_HEADING ] ) + 1 ) - FOR nLine := 1 to Len( aTempPgHeader) - nLinesInHeader:=Max( XMLCOUNT( LTrim( aTempPgHeader[ nLine ] ) , ; - nHeadingLength),1) + FOR nLine := 1 TO Len( aTempPgHeader ) + nLinesInHeader := Max( XMLCOUNT( LTrim( aTempPgHeader[ nLine ] ), ; + nHeadingLength ), 1 ) - FOR nHeadLine := 1 to nLinesInHeader + FOR nHeadLine := 1 TO nLinesInHeader AAdd( aPageHeader, Space( 15 ) + ; - PadC( RTrim( XMEMOLINE( LTrim( aTempPgHeader[ nLine ] ),; + PadC( RTrim( XMEMOLINE( LTrim( aTempPgHeader[ nLine ] ), ; nHeadingLength, nHeadLine ) ), nHeadingLength ) ) NEXT NEXT - aPageHeader[ 1 ] := Stuff(aPageHeader[ 1 ], 1, 14, ; - __NatMsg( _RFRM_PAGENO ) + Str( ::nPageNumber, 6 ) ) + aPageHeader[ 1 ] := Stuff( aPageHeader[ 1 ], 1, 14, ; + __natMsg( _RFRM_PAGENO ) + Str( ::nPageNumber, 6 ) ) ENDIF AAdd( aPageHeader, DToC( Date() ) ) ENDIF - FOR nLine := 1 TO Len( ::aReportData[ RPT_HEADER]) - nLinesInHeader := Max( XMLCOUNT( LTrim( ::aReportData[ RPT_HEADER,; + FOR nLine := 1 TO Len( ::aReportData[ RPT_HEADER ] ) + nLinesInHeader := Max( XMLCOUNT( LTrim( ::aReportData[ RPT_HEADER, ; nLine ] ) ), 1 ) - FOR nHeadLine := 1 to nLinesInHeader + FOR nHeadLine := 1 TO nLinesInHeader - cHeader := RTrim( XMEMOLINE( LTrim( ::aReportData[ RPT_HEADER, nLine ] ),,; + cHeader := RTrim( XMEMOLINE( LTrim( ::aReportData[ RPT_HEADER, nLine ] ),, ; nHeadLine ) ) - AAdd( aPageHeader, Space( ( nRPageSize - ::aReportData[ RPT_LMARGIN ] -; - Len( cHeader ) ) / 2 ) + cHeader ) + AAdd( aPageHeader, Space( ( nRPageSize - ::aReportData[ RPT_LMARGIN ] - ; + Len( cHeader ) ) / 2 ) + cHeader ) NEXT @@ -515,17 +515,17 @@ METHOD ReportHeader() CLASS HBReportForm AAdd( aPageHeader, "" ) // S87 compat. - nLinesInHeader := Len( aPageHeader) + nLinesInHeader := Len( aPageHeader ) nMaxColLength := 0 FOR nCol := 1 TO Len( ::aReportData[ RPT_COLUMNS ] ) nMaxColLength := Max( Len( ::aReportData[ RPT_COLUMNS, nCol, RCT_HEADER ] ), ; - nMaxColLength ) + nMaxColLength ) NEXT - FOR nCol := 1 to Len( ::aReportData[ RPT_COLUMNS ] ) + FOR nCol := 1 TO Len( ::aReportData[ RPT_COLUMNS ] ) ASize( ::aReportData[ RPT_COLUMNS, nCol, RCT_HEADER ], nMaxColLength ) NEXT - FOR nLine:=1 TO nMaxColLength - AAdd( aPageHeader, "") + FOR nLine := 1 TO nMaxColLength + AAdd( aPageHeader, "" ) NEXT FOR nCol := 1 TO Len( ::aReportData[ RPT_COLUMNS ] ) // Cycle through the columns @@ -535,16 +535,16 @@ METHOD ReportHeader() CLASS HBReportForm ENDIF IF ::aReportData[ RPT_COLUMNS, nCol, RCT_HEADER, nLine ] == NIL aPageHeader[ nLinesInHeader + nLine ] += ; - Space( ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ) + Space( ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ) ELSE IF ::aReportData[ RPT_COLUMNS, nCol, RCT_TYPE ] == "N" aPageHeader[ nLinesInHeader + nLine ] += ; - PadL( ::aReportData[ RPT_COLUMNS, nCol, RCT_HEADER, nLine ],; - ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ) + PadL( ::aReportData[ RPT_COLUMNS, nCol, RCT_HEADER, nLine ], ; + ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ) ELSE aPageHeader[ nLinesInHeader + nLine ] += ; - PadR( ::aReportData[ RPT_COLUMNS, nCol, RCT_HEADER, nLine ],; - ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ) + PadR( ::aReportData[ RPT_COLUMNS, nCol, RCT_HEADER, nLine ], ; + ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ) ENDIF ENDIF NEXT @@ -554,7 +554,7 @@ METHOD ReportHeader() CLASS HBReportForm AAdd( aPageHeader, "" ) AAdd( aPageHeader, "" ) AEval( aPageHeader, {| HeaderLine | ; - ::PrintIt( Space( ::aReportData[ RPT_LMARGIN ] ) + HeaderLine ) } ) + ::PrintIt( Space( ::aReportData[ RPT_LMARGIN ] ) + HeaderLine ) } ) // Set the page number and number of available lines ::nPageNumber++ @@ -580,11 +580,12 @@ METHOD ExecuteReport() CLASS HBReportForm LOCAL lAnySubTotals // Add to the main column totals + FOR nCol := 1 TO Len( ::aReportData[ RPT_COLUMNS ] ) IF ::aReportData[ RPT_COLUMNS, nCol, RCT_TOTAL ] // If this column should be totaled, do it ::aReportTotals[ 1, nCol ] += ; - Eval( ::aReportData[ RPT_COLUMNS, nCol, RCT_EXP ] ) + Eval( ::aReportData[ RPT_COLUMNS, nCol, RCT_EXP ] ) ENDIF NEXT @@ -614,17 +615,17 @@ METHOD ExecuteReport() CLASS HBReportForm ENDIF // For subgroup processing: check if group has been changed - IF MakeAStr( Eval( ::aReportData[ RPT_GROUPS, 1, RGT_EXP ] ),; - ::aReportData[ RPT_GROUPS, 1, RGT_TYPE ] ) != ::aGroupTotals[ 1 ] + IF MakeAStr( Eval( ::aReportData[ RPT_GROUPS, 1, RGT_EXP ] ), ; + ::aReportData[ RPT_GROUPS, 1, RGT_TYPE ] ) != ::aGroupTotals[ 1 ] lGroupChanged := .T. ENDIF // If this (sub)group has changed since the last record - IF lGroupChanged .OR. MakeAStr( Eval( ::aReportData[ RPT_GROUPS, nGroup, RGT_EXP ] ),; - ::aReportData[ RPT_GROUPS, nGroup, RGT_TYPE ] ) != ::aGroupTotals[ nGroup ] + IF lGroupChanged .OR. MakeAStr( Eval( ::aReportData[ RPT_GROUPS, nGroup, RGT_EXP ] ), ; + ::aReportData[ RPT_GROUPS, nGroup, RGT_TYPE ] ) != ::aGroupTotals[ nGroup ] - AAdd( aRecordHeader, iif( nGroup == 1, __NatMsg( _RFRM_SUBTOTAL ),; - __NatMsg( _RFRM_SUBSUBTOTAL ) ) ) + AAdd( aRecordHeader, iif( nGroup == 1, __natMsg( _RFRM_SUBTOTAL ), ; + __natMsg( _RFRM_SUBSUBTOTAL ) ) ) AAdd( aRecordHeader, "" ) @@ -640,14 +641,14 @@ METHOD ExecuteReport() CLASS HBReportForm ::aReportTotals[ nGroup + 1, nCol ] := 0 ELSE aRecordHeader[ Len( aRecordHeader ) ] += ; - Space( ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ) + Space( ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ) ENDIF aRecordHeader[ Len( aRecordHeader ) ] += " " NEXT // Get rid of the extra space from the last column aRecordHeader[ Len( aRecordHeader ) ] := ; - Left( aRecordHeader[ Len( aRecordHeader ) ], ; - Len( aRecordHeader[ Len( aRecordHeader ) ] ) - 1 ) + Left( aRecordHeader[ Len( aRecordHeader ) ], ; + Len( aRecordHeader[ Len( aRecordHeader ) ] ) - 1 ) ENDIF NEXT @@ -689,7 +690,7 @@ METHOD ExecuteReport() CLASS HBReportForm // Cycle through the groups FOR nGroup := 1 TO Len( ::aReportData[ RPT_GROUPS ] ) // If the group has changed - IF MakeAStr( Eval( ::aReportData[ RPT_GROUPS, nGroup, RGT_EXP ] ),; + IF MakeAStr( Eval( ::aReportData[ RPT_GROUPS, nGroup, RGT_EXP ] ), ; ::aReportData[ RPT_GROUPS, nGroup, RGT_TYPE ] ) == ::aGroupTotals[ nGroup ] ELSE AAdd( aRecordHeader, "" ) // The blank line @@ -704,10 +705,10 @@ METHOD ExecuteReport() CLASS HBReportForm ENDIF - AAdd( aRecordHeader, iif( nGroup == 1, "** ", "* " ) +; - ::aReportData[ RPT_GROUPS, nGroup, RGT_HEADER ] + " " +; - MakeAStr( Eval( ::aReportData[ RPT_GROUPS, nGroup, RGT_EXP ] ), ; - ::aReportData[ RPT_GROUPS, nGroup, RGT_TYPE ] ) ) + AAdd( aRecordHeader, iif( nGroup == 1, "** ", "* " ) + ; + ::aReportData[ RPT_GROUPS, nGroup, RGT_HEADER ] + " " + ; + MakeAStr( Eval( ::aReportData[ RPT_GROUPS, nGroup, RGT_EXP ] ), ; + ::aReportData[ RPT_GROUPS, nGroup, RGT_TYPE ] ) ) ENDIF NEXT @@ -728,7 +729,7 @@ METHOD ExecuteReport() CLASS HBReportForm // Send aRecordHeader to the output device, resetting nLinesLeft AEval( aRecordHeader, {| HeaderLine | ; - ::PrintIt( Space( ::aReportData[ RPT_LMARGIN ] ) + HeaderLine ) } ) + ::PrintIt( Space( ::aReportData[ RPT_LMARGIN ] ) + HeaderLine ) } ) ::nLinesLeft -= Len( aRecordHeader ) @@ -749,7 +750,7 @@ METHOD ExecuteReport() CLASS HBReportForm IF ::aReportData[ RPT_COLUMNS, nCol, RCT_TOTAL ] // Cycle through the groups FOR nGroup := 1 TO Len( ::aReportTotals ) - 1 - ::aReportTotals[nGroup+1,nCol] += ; + ::aReportTotals[ nGroup + 1, nCol ] += ; Eval( ::aReportData[ RPT_COLUMNS, nCol, RCT_EXP ] ) NEXT ENDIF @@ -757,8 +758,8 @@ METHOD ExecuteReport() CLASS HBReportForm // Reset the group expressions in aGroupTotals FOR nGroup := 1 TO Len( ::aReportData[ RPT_GROUPS ] ) - ::aGroupTotals[ nGroup ] := MakeAStr( Eval( ::aReportData[ RPT_GROUPS, nGroup, RGT_EXP ] ),; - ::aReportData[ RPT_GROUPS, nGroup, RGT_TYPE ] ) + ::aGroupTotals[ nGroup ] := MakeAStr( Eval( ::aReportData[ RPT_GROUPS, nGroup, RGT_EXP ] ), ; + ::aReportData[ RPT_GROUPS, nGroup, RGT_TYPE ] ) NEXT // Only run through the record detail if this is NOT a summary report @@ -768,12 +769,12 @@ METHOD ExecuteReport() CLASS HBReportForm FOR nCol := 1 TO Len( ::aReportData[ RPT_COLUMNS ] ) IF ::aReportData[ RPT_COLUMNS, nCol, RCT_TYPE ] $ "M" - nMaxLines := Max( XMLCOUNT( Eval( ::aReportData[ RPT_COLUMNS, nCol, RCT_EXP ] ),; - ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ), nMaxLines ) + nMaxLines := Max( XMLCOUNT( Eval( ::aReportData[ RPT_COLUMNS, nCol, RCT_EXP ] ), ; + ::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_eol() ),; - ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ), nMaxLines ) + nMaxLines := Max( XMLCOUNT( StrTran( Eval( ::aReportData[ RPT_COLUMNS, nCol, RCT_EXP ] ), ; + ";", hb_eol() ), ; + ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ), nMaxLines ) ENDIF NEXT @@ -790,18 +791,18 @@ METHOD ExecuteReport() CLASS HBReportForm // Load the current line of the current column into cLine // 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_eol() ) ),; - ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ], nLine ) + cLine := XMEMOLINE( RTrim( StrTran( Eval( ::aReportData[ RPT_COLUMNS, nCol, RCT_EXP ] ), ; + ";", hb_eol() ) ), ; + ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ], nLine ) ELSE - cLine := XMEMOLINE( RTrim( Eval( ::aReportData[ RPT_COLUMNS, nCol, RCT_EXP ] ) ),; - ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ], nLine ) + cLine := XMEMOLINE( RTrim( Eval( ::aReportData[ RPT_COLUMNS, nCol, RCT_EXP ] ) ), ; + ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ], nLine ) ENDIF cLine := PadR( cLine, ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ) ELSE IF nLine == 1 - cLine := Transform( Eval( ::aReportData[ RPT_COLUMNS, nCol, RCT_EXP ] ),; - ::aReportData[ RPT_COLUMNS, nCol, RCT_PICT ] ) + cLine := Transform( Eval( ::aReportData[ RPT_COLUMNS, nCol, RCT_EXP ] ), ; + ::aReportData[ RPT_COLUMNS, nCol, RCT_PICT ] ) cLine := PadR( cLine, ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ) ELSE cLine := Space( ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] ) @@ -844,18 +845,18 @@ METHOD ExecuteReport() CLASS HBReportForm ENDIF AEval( aRecordToPrint, ; {| RecordLine | ; - ::PrintIt( Space( ::aReportData[ RPT_LMARGIN ] ) + RecordLine ) ; + ::PrintIt( Space( ::aReportData[ RPT_LMARGIN ] ) + RecordLine ) ; } ; - ) + ) ::nLinesLeft -= Len( aRecordToPrint ) ENDIF ELSE // Send aRecordToPrint to the output device, resetting ::nLinesLeft AEval( aRecordToPrint, ; {| RecordLine | ; - ::PrintIt( Space( ::aReportData[ RPT_LMARGIN ] ) + RecordLine ) ; + ::PrintIt( Space( ::aReportData[ RPT_LMARGIN ] ) + RecordLine ) ; } ; - ) + ) ::nLinesLeft -= Len( aRecordToPrint ) ENDIF @@ -878,6 +879,7 @@ METHOD ExecuteReport() CLASS HBReportForm RETURN NIL METHOD LoadReportFile( cFrmFile AS STRING ) CLASS HBReportForm + LOCAL cFieldsBuff LOCAL cParamsBuff LOCAL nFieldOffset := 0 @@ -892,17 +894,18 @@ METHOD LoadReportFile( cFrmFile AS STRING ) CLASS HBReportForm LOCAL nFileError // Contains current file error LOCAL cOptionByte // Contains option byte - LOCAL aReport[ RPT_COUNT ] // Create report array + LOCAL aReport[ RPT_COUNT ] // Create report array LOCAL err // error object - LOCAL cDefPath // contents of SET DEFAULT string - LOCAL aPaths // array of paths - LOCAL nPathIndex // iteration counter + LOCAL cDefPath // contents of SET DEFAULT string + LOCAL aPaths // array of paths + LOCAL nPathIndex // iteration counter - LOCAL aHeader // temporary storage for report form headings - LOCAL nHeaderIndex // index into temporary header array + LOCAL aHeader // temporary storage for report form headings + LOCAL nHeaderIndex // index into temporary header array // Initialize STATIC buffer values + ::cLengthsBuff := "" ::cOffSetsBuff := "" ::cExprBuff := "" @@ -977,8 +980,8 @@ METHOD LoadReportFile( cFrmFile AS STRING ) CLASS HBReportForm IF nFileError == F_OK // Is this a .frm type file (2 at start and end of file) - IF BIN2W( hb_BSubStr( cFileBuff, 1, 2 ) ) == 2 .AND.; - BIN2W( hb_BSubStr( cFileBuff, SIZE_FILE_BUFF - 1, 2 ) ) == 2 + IF Bin2W( hb_BSubStr( cFileBuff, 1, 2 ) ) == 2 .AND. ; + Bin2W( hb_BSubStr( cFileBuff, SIZE_FILE_BUFF - 1, 2 ) ) == 2 nFileError := F_OK ELSE @@ -1009,27 +1012,27 @@ METHOD LoadReportFile( cFrmFile AS STRING ) CLASS HBReportForm // Process report attributes // Report width - aReport[ RPT_WIDTH ] := BIN2W( hb_BSubStr( cParamsBuff, PAGE_WIDTH_OFFSET, 2 ) ) + aReport[ RPT_WIDTH ] := Bin2W( hb_BSubStr( cParamsBuff, PAGE_WIDTH_OFFSET, 2 ) ) // Lines per page - aReport[ RPT_LINES ] := BIN2W( hb_BSubStr( cParamsBuff, LNS_PER_PAGE_OFFSET, 2 ) ) + aReport[ RPT_LINES ] := Bin2W( hb_BSubStr( cParamsBuff, LNS_PER_PAGE_OFFSET, 2 ) ) // Page offset (left margin) - aReport[ RPT_LMARGIN ] := BIN2W( hb_BSubStr( cParamsBuff, LEFT_MRGN_OFFSET, 2 ) ) + aReport[ RPT_LMARGIN ] := Bin2W( hb_BSubStr( cParamsBuff, LEFT_MRGN_OFFSET, 2 ) ) // Page right margin (not used) - aReport[ RPT_RMARGIN ] := BIN2W( hb_BSubStr( cParamsBuff, RIGHT_MGRN_OFFSET, 2 ) ) + aReport[ RPT_RMARGIN ] := Bin2W( hb_BSubStr( cParamsBuff, RIGHT_MGRN_OFFSET, 2 ) ) - nColCount := BIN2W( hb_BSubStr( cParamsBuff, COL_COUNT_OFFSET, 2 ) ) + nColCount := Bin2W( hb_BSubStr( cParamsBuff, COL_COUNT_OFFSET, 2 ) ) // Line spacing // Spacing is 1, 2, or 3 aReport[ RPT_SPACING ] := iif( hb_BSubStr( cParamsBuff, ; - DBL_SPACE_OFFSET, 1 ) $ "YyTt", 2, 1 ) + DBL_SPACE_OFFSET, 1 ) $ "YyTt", 2, 1 ) // Summary report flag aReport[ RPT_SUMMARY ] := iif( hb_BSubStr( cParamsBuff, ; - SUMMARY_RPT_OFFSET, 1 ) $ "YyTt", .T., .F. ) + SUMMARY_RPT_OFFSET, 1 ) $ "YyTt", .T., .F. ) // Process report eject and plain attributes option byte cOptionByte := Asc( hb_BSubStr( cParamsBuff, OPTION_OFFSET, 1 ) ) @@ -1046,11 +1049,11 @@ METHOD LoadReportFile( cFrmFile AS STRING ) CLASS HBReportForm IF Int( cOptionByte / 1 ) == 1 aReport[ RPT_BEJECT ] := .F. // Page eject before report - //cOptionByte -= 1 + // cOptionByte -= 1 ENDIF // Page heading, report title - nPointer := BIN2W( hb_BSubStr( cParamsBuff, PAGE_HDR_OFFSET, 2 ) ) + nPointer := Bin2W( hb_BSubStr( cParamsBuff, PAGE_HDR_OFFSET, 2 ) ) // Retrieve the header stored in the .frm file nHeaderIndex := 4 @@ -1065,12 +1068,12 @@ METHOD LoadReportFile( cFrmFile AS STRING ) CLASS HBReportForm nHeaderIndex-- ENDDO - aReport[ RPT_HEADER ] := iif( Empty( nHeaderIndex ) , {}, ; - ASize( aHeader, nHeaderIndex ) ) + aReport[ RPT_HEADER ] := iif( Empty( nHeaderIndex ), {}, ; + ASize( aHeader, nHeaderIndex ) ) // Process Groups // Group - nPointer := BIN2W( hb_BSubStr( cParamsBuff, GRP_EXPR_OFFSET, 2 ) ) + nPointer := Bin2W( hb_BSubStr( cParamsBuff, GRP_EXPR_OFFSET, 2 ) ) IF ! Empty( cGroupExp := ::GetExpr( nPointer ) ) @@ -1082,21 +1085,21 @@ METHOD LoadReportFile( cFrmFile AS STRING ) CLASS HBReportForm aReport[ RPT_GROUPS ][ 1 ][ RGT_EXP ] := hb_macroBlock( cGroupExp ) IF Used() aReport[ RPT_GROUPS ][ 1 ][ RGT_TYPE ] := ; - ValType( Eval( aReport[ RPT_GROUPS ][ 1 ][ RGT_EXP ] ) ) + ValType( Eval( aReport[ RPT_GROUPS ][ 1 ][ RGT_EXP ] ) ) ENDIF // Group header - nPointer := BIN2W( hb_BSubStr( cParamsBuff, GRP_HDR_OFFSET, 2 ) ) + nPointer := Bin2W( hb_BSubStr( cParamsBuff, GRP_HDR_OFFSET, 2 ) ) aReport[ RPT_GROUPS ][ 1 ][ RGT_HEADER ] := ::GetExpr( nPointer ) // Page eject after group aReport[ RPT_GROUPS ][ 1 ][ RGT_AEJECT ] := iif( hb_BSubStr( cParamsBuff, ; - PE_OFFSET, 1) $ "YyTt", .T., .F. ) + PE_OFFSET, 1 ) $ "YyTt", .T., .F. ) ENDIF // Subgroup - nPointer := BIN2W( hb_BSubStr( cParamsBuff, SUB_EXPR_OFFSET, 2 ) ) + nPointer := Bin2W( hb_BSubStr( cParamsBuff, SUB_EXPR_OFFSET, 2 ) ) IF ! Empty( cSubGroupExp := ::GetExpr( nPointer ) ) @@ -1108,11 +1111,11 @@ METHOD LoadReportFile( cFrmFile AS STRING ) CLASS HBReportForm aReport[ RPT_GROUPS ][ 2 ][ RGT_EXP ] := hb_macroBlock( cSubGroupExp ) IF Used() aReport[ RPT_GROUPS ][ 2 ][ RGT_TYPE ] := ; - ValType( Eval( aReport[ RPT_GROUPS ][ 2 ][ RGT_EXP ] ) ) + ValType( Eval( aReport[ RPT_GROUPS ][ 2 ][ RGT_EXP ] ) ) ENDIF // Subgroup header - nPointer := BIN2W( hb_BSubStr( cParamsBuff, SUB_HDR_OFFSET, 2 ) ) + nPointer := Bin2W( hb_BSubStr( cParamsBuff, SUB_HDR_OFFSET, 2 ) ) aReport[ RPT_GROUPS ][ 2 ][ RGT_HEADER ] := ::GetExpr( nPointer ) // Page eject after subgroup @@ -1122,7 +1125,7 @@ METHOD LoadReportFile( cFrmFile AS STRING ) CLASS HBReportForm // Process columns nFieldOffset := 12 // dBASE skips first 12 byte fields block. - FOR nCount := 1 to nColCount + FOR nCount := 1 TO nColCount AAdd( aReport[ RPT_COLUMNS ], ::GetColumn( cFieldsBuff, @nFieldOffset ) ) @@ -1148,12 +1151,14 @@ METHOD LoadReportFile( cFrmFile AS STRING ) CLASS HBReportForm */ METHOD GetExpr( nPointer AS NUMERIC ) CLASS HBReportForm + LOCAL nExprOffset LOCAL nExprLength LOCAL nOffsetOffset := 0 LOCAL cString := "" // Stuff for dBASE compatability. + IF nPointer != 65535 // Convert FILE offset to CLIPPER string offset @@ -1164,8 +1169,8 @@ METHOD GetExpr( nPointer AS NUMERIC ) CLASS HBReportForm nOffsetOffset := ( nPointer * 2 ) - 1 ENDIF - nExprOffset := BIN2W( hb_BSubStr( ::cOffsetsBuff, nOffsetOffset, 2 ) ) - nExprLength := BIN2W( hb_BSubStr( ::cLengthsBuff, nOffsetOffset, 2 ) ) + nExprOffset := Bin2W( hb_BSubStr( ::cOffsetsBuff, nOffsetOffset, 2 ) ) + nExprLength := Bin2W( hb_BSubStr( ::cLengthsBuff, nOffsetOffset, 2 ) ) // EXPR_OFFSET points to a NULL, so add one (+1) to get the string // and subtract one (-1) from EXPR_LENGTH for correct length @@ -1186,6 +1191,7 @@ METHOD GetExpr( nPointer AS NUMERIC ) CLASS HBReportForm RETURN cString STATIC FUNCTION Occurs( cSearch, cTarget ) + LOCAL nPos, nCount := 0 DO WHILE !Empty( cTarget ) @@ -1218,6 +1224,7 @@ STATIC FUNCTION XMLCOUNT( cString, nLineLength, nTabSize, lWrap ) * [], [] ) --> cLine * */ + STATIC FUNCTION XMEMOLINE( cString, nLineLength, nLineNumber, nTabSize, lWrap ) hb_default( @nLineLength, 79 ) @@ -1232,6 +1239,7 @@ STATIC FUNCTION XMEMOLINE( cString, nLineLength, nLineNumber, nTabSize, lWrap ) RETURN MemoLine( cString, nLineLength, nLineNumber, nTabSize, lWrap ) STATIC FUNCTION ParseHeader( cHeaderString, nFields ) + LOCAL cItem LOCAL nItemCount := 0 LOCAL aPageHeader := {} @@ -1279,34 +1287,37 @@ STATIC FUNCTION ParseHeader( cHeaderString, nFields ) * b. Character following character pointed to by pointer is Chr(0) * */ + METHOD GetColumn( cFieldsBuffer AS STRING, nOffset AS NUMERIC ) CLASS HBReportForm + LOCAL nPointer, aColumn[ RCT_COUNT ], cType, cExpr // Column width - aColumn[ RCT_WIDTH ] := BIN2W( hb_BSubStr( cFieldsBuffer, nOffset + ; - FIELD_WIDTH_OFFSET, 2 ) ) + + aColumn[ RCT_WIDTH ] := Bin2W( hb_BSubStr( cFieldsBuffer, nOffset + ; + FIELD_WIDTH_OFFSET, 2 ) ) // Total column? aColumn[ RCT_TOTAL ] := iif( hb_BSubStr( cFieldsBuffer, nOffset + ; - FIELD_TOTALS_OFFSET, 1 ) $ "YyTt", .T., .F. ) + FIELD_TOTALS_OFFSET, 1 ) $ "YyTt", .T., .F. ) // Decimals width - aColumn[ RCT_DECIMALS ] := BIN2W( hb_BSubStr( cFieldsBuffer, nOffset + ; - FIELD_DECIMALS_OFFSET, 2 ) ) + aColumn[ RCT_DECIMALS ] := Bin2W( hb_BSubStr( cFieldsBuffer, nOffset + ; + FIELD_DECIMALS_OFFSET, 2 ) ) // Offset (relative to FIELDS_OFFSET), 'point' to // expression area via array OFFSETS[] // Content expression - nPointer := BIN2W( hb_BSubStr( cFieldsBuffer, nOffset +; - FIELD_CONTENT_EXPR_OFFSET, 2 ) ) + nPointer := Bin2W( hb_BSubStr( cFieldsBuffer, nOffset + ; + FIELD_CONTENT_EXPR_OFFSET, 2 ) ) aColumn[ RCT_TEXT ] := ::GetExpr( nPointer ) cExpr := aColumn[ RCT_TEXT ] aColumn[ RCT_EXP ] := hb_macroBlock( cExpr ) // Header expression - nPointer := BIN2W( hb_BSubStr( cFieldsBuffer, nOffset +; - FIELD_HEADER_EXPR_OFFSET, 2 ) ) + nPointer := Bin2W( hb_BSubStr( cFieldsBuffer, nOffset + ; + FIELD_HEADER_EXPR_OFFSET, 2 ) ) aColumn[ RCT_HEADER ] := ListAsArray( ::GetExpr( nPointer ), ";" ) @@ -1329,7 +1340,7 @@ METHOD GetColumn( cFieldsBuffer AS STRING, nOffset AS NUMERIC ) CLASS HBReportFo CASE "N" IF aColumn[ RCT_DECIMALS ] != 0 aColumn[ RCT_PICT ] := Replicate( "9", aColumn[ RCT_WIDTH ] - aColumn[ RCT_DECIMALS ] -1 ) + "." + ; - Replicate( "9", aColumn[ RCT_DECIMALS ] ) + Replicate( "9", aColumn[ RCT_DECIMALS ] ) ELSE aColumn[ RCT_PICT ] := Replicate( "9", aColumn[ RCT_WIDTH ] ) ENDIF @@ -1351,6 +1362,7 @@ METHOD GetColumn( cFieldsBuffer AS STRING, nOffset AS NUMERIC ) CLASS HBReportFo * Convert a delimited string to an array * */ + STATIC FUNCTION ListAsArray( cList, cDelimiter ) LOCAL nPos @@ -1386,6 +1398,7 @@ STATIC FUNCTION ListAsArray( cList, cDelimiter ) RETURN aList // Return the array STATIC FUNCTION MakeAStr( uVar, cType ) + LOCAL cString SWITCH Asc( cType ) @@ -1418,7 +1431,8 @@ STATIC FUNCTION MakeAStr( uVar, cType ) RETURN cString FUNCTION __ReportForm( cFRMName, lPrinter, cAltFile, lNoConsole, bFor, ; - bWhile, nNext, nRecord, lRest, lPlain, cHeading, ; - lBEject, lSummary ) - RETURN HBReportForm():New( cFrmName, lPrinter, cAltFile, lNoConsole, bFor, bWhile, nNext, nRecord,; - lRest, lPlain, cHeading, lBEject, lSummary) + bWhile, nNext, nRecord, lRest, lPlain, cHeading, ; + lBEject, lSummary ) + + RETURN HBReportForm():New( cFrmName, lPrinter, cAltFile, lNoConsole, bFor, bWhile, nNext, nRecord, ; + lRest, lPlain, cHeading, lBEject, lSummary ) diff --git a/harbour/src/rtl/tscalar.prg b/harbour/src/rtl/tscalar.prg index 48a65b0d44..6c7986c200 100644 --- a/harbour/src/rtl/tscalar.prg +++ b/harbour/src/rtl/tscalar.prg @@ -82,7 +82,7 @@ METHOD AsString() CLASS ScalarObject CASE "M" CASE "C" ; RETURN Self CASE "D" ; RETURN DToC( Self ) - CASE "T" ; RETURN HB_TToC( Self ) + CASE "T" ; RETURN hb_TToC( Self ) CASE "H" ; RETURN "{ ... => ... }" CASE "L" ; RETURN iif( Self, ".T.", ".F." ) CASE "N" ; RETURN hb_ntos( Self ) @@ -99,37 +99,39 @@ METHOD AsExpStr() CLASS ScalarObject CASE "M" CASE "C" ; RETURN '"' + Self + '"' CASE "D" ; RETURN 'CToD("' + DToC( Self ) + '")' - CASE "T" ; RETURN 'HB_CToT("' + HB_TToC( Self ) + '")' + CASE "T" ; RETURN 'hb_CToT("' + hb_TToC( Self ) + '")' ENDSWITCH RETURN ::AsString() METHOD BecomeErr() CLASS ScalarObject + // Not implemented yet // ::error( CSYERR_BECOME, "Message 'become' illegally sent to scalar", ::ClassName() ) + RETURN NIL /* -------------------------------------------- */ CREATE CLASS Array INHERIT HBScalar FUNCTION __HBArray - METHOD Init + METHOD Init( nElements ) - METHOD AsString - METHOD At - METHOD AtPut - METHOD Add - METHOD AddAll - METHOD Collect - METHOD Copy - METHOD Do - METHOD DeleteAt - METHOD InsertAt - METHOD IndexOf - METHOD IsScalar - METHOD Remove - METHOD Scan - METHOD _Size // assignment method + METHOD AsString() + METHOD At( n ) + METHOD AtPut( n, x ) + METHOD Add( x ) + METHOD AddAll( aOtherCollection ) + METHOD Collect( b ) + METHOD Copy() + METHOD Do( b ) + METHOD DeleteAt( n ) + METHOD InsertAt( n, x ) + METHOD IndexOf( x ) + METHOD IsScalar() + METHOD Remove( e ) + METHOD Scan( b ) + METHOD _Size( newSize ) // assignment method MESSAGE Append METHOD Add @@ -169,7 +171,7 @@ METHOD Collect( b ) CLASS Array LOCAL result := {} LOCAL nElems := Len( Self ) - FOR i := 1 to nElems + FOR i := 1 TO nElems currElem := Self[ i ] IF Eval( b, currElem ) AAdd( result, currElem ) @@ -312,16 +314,16 @@ CREATE CLASS TimeStamp INHERIT HBScalar FUNCTION __HBTimeStamp ENDCLASS METHOD AsString() CLASS TimeStamp - RETURN HB_TTOS( Self ) + RETURN hb_TToS( Self ) METHOD AsExpStr() CLASS TimeStamp - RETURN 'HB_STOT("' + ::AsString() + '")' + RETURN 'hb_SToT("' + ::AsString() + '")' METHOD Date() CLASS TimeStamp - RETURN HB_TTOC( Self, NIL, "" ) + RETURN hb_TToC( Self, NIL, "" ) METHOD Time() CLASS TimeStamp - RETURN HB_TTOC( Self, "", "HH:MM:SS" ) + RETURN hb_TToC( Self, "", "HH:MM:SS" ) METHOD Year() CLASS TimeStamp RETURN Year( Self ) @@ -333,13 +335,13 @@ METHOD Day() CLASS TimeStamp RETURN Day( Self ) METHOD Hour() CLASS TimeStamp - RETURN HB_HOUR( Self ) + RETURN hb_Hour( Self ) METHOD Minute() CLASS TimeStamp - RETURN HB_MINUTE( Self ) + RETURN hb_Minute( Self ) METHOD Sec() CLASS TimeStamp - RETURN HB_SEC( Self ) + RETURN hb_Sec( Self ) /* -------------------------------------------- */ @@ -365,13 +367,13 @@ METHOD AsString() CLASS Logical /* -------------------------------------------- */ -CREATE CLASS Nil INHERIT HBScalar FUNCTION __HBNil +CREATE CLASS NIL INHERIT HBScalar FUNCTION __HBNil METHOD AsString() ENDCLASS -METHOD AsString() CLASS Nil +METHOD AsString() CLASS NIL RETURN "NIL" /* -------------------------------------------- */ diff --git a/harbour/src/rtl/tsymbol.prg b/harbour/src/rtl/tsymbol.prg index 52a22b7490..f6d2e93a42 100644 --- a/harbour/src/rtl/tsymbol.prg +++ b/harbour/src/rtl/tsymbol.prg @@ -68,7 +68,9 @@ CREATE CLASS Symbol ENDCLASS METHOD New( cSymName ) CLASS Symbol - ::nSym := __DynSN2Sym( cSymName ) + + ::nSym := __dynSN2Sym( cSymName ) + RETURN Self METHOD name() CLASS Symbol diff --git a/harbour/src/rtl/ttopbar.prg b/harbour/src/rtl/ttopbar.prg index 25f4e0e691..602d25eebd 100644 --- a/harbour/src/rtl/ttopbar.prg +++ b/harbour/src/rtl/ttopbar.prg @@ -118,6 +118,7 @@ METHOD addItem( oItem ) CLASS TOPBARMENU RETURN Self METHOD delItem( nPos ) CLASS TOPBARMENU + LOCAL nLen LOCAL aItems LOCAL nWidth @@ -130,13 +131,13 @@ METHOD delItem( nPos ) CLASS TOPBARMENU ASize( ::aItems, --::nItemCount ) IF ::nWidth == nLen + 2 - aItems := ::aItems - nLen := ::nItemCount - nWidth := 0 - FOR nPos := 1 TO nLen - nWidth := Max( __CapMetrics( aItems[ nPos ] ), nWidth ) - NEXT - ::nWidth := nWidth + aItems := ::aItems + nLen := ::nItemCount + nWidth := 0 + FOR nPos := 1 TO nLen + nWidth := Max( __CapMetrics( aItems[ nPos ] ), nWidth ) + NEXT + ::nWidth := nWidth ENDIF ENDIF @@ -162,7 +163,7 @@ METHOD display() CLASS TOPBARMENU DispBegin() - hb_dispOutAt( nRow, nLeft, Space( nRight - nLeft + 1 ), cColor1 ) + hb_DispOutAt( nRow, nLeft, Space( nRight - nLeft + 1 ), cColor1 ) FOR nItem := 1 TO nItemCount @@ -197,12 +198,12 @@ METHOD display() CLASS TOPBARMENU ENDIF ENDIF - hb_dispOutAt( nRow, nLeft, cCaption,; + hb_DispOutAt( nRow, nLeft, cCaption,; iif( nItem == nCurrent, cColor2,; iif( aItems[ nItem ]:enabled, cColor1, hb_ColorIndex( ::cColorSpec, 4 ) ) ) ) IF aItems[ nItem ]:enabled .AND. nPos > 0 - hb_dispOutAt( nRow, nLeft + nPos - 1, SubStr( cCaption, nPos, 1 ),; + hb_DispOutAt( nRow, nLeft + nPos - 1, SubStr( cCaption, nPos, 1 ),; iif( nItem == nCurrent, hb_ColorIndex( ::cColorSpec, 3 ), hb_ColorIndex( ::cColorSpec, 2 ) ) ) ENDIF @@ -282,12 +283,14 @@ METHOD getPrev() CLASS TOPBARMENU METHOD getAccel( nKey ) CLASS TOPBARMENU - LOCAL nIndex := AScan( { K_ALT_A, K_ALT_B, K_ALT_C, K_ALT_D, K_ALT_E, K_ALT_F,; - K_ALT_G, K_ALT_H, K_ALT_I, K_ALT_J, K_ALT_K, K_ALT_L,; - K_ALT_M, K_ALT_N, K_ALT_O, K_ALT_P, K_ALT_Q, K_ALT_R,; - K_ALT_S, K_ALT_T, K_ALT_U, K_ALT_V, K_ALT_W, K_ALT_X,; - K_ALT_Y, K_ALT_Z, K_ALT_1, K_ALT_2, K_ALT_3, K_ALT_4,; - K_ALT_5, K_ALT_6, K_ALT_7, K_ALT_8, K_ALT_9, K_ALT_0 }, nKey ) + LOCAL nIndex := AScan( { ; + K_ALT_A, K_ALT_B, K_ALT_C, K_ALT_D, K_ALT_E, K_ALT_F, ; + K_ALT_G, K_ALT_H, K_ALT_I, K_ALT_J, K_ALT_K, K_ALT_L, ; + K_ALT_M, K_ALT_N, K_ALT_O, K_ALT_P, K_ALT_Q, K_ALT_R, ; + K_ALT_S, K_ALT_T, K_ALT_U, K_ALT_V, K_ALT_W, K_ALT_X, ; + K_ALT_Y, K_ALT_Z, K_ALT_1, K_ALT_2, K_ALT_3, K_ALT_4, ; + K_ALT_5, K_ALT_6, K_ALT_7, K_ALT_8, K_ALT_9, K_ALT_0 }, nKey ) + LOCAL cKey LOCAL item @@ -363,12 +366,14 @@ METHOD select( nPos ) CLASS TOPBARMENU ::nCurrent != nPos .AND. ; ::aItems[ nPos ]:enabled ) .OR. nPos == 0 -// IF ::isOpen() .AND. ; -// ::nCurrent > 0 .AND. ; -// ::aItems[ ::nCurrent ]:isPopUp() -// -// ::aItems[ ::nCurrent ]:data:close() -// ENDIF +#if 0 + IF ::isOpen() .AND. ; + ::nCurrent > 0 .AND. ; + ::aItems[ ::nCurrent ]:isPopUp() + + ::aItems[ ::nCurrent ]:data:close() + ENDIF +#endif ::nCurrent := nPos ENDIF @@ -447,12 +452,13 @@ METHOD New( nRow, nLeft, nRight ) CLASS TOPBARMENU ::cColorSpec := "N/W,W/N,W+/W,W+/N,N+/W,W/N" ELSE cColor := SetColor() - ::cColorSpec := hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," +; - hb_ColorIndex( cColor, CLR_ENHANCED ) + "," +; - hb_ColorIndex( cColor, CLR_BACKGROUND ) + "," +; - hb_ColorIndex( cColor, CLR_ENHANCED ) + "," +; - hb_ColorIndex( cColor, CLR_STANDARD ) + "," +; - hb_ColorIndex( cColor, CLR_BORDER ) + ::cColorSpec := ; + hb_ColorIndex( cColor, CLR_UNSELECTED ) + "," + ; + hb_ColorIndex( cColor, CLR_ENHANCED ) + "," + ; + hb_ColorIndex( cColor, CLR_BACKGROUND ) + "," + ; + hb_ColorIndex( cColor, CLR_ENHANCED ) + "," + ; + hb_ColorIndex( cColor, CLR_STANDARD ) + "," + ; + hb_ColorIndex( cColor, CLR_BORDER ) ENDIF RETURN Self diff --git a/harbour/src/rtl/valtoexp.prg b/harbour/src/rtl/valtoexp.prg index 31fbb25e67..60605b298f 100644 --- a/harbour/src/rtl/valtoexp.prg +++ b/harbour/src/rtl/valtoexp.prg @@ -51,6 +51,7 @@ */ FUNCTION hb_CStr( xVal ) + LOCAL v := ValType( xVal ) SWITCH v @@ -76,11 +77,12 @@ FUNCTION hb_CStr( xVal ) REQUEST __objSetClass -FUNCTION hb_valToExp( xVal ) +FUNCTION hb_ValToExp( xVal ) RETURN s_valToExp( xVal ) STATIC FUNCTION s_valToExp( xVal, cInd, hRefs, cRefs ) + LOCAL cVal, cKey LOCAL tmp LOCAL v := ValType( xVal ) @@ -119,8 +121,8 @@ STATIC FUNCTION s_valToExp( xVal, cInd, hRefs, cRefs ) FOR EACH tmp IN xVal cKey := s_valToExp( tmp:__enumKey() ) cVal += iif( tmp:__enumIndex() == 1, "", ", " ) + ; - cKey + "=>" + ; - s_valToExp( tmp, cInd + cKey, hRefs, @cRefs ) + cKey + "=>" + ; + s_valToExp( tmp, cInd + cKey, hRefs, @cRefs ) NEXT cVal += "}" ENDIF @@ -128,7 +130,7 @@ STATIC FUNCTION s_valToExp( xVal, cInd, hRefs, cRefs ) cVal := "{" FOR EACH tmp IN xVal cVal += iif( tmp:__enumIndex() == 1, "", ", " ) + ; - s_valToExp( tmp, cInd + hb_ntos( tmp:__enumIndex() ), hRefs, @cRefs ) + s_valToExp( tmp, cInd + hb_ntos( tmp:__enumIndex() ), hRefs, @cRefs ) NEXT cVal += "}" ENDIF @@ -153,11 +155,12 @@ STATIC FUNCTION s_valToExp( xVal, cInd, hRefs, cRefs ) RETURN cVal FUNCTION __itemSetRef( xVal, aRefs ) + LOCAL aRef FOR EACH aRef in aRefs - xVal[ hb_arrayToParams( aRef[ 1 ] ) ] := ; - iif( aRef[ 2 ] == NIL, xVal, xVal[ hb_arrayToParams( aRef[ 2 ] ) ] ) + xVal[ hb_ArrayToParams( aRef[ 1 ] ) ] := ; + iif( aRef[ 2 ] == NIL, xVal, xVal[ hb_ArrayToParams( aRef[ 2 ] ) ] ) NEXT RETURN xVal diff --git a/harbour/src/rtl/wait.prg b/harbour/src/rtl/wait.prg index 2408330a5f..ed8850f090 100644 --- a/harbour/src/rtl/wait.prg +++ b/harbour/src/rtl/wait.prg @@ -53,6 +53,7 @@ #include "inkey.ch" FUNCTION __Wait( xPrompt ) + LOCAL nKey LOCAL cKey LOCAL bBlock @@ -67,7 +68,7 @@ FUNCTION __Wait( xPrompt ) IF ( bBlock := SetKey( nKey ) ) != NIL Eval( bBlock, ProcName( 1 ), ProcLine( 1 ), "" ) ELSE - cKey := hb_KeyChar( nKey ) + cKey := hb_keyChar( nKey ) IF Len( cKey ) > 0 QQOut( cKey ) ELSE diff --git a/harbour/src/vm/classes.c b/harbour/src/vm/classes.c index 4f107c1a1d..551f59dec8 100644 --- a/harbour/src/vm/classes.c +++ b/harbour/src/vm/classes.c @@ -388,15 +388,15 @@ static HB_USHORT s_uiObjectClass = 0; # include "hbthread.h" # define HB_CLASS_POOL_SIZE 16384 -# define HB_CLASS_LOCK hb_threadEnterCriticalSection( &s_clsMtx ); -# define HB_CLASS_UNLOCK hb_threadLeaveCriticalSection( &s_clsMtx ); +# define HB_CLASS_LOCK() hb_threadEnterCriticalSection( &s_clsMtx ) +# define HB_CLASS_UNLOCK() hb_threadLeaveCriticalSection( &s_clsMtx ) static HB_CRITICAL_NEW( s_clsMtx ); #else # define HB_CLASS_POOL_SIZE 0 -# define HB_CLASS_LOCK -# define HB_CLASS_UNLOCK +# define HB_CLASS_LOCK() +# define HB_CLASS_UNLOCK() #endif @@ -3229,7 +3229,7 @@ static HB_USHORT hb_clsNew( const char * szClassName, HB_USHORT uiDatas, pNewCls = ( PCLASS ) hb_xgrab( sizeof( CLASS ) ); memset( pNewCls, 0, sizeof( CLASS ) ); - HB_CLASS_LOCK + HB_CLASS_LOCK(); if( s_uiClasses == s_uiClsSize ) { @@ -3240,7 +3240,7 @@ static HB_USHORT hb_clsNew( const char * szClassName, HB_USHORT uiDatas, s_pClasses[ ++s_uiClasses ] = pNewCls; pNewCls->uiClass = s_uiClasses; - HB_CLASS_UNLOCK + HB_CLASS_UNLOCK(); pNewCls->szName = hb_strdup( szClassName ); pNewCls->pClassSym = hb_dynsymGet( pNewCls->szName ); @@ -5060,7 +5060,7 @@ HB_FUNC( __CLSPREALLOCATE ) if( lNewSize > ( HB_LONG ) USHRT_MAX ) lNewSize = USHRT_MAX; - HB_CLASS_LOCK + HB_CLASS_LOCK(); if( lNewSize > ( HB_LONG ) s_uiClsSize ) { @@ -5069,7 +5069,7 @@ HB_FUNC( __CLSPREALLOCATE ) ( ( HB_SIZE ) s_uiClsSize + 1 ) ); } - HB_CLASS_UNLOCK + HB_CLASS_UNLOCK(); hb_retnl( s_uiClsSize ); } diff --git a/harbour/src/vm/dynsym.c b/harbour/src/vm/dynsym.c index c5ad7c0823..920b15d2e2 100644 --- a/harbour/src/vm/dynsym.c +++ b/harbour/src/vm/dynsym.c @@ -74,15 +74,15 @@ HB_SYM_HOLDER, * PHB_SYM_HOLDER; # include "hbthread.h" static HB_CRITICAL_NEW( s_dynsMtx ); -# define HB_DYNSYM_LOCK hb_threadEnterCriticalSection( &s_dynsMtx ); -# define HB_DYNSYM_UNLOCK hb_threadLeaveCriticalSection( &s_dynsMtx ); +# define HB_DYNSYM_LOCK() hb_threadEnterCriticalSection( &s_dynsMtx ) +# define HB_DYNSYM_UNLOCK() hb_threadLeaveCriticalSection( &s_dynsMtx ) # define hb_dynsymHandles( p ) hb_stackGetDynHandle( p ) #else -# define HB_DYNSYM_LOCK -# define HB_DYNSYM_UNLOCK +# define HB_DYNSYM_LOCK() +# define HB_DYNSYM_UNLOCK() # define hb_dynsymHandles( p ) ( p ) @@ -99,7 +99,7 @@ static PDYNHB_ITEM s_pDynIndex = NULL; static int s_iDynIdxSize = 0; /* Insert new symbol into dynamic symbol table. - * In MT mode caller should protected it by HB_DYNSYM_LOCK + * In MT mode caller should protected it by HB_DYNSYM_LOCK() */ static PHB_DYNS hb_dynsymInsert( PHB_SYMB pSymbol, HB_UINT uiPos ) { @@ -135,7 +135,7 @@ static PHB_DYNS hb_dynsymInsert( PHB_SYMB pSymbol, HB_UINT uiPos ) /* Find symbol in dynamic symbol table and set it's position. * If not found set position for insert operation. - * In MT mode caller should protected it by HB_DYNSYM_LOCK + * In MT mode caller should protected it by HB_DYNSYM_LOCK() */ static PHB_DYNS hb_dynsymPos( const char * szName, HB_UINT * puiPos ) { @@ -169,7 +169,7 @@ static PHB_DYNS hb_dynsymPos( const char * szName, HB_UINT * puiPos ) } /* Create new symbol. - * In MT mode caller should protected it by HB_DYNSYM_LOCK + * In MT mode caller should protected it by HB_DYNSYM_LOCK() */ static PHB_SYMB hb_symbolAlloc( const char * szName ) { @@ -199,7 +199,7 @@ PHB_DYNS hb_dynsymFind( const char * szName ) HB_TRACE(HB_TR_DEBUG, ("hb_dynsymFind(%s)", szName)); - HB_DYNSYM_LOCK + HB_DYNSYM_LOCK(); uiFirst = 0; uiLast = s_uiDynSymbols; @@ -211,7 +211,7 @@ PHB_DYNS hb_dynsymFind( const char * szName ) if( iCmp == 0 ) { - HB_DYNSYM_UNLOCK + HB_DYNSYM_UNLOCK(); return s_pDynItems[ uiMiddle ].pDynSym; } else if( iCmp < 0 ) @@ -220,7 +220,7 @@ PHB_DYNS hb_dynsymFind( const char * szName ) uiFirst = uiMiddle + 1; } - HB_DYNSYM_UNLOCK + HB_DYNSYM_UNLOCK(); return NULL; } @@ -232,11 +232,11 @@ PHB_SYMB hb_symbolNew( const char * szName ) HB_TRACE(HB_TR_DEBUG, ("hb_symbolNew(%s)", szName)); - HB_DYNSYM_LOCK + HB_DYNSYM_LOCK(); pSymbol = hb_symbolAlloc( szName ); - HB_DYNSYM_UNLOCK + HB_DYNSYM_UNLOCK(); return pSymbol; } @@ -249,7 +249,7 @@ PHB_DYNS hb_dynsymNew( PHB_SYMB pSymbol ) HB_TRACE(HB_TR_DEBUG, ("hb_dynsymNew(%p)", pSymbol)); - HB_DYNSYM_LOCK + HB_DYNSYM_LOCK(); pDynSym = hb_dynsymPos( pSymbol->szName, &uiPos ); /* Find position */ if( ! pDynSym ) @@ -305,7 +305,7 @@ PHB_DYNS hb_dynsymNew( PHB_SYMB pSymbol ) * In such case update pDynSym address in the new symbol but * do not register it as the main one */ - HB_DYNSYM_UNLOCK + HB_DYNSYM_UNLOCK(); return pDynSym; /* Return pointer to DynSym */ } /* The multiple symbols comes from single binaries - we have to @@ -356,7 +356,7 @@ PHB_DYNS hb_dynsymNew( PHB_SYMB pSymbol ) } } - HB_DYNSYM_UNLOCK + HB_DYNSYM_UNLOCK(); return pDynSym; } @@ -369,13 +369,13 @@ PHB_DYNS hb_dynsymGetCase( const char * szName ) HB_TRACE(HB_TR_DEBUG, ("hb_dynsymGetCase(%s)", szName)); - HB_DYNSYM_LOCK + HB_DYNSYM_LOCK(); pDynSym = hb_dynsymPos( szName, &uiPos ); if( ! pDynSym ) pDynSym = hb_dynsymInsert( hb_symbolAlloc( szName ), uiPos ); - HB_DYNSYM_UNLOCK + HB_DYNSYM_UNLOCK(); return pDynSym; } @@ -515,12 +515,12 @@ static PHB_DYNS hb_dynsymGetByIndex( HB_LONG lIndex ) { PHB_DYNS pDynSym = NULL; - HB_DYNSYM_LOCK + HB_DYNSYM_LOCK(); if( lIndex >= 1 && lIndex <= s_uiDynSymbols ) pDynSym = s_pDynItems[ lIndex - 1 ].pDynSym; - HB_DYNSYM_UNLOCK + HB_DYNSYM_UNLOCK(); return pDynSym; } @@ -538,7 +538,7 @@ int hb_dynsymToNum( PHB_DYNS pDynSym ) HB_TRACE(HB_TR_DEBUG, ("hb_dynsymToNum(%p)", pDynSym)); - HB_DYNSYM_LOCK + HB_DYNSYM_LOCK(); iSymNum = pDynSym->uiSymNum; @@ -554,7 +554,7 @@ int hb_dynsymToNum( PHB_DYNS pDynSym ) if( s_pDynIndex[ iSymNum - 1 ].pDynSym == NULL ) s_pDynIndex[ iSymNum - 1 ].pDynSym = pDynSym; - HB_DYNSYM_UNLOCK + HB_DYNSYM_UNLOCK(); return iSymNum; } @@ -565,12 +565,12 @@ PHB_DYNS hb_dynsymFromNum( int iSymNum ) HB_TRACE(HB_TR_DEBUG, ("hb_dynsymFromNum(%d)", iSymNum)); - HB_DYNSYM_LOCK + HB_DYNSYM_LOCK(); pDynSym = iSymNum > 0 && iSymNum <= s_iDynIdxSize ? s_pDynIndex[ iSymNum - 1 ].pDynSym : NULL; - HB_DYNSYM_UNLOCK + HB_DYNSYM_UNLOCK(); return pDynSym; } @@ -585,7 +585,7 @@ void hb_dynsymEval( PHB_DYNS_FUNC pFunction, void * Cargo ) for( ;; ) { - HB_DYNSYM_LOCK + HB_DYNSYM_LOCK(); if( pDynSym ) { @@ -603,7 +603,7 @@ void hb_dynsymEval( PHB_DYNS_FUNC pFunction, void * Cargo ) else pDynSym = NULL; - HB_DYNSYM_UNLOCK + HB_DYNSYM_UNLOCK(); if( !pDynSym || !( pFunction )( pDynSym, Cargo ) ) break; @@ -616,7 +616,7 @@ void hb_dynsymProtectEval( PHB_DYNS_FUNC pFunction, void * Cargo ) HB_TRACE(HB_TR_DEBUG, ("hb_dynsymProtectEval(%p, %p)", pFunction, Cargo)); - HB_DYNSYM_LOCK + HB_DYNSYM_LOCK(); while( uiPos < s_uiDynSymbols ) { @@ -624,14 +624,14 @@ void hb_dynsymProtectEval( PHB_DYNS_FUNC pFunction, void * Cargo ) break; } - HB_DYNSYM_UNLOCK + HB_DYNSYM_UNLOCK(); } void hb_dynsymRelease( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_dynsymRelease()")); - HB_DYNSYM_LOCK + HB_DYNSYM_LOCK(); if( s_iDynIdxSize ) { @@ -656,7 +656,7 @@ void hb_dynsymRelease( void ) hb_xfree( pHolder ); } - HB_DYNSYM_UNLOCK + HB_DYNSYM_UNLOCK(); } HB_FUNC( __DYNSCOUNT ) /* How much symbols do we have: dsCount = __dynsymCount() */ @@ -685,10 +685,10 @@ HB_FUNC( __DYNSGETINDEX ) /* Gimme index number of symbol: dsIndex = __dynsymGet pDynSym = hb_dynsymFindName( szName ); if( pDynSym ) { - HB_DYNSYM_LOCK + HB_DYNSYM_LOCK(); if( !hb_dynsymPos( pDynSym->pSymbol->szName, &uiPos ) ) uiPos = 0; - HB_DYNSYM_UNLOCK + HB_DYNSYM_UNLOCK(); } } diff --git a/harbour/src/vm/fm.c b/harbour/src/vm/fm.c index cde297f425..e64e955fe3 100644 --- a/harbour/src/vm/fm.c +++ b/harbour/src/vm/fm.c @@ -259,13 +259,13 @@ !defined( HB_ATOM_INC ) || !defined( HB_ATOM_DEC ) ) static HB_CRITICAL_NEW( s_fmMtx ); -# define HB_FM_LOCK hb_threadEnterCriticalSection( &s_fmMtx ); -# define HB_FM_UNLOCK hb_threadLeaveCriticalSection( &s_fmMtx ); +# define HB_FM_LOCK() hb_threadEnterCriticalSection( &s_fmMtx ) +# define HB_FM_UNLOCK() hb_threadLeaveCriticalSection( &s_fmMtx ) #else -# define HB_FM_LOCK -# define HB_FM_UNLOCK +# define HB_FM_LOCK() +# define HB_FM_UNLOCK() #endif @@ -366,17 +366,17 @@ typedef void * PHB_MEMINFO; # undef HB_ATOM_SET static HB_FORCEINLINE void hb_counterIncrement( volatile HB_COUNTER * p ) { - HB_FM_LOCK + HB_FM_LOCK(); ++(*p); - HB_FM_UNLOCK + HB_FM_UNLOCK(); } # define HB_ATOM_INC( p ) hb_counterIncrement( p ) static HB_FORCEINLINE int hb_counterDecrement( volatile HB_COUNTER * p ) { int iResult; - HB_FM_LOCK + HB_FM_LOCK(); iResult = --(*p) != 0; - HB_FM_UNLOCK + HB_FM_UNLOCK(); return iResult; } # define HB_ATOM_DEC( p ) hb_counterDecrement( p ) @@ -507,9 +507,9 @@ void hb_xinit_thread( void ) if( hb_stack.allocator == NULL ) { - HB_FM_LOCK + HB_FM_LOCK(); hb_stack.allocator = ( void * ) hb_mspace_alloc(); - HB_FM_UNLOCK + HB_FM_UNLOCK(); } #endif } @@ -523,10 +523,10 @@ void hb_xexit_thread( void ) if( pm ) { hb_stack.allocator = NULL; - HB_FM_LOCK + HB_FM_LOCK(); if( --pm->count == 0 ) mspace_trim( pm->ms, 0 ); - HB_FM_UNLOCK + HB_FM_UNLOCK(); } #endif } @@ -534,7 +534,7 @@ void hb_xexit_thread( void ) void hb_xclean( void ) { #if defined( HB_FM_DLMT_ALLOC ) - HB_FM_LOCK + HB_FM_LOCK(); { int i, imax, icount; @@ -558,7 +558,7 @@ void hb_xclean( void ) hb_vmUpdateAllocator( hb_mspace_update, icount ); } } - HB_FM_UNLOCK + HB_FM_UNLOCK(); #elif defined( HB_FM_DL_ALLOC ) dlmalloc_trim( 0 ); #endif @@ -610,7 +610,7 @@ void * hb_xalloc( HB_SIZE nSize ) /* allocates fixed memory, returns NUL { PHB_TRACEINFO pTrace; - HB_FM_LOCK + HB_FM_LOCK(); if( ! s_pFirstBlock ) { @@ -656,7 +656,7 @@ void * hb_xalloc( HB_SIZE nSize ) /* allocates fixed memory, returns NUL if( s_nMemoryMaxBlocks < s_nMemoryBlocks ) s_nMemoryMaxBlocks = s_nMemoryBlocks; - HB_FM_UNLOCK + HB_FM_UNLOCK(); #ifdef HB_PARANOID_MEM_CHECK memset( HB_MEM_PTR( pMem ), HB_MEMFILER, nSize ); @@ -696,7 +696,7 @@ void * hb_xgrab( HB_SIZE nSize ) /* allocates fixed memory, exits on fai { PHB_TRACEINFO pTrace; - HB_FM_LOCK + HB_FM_LOCK(); if( ! s_pFirstBlock ) { @@ -742,7 +742,7 @@ void * hb_xgrab( HB_SIZE nSize ) /* allocates fixed memory, exits on fai if( s_nMemoryMaxBlocks < s_nMemoryBlocks ) s_nMemoryMaxBlocks = s_nMemoryBlocks; - HB_FM_UNLOCK + HB_FM_UNLOCK(); #ifdef HB_PARANOID_MEM_CHECK memset( HB_MEM_PTR( pMem ), HB_MEMFILER, nSize ); @@ -799,7 +799,7 @@ void * hb_xrealloc( void * pMem, HB_SIZE nSize ) /* reallocates memory */ HB_FM_CLRSIG( pMem, nMemSize ); - HB_FM_LOCK + HB_FM_LOCK(); #ifdef HB_PARANOID_MEM_CHECK pMem = malloc( HB_ALLOC_SIZE( nSize ) ); @@ -839,7 +839,7 @@ void * hb_xrealloc( void * pMem, HB_SIZE nSize ) /* reallocates memory */ s_pLastBlock = ( PHB_MEMINFO ) pMem; } - HB_FM_UNLOCK + HB_FM_UNLOCK(); } else pMem = realloc( HB_FM_PTR( pMem ), HB_ALLOC_SIZE( nSize ) ); @@ -893,7 +893,7 @@ void hb_xfree( void * pMem ) /* frees fixed memory */ if( HB_FM_GETSIG( pMem, pMemBlock->nSize ) != HB_MEMINFO_SIGNATURE ) hb_errInternal( HB_EI_XMEMOVERFLOW, NULL, NULL, NULL ); - HB_FM_LOCK + HB_FM_LOCK(); s_nMemoryConsumed -= pMemBlock->nSize + sizeof( HB_COUNTER ); s_nMemoryBlocks--; @@ -908,7 +908,7 @@ void hb_xfree( void * pMem ) /* frees fixed memory */ else s_pLastBlock = pMemBlock->pPrevBlock; - HB_FM_UNLOCK + HB_FM_UNLOCK(); pMemBlock->u32Signature = 0; HB_FM_CLRSIG( pMem, pMemBlock->nSize ); diff --git a/harbour/src/vm/garbage.c b/harbour/src/vm/garbage.c index 3099f10935..5b93a764ce 100644 --- a/harbour/src/vm/garbage.c +++ b/harbour/src/vm/garbage.c @@ -76,21 +76,21 @@ # if defined( HB_SPINLOCK_INIT ) && 1 HB_SPINLOCK_T s_gcSpinLock = HB_SPINLOCK_INIT; -# define HB_GC_LOCK HB_SPINLOCK_ACQUIRE( &s_gcSpinLock ); -# define HB_GC_UNLOCK HB_SPINLOCK_RELEASE( &s_gcSpinLock ); +# define HB_GC_LOCK() HB_SPINLOCK_ACQUIRE( &s_gcSpinLock ) +# define HB_GC_UNLOCK() HB_SPINLOCK_RELEASE( &s_gcSpinLock ) # else static HB_CRITICAL_NEW( s_gcMtx ); -# define HB_GC_LOCK hb_threadEnterCriticalSection( &s_gcMtx ); -# define HB_GC_UNLOCK hb_threadLeaveCriticalSection( &s_gcMtx ); +# define HB_GC_LOCK() hb_threadEnterCriticalSection( &s_gcMtx ) +# define HB_GC_UNLOCK() hb_threadLeaveCriticalSection( &s_gcMtx ) #endif #else -# define HB_GC_LOCK -# define HB_GC_UNLOCK +# define HB_GC_LOCK() +# define HB_GC_UNLOCK() #endif /* HB_MT_VM */ @@ -204,9 +204,9 @@ void * hb_gcAllocate( HB_SIZE nSize, const HB_GC_FUNCS * pFuncs ) pAlloc->pFuncs = pFuncs; pAlloc->locked = 1; pAlloc->used = s_uUsedFlag; - HB_GC_LOCK + HB_GC_LOCK(); hb_gcLink( &s_pLockedBlock, pAlloc ); - HB_GC_UNLOCK + HB_GC_UNLOCK(); return HB_BLOCK_PTR( pAlloc ); /* hide the internal data */ } @@ -221,19 +221,19 @@ void * hb_gcAllocRaw( HB_SIZE nSize, const HB_GC_FUNCS * pFuncs ) pAlloc->locked = 0; pAlloc->used = s_uUsedFlag; - HB_GC_LOCK + HB_GC_LOCK(); #ifdef HB_GC_AUTO if( s_ulBlocks > s_ulBlocksCheck ) { - HB_GC_UNLOCK + HB_GC_UNLOCK(); hb_gcCollectAll( HB_TRUE ); - HB_GC_LOCK + HB_GC_LOCK(); pAlloc->used = s_uUsedFlag; } HB_GC_AUTO_INC #endif hb_gcLink( &s_pCurrBlock, pAlloc ); - HB_GC_UNLOCK + HB_GC_UNLOCK(); return HB_BLOCK_PTR( pAlloc ); /* hide the internal data */ } @@ -248,7 +248,7 @@ void hb_gcFree( void *pBlock ) /* Don't release the block that will be deleted during finalization */ if( !( pAlloc->used & HB_GC_DELETE ) ) { - HB_GC_LOCK + HB_GC_LOCK(); if( pAlloc->locked ) hb_gcUnlink( &s_pLockedBlock, pAlloc ); else @@ -256,7 +256,7 @@ void hb_gcFree( void *pBlock ) hb_gcUnlink( &s_pCurrBlock, pAlloc ); HB_GC_AUTO_DEC } - HB_GC_UNLOCK + HB_GC_UNLOCK(); HB_GARBAGE_FREE( pAlloc ); } @@ -296,7 +296,7 @@ void hb_gcRefFree( void * pBlock ) /* unlink the block first to avoid possible problems * if cleanup function activate GC */ - HB_GC_LOCK + HB_GC_LOCK(); if( pAlloc->locked ) hb_gcUnlink( &s_pLockedBlock, pAlloc ); else @@ -304,7 +304,7 @@ void hb_gcRefFree( void * pBlock ) hb_gcUnlink( &s_pCurrBlock, pAlloc ); HB_GC_AUTO_DEC } - HB_GC_UNLOCK + HB_GC_UNLOCK(); pAlloc->used |= HB_GC_DELETE; @@ -345,10 +345,10 @@ void hb_gcRefCheck( void * pBlock ) pAlloc->used = s_uUsedFlag; pAlloc->locked = 0; - HB_GC_LOCK + HB_GC_LOCK(); hb_gcLink( &s_pCurrBlock, pAlloc ); HB_GC_AUTO_INC - HB_GC_UNLOCK + HB_GC_UNLOCK(); if( hb_vmRequestQuery() == 0 ) hb_errRT_BASE( EG_DESTRUCTOR, 1301, NULL, "Reference to freed block", 0 ); @@ -390,9 +390,9 @@ PHB_ITEM hb_gcGripGet( PHB_ITEM pOrigin ) pItem->type = HB_IT_NIL; - HB_GC_LOCK + HB_GC_LOCK(); hb_gcLink( &s_pLockedBlock, pAlloc ); - HB_GC_UNLOCK + HB_GC_UNLOCK(); if( pOrigin ) hb_itemCopy( pItem, pOrigin ); @@ -414,7 +414,7 @@ void * hb_gcLock( void * pBlock ) { HB_GARBAGE_PTR pAlloc = HB_GC_PTR( pBlock ); - HB_GC_LOCK + HB_GC_LOCK(); if( ! pAlloc->locked ) { hb_gcUnlink( &s_pCurrBlock, pAlloc ); @@ -422,7 +422,7 @@ void * hb_gcLock( void * pBlock ) HB_GC_AUTO_DEC } ++pAlloc->locked; - HB_GC_UNLOCK + HB_GC_UNLOCK(); } return pBlock; @@ -439,7 +439,7 @@ void * hb_gcUnlock( void * pBlock ) if( pAlloc->locked ) { - HB_GC_LOCK + HB_GC_LOCK(); if( pAlloc->locked ) { if( --pAlloc->locked == 0 ) @@ -451,7 +451,7 @@ void * hb_gcUnlock( void * pBlock ) HB_GC_AUTO_INC } } - HB_GC_UNLOCK + HB_GC_UNLOCK(); } } return pBlock; @@ -463,7 +463,7 @@ void hb_gcAttach( void * pBlock ) if( pAlloc->locked ) { - HB_GC_LOCK + HB_GC_LOCK(); if( pAlloc->locked ) { if( --pAlloc->locked == 0 ) @@ -476,7 +476,7 @@ void hb_gcAttach( void * pBlock ) pAlloc = NULL; } } - HB_GC_UNLOCK + HB_GC_UNLOCK(); } if( pAlloc ) hb_xRefInc( pAlloc ); @@ -717,10 +717,10 @@ void hb_gcCollectAll( HB_BOOL fForce ) { pDelete->used = s_uUsedFlag; pDelete->locked = 0; - HB_GC_LOCK + HB_GC_LOCK(); hb_gcLink( &s_pCurrBlock, pDelete ); HB_GC_AUTO_INC - HB_GC_UNLOCK + HB_GC_UNLOCK(); if( hb_vmRequestQuery() == 0 ) hb_errRT_BASE( EG_DESTRUCTOR, 1301, NULL, "Reference to freed block", 0 ); } @@ -808,7 +808,7 @@ HB_FUNC( HB_GCSETAUTO ) nBlocks = fSet ? hb_parnint( 1 ) * 1000 : 0; - HB_GC_LOCK + HB_GC_LOCK(); nPrevBlocks = s_ulBlocksAuto; if( fSet ) { @@ -822,7 +822,7 @@ HB_FUNC( HB_GCSETAUTO ) s_ulBlocksCheck = HB_GC_AUTO_MAX; } } - HB_GC_UNLOCK + HB_GC_UNLOCK(); hb_retnint( nPrevBlocks / 1000 ); } diff --git a/harbour/src/vm/hvm.c b/harbour/src/vm/hvm.c index 07c4ea216b..c1991d6631 100644 --- a/harbour/src/vm/hvm.c +++ b/harbour/src/vm/hvm.c @@ -233,13 +233,13 @@ static void hb_vmRequestTest( void ); static PHB_ITEM s_pSymbolsMtx = NULL; static HB_CRITICAL_NEW( s_atInitMtx ); -# define HB_ATINIT_LOCK hb_threadEnterCriticalSection( &s_atInitMtx ); -# define HB_ATINIT_UNLOCK hb_threadLeaveCriticalSection( &s_atInitMtx ); -# define HB_TASK_SHEDULER HB_THREAD_SHEDULER(); +# define HB_ATINIT_LOCK() hb_threadEnterCriticalSection( &s_atInitMtx ) +# define HB_ATINIT_UNLOCK() hb_threadLeaveCriticalSection( &s_atInitMtx ) +# define HB_TASK_SHEDULER() HB_THREAD_SHEDULER() #else -# define HB_ATINIT_LOCK -# define HB_ATINIT_UNLOCK -# define HB_TASK_SHEDULER +# define HB_ATINIT_LOCK() +# define HB_ATINIT_UNLOCK() +# define HB_TASK_SHEDULER() #endif /* HB_MT_VM */ #ifndef HB_NO_PROFILER @@ -303,10 +303,10 @@ static void hb_vmAddModuleFunction( PHB_FUNC_LIST * pLstPtr, HB_INIT_FUNC pFunc, pLst->pFunc = pFunc; pLst->cargo = cargo; - HB_ATINIT_LOCK + HB_ATINIT_LOCK(); pLst->pNext = *pLstPtr; *pLstPtr = pLst; - HB_ATINIT_UNLOCK + HB_ATINIT_UNLOCK(); } static void hb_vmDoModuleFunctions( PHB_FUNC_LIST pLst ) @@ -440,14 +440,14 @@ static HB_THREAD_NO s_threadNo = 0; # define HB_THREQUEST_STOP 1 # define HB_THREQUEST_QUIT 2 -# define HB_VM_LOCK hb_threadEnterCriticalSection( &s_vmMtx ); -# define HB_VM_UNLOCK hb_threadLeaveCriticalSection( &s_vmMtx ); +# define HB_VM_LOCK() hb_threadEnterCriticalSection( &s_vmMtx ) +# define HB_VM_UNLOCK() hb_threadLeaveCriticalSection( &s_vmMtx ) HB_BOOL hb_vmIsMt( void ) { return HB_TRUE; } static void hb_vmRequestTest( void ) { - HB_VM_LOCK + HB_VM_LOCK(); s_iRunningCount--; for( ;; ) @@ -471,7 +471,7 @@ static void hb_vmRequestTest( void ) } s_iRunningCount++; - HB_VM_UNLOCK + HB_VM_UNLOCK(); } /* unlock VM, allow GC and other exclusive single task code execution */ @@ -483,7 +483,7 @@ void hb_vmUnlock( void ) { if( hb_stackUnlock() == 1 ) { - HB_VM_LOCK + HB_VM_LOCK(); s_iRunningCount--; if( hb_vmThreadRequest ) { @@ -497,11 +497,11 @@ void hb_vmUnlock( void ) } hb_threadCondBroadcast( &s_vmCond ); } - HB_VM_UNLOCK + HB_VM_UNLOCK(); } } - HB_TASK_SHEDULER + HB_TASK_SHEDULER(); } /* lock VM blocking GC and other exclusive single task code execution */ @@ -513,7 +513,7 @@ void hb_vmLock( void ) { if( hb_stackLock() == 0 ) { - HB_VM_LOCK + HB_VM_LOCK(); for( ;; ) { if( hb_vmThreadRequest & HB_THREQUEST_QUIT ) @@ -530,7 +530,7 @@ void hb_vmLock( void ) break; } s_iRunningCount++; - HB_VM_UNLOCK + HB_VM_UNLOCK(); } } } @@ -538,7 +538,7 @@ void hb_vmLock( void ) /* (try to) stop all threads except current one */ HB_BOOL hb_vmSuspendThreads( HB_BOOL fWait ) { - HB_VM_LOCK + HB_VM_LOCK(); if( ( hb_vmThreadRequest & ( HB_THREQUEST_STOP | HB_THREQUEST_QUIT ) ) == 0 ) { @@ -563,7 +563,7 @@ HB_BOOL hb_vmSuspendThreads( HB_BOOL fWait ) hb_threadCondBroadcast( &s_vmCond ); } - HB_VM_UNLOCK + HB_VM_UNLOCK(); return HB_FALSE; } @@ -573,7 +573,7 @@ void hb_vmResumeThreads( void ) { hb_vmThreadRequest &= ~HB_THREQUEST_STOP; hb_threadCondBroadcast( &s_vmCond ); - HB_VM_UNLOCK + HB_VM_UNLOCK(); } /* send QUIT request to all threads except current one @@ -586,7 +586,7 @@ void hb_vmTerminateThreads( void ) if( s_main_thread == hb_stackId() ) { - HB_VM_LOCK + HB_VM_LOCK(); hb_vmThreadRequest |= HB_THREQUEST_QUIT; --s_iRunningCount; @@ -603,7 +603,7 @@ void hb_vmTerminateThreads( void ) /* hb_vmThreadRequest &= ~HB_THREQUEST_QUIT; */ hb_vmThreadRequest = 0; - HB_VM_UNLOCK + HB_VM_UNLOCK(); } } @@ -616,7 +616,7 @@ void hb_vmWaitForThreads( void ) if( s_main_thread == hb_stackId() ) { - HB_VM_LOCK + HB_VM_LOCK(); --s_iRunningCount; if( hb_vmThreadRequest ) @@ -627,7 +627,7 @@ void hb_vmWaitForThreads( void ) ++s_iRunningCount; - HB_VM_UNLOCK + HB_VM_UNLOCK(); } } @@ -704,7 +704,7 @@ static void hb_vmStackInit( PHB_THREADSTATE pState ) hb_stackInit(); /* initialize HVM thread stack */ - HB_VM_LOCK + HB_VM_LOCK(); { HB_STACK_TLS_PRELOAD @@ -714,7 +714,7 @@ static void hb_vmStackInit( PHB_THREADSTATE pState ) pState->fActive = HB_TRUE; hb_vmStackAdd( pState ); } - HB_VM_UNLOCK + HB_VM_UNLOCK(); hb_vmLock(); } @@ -727,12 +727,12 @@ static void hb_vmStackRelease( void ) HB_TRACE(HB_TR_DEBUG, ("hb_vmStackRelease()")); - HB_VM_LOCK + HB_VM_LOCK(); fLocked = hb_stackUnlock() == 1; pThItm = hb_vmStackDel( ( PHB_THREADSTATE ) hb_stackList(), HB_FALSE ); - HB_VM_UNLOCK + HB_VM_UNLOCK(); /* NOTE: releasing pThItm may force pState freeing if parent * thread does not keep thread pointer item. So it's @@ -746,7 +746,7 @@ static void hb_vmStackRelease( void ) hb_threadMutexUnlockAll(); - HB_VM_LOCK + HB_VM_LOCK(); if( fLocked ) s_iRunningCount--; @@ -754,18 +754,18 @@ static void hb_vmStackRelease( void ) s_iStackCount--; hb_threadCondBroadcast( &s_vmCond ); - HB_VM_UNLOCK + HB_VM_UNLOCK(); } HB_BOOL hb_vmThreadRegister( void * Cargo ) { HB_TRACE(HB_TR_DEBUG, ("hb_vmThreadRegister(%p)", Cargo)); - HB_VM_LOCK + HB_VM_LOCK(); hb_vmStackAdd( ( PHB_THREADSTATE ) Cargo ); - HB_VM_UNLOCK + HB_VM_UNLOCK(); return HB_TRUE; } @@ -776,12 +776,12 @@ void hb_vmThreadRelease( void * Cargo ) HB_TRACE(HB_TR_DEBUG, ("hb_vmThreadRelease(%p)", Cargo)); - HB_VM_LOCK + HB_VM_LOCK(); pThItm = hb_vmStackDel( ( PHB_THREADSTATE ) Cargo, HB_TRUE ); hb_threadCondBroadcast( &s_vmCond ); - HB_VM_UNLOCK + HB_VM_UNLOCK(); if( pThItm ) hb_itemRelease( pThItm ); @@ -890,12 +890,12 @@ void hb_vmThreadQuitRequest( void * Cargo ) pState = ( PHB_THREADSTATE ) Cargo; - HB_VM_LOCK + HB_VM_LOCK(); if( pState->pStackId && pState->fActive ) hb_stackIdSetActionRequest( pState->pStackId, HB_QUIT_REQUESTED ); - HB_VM_UNLOCK + HB_VM_UNLOCK(); } #endif /* HB_MT_VM */ @@ -5823,7 +5823,7 @@ void hb_vmProc( HB_USHORT uiParams ) HB_TRACE(HB_TR_DEBUG, ("hb_vmProc(%hu)", uiParams)); - HB_TASK_SHEDULER + HB_TASK_SHEDULER(); #ifndef HB_NO_PROFILER if( bProfiler ) @@ -5883,7 +5883,7 @@ void hb_vmDo( HB_USHORT uiParams ) HB_TRACE(HB_TR_DEBUG, ("hb_vmDo(%hu)", uiParams)); - HB_TASK_SHEDULER + HB_TASK_SHEDULER(); #ifndef HB_NO_PROFILER if( bProfiler ) @@ -5970,7 +5970,7 @@ void hb_vmSend( HB_USHORT uiParams ) HB_BOOL bProfiler = hb_bProfiler; /* because profiler state may change */ #endif - HB_TASK_SHEDULER + HB_TASK_SHEDULER(); HB_TRACE(HB_TR_DEBUG, ("hb_vmSend(%hu)", uiParams)); @@ -6044,7 +6044,7 @@ void hb_vmEval( HB_USHORT uiParams ) HB_BOOL bProfiler = hb_bProfiler; /* because profiler state may change */ #endif - HB_TASK_SHEDULER + HB_TASK_SHEDULER(); HB_TRACE(HB_TR_DEBUG, ("hb_vmEval(%hu)", uiParams)); @@ -8970,14 +8970,18 @@ void hb_vmSetI18N( void * pI18N ) #if defined( HB_MT_VM ) # define HB_XVM_RETURN \ - if( hb_vmThreadRequest ) \ - hb_vmRequestTest(); \ - return ( hb_stackGetActionRequest() & \ - ( HB_ENDPROC_REQUESTED | HB_BREAK_REQUESTED | HB_QUIT_REQUESTED ) ) != 0; + { \ + if( hb_vmThreadRequest ) \ + hb_vmRequestTest(); \ + return ( hb_stackGetActionRequest() & \ + ( HB_ENDPROC_REQUESTED | HB_BREAK_REQUESTED | HB_QUIT_REQUESTED ) ) != 0; \ + } #else # define HB_XVM_RETURN \ - return ( hb_stackGetActionRequest() & \ - ( HB_ENDPROC_REQUESTED | HB_BREAK_REQUESTED | HB_QUIT_REQUESTED ) ) != 0; + { \ + return ( hb_stackGetActionRequest() & \ + ( HB_ENDPROC_REQUESTED | HB_BREAK_REQUESTED | HB_QUIT_REQUESTED ) ) != 0; \ + } #endif /* HB_MT_VM */ void hb_xvmExitProc( void ) diff --git a/harbour/tests/ac_test.prg b/harbour/tests/ac_test.prg index 74b700c02a..6aee5b0fea 100644 --- a/harbour/tests/ac_test.prg +++ b/harbour/tests/ac_test.prg @@ -2,18 +2,18 @@ * $Id$ */ -//+==================================================================== -//+ -//+ Released to Public Domain. -//+ -//+ Functions: Procedure test() -//+ Function cUserFunction() -//+ -//+ Tables: use vendor exclusive -//+ -//+ Reformatted by Click! 1.10 on Aug-13-1997 at 11:39 pm -//+ -//+==================================================================== +// ==================================================================== +// +// Released to Public Domain. +// +// Functions: Procedure test() +// Function cUserFunction() +// +// Tables: use vendor exclusive +// +// Reformatted by Click! 1.10 on Aug-13-1997 at 11:39 pm +// +// ==================================================================== #include "achoice.ch" #include "inkey.ch" @@ -22,11 +22,11 @@ #define hb_ntos( n ) LTrim( Str( n ) ) #endif -//+-------------------------------------------------------------------- -//+ -//+ Procedure test() -//+ -//+-------------------------------------------------------------------- +// -------------------------------------------------------------------- +// +// Procedure test() +// +// -------------------------------------------------------------------- PROCEDURE Main() @@ -192,11 +192,11 @@ PROCEDURE Main() RETURN -//+-------------------------------------------------------------------- -//+ -//+ Function cUserFunction() -//+ -//+-------------------------------------------------------------------- +// -------------------------------------------------------------------- +// +// Function cUserFunction() +// +// -------------------------------------------------------------------- FUNCTION cUserFunction( nMode, nCurElement, nRowPos ) diff --git a/harbour/tests/arrindex.prg b/harbour/tests/arrindex.prg index ababf2bc9b..b2eed117d4 100644 --- a/harbour/tests/arrindex.prg +++ b/harbour/tests/arrindex.prg @@ -6,13 +6,13 @@ PROCEDURE Main() LOCAL a, b, c - a := { { , } } + a := { {, } } a[ 1, 2 ] := [Hello] c := { 1 } - b := a[ c[ 1 ] ][ val( [ 2 ] ) ] + b := a[ c[ 1 ] ][ Val( [ 2 ] ) ] ? b diff --git a/harbour/tests/base64.prg b/harbour/tests/base64.prg index c5a5b366b0..6af572f23f 100644 --- a/harbour/tests/base64.prg +++ b/harbour/tests/base64.prg @@ -21,20 +21,20 @@ PROCEDURE Main() FOR EACH aVector IN aTestVectors - cStr := hb_base64encode( aVector:__enumKey ) + cStr := hb_base64Encode( aVector:__enumKey ) IF cStr != aVector - ? hb_strFormat( "hb_base64encode(): expected '%s' got '%s' while encoding '%s'", ; - aVector:__enumKey(), cStr, aVector ) + ? hb_StrFormat( "hb_base64encode(): expected '%s' got '%s' while encoding '%s'", ; + aVector:__enumKey(), cStr, aVector ) ELSE - ? hb_strFormat( "hb_base64encode(): passed '%s'", aVector:__enumKey ) + ? hb_StrFormat( "hb_base64encode(): passed '%s'", aVector:__enumKey ) ENDIF - cStr := hb_base64decode( aVector ) + cStr := hb_base64Decode( aVector ) IF cStr != aVector:__enumKey() - ? hb_strFormat( "hb_base64decode(): expected '%s' got '%s' while decoding '%s'", ; - aVector, cStr, aVector:__enumKey() ) + ? hb_StrFormat( "hb_base64decode(): expected '%s' got '%s' while decoding '%s'", ; + aVector, cStr, aVector:__enumKey() ) ELSE - ? hb_strFormat( "hb_base64decode(): passed '%s'", aVector ) + ? hb_StrFormat( "hb_base64decode(): passed '%s'", aVector ) ENDIF NEXT diff --git a/harbour/tests/begin.prg b/harbour/tests/begin.prg index e549d3c988..dd28ac4129 100644 --- a/harbour/tests/begin.prg +++ b/harbour/tests/begin.prg @@ -50,7 +50,7 @@ PROCEDURE Main() BEGIN SEQUENCE ? " Inside SEQUENCE 5" - Break1( ) + Break1() ? " Recovering in 5 using....", oLocal END SEQUENCE ? "After SEQUENCE 5" @@ -58,7 +58,7 @@ PROCEDURE Main() BEGIN SEQUENCE ? " Inside SEQUENCE 6" - Break1( ) + Break1() RECOVER USING m_oMemvar ? " Recovering in 6 using... ", m_oMemvar END SEQUENCE @@ -67,7 +67,7 @@ PROCEDURE Main() BEGIN SEQUENCE ? " Inside SEQUENCE 7" - Break2( ) + Break2() RECOVER USING m_oMemvar ? " Recovering in 7 using... ", m_oMemvar END SEQUENCE @@ -89,7 +89,7 @@ PROCEDURE Break2() BEGIN SEQUENCE ? " Inside SEQUENCE 8" - Break3( ) + Break3() RECOVER USING m_oMemvar ? " Recovering in 8 using...", Eval( m_oMemvar, " eval in 8" ) Break( "BREAK from recovery code" ) diff --git a/harbour/tests/boxtest.prg b/harbour/tests/boxtest.prg index 983e08ba97..c331ac1130 100644 --- a/harbour/tests/boxtest.prg +++ b/harbour/tests/boxtest.prg @@ -7,19 +7,19 @@ PROCEDURE Main() CLS @ 0, 0, 15, 50 BOX " " COLOR "W+/B" - MESSAGE( [@ 0, 0, 15, 50 BOX " " COLOR "W+/B"] ) + MESSAGE( '@ 0, 0, 15, 50 BOX " " COLOR "W+/B"' ) __Box( 1, 1, 5, 7 ) - MESSAGE( [__BOX( 1, 1, 5, 7 )] ) + MESSAGE( '__BOX( 1, 1, 5, 7 )' ) __Box( 1, 1, 5, 7, "X" ) - MESSAGE( [__BOX( 1, 1, 5, 7, "X" )] ) + MESSAGE( '__BOX( 1, 1, 5, 7, "X" )' ) __BoxD( 2, 2, 6, 8 ) - MESSAGE( [__BOXD( 2, 2, 6, 8 )] ) + MESSAGE( '__BOXD( 2, 2, 6, 8 )' ) __BoxS( 3, 3, 7, 9 ) - MESSAGE( [__BOXS( 3, 3, 7, 9 )] ) + MESSAGE( '__BOXS( 3, 3, 7, 9 )' ) RETURN diff --git a/harbour/tests/cdow.prg b/harbour/tests/cdow.prg index 24feaff836..45e035a2c3 100644 --- a/harbour/tests/cdow.prg +++ b/harbour/tests/cdow.prg @@ -8,8 +8,8 @@ PROCEDURE Main() ? CMonth( Date() + 31 ) ? CMonth( Date() + 60 ) - ? CDow( Date() ) - ? CDow( Date() + 6 ) - ? CDow( Date() + 7 ) + ? CDoW( Date() ) + ? CDoW( Date() + 6 ) + ? CDoW( Date() + 7 ) RETURN diff --git a/harbour/tests/codebl.prg b/harbour/tests/codebl.prg index 5517406f1a..dd5c1cfcbe 100644 --- a/harbour/tests/codebl.prg +++ b/harbour/tests/codebl.prg @@ -128,7 +128,7 @@ FUNCTION ReferParam() bResult := GetBlock( @lEnd ), ; SetByRef( @lEnd ) } ) // Clipper & xHarbour it's .T. - //In Harbour it is .F. + // In Harbour it is .F. ? "Printed value in Clipper .T. =", Eval( bResult ) ? // Notice the Clipper bug: GetBlock is receiving the reference to @@ -139,7 +139,7 @@ FUNCTION ReferParam() bResult := GetBlock( @lEnd ), ; SetByRef( @lEnd ) } ) // Clipper & xHarbour it's .T. - //In Harbour it is .F. + // In Harbour it is .F. ? "Printed value in Clipper .T. =", Eval( bResult ) ? @@ -149,7 +149,7 @@ FUNCTION ReferParam() SetByRef( @lEnd ), ; bResult := GetBlock( @lEnd ) } ) // Clipper & xHarbour it's .T. - //In Harbour it is .F. + // In Harbour it is .F. ? "Printed value in Clipper .F. =", Eval( bResult ) ? @@ -157,11 +157,11 @@ FUNCTION ReferParam() SetByRef( @lEnd ), ; bResult := GetBlock( @lEnd ) } ) // Clipper & xHarbour it's .T. - //In Harbour it is .F. + // In Harbour it is .F. ? "Printed value in Clipper .F. =", Eval( bResult ) ? - RETURN Nil + RETURN NIL STATIC FUNCTION PassByValue( bBlock ) @@ -185,7 +185,7 @@ STATIC FUNCTION SetByRef( lVar ) lVar := .F. - RETURN Nil + RETURN NIL STATIC FUNCTION GetBlock( lVar ) diff --git a/harbour/tests/codebloc.prg b/harbour/tests/codebloc.prg index fea0b77de7..8a04ccce1f 100644 --- a/harbour/tests/codebloc.prg +++ b/harbour/tests/codebloc.prg @@ -56,9 +56,9 @@ PROCEDURE Main() yy := 5 x := {| xx | OutStd( hb_ntos( xx ) ), OutStd( "+" ), OutStd( hb_ntos( yy ) ), OutStd( "=" ), xx + yy } - OutStd( Eval( x, 1 ) ) //this is OK + OutStd( Eval( x, 1 ) ) // this is OK OutStd( hb_eol() ) - OutStd( Eval( x, 1, 2 ) ) //this should ignore unnecesary parameters + OutStd( Eval( x, 1, 2 ) ) // this should ignore unnecesary parameters QOut( Eval( RetBlock(), 5 ) ) @@ -71,7 +71,7 @@ PROCEDURE Main() x2 := 6 de := DetachLocal( x1, x2 ) OutStd( Eval( de ) ) - //changing the value of variables + // changing the value of variables OutStd( hb_eol() ) x1 := 10 x2 := 11 @@ -108,7 +108,7 @@ PROCEDURE AnotherTest( cb, a ) FUNCTION DetachLocal( x, y ) - //NOTE! this should work + // NOTE! this should work LOCAL z := x + y LOCAL cb := {|| QOut( "z=x+y=" ), QOut( z ), QOut( "x*x=" ), QOut( x * x ), QOut( "x*x+z=" ), x * x + z } diff --git a/harbour/tests/dates3.prg b/harbour/tests/dates3.prg index f5bd1465d3..07b9b0eb1d 100644 --- a/harbour/tests/dates3.prg +++ b/harbour/tests/dates3.prg @@ -13,36 +13,36 @@ PROCEDURE Main() Set( _SET_DATEFORMAT, "dd/mm/yyyy" ) dDate := hb_SToD( "19990525" ) - ? dDate, DOW( dDate ) + ? dDate, DoW( dDate ) ? LastMonday( dDate ) dDate += 3 - ? dDate, DOW( dDate ) + ? dDate, DoW( dDate ) dDate += 4 - ? dDate, DOW( dDate ) + ? dDate, DoW( dDate ) Set( _SET_DATEFORMAT, "mm/dd/yyyy" ) dDate := hb_SToD( "19990525" ) - ? dDate, DOW( dDate ) + ? dDate, DoW( dDate ) ? LastMonday( dDate ) dDate += 3 - ? dDate, DOW( dDate ) + ? dDate, DoW( dDate ) dDate += 4 - ? dDate, DOW( dDate ) + ? dDate, DoW( dDate ) ? dDate := Date () FOR i := 1 TO 7 - ? dDate, DOW( dDate ) + ? dDate, DoW( dDate ) dDate++ NEXT - ? CToD( "" ), DOW( CToD( "" ) ) + ? CToD( "" ), DoW( CToD( "" ) ) RETURN @@ -50,4 +50,4 @@ PROCEDURE Main() FUNCTION LastMonday( dDate ) - RETURN dDate - DOW( dDate ) + 2 + RETURN dDate - DoW( dDate ) + 2 diff --git a/harbour/tests/db_brows.prg b/harbour/tests/db_brows.prg index b909470b92..c13d1fe028 100644 --- a/harbour/tests/db_brows.prg +++ b/harbour/tests/db_brows.prg @@ -2,30 +2,30 @@ * $Id$ */ -//+-------------------------------------------------------------------- -//+ Browse function -//+ -//+ Written by Alexander Kresin -//+ -//+ Placed in the public domain -//+ -//+ Functions: PROCEDURE Main() -//+ Function DBFLIST() -//+ Function DBFLIST() -//+ Function FLDCOUNT() -//+ Function VIVNAMES() -//+ Function WNDVIVOD() -//+ Static Procedure VIVSTR() -//+ Function FLDSTR() -//+ Function InitList() -//+ Function Defpict() -//+ Function NUM_STR() -//+ -//+ Tables: USE &filename -//+ -//+ Reformatted by Click! 2.00 on Apr-20-2001 at 11:46 am -//+ -//+-------------------------------------------------------------------- +// -------------------------------------------------------------------- +// Browse function +// +// Written by Alexander Kresin +// +// Placed in the public domain +// +// Functions: PROCEDURE Main() +// Function DBFLIST() +// Function DBFLIST() +// Function FLDCOUNT() +// Function VIVNAMES() +// Function WNDVIVOD() +// Static Procedure VIVSTR() +// Function FLDSTR() +// Function InitList() +// Function Defpict() +// Function NUM_STR() +// +// Tables: USE &filename +// +// Reformatted by Click! 2.00 on Apr-20-2001 at 11:46 am +// +// -------------------------------------------------------------------- /* UTF-8 */ @@ -76,12 +76,11 @@ #define LI_COLCOUNT mslist[ 42 ] #define LI_LEN 42 -//+-------------------------------------------------------------------- -//+ -//+ PROCEDURE Main() -//+ -//+-------------------------------------------------------------------- -//+ +// -------------------------------------------------------------------- +// +// PROCEDURE Main() +// +// -------------------------------------------------------------------- PROCEDURE Main( filename ) @@ -108,14 +107,13 @@ PROCEDURE Main( filename ) RETURN -//+-------------------------------------------------------------------- -//+ -//+ Function DBFLIST() -//+ -//+ Called from ( db_brows.prg ) 1 - PROCEDURE Main() -//+ -//+-------------------------------------------------------------------- -//+ +// -------------------------------------------------------------------- +// +// Function DBFLIST() +// +// Called from ( db_brows.prg ) 1 - PROCEDURE Main() +// +// -------------------------------------------------------------------- FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) @@ -451,14 +449,13 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) RETURN rezproc -//+-------------------------------------------------------------------- -//+ -//+ Function FLDCOUNT() -//+ -//+ Called from ( db_brows.prg ) 6 - function dbflist() -//+ -//+-------------------------------------------------------------------- -//+ +// -------------------------------------------------------------------- +// +// Function FLDCOUNT() +// +// Called from ( db_brows.prg ) 6 - function dbflist() +// +// -------------------------------------------------------------------- FUNCTION FLDCOUNT( mslist, xstrt, xend, fld1 ) @@ -479,14 +476,13 @@ FUNCTION FLDCOUNT( mslist, xstrt, xend, fld1 ) RETURN iif( klf == 0, 1, klf ) -//+-------------------------------------------------------------------- -//+ -//+ Function VIVNAMES() -//+ -//+ Called from ( db_brows.prg ) 3 - function dbflist() -//+ -//+-------------------------------------------------------------------- -//+ +// -------------------------------------------------------------------- +// +// Function VIVNAMES() +// +// Called from ( db_brows.prg ) 3 - function dbflist() +// +// -------------------------------------------------------------------- FUNCTION VIVNAMES( mslist ) @@ -516,14 +512,13 @@ FUNCTION VIVNAMES( mslist ) RETURN NIL -//+-------------------------------------------------------------------- -//+ -//+ Function WNDVIVOD() -//+ -//+ Called from ( db_brows.prg ) 8 - function dbflist() -//+ -//+-------------------------------------------------------------------- -//+ +// -------------------------------------------------------------------- +// +// Function WNDVIVOD() +// +// Called from ( db_brows.prg ) 8 - function dbflist() +// +// -------------------------------------------------------------------- FUNCTION WNDVIVOD( mslist ) @@ -550,15 +545,14 @@ FUNCTION WNDVIVOD( mslist ) RETURN nstr - 1 -//+-------------------------------------------------------------------- -//+ -//+ Static Procedure VIVSTR() -//+ -//+ Called from ( db_brows.prg ) 5 - function dbflist() -//+ 1 - function wndvivod() -//+ -//+-------------------------------------------------------------------- -//+ +// -------------------------------------------------------------------- +// +// Static Procedure VIVSTR() +// +// Called from ( db_brows.prg ) 5 - function dbflist() +// 1 - function wndvivod() +// +// -------------------------------------------------------------------- STATIC PROCEDURE VIVSTR( mslist, nstroka, vybfld ) @@ -601,17 +595,16 @@ STATIC PROCEDURE VIVSTR( mslist, nstroka, vybfld ) RETURN -//+-------------------------------------------------------------------- -//+ -//+ Function FLDSTR() -//+ -//+ Called from ( db_brows.prg ) 1 - function dbflist() -//+ 1 - function fldcount() -//+ 1 - function vivnames() -//+ 3 - static procedure vivstr() -//+ -//+-------------------------------------------------------------------- -//+ +// -------------------------------------------------------------------- +// +// Function FLDSTR() +// +// Called from ( db_brows.prg ) 1 - function dbflist() +// 1 - function fldcount() +// 1 - function vivnames() +// 3 - static procedure vivstr() +// +// -------------------------------------------------------------------- FUNCTION FLDSTR( mslist, numf ) @@ -657,15 +650,14 @@ FUNCTION FLDSTR( mslist, numf ) RETURN rez -//+-------------------------------------------------------------------- -//+ -//+ Function InitList() -//+ -//+ Called from ( db_brows.prg ) 1 - PROCEDURE Main() -//+ 1 - function dbflist() -//+ -//+-------------------------------------------------------------------- -//+ +// -------------------------------------------------------------------- +// +// Function InitList() +// +// Called from ( db_brows.prg ) 1 - PROCEDURE Main() +// 1 - function dbflist() +// +// -------------------------------------------------------------------- FUNCTION InitList @@ -678,8 +670,8 @@ FUNCTION InitList LI_BSKIP := {| a, x | HB_SYMBOL_UNUSED( a ), dbSkip( x ) } LI_BGTOP := {|| dbGoTop() } LI_BGBOT := {|| dbGoBottom() } - LI_BEOF := {|| EOF() } - LI_BBOF := {|| BOF() } + LI_BEOF := {|| Eof() } + LI_BBOF := {|| Bof() } LI_B1 := {| a | HB_SYMBOL_UNUSED( a ), hb_DispOutAt( LI_Y2, LI_X1 + 2, Str( RecNo(), 6 ) + "/" + Str( LI_KOLZ, 6 ) ) } LI_FREEZE := 0 LI_RCOU := {|| RecCount() } @@ -692,14 +684,13 @@ FUNCTION InitList RETURN mslist -//+-------------------------------------------------------------------- -//+ -//+ Function Defpict() -//+ -//+ Called from ( db_brows.prg ) 1 - function dbflist() -//+ -//+-------------------------------------------------------------------- -//+ +// -------------------------------------------------------------------- +// +// Function Defpict() +// +// Called from ( db_brows.prg ) 1 - function dbflist() +// +// -------------------------------------------------------------------- FUNCTION Defpict( mslist, i, maxlen ) @@ -717,14 +708,13 @@ FUNCTION Defpict( mslist, i, maxlen ) RETURN spict -//+-------------------------------------------------------------------- -//+ -//+ Function NUM_STR() -//+ -//+ Called from ( db_brows.prg ) 1 - function defpict() -//+ -//+-------------------------------------------------------------------- -//+ +// -------------------------------------------------------------------- +// +// Function NUM_STR() +// +// Called from ( db_brows.prg ) 1 - function defpict() +// +// -------------------------------------------------------------------- FUNCTION NUM_STR( NOM, KOLZN ) diff --git a/harbour/tests/dbevalts.prg b/harbour/tests/dbevalts.prg index c5c2ae8c7b..c16c98ad6f 100644 --- a/harbour/tests/dbevalts.prg +++ b/harbour/tests/dbevalts.prg @@ -3,6 +3,7 @@ */ PROCEDURE Main() + LOCAL nCount USE test diff --git a/harbour/tests/delimtst.prg b/harbour/tests/delimtst.prg index aed3b5da88..1edbfe59aa 100644 --- a/harbour/tests/delimtst.prg +++ b/harbour/tests/delimtst.prg @@ -19,7 +19,7 @@ PROCEDURE Main() COPY TO test1 DELIMITED // Copy only address fields for records with salary over 50,000. - COPY FIELD first, last, street, city, state, zip TO test2 delimited for _field->salary > 50000 + COPY FIELD first, last, street, city, state, zip TO test2 delimited FOR _field->salary > 50000 // Only copy record 3. COPY RECORD 3 TO test3 DELIMITED @@ -40,7 +40,7 @@ PROCEDURE Main() // Copy the last 10 records again. GO BOTTOM SKIP -9 - COPY TO test6 delimited WHILE ! EOF() + COPY TO test6 delimited WHILE ! Eof() // Copy only some of the last 10 records. GO BOTTOM diff --git a/harbour/tests/destruct.prg b/harbour/tests/destruct.prg index 6baddd5a9e..a968c529a5 100644 --- a/harbour/tests/destruct.prg +++ b/harbour/tests/destruct.prg @@ -96,7 +96,7 @@ CREATE CLASS myClass CLASS VAR var2 - METHOD init + METHOD INIT DESTRUCTOR dtor END CLASS diff --git a/harbour/tests/dirtest.prg b/harbour/tests/dirtest.prg index d983feaed9..a98da47929 100644 --- a/harbour/tests/dirtest.prg +++ b/harbour/tests/dirtest.prg @@ -21,11 +21,12 @@ PROCEDURE Main( filespec, attribs, cshort ) SET CENTURY ON FOR x := 1 TO Len( aDir ) - ? PadR( aDir[ x, F_NAME ], 20 ), "|", ; - Transform( aDir[ x, F_SIZE ], "9,999,999,999" ), "|", ; - aDir[ x, F_DATE ], "|", ; - aDir[ x, F_TIME ], "|", ; - aDir[ x, F_ATTR ] + ? ; + PadR( aDir[ x, F_NAME ], 20 ), "|", ; + Transform( aDir[ x, F_SIZE ], "9,999,999,999" ), "|", ; + aDir[ x, F_DATE ], "|", ; + aDir[ x, F_TIME ], "|", ; + aDir[ x, F_ATTR ] NEXT RETURN diff --git a/harbour/tests/dynobj.prg b/harbour/tests/dynobj.prg index 08f3f5bedc..f44b769b86 100644 --- a/harbour/tests/dynobj.prg +++ b/harbour/tests/dynobj.prg @@ -20,7 +20,7 @@ PROCEDURE Main() ? "What methods are in the class :" ? hb_ValToExp( __objGetMethodList( oForm ) ) -/* Let's add an inline at run-time. Should already be possible */ + /* Let's add an inline at run-time. Should already be possible */ ? "Let's add inline 'CalcArea' at run-time to an already instanced class" diff --git a/harbour/tests/dynsym.prg b/harbour/tests/dynsym.prg index 361b49e594..71d918ae32 100644 --- a/harbour/tests/dynsym.prg +++ b/harbour/tests/dynsym.prg @@ -3,20 +3,21 @@ */ PROCEDURE Main() - LOCAL nCount := __dynsCount() + + LOCAL nCount := __dynSCount() LOCAL nPos FOR nPos := 1 TO nCount - ? __dynsGetName( nPos ) + ? __dynSGetName( nPos ) NEXT - nPos := __dynsGetIndex( "MAIN" ) + nPos := __dynSGetIndex( "MAIN" ) ? "MAIN", nPos - ? __dynsGetName( nPos ) - ? __dynsGetName() - ? __dynsGetName( 0 ) - ? __dynsGetName( 100000 ) - ? __dynsGetName( __dynsGetIndex( "HB_THISDOESNTEXIST_" ) ) + ? __dynSGetName( nPos ) + ? __dynSGetName() + ? __dynSGetName( 0 ) + ? __dynSGetName( 100000 ) + ? __dynSGetName( __dynSGetIndex( "HB_THISDOESNTEXIST_" ) ) RETURN diff --git a/harbour/tests/files.prg b/harbour/tests/files.prg index e76d968b2a..602f12eb82 100644 --- a/harbour/tests/files.prg +++ b/harbour/tests/files.prg @@ -12,7 +12,7 @@ // use only *one* at a time // dejar solo una de las dos lineas siguientes: #define WITH_DBFCDX -//#define WITH_ADS +// #define WITH_ADS #ifdef WITH_ADS #include "ads.ch" @@ -28,7 +28,7 @@ PROCEDURE Main() #ifdef WITH_ADS rddRegister( "ADS", 1 ) - rddsetdefault( "ADS" ) + rddSetDefault( "ADS" ) SET SERVER LOCAL SET FILETYPE TO CDX SET CHARTYPE TO OEM @@ -59,9 +59,9 @@ PROCEDURE Main() @ 12, 0 SAY "Opening files.... " + Str( n ) USE ( "file" + hb_ntos( n ) ) NEW - #ifdef WITH_ADS +#ifdef WITH_ADS SET ORDER TO TAG CODIGO - #endif +#endif ENDDO diff --git a/harbour/tests/fortest.prg b/harbour/tests/fortest.prg index 9376fb762d..aede355ba9 100644 --- a/harbour/tests/fortest.prg +++ b/harbour/tests/fortest.prg @@ -36,9 +36,10 @@ PROCEDURE Main() s_nTo := array[ tmp ][ 2 ] s_nStep := array[ tmp ][ 3 ] - ? " From:", s_nFrom,; - " To:", s_nTo,; - " Step:", s_nStep + ? ; + " From:", s_nFrom, ; + " To:", s_nTo, ; + " Step:", s_nStep FOR n := Eval( {|| ValFrom() } ) TO Eval( {|| ValTo() } ) STEP Eval( {|| ValStep() } ) ? "Exec", n diff --git a/harbour/tests/funcarr.prg b/harbour/tests/funcarr.prg index 17249baf29..90cb0738e7 100644 --- a/harbour/tests/funcarr.prg +++ b/harbour/tests/funcarr.prg @@ -50,9 +50,9 @@ PROCEDURE Main() ? "To the power 3 : ", aFunc()[ 1 ] ? "Global stack" - ? hb_ValToExp( __dbgVMStkGList() ) // Please note a is a reference to aArray ! + ? hb_ValToExp( __dbgVMStkGList() ) // Please note a is a reference to aArray ! ? "Statics" - ? hb_ValToExp( __dbgVMVarSList() ) + ? hb_ValToExp( __dbgVMVarSList() ) RETURN diff --git a/harbour/tests/function.cfm b/harbour/tests/function.cfm index ee6aba9067..7a1a62cb5c 100644 --- a/harbour/tests/function.cfm +++ b/harbour/tests/function.cfm @@ -2,7 +2,7 @@ +content="text/html; charset=utf-8"> Harbour function task list diff --git a/harbour/tests/gfx.prg b/harbour/tests/gfx.prg index ed2b466360..80543b50ea 100644 --- a/harbour/tests/gfx.prg +++ b/harbour/tests/gfx.prg @@ -12,9 +12,17 @@ PROCEDURE Main() LOCAL nFontHeight, nFontWidth LOCAL nTop, nLeft, nHeight, nWidth, nColor, nSec := Seconds() +#if defined( __HBSCRIPT__HBSHELL ) +# if defined( __PLATFORM__WINDOWS ) + hbshell_gtSelect( "GTWVT" ) +# elif defined( __PLATFORM__UNIX ) + hbshell_gtSelect( "GTXWC" ) +# endif +#endif + IF ! hb_gtInfo( HB_GTI_ISGRAPHIC ) - OutStd( "You are using a non graphics capable gt:" + hb_eol() ) - OutStd( hb_gtVersion() + hb_eol() ) + ? "You are using a non graphics capable gt:" + ? hb_gtVersion() QUIT ENDIF @@ -42,11 +50,11 @@ PROCEDURE Main() hb_gfxMakeColor( 0, 0, 0 ), hb_gfxMakeColor( 255, 255, 255 ) ) DO WHILE Inkey() == 0 - nTop := Int( hb_Random( 3.1 * nFontHeight, hb_gtInfo(HB_GTI_SCREENHEIGHT ) ) ) - nLeft := Int( hb_Random( hb_gtInfo(HB_GTI_SCREENWIDTH ) ) ) + nTop := Int( hb_Random( 3.1 * nFontHeight, hb_gtInfo( HB_GTI_SCREENHEIGHT ) ) ) + nLeft := Int( hb_Random( hb_gtInfo( HB_GTI_SCREENWIDTH ) ) ) nHeight := Int( hb_Random( 251 ) ) nWidth := Int( hb_Random( 251 ) ) - nColor := hb_gfxMakeColor( Int( hb_Random(32, 256 ) ), Int( hb_Random(32, 256 ) ), Int( hb_Random(32, 256 ) ) ) + nColor := hb_gfxMakeColor( Int( hb_Random( 32, 256 ) ), Int( hb_Random( 32, 256 ) ), Int( hb_Random( 32, 256 ) ) ) SWITCH Int( hb_Random( 1, 9 ) ) CASE 1 @@ -77,7 +85,7 @@ PROCEDURE Main() CASE 8 nHeight %= 64 IF nHeight % 2 == 1 - nHeight ++ + nHeight++ ENDIF hb_gfxText( nTop, nLeft, "Hello", nColor, nHeight ) EXIT @@ -94,7 +102,9 @@ FUNCTION PutFrame( nTop, nLeft, nBottom, nRight, nColor1, nColor2 ) hb_gfxRect( ntop, nLeft, nBottom, nRight, nColor1 ) hb_gfxRect( ntop + 1, nLeft + 1, nBottom - 1, nRight - 1, nColor2 ) -/* hb_gfxLine( nTop + 1, nLeft + 1, nTop + 1, nRight - 1, nColor2 ) - hb_gfxLine( nTop + 2, nLeft + 1, nBottom - 1, nLeft + 1, nColor2 ) */ +#if 0 + hb_gfxLine( nTop + 1, nLeft + 1, nTop + 1, nRight - 1, nColor2 ) + hb_gfxLine( nTop + 2, nLeft + 1, nBottom - 1, nLeft + 1, nColor2 ) +#endif RETURN NIL diff --git a/harbour/tests/gtkeys.prg b/harbour/tests/gtkeys.prg index 4c586a0b05..2a2cc0616d 100644 --- a/harbour/tests/gtkeys.prg +++ b/harbour/tests/gtkeys.prg @@ -228,9 +228,9 @@ PROCEDURE Main( cTermCP, cHostCP, lBoxChar ) #ifdef __HARBOUR__ SET( _SET_EVENTMASK, HB_INKEY_ALL ) - //hb_gtInfo( HB_GTI_RESIZABLE, .F. ) - //hb_gtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_ROWS ) - //hb_gtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_FONT ) + // hb_gtInfo( HB_GTI_RESIZABLE, .F. ) + // hb_gtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_ROWS ) + // hb_gtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_FONT ) hb_gtInfo( HB_GTI_ISFULLSCREEN, .T. ) hb_gtInfo( HB_GTI_ALTENTER, .T. ) hb_gtInfo( HB_GTI_CLOSABLE, .F. ) @@ -256,7 +256,7 @@ PROCEDURE Main( cTermCP, cHostCP, lBoxChar ) MDblClk( 250 ) SetCancel( .F. ) - //altd(0) + // altd(0) ? OS(), Version(), Date(), Time() #ifdef __HARBOUR__ @@ -276,7 +276,7 @@ PROCEDURE Main( cTermCP, cHostCP, lBoxChar ) ELSE ? " key:" + Str( k, 7 ) ENDIF - // ?? " (" + hb_ntos( maxrow() ) + ":" + hb_ntos( maxcol() ) + ")" +// ?? " (" + hb_ntos( MaxRow() ) + ":" + hb_ntos( MaxCol() ) + ")" IF k == hb_keyCode( "@" ) .AND. NextKey() == 0 EXIT diff --git a/harbour/tests/gtwin.prg b/harbour/tests/gtwin.prg index 723c99a7d9..9537778fc2 100644 --- a/harbour/tests/gtwin.prg +++ b/harbour/tests/gtwin.prg @@ -28,8 +28,12 @@ proc main() local pGT, pGT1, pGT2 -#if defined( __PLATFORM__WINDOWS ) .AND. defined( __HBSCRIPT__HBSHELL ) - hbshell_gtSelect( "GTWVT" ) +#if defined( __HBSCRIPT__HBSHELL ) + #if defined( __PLATFORM__WINDOWS ) + hbshell_gtSelect( "GTWVT" ) + #elif defined( __PLATFORM__UNIX ) + hbshell_gtSelect( "GTXWC" ) + #endif #endif ? "This is small test for using more then one console window." diff --git a/harbour/tests/gtxfnt.prg b/harbour/tests/gtxfnt.prg index de2740618c..ce1d0b042b 100644 --- a/harbour/tests/gtxfnt.prg +++ b/harbour/tests/gtxfnt.prg @@ -13,10 +13,19 @@ #include "hbgtinfo.ch" +#if ! defined( __HBSCRIPT__HBSHELL ) REQUEST HB_GT_XWC_DEFAULT +#endif + proc main() local cChars, i, j, n +#if defined( __HBSCRIPT__HBSHELL ) + #if defined( __PLATFORM__UNIX ) + hbshell_gtSelect( "GTXWC" ) + #endif +#endif + cChars := "" for i := 0 to 7 cChars += ";" diff --git a/harbour/tests/hbdocext.hb b/harbour/tests/hbdocext.hb index cf36f2bb06..e11e77e1d3 100644 --- a/harbour/tests/hbdocext.hb +++ b/harbour/tests/hbdocext.hb @@ -14,13 +14,14 @@ #include "simpleio.ch" PROCEDURE Main() + LOCAL aFile LOCAL cFile LOCAL cDst LOCAL cHdr := ; - "/*" + hb_eol() +; - " * $" + "Id" + "$" + hb_eol() +; + "/*" + hb_eol() + ; + " * $" + "Id" + "$" + hb_eol() + ; " */" + hb_eol() FOR EACH aFile IN Directory( hb_osFileMask() ) diff --git a/harbour/tests/hbdoctst.prg b/harbour/tests/hbdoctst.prg index b1df1b463e..dfd2336b4a 100644 --- a/harbour/tests/hbdoctst.prg +++ b/harbour/tests/hbdoctst.prg @@ -14,6 +14,7 @@ #include "simpleio.ch" PROCEDURE Main( cRoot ) + LOCAL aEntry LOCAL cName @@ -77,7 +78,7 @@ PROCEDURE Main( cRoot ) NEXT IF ! Empty( aEntry ) - ? __hbdoc_savehbd( cName, aEntry ), cName, Len( aEntry ), tModified + ? __hbdoc_SaveHBD( cName, aEntry ), cName, Len( aEntry ), tModified ENDIF ENDIF NEXT @@ -85,6 +86,7 @@ PROCEDURE Main( cRoot ) RETURN STATIC FUNCTION DirGetName( cDir ) + LOCAL cName cDir := hb_DirSepDel( cDir ) diff --git a/harbour/tests/hsxtest.prg b/harbour/tests/hsxtest.prg index 259c27224b..b9ec91cf95 100644 --- a/harbour/tests/hsxtest.prg +++ b/harbour/tests/hsxtest.prg @@ -13,7 +13,7 @@ #include "dbinfo.ch" -//REQUEST RMDBFCDX +// REQUEST RMDBFCDX PROCEDURE Main() diff --git a/harbour/tests/inherit.prg b/harbour/tests/inherit.prg index 418a3a7145..bf0009b356 100644 --- a/harbour/tests/inherit.prg +++ b/harbour/tests/inherit.prg @@ -53,7 +53,7 @@ PROCEDURE Main() oFrom:Dispose() oTo:Dispose() -// ? hb_ValToExp( __dbgvmStkGList() ) // Stack is OK! + // ? hb_ValToExp( __dbgvmStkGList() ) // Stack is OK! RETURN diff --git a/harbour/tests/initexit.prg b/harbour/tests/initexit.prg index a8d37529c7..76599b2125 100644 --- a/harbour/tests/initexit.prg +++ b/harbour/tests/initexit.prg @@ -58,6 +58,7 @@ EXIT FUNCTION Sixth() RETURN NIL INIT PROCEDURE initStatics() + PUBLIC p_initStatics := "P_INITSTATICS" RETURN diff --git a/harbour/tests/langapi.prg b/harbour/tests/langapi.prg index 9673dbb0b1..0985707c0b 100644 --- a/harbour/tests/langapi.prg +++ b/harbour/tests/langapi.prg @@ -14,28 +14,28 @@ PROCEDURE Main() ? hb_langName() ? NationMsg( 1 ) ? CMonth( Date() ) - ? CDOW( Date() ) + ? CDoW( Date() ) ? "---------" ? "Prev:", hb_langSelect( "HU852" ) ? hb_langName() ? NationMsg( 1 ) ? CMonth( Date() ) - ? CDOW( Date() ) + ? CDoW( Date() ) ? "---------" ? "Prev:", hb_langSelect( "NOTHERE" ) ? hb_langName() ? NationMsg( 1 ) ? CMonth( Date() ) - ? CDOW( Date() ) + ? CDoW( Date() ) ? "---------" ? "Prev:", hb_langSelect( "KO" ) ? hb_langName() ? NationMsg( 1 ) ? CMonth( Date() ) - ? CDOW( Date() ) + ? CDoW( Date() ) ? "---------" RETURN diff --git a/harbour/tests/langmsg.prg b/harbour/tests/langmsg.prg index bbc57aa43b..11c22798ee 100644 --- a/harbour/tests/langmsg.prg +++ b/harbour/tests/langmsg.prg @@ -46,7 +46,7 @@ PROCEDURE Main( cLng ) ? "-------" a := GET_ERR() FOR i := 1 TO Len( a ) - ? PadR( a[i,1], 15 ) + "|" + PadR( aErr[i,2], 30 ) + "|" + PadR( a[i,2], 32 ) + ? PadR( a[ i, 1 ], 15 ) + "|" + PadR( aErr[ i, 2 ], 30 ) + "|" + PadR( a[ i, 2 ], 32 ) NEXT ? Inkey( 0 ) @@ -85,8 +85,8 @@ FUNCTION GET_DAYS() LOCAL i, n, aDays[ 7 ], dt := Date() FOR i := 1 TO 7 - n := DOW( dt ) - aDays[ n ] := CDOW( dt ) + n := DoW( dt ) + aDays[ n ] := CDoW( dt ) ++dt NEXT @@ -110,7 +110,7 @@ FUNCTION GET_ERR() LOCAL aErr - aErr := {; + aErr := { ; { "EG_ARG ", hb_langErrMsg( 1 ) }, ; { "EG_BOUND ", hb_langErrMsg( 2 ) }, ; { "EG_STROVERFLOW ", hb_langErrMsg( 3 ) }, ; diff --git a/harbour/tests/libname.prg b/harbour/tests/libname.prg index 2c69bf6d85..9ebcc95e12 100644 --- a/harbour/tests/libname.prg +++ b/harbour/tests/libname.prg @@ -14,16 +14,16 @@ PROCEDURE Main() - ? hb_LibName( NIL ) - ? hb_LibName( "" ) - ? hb_LibName( "name" ) - ? hb_LibName( "name.ext" ) - ? hb_LibName( "name." ) - ? hb_LibName( "name.ext", NIL ) - ? hb_LibName( "dir\name.ext", NIL ) - ? hb_LibName( "name.ext", "mydir" ) - ? hb_LibName( "dir\name.ext", "mydir" ) - ? hb_LibName( "name.ext", "mydir\" ) - ? hb_LibName( "dir\name.ext", "mydir\" ) + ? hb_libName( NIL ) + ? hb_libName( "" ) + ? hb_libName( "name" ) + ? hb_libName( "name.ext" ) + ? hb_libName( "name." ) + ? hb_libName( "name.ext", NIL ) + ? hb_libName( "dir\name.ext", NIL ) + ? hb_libName( "name.ext", "mydir" ) + ? hb_libName( "dir\name.ext", "mydir" ) + ? hb_libName( "name.ext", "mydir\" ) + ? hb_libName( "dir\name.ext", "mydir\" ) RETURN diff --git a/harbour/tests/lnlenli1.prg b/harbour/tests/lnlenli1.prg index b13d3e7d86..71842dd8ef 100644 --- a/harbour/tests/lnlenli1.prg +++ b/harbour/tests/lnlenli1.prg @@ -14,87 +14,87 @@ PROCEDURE Main() RETURN FUNCTION LongLine1() - RETURN {; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9},; - {I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") , {|| I_("XXXXXXXXXXXXXXXXXXXXXXXXXXX") }, 99, 9}} + RETURN { ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 }, ; + { I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ), {|| I_( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) }, 99, 9 } } diff --git a/harbour/tests/mathtest.prg b/harbour/tests/mathtest.prg index 75ad834448..1638ddb140 100644 --- a/harbour/tests/mathtest.prg +++ b/harbour/tests/mathtest.prg @@ -52,7 +52,7 @@ PROCEDURE Main() hb_matherMode( nOldMathErrMode ) - bOldMathErr := hb_matherBlock( {| nType, cFuncname, cError, nArg1, nArg2, aInfo |; + bOldMathErr := hb_matherBlock( {| nType, cFuncname, cError, nArg1, nArg2, aInfo | ; localmatherr( nType, cFuncname, cError, nArg1, nArg2, aInfo ) } ) ? " IIc) error handling by callback block(hb_MathErBlock())" diff --git a/harbour/tests/memory.prg b/harbour/tests/memory.prg index 85b76c7d14..fa011e21a6 100644 --- a/harbour/tests/memory.prg +++ b/harbour/tests/memory.prg @@ -9,19 +9,19 @@ PROCEDURE Main() - ? "HB_MEM_CHAR " , Memory( HB_MEM_CHAR ) - ? "HB_MEM_BLOCK " , Memory( HB_MEM_BLOCK ) - ? "HB_MEM_RUN " , Memory( HB_MEM_RUN ) - ? "HB_MEM_VM " , Memory( HB_MEM_VM ) - ? "HB_MEM_EMS " , Memory( HB_MEM_EMS ) - ? "HB_MEM_FM " , Memory( HB_MEM_FM ) - ? "HB_MEM_FMSEGS " , Memory( HB_MEM_FMSEGS ) - ? "HB_MEM_SWAP " , Memory( HB_MEM_SWAP ) - ? "HB_MEM_CONV " , Memory( HB_MEM_CONV ) - ? "HB_MEM_EMSUSED " , Memory( HB_MEM_EMSUSED ) - ? "HB_MEM_USED " , Memory( HB_MEM_USED ) - ? "HB_MEM_USEDMAX " , Memory( HB_MEM_USEDMAX ) - ? "HB_MEM_STACKITEMS" , Memory( HB_MEM_STACKITEMS ) - ? "HB_MEM_STACK " , Memory( HB_MEM_STACK ) + ? "HB_MEM_CHAR ", Memory( HB_MEM_CHAR ) + ? "HB_MEM_BLOCK ", Memory( HB_MEM_BLOCK ) + ? "HB_MEM_RUN ", Memory( HB_MEM_RUN ) + ? "HB_MEM_VM ", Memory( HB_MEM_VM ) + ? "HB_MEM_EMS ", Memory( HB_MEM_EMS ) + ? "HB_MEM_FM ", Memory( HB_MEM_FM ) + ? "HB_MEM_FMSEGS ", Memory( HB_MEM_FMSEGS ) + ? "HB_MEM_SWAP ", Memory( HB_MEM_SWAP ) + ? "HB_MEM_CONV ", Memory( HB_MEM_CONV ) + ? "HB_MEM_EMSUSED ", Memory( HB_MEM_EMSUSED ) + ? "HB_MEM_USED ", Memory( HB_MEM_USED ) + ? "HB_MEM_USEDMAX ", Memory( HB_MEM_USEDMAX ) + ? "HB_MEM_STACKITEMS", Memory( HB_MEM_STACKITEMS ) + ? "HB_MEM_STACK ", Memory( HB_MEM_STACK ) RETURN diff --git a/harbour/tests/memvar.prg b/harbour/tests/memvar.prg index ff676d9a99..5c7822e31f 100644 --- a/harbour/tests/memvar.prg +++ b/harbour/tests/memvar.prg @@ -235,7 +235,7 @@ FUNCTION UseVar( value ) UseRef( @value ) #ifdef __HARBOUR__ - __mvPublic( "public1" ) //, "public21" ) + __mvPublic( "public1" ) // , "public21" ) // __mvPRIVATE( "private1", "private2", "private3" ) __mvPrivate( { "private1", "private2", "private3" } ) ? "undeclared PUBLIC created by __PUBLIC function : ", public1 @@ -368,8 +368,10 @@ STATIC FUNCTION memfunc( memfunc ) RETURN memfunc * memfunc INIT PROCEDURE initmem() + PARAMETERS MEMVAR PARAMETERS initmem + ? "Tests for PARAMETERS, PRIVATE nad PUBLIC variables" ? ? "in INIT function - Passed parameter : ", memvar diff --git a/harbour/tests/mousetst.prg b/harbour/tests/mousetst.prg index 1bba68bf76..c2a617b672 100644 --- a/harbour/tests/mousetst.prg +++ b/harbour/tests/mousetst.prg @@ -26,18 +26,18 @@ PROCEDURE Main() @ MaxRow() - 1, 2 SAY "Y:" @ MaxRow() - 1, 10 SAY "X:" - @ nR , 2 SAY "Mouse Type : " + @ nR, 2 SAY "Mouse Type : " @ nR, 18 SAY "Mouse System" @ MaxRow() - 2, 68 TO MaxRow(), MaxCol() DOUBLE @ MaxRow() - 1, 70 SAY "Exit" - @ 10, 02 SAY " -- Checkings -- " - @ 11, 02 SAY "Window Boundaries :" - @ 12, 02 SAY "Press/Release But.:" - @ 13, 02 SAY "Double Click Left :" - @ 14, 02 SAY "Double Click Right:" + @ 10, 2 SAY " -- Checkings -- " + @ 11, 2 SAY "Window Boundaries :" + @ 12, 2 SAY "Press/Release But.:" + @ 13, 2 SAY "Double Click Left :" + @ 14, 2 SAY "Double Click Right:" TEST1() @@ -52,8 +52,8 @@ PROCEDURE Main() FUNCTION MUPDATE() - @ MaxRow() - 1, 04 SAY MRow() PICT "9999" - @ MaxRow() - 1, 12 SAY MCol() PICT "9999" + @ MaxRow() - 1, 4 SAY MRow() PICTURE "9999" + @ MaxRow() - 1, 12 SAY MCol() PICTURE "9999" RETURN 0 @@ -69,7 +69,7 @@ FUNCTION MINRECT( nTop, nLeft, nBott, nRight ) RETURN lInside - // First test: Check the boundaries of the main window +// First test: Check the boundaries of the main window PROCEDURE TEST1() @@ -137,7 +137,7 @@ PROCEDURE TEST2( nR, nC ) LOCAL cSkip := "", nKey, nPress := 0 - @ nR , nC SAY "+---------|---------+" + @ nR + 0, nC SAY "+---------|---------+" @ nR + 1, nC SAY "| +===+ +===+ +===+ |" @ nR + 2, nC SAY "| | | | | | | |" @ nR + 3, nC SAY "| | | | | | | |" diff --git a/harbour/tests/newrdd.prg b/harbour/tests/newrdd.prg index edb7280e02..23c5d130db 100644 --- a/harbour/tests/newrdd.prg +++ b/harbour/tests/newrdd.prg @@ -50,52 +50,52 @@ PROCEDURE Main() ? "dbGoTop():" dbGoTop() - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "dbSkip( -1 ):" dbSkip( -1 ) - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "dbSkip( -1 ):" dbSkip( -1 ) - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "dbSkip( 1 ):" dbSkip( 1 ) - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "dbSkip( 1 ):" dbSkip( 1 ) - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "dbGoTop():" dbGoTop() - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "dbSkip( 1 ):" dbSkip( 1 ) - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "dbSkip( 1 ):" dbSkip( 1 ) - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "dbSkip( -1 ):" dbSkip( -1 ) - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "dbSkip( -1 ):" dbSkip( -1 ) - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) Inkey( 0 ) @@ -103,27 +103,27 @@ PROCEDURE Main() ? "dbGoBottom():" dbGoBottom() - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "dbSkip( 1 ):" dbSkip( 1 ) - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "dbSkip( 1 ):" dbSkip( 1 ) - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "dbSkip( -1 ):" dbSkip( -1 ) - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "dbSkip( -1 ):" dbSkip( -1 ) - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) @@ -133,7 +133,7 @@ PROCEDURE Main() ? "dbGoto( 490 ):" dbGoto( 490 ) - ? "Bof Eof Found Deleted RecNo:", TESTDBF->( BOF() ), TESTDBF->( EOF() ), ; + ? "Bof Eof Found Deleted RecNo:", TESTDBF->( Bof() ), TESTDBF->( Eof() ), ; TESTDBF->( Found() ), TESTDBF->( Deleted() ), TESTDBF->( Deleted() ), ; TESTDBF->( RecNo() ) ? "FCount:", TESTDBF->( FCount() ) @@ -150,7 +150,7 @@ PROCEDURE Main() ? " TESTDBF->( dbSkip() )" ? "ENDDO" ? "" - WHILE !TESTDBF->( EOF() ) + WHILE !TESTDBF->( Eof() ) ? TESTDBF->FIRST, TESTDBF->( RecNo() ) TESTDBF->( dbSkip() ) ENDDO @@ -171,7 +171,7 @@ PROCEDURE Main() SET FILTER TO TESTDBF->AGE == 21 ? TESTDBF->( dbFilter() ) TESTDBF->( dbGoTop() ) - WHILE !TESTDBF->( EOF() ) + WHILE !TESTDBF->( Eof() ) ? TESTDBF->FIRST, TESTDBF->AGE, TESTDBF->( RecNo() ) TESTDBF->( dbSkip() ) ENDDO @@ -260,7 +260,7 @@ PROCEDURE Main() SELECT( "TESTDBF" ) SET FILTER TO TESTDBF->SALARY > 120000 TESTDBF->( dbGoTop() ) - WHILE !TESTDBF->( EOF() ) + WHILE !TESTDBF->( Eof() ) NEWRDD->( dbAppend() ) NEWRDD->FIRST_NAME := TESTDBF->FIRST NEWRDD->AGE := TESTDBF->AGE diff --git a/harbour/tests/onidle.prg b/harbour/tests/onidle.prg index 78e98c866c..0f5e8d9da3 100644 --- a/harbour/tests/onidle.prg +++ b/harbour/tests/onidle.prg @@ -12,7 +12,7 @@ PROCEDURE Main() LOCAL nPrev := Seconds() CLS - ? " Time: Memory used: Miliseconds elapsed" + ? " Time: Memory used: Milliseconds elapsed" ? ? "Can you see it ??? :) Press any key or wait 30 seconds" ? diff --git a/harbour/tests/osshell.prg b/harbour/tests/osshell.prg index 7f926269ee..9c2a6ce5b5 100644 --- a/harbour/tests/osshell.prg +++ b/harbour/tests/osshell.prg @@ -16,11 +16,11 @@ PROCEDURE Main() LOCAL cShell - #if defined( __PLATFORM__UNIX ) - cShell := GetEnv( "SHELL" ) - #else - cShell := GetEnv( "COMSPEC" ) - #endif +#if defined( __PLATFORM__UNIX ) + cShell := GetEnv( "SHELL" ) +#else + cShell := GetEnv( "COMSPEC" ) +#endif ? "About to shell to OS.." ! ( cShell ) diff --git a/harbour/tests/parexpr.prg b/harbour/tests/parexpr.prg index 4488f53741..d50745fd13 100644 --- a/harbour/tests/parexpr.prg +++ b/harbour/tests/parexpr.prg @@ -14,6 +14,7 @@ #endif PROCEDURE Main() + LOCAL x LOCAL y @@ -41,7 +42,7 @@ PROCEDURE Main() x := ( y := 10, y ) ? x - x := ( ( y := ( 1, 2, 3) ), y * ( 10, 20, 30 ) ) + x := ( ( y := ( 1, 2, 3 ) ), y * ( 10, 20, 30 ) ) ? x // Now mix with statements and functions diff --git a/harbour/tests/parseini.prg b/harbour/tests/parseini.prg index 515c626bf5..508857cb05 100644 --- a/harbour/tests/parseini.prg +++ b/harbour/tests/parseini.prg @@ -23,7 +23,7 @@ PROCEDURE Main( cName ) IF Empty( cName ) cName := "parseini.ini" - @nRow++ , 5 SAY "Using default parseini.ini file" + @ nRow++, 5 SAY "Using default parseini.ini file" ENDIF hIni := hb_iniRead( cName ) @@ -101,7 +101,7 @@ PROCEDURE Main( cName ) hIni[ "Added" ][ "NEW" ] := "new" ? "Writing output to parseini_out1.ini" - IF hb_IniWrite( "parseini_out1.ini", hIni,; + IF hb_iniWrite( "parseini_out1.ini", hIni,; "#Generated file without main auto section; don't touch", "#End of file",; .F. ) ? "File written" @@ -118,7 +118,7 @@ PROCEDURE Main( cName ) ? "WRITING INI TO A STRING" ? - cIni := hb_IniWriteStr( hIni ) + cIni := hb_iniWriteStr( hIni ) ? "Content of hIni : " ? @@ -133,7 +133,7 @@ PROCEDURE Main( cName ) ? "READING INI FILE FROM A STRING" ? - hIni := hb_IniReadStr( cIni,; /*default case*/ + hIni := hb_iniReadStr( cIni,; /*default case*/ ,; /*Default key indicators */ , .F. ) @@ -171,7 +171,7 @@ PROCEDURE Main( cName ) ? "WRITING INI FILE TO A STRING " ? - cIni := hb_IniWriteStr( hb_IniRead( cName ) ) + cIni := hb_iniWriteStr( hb_iniRead( cName ) ) ? "Content of " + cName ? diff --git a/harbour/tests/round.prg b/harbour/tests/round.prg index f828c429a2..08392affd0 100644 --- a/harbour/tests/round.prg +++ b/harbour/tests/round.prg @@ -13,11 +13,12 @@ PROCEDURE Main() LOCAL n, value := -5 FOR n := 1 TO 100 - ? value,; - Round( value, 3 ) ,; - Round( value, 2 ) ,; - Round( value, 1 ) ,; - Round( value, 0 ) + ? ; + value, ; + Round( value, 3 ),; + Round( value, 2 ),; + Round( value, 1 ),; + Round( value, 0 ) value += 0.001 NEXT diff --git a/harbour/tests/rto_get.prg b/harbour/tests/rto_get.prg index ce39fbf52b..e8ed267303 100644 --- a/harbour/tests/rto_get.prg +++ b/harbour/tests/rto_get.prg @@ -81,9 +81,7 @@ PROCEDURE Main( cArg01, cArg02, cArg03, cArg04 ) LOCAL cStr05 := "" LOCAL cStr06 := "" LOCAL cStr07 := "" -//#ifdef NULL LOCAL dDate01 -//#endif LOCAL bOldBlock LOCAL o diff --git a/harbour/tests/scroll.prg b/harbour/tests/scroll.prg index 86f007b08a..da0974f8e3 100644 --- a/harbour/tests/scroll.prg +++ b/harbour/tests/scroll.prg @@ -44,7 +44,7 @@ PROCEDURE Main() @ 13, 0 SAY "0 1 2 3 " Pause() - //save/restore test + // save/restore test cT := SaveScreen( 0, 0, 13, 31 ) RestScreen( 10, 40, 23, 71, cT ) pause() diff --git a/harbour/tests/sdf_test.prg b/harbour/tests/sdf_test.prg index 08e23496bb..600dacee6c 100644 --- a/harbour/tests/sdf_test.prg +++ b/harbour/tests/sdf_test.prg @@ -3,8 +3,8 @@ * $Id$ */ - // Test program for COPY TO SDF and APPEND FROM SDF - // Note: Only COPY TO SDF is fully implemented at this time... +// Test program for COPY TO SDF and APPEND FROM SDF +// Note: Only COPY TO SDF is fully implemented at this time... /* Harbour Project source code http://harbour-project.org/ Donated to the public domain on 2001-04-18 by David G. Holm @@ -40,7 +40,7 @@ PROCEDURE Main() // Copy the last 10 records again. GO BOTTOM SKIP -9 - COPY TO test6 SDF WHILE !EOF() + COPY TO test6 SDF WHILE !Eof() // Copy only some of the last 10 records. GO BOTTOM diff --git a/harbour/tests/server.prg b/harbour/tests/server.prg index c15292df52..5a39d97f0d 100644 --- a/harbour/tests/server.prg +++ b/harbour/tests/server.prg @@ -12,6 +12,7 @@ */ PROCEDURE Main( cPort ) + LOCAL Socket, s LOCAL nResponse, cResponse LOCAL nTurn := 0, nTurn1 := 0 @@ -80,7 +81,7 @@ PROCEDURE Main( cPort ) IF Lower( cResponse ) == "quit" bCont := .F. ENDIF - @ 8, 5 SAY space(70) + @ 8, 5 SAY Space( 70 ) @ 8, 5 SAY cResponse cResponse := "Count: " + Str( nResponse ) + " characters" + hb_eol() hb_inetSend( s, cResponse ) diff --git a/harbour/tests/set_test.prg b/harbour/tests/set_test.prg index 462332e473..a8a77ba95b 100644 --- a/harbour/tests/set_test.prg +++ b/harbour/tests/set_test.prg @@ -86,8 +86,9 @@ PROCEDURE Main() PROCEDURE testline( c, n ) - ? Str( n, 3 ) ,; - PadR( c, 20 ) ,; - Set( n ) + ? ; + Str( n, 3 ),; + PadR( c, 20 ),; + Set( n ) RETURN diff --git a/harbour/tests/setkeys.prg b/harbour/tests/setkeys.prg index 3d9a244e8d..83c299e5e3 100644 --- a/harbour/tests/setkeys.prg +++ b/harbour/tests/setkeys.prg @@ -75,10 +75,10 @@ PROCEDURE Main() SetKey( K_F10, {|| Alert( Transform( GetActive():varGet(), NIL ) ) }, ; {|| ! Empty( GetActive():VarGet() ) } ) /* :buffer */ - SetKey( K_F9 , {|| k := hb_SetKeySave( NIL ), ; + SetKey( K_F9, {|| k := hb_SetKeySave( NIL ), ; SetKey( K_F9, {|| hb_SetKeySave( k ) } ) } ) - SetKey( K_F8 , {|| SubMain() }, {|| F8Active } ) - SetKey( K_F7 , {|| F8Active := ! F8Active } ) + SetKey( K_F8, {|| SubMain() }, {|| F8Active } ) + SetKey( K_F7, {|| F8Active := ! F8Active } ) READ ? alpha, bravo, charlie diff --git a/harbour/tests/speed.prg b/harbour/tests/speed.prg index cff5196583..97a47e9baf 100644 --- a/harbour/tests/speed.prg +++ b/harbour/tests/speed.prg @@ -4,7 +4,7 @@ PROCEDURE Main() - LOCAL Program := { , }, Condition := 1, body := 2, Counter := 1, TheEnd := 1000000, stop, start + LOCAL Program := {, }, Condition := 1, body := 2, Counter := 1, TheEnd := 1000000, stop, start Program[ condition ] := {|| Counter == TheEnd } Program[ body ] := {|| Counter++ } diff --git a/harbour/tests/speedstr.prg b/harbour/tests/speedstr.prg index 9325feaa6b..128fc85ac6 100644 --- a/harbour/tests/speedstr.prg +++ b/harbour/tests/speedstr.prg @@ -14,64 +14,71 @@ #define N_LOOP 200000 #ifndef __XHARBOUR__ - #translate secondsCPU( => hb_secondsCPU( +# translate secondsCPU( => hb_secondsCPU( #endif #ifdef __XPP__ - #translate secondsCPU( => seconds( +# translate secondsCPU( => seconds( #endif #ifdef __HARBOUR__ -#include "hbclass.ch" +# include "hbclass.ch" +#else +# translate hb_BChar( => Chr( #endif -proc main() - memvar p - local i, t - local l, o - static s, s2[ 1 ] - private p +PROCEDURE Main() + + MEMVAR p + LOCAL i, t + LOCAL l, o + STATIC s, s2[ 1 ] + PRIVATE p + p := s2[ 1 ] := s := l := "" t := secondsCPU() - for i := 1 to N_LOOP - l += chr( i ) - next + FOR i := 1 TO N_LOOP + l += hb_BChar( i ) + NEXT t := secondsCPU() - t ? "LOCAL +=", t, "sec." t := secondsCPU() - for i := 1 to N_LOOP - s += chr( i ) - next + FOR i := 1 TO N_LOOP + s += hb_BChar( i ) + NEXT t := secondsCPU() - t ? "STATIC +=", t, "sec." t := secondsCPU() - for i := 1 to N_LOOP - s2[ 1 ] += chr( i ) - next + FOR i := 1 TO N_LOOP + s2[ 1 ] += hb_BChar( i ) + NEXT t := secondsCPU() - t ? "ARRAY[] +=", t, "sec." t := secondsCPU() - for i := 1 to N_LOOP - p += chr( i ) - next + FOR i := 1 TO N_LOOP + p += hb_BChar( i ) + NEXT t := secondsCPU() - t ? "PRIVATE +=", t, "sec." p := ""; s := "p" t := secondsCPU() - for i := 1 to N_LOOP - &s += chr( i ) - next + FOR i := 1 TO N_LOOP + &s += hb_BChar( i ) + NEXT t := secondsCPU() - t ? "MACRO +=", t, "sec." o := mycls():new(); o:v := "" t := secondsCPU() - for i := 1 to N_LOOP - o:v += chr( i ) - next + FOR i := 1 TO N_LOOP + o:v += hb_BChar( i ) + NEXT t := secondsCPU() - t ? "OBJECT:VAR +=", t, "sec." - wait -return + WAIT -class mycls - exported: - var v -endclass + RETURN + +CLASS mycls + + EXPORTED: + VAR v + +ENDCLASS diff --git a/harbour/tests/stripdoc.hb b/harbour/tests/stripdoc.hb index de66f22cbd..cf5b853069 100644 --- a/harbour/tests/stripdoc.hb +++ b/harbour/tests/stripdoc.hb @@ -13,6 +13,7 @@ #include "directry.ch" PROCEDURE Main() + LOCAL aFile FOR EACH aFile IN Directory( hb_osFileMask() ) diff --git a/harbour/tests/stripeol.hb b/harbour/tests/stripeol.hb index 482c7a2118..cd21a07639 100644 --- a/harbour/tests/stripeol.hb +++ b/harbour/tests/stripeol.hb @@ -13,6 +13,7 @@ #include "directry.ch" PROCEDURE Main( cMask ) + LOCAL aFile hb_default( @cMask, "*.txt" ) @@ -24,6 +25,7 @@ PROCEDURE Main( cMask ) RETURN FUNCTION __stripeol( cFile ) + LOCAL cOK := "" LOCAL cLine diff --git a/harbour/tests/usrrdd/exarr.prg b/harbour/tests/usrrdd/exarr.prg index 51340713db..ff9f8c0abe 100644 --- a/harbour/tests/usrrdd/exarr.prg +++ b/harbour/tests/usrrdd/exarr.prg @@ -65,9 +65,9 @@ PROCEDURE Main() ? "Create a new dbf in memory using dbCreate() command" aStruct := { ; - { "NAME" , "C", 40, 0 } , ; - { "ADDRESS" , "C", 40, 0 } , ; - { "BIRTHDAY" , "D", 8, 0 } , ; + { "NAME" , "C", 40, 0 }, ; + { "ADDRESS" , "C", 40, 0 }, ; + { "BIRTHDAY" , "D", 8, 0 }, ; { "AGE" , "N", 3, 0 } } #ifndef USE_DBCREATE_EXTENSIONS @@ -88,7 +88,7 @@ PROCEDURE Main() WAIT ? "ALIAS", Alias(), "RECNO", RecNo(), ; - "BOF", BOF(), "EOF", EOF(), "LASTREC", LastRec() + "BOF", Bof(), "EOF", Eof(), "LASTREC", LastRec() ? RecNo(), '"' + FIELD->NAME + '"' dbGoBottom() ? RecNo(), '"' + FIELD->NAME + '"' @@ -111,7 +111,7 @@ PROCEDURE Main() field->birthday := SToD( "19400101" ) field->age := 66 - WHILE !EOF() + WHILE !Eof() ? RecNo(), '"' + FIELD->NAME + '"' IF RecNo() == 20 Inkey( 0 ) @@ -119,13 +119,13 @@ PROCEDURE Main() dbSkip() ENDDO ? "ALIAS", Alias(), "RECNO", RecNo(), ; - "BOF", BOF(), "EOF", EOF(), "LASTREC", LastRec() + "BOF", Bof(), "EOF", Eof(), "LASTREC", LastRec() WAIT dbGoBottom() ? "ALIAS", Alias(), "RECNO", RecNo(), ; - "BOF", BOF(), "EOF", EOF(), "LASTREC", LastRec() + "BOF", Bof(), "EOF", Eof(), "LASTREC", LastRec() WAIT - WHILE !BOF() + WHILE !Bof() ? RecNo(), '[' + FIELD->NAME + ']' IF RecNo() == LastRec() - 20 Inkey( 0 ) @@ -133,7 +133,7 @@ PROCEDURE Main() dbSkip( -1 ) ENDDO ? "ALIAS", Alias(), "RECNO", RecNo(), ; - "BOF", BOF(), "EOF", EOF(), "LASTREC", LastRec() + "BOF", Bof(), "EOF", Eof(), "LASTREC", LastRec() WAIT ? "Show it - Please don't press any key except movement keys and ESC" diff --git a/harbour/tests/usrrdd/exfcm.prg b/harbour/tests/usrrdd/exfcm.prg index 1a0477c9b5..df2f2f185a 100644 --- a/harbour/tests/usrrdd/exfcm.prg +++ b/harbour/tests/usrrdd/exfcm.prg @@ -8,14 +8,14 @@ PROCEDURE Main() USE test.csv VIA "FCOMMA" ? "ALIAS", Alias(), "RECNO", RecNo(), ; - "BOF", BOF(), "EOF", EOF(), "LASTREC", LastRec() + "BOF", Bof(), "EOF", Eof(), "LASTREC", LastRec() ? RecNo(), '"' + FIELD->LINE + '"' dbGoBottom() ? RecNo(), '"' + FIELD->LINE + '"' dbGoTop() ? RecNo(), '"' + FIELD->LINE + '"' WAIT - DO WHILE !EOF() + DO WHILE !Eof() ? RecNo(), '"' + FIELD->LINE + '"' IF RecNo() == 20 Inkey( 0 ) @@ -23,13 +23,13 @@ PROCEDURE Main() dbSkip() ENDDO ? "ALIAS", Alias(), "RECNO", RecNo(), ; - "BOF", BOF(), "EOF", EOF(), "LASTREC", LastRec() + "BOF", Bof(), "EOF", Eof(), "LASTREC", LastRec() WAIT dbGoBottom() ? "ALIAS", Alias(), "RECNO", RecNo(), ; - "BOF", BOF(), "EOF", EOF(), "LASTREC", LastRec() + "BOF", Bof(), "EOF", Eof(), "LASTREC", LastRec() WAIT - DO WHILE !BOF() + DO WHILE !Bof() ? RecNo(), '[' + FIELD->LINE + ']' IF RecNo() == LastRec() - 20 Inkey( 0 ) @@ -37,7 +37,7 @@ PROCEDURE Main() dbSkip( -1 ) ENDDO ? "ALIAS", Alias(), "RECNO", RecNo(), ; - "BOF", BOF(), "EOF", EOF(), "LASTREC", LastRec() + "BOF", Bof(), "EOF", Eof(), "LASTREC", LastRec() WAIT Browse() diff --git a/harbour/tests/usrrdd/exlog.prg b/harbour/tests/usrrdd/exlog.prg index 24b15aef85..220c96ee2e 100644 --- a/harbour/tests/usrrdd/exlog.prg +++ b/harbour/tests/usrrdd/exlog.prg @@ -28,10 +28,10 @@ PROCEDURE Main() hb_LogRddActive( .T. ) // Uncomment next command to change logged string that I have to return to standard LOGRDD file -// hb_LogRddMsgLogBlock( {| cTag, cRDDName, cCmd, nWA, xPar1, xPar2, xPar3 | MyToString( cTag, cRDDName, cCmd, nWA, xPar1, xPar2, xPar3 ) } ) + // hb_LogRddMsgLogBlock( {| cTag, cRDDName, cCmd, nWA, xPar1, xPar2, xPar3 | MyToString( cTag, cRDDName, cCmd, nWA, xPar1, xPar2, xPar3 ) } ) // Uncomment next command to change standard destination of my logged string -// hb_LogRddUserLogBlock( {| cTag, cRDDName, cCmd, nWA, xPar1, xPar2, xPar3 | hb_toOutDebug( MyToString( cTag, cRDDName, cCmd, nWA, xPar1, xPar2, xPar3 ) + "\n\r" ) } ) + // hb_LogRddUserLogBlock( {| cTag, cRDDName, cCmd, nWA, xPar1, xPar2, xPar3 | hb_toOutDebug( MyToString( cTag, cRDDName, cCmd, nWA, xPar1, xPar2, xPar3 ) + "\n\r" ) } ) // Start program logic @@ -65,7 +65,7 @@ STATIC FUNCTION MyToString( cCmd, nWA, xPar1, xPar2, xPar3 ) // In this example I don't want to log Open Command CASE cCmd == "CLOSE" // Parameters received: xPar1 = cTableName, xPar2 = cAlias - //cString := 'Table : "' + xPar1 + '", Alias : "' + xPar2 + '", WorkArea : ' + hb_ntos( nWA ) + // cString := 'Table : "' + xPar1 + '", Alias : "' + xPar2 + '", WorkArea : ' + hb_ntos( nWA ) // In this example I don't want to log Close Command CASE cCmd == "APPEND" // Parameters received: xPar1 = lUnlockAll diff --git a/harbour/tests/vmasort.prg b/harbour/tests/vmasort.prg index f5703f6f4b..7a1742530b 100644 --- a/harbour/tests/vmasort.prg +++ b/harbour/tests/vmasort.prg @@ -17,16 +17,17 @@ PROCEDURE Main( nPass ) nPass := Val( nPass ) ENDIF - ? "Testing aSort with " + hb_ntos( nPass ) + " loops." + ? "Testing ASort() with " + hb_ntos( nPass ) + " loops." ? aTest := aMkArray( nPass ) aOrig := AClone( aTest ) SET DATE ANSI + SET CENTURY ON ? "Original.....:", aDump( aOrig ) - ? "Asort.c......:", aDump( ASort( aTest ) ) -// ? "Asort.c.block:", aDump( aSort( aTest, , , {| x, y | x < y } ) ) + ? "asort.c......:", aDump( ASort( aTest ) ) +// ? "asort.c.block:", aDump( ASort( aTest,,, {| x, y | x < y } ) ) RETURN diff --git a/harbour/tests/wcecon.prg b/harbour/tests/wcecon.prg index 30ab6520c4..0c7053d599 100644 --- a/harbour/tests/wcecon.prg +++ b/harbour/tests/wcecon.prg @@ -60,12 +60,13 @@ proc main() Alert( "Database path:;;" + cPath ) rddSetDefault("DBFCDX") - if !hb_dirExists( cPath ) + if ! hb_dirExists( cPath ) hb_dirCreate( cPath ) endif - dbCreate( cPath + "mydata", { { "F1", "C", 10, 0 }, ; - { "F2", "=", 8, 0 }, ; - { "FX", "M", 4, 0 } } ) + dbCreate( cPath + "mydata", { ; + { "F1", "C", 10, 0 }, ; + { "F2", "=", 8, 0 }, ; + { "FX", "M", 4, 0 } } ) use ( cPath + "mydata" ) index on F1 tag T1 index on F2 tag T2 diff --git a/harbour/tests/wvt_fs.prg b/harbour/tests/wvt_fs.prg index 81d07adde6..20b92540de 100644 --- a/harbour/tests/wvt_fs.prg +++ b/harbour/tests/wvt_fs.prg @@ -6,26 +6,28 @@ #include "inkey.ch" PROCEDURE Main() - LOCAL cGt -#if defined( __PLATFORM__WINDOWS ) .AND. defined( __HBSCRIPT__HBSHELL ) - hbshell_gtSelect( "GTWVT" ) +#if defined( __HBSCRIPT__HBSHELL ) + #if defined( __PLATFORM__WINDOWS ) + hbshell_gtSelect( "GTWVT" ) + #elif defined( __PLATFORM__UNIX ) + hbshell_gtSelect( "GTXWC" ) + #endif #endif - cGt := HB_GtVersion( 0 ) - IF cGt == "WVT" - HB_GtInfo( HB_GTI_FONTNAME, "Lucida Console" ) + IF hb_gtInfo( HB_GTI_ISGRAPHIC ) + hb_gtInfo( HB_GTI_FONTNAME, "Lucida Console" ) ELSE - ? "launch me under GTWVT" + ? "launch me under a graphical GT" QUIT ENDIF - ? "GTWVT test" + ? "GT" + hb_gtVersion( 0 ) + " test" - ? HB_GtInfo( HB_GTI_ISFULLSCREEN, .T. ), "we should be on full screen" + ? hb_gtInfo( HB_GTI_ISFULLSCREEN, .T. ), "we should be on full screen" WAIT - ? HB_GtInfo( HB_GTI_ISFULLSCREEN, .F. ), "we should be windowed" - ? HB_GtInfo( HB_GTI_ALTENTER, .T. ), "Alt+Enter is now enabled, try it" + ? hb_gtInfo( HB_GTI_ISFULLSCREEN, .F. ), "we should be windowed" + ? hb_gtInfo( HB_GTI_ALTENTER, .T. ), "Alt+Enter is now enabled, try it" DO WHILE Inkey( 0 ) != K_ESC ? Row() ENDDO diff --git a/harbour/tests/wvtext.prg b/harbour/tests/wvtext.prg index ce6d451a57..d1232c652c 100644 --- a/harbour/tests/wvtext.prg +++ b/harbour/tests/wvtext.prg @@ -30,8 +30,12 @@ PROCEDURE Main() LOCAL nMSec -#if defined( __PLATFORM__WINDOWS ) .AND. defined( __HBSCRIPT__HBSHELL ) - hbshell_gtSelect( "GTWVT" ) +#if defined( __HBSCRIPT__HBSHELL ) + #if defined( __PLATFORM__WINDOWS ) + hbshell_gtSelect( "GTWVT" ) + #elif defined( __PLATFORM__UNIX ) + hbshell_gtSelect( "GTXWC" ) + #endif #endif AFill( aKeys, 0 ) @@ -39,7 +43,7 @@ PROCEDURE Main() hb_gtInfo( HB_GTI_FONTNAME , "Lucida Console" ) hb_gtInfo( HB_GTI_FONTWIDTH, nWidth ) hb_gtInfo( HB_GTI_FONTSIZE , nHeight ) - hb_gtInfo( HB_GTI_WINTITLE , "GTWVT-Test (Resizable by Font)" ) + hb_gtInfo( HB_GTI_WINTITLE , "GT-Test (Resizable by Font)" ) hb_gtInfo( HB_GTI_ALTENTER, .T. ) // allow alt-enter for full screen SetCursor( SC_NONE ) @@ -221,7 +225,7 @@ PROCEDURE Main() CASE nKey == K_F9 hb_gtInfo( HB_GTI_RESIZEMODE, iif( hb_gtInfo( HB_GTI_RESIZEMODE ) == HB_GTI_RESIZEMODE_ROWS, HB_GTI_RESIZEMODE_FONT, HB_GTI_RESIZEMODE_ROWS ) ) - hb_gtInfo( HB_GTI_WINTITLE , "GTWVT-Test (Resizable by " + iif( hb_gtInfo( HB_GTI_RESIZEMODE ) == HB_GTI_RESIZEMODE_ROWS, "ROWS", "FONT" ) + ")" ) + hb_gtInfo( HB_GTI_WINTITLE , "GT-Test (Resizable by " + iif( hb_gtInfo( HB_GTI_RESIZEMODE ) == HB_GTI_RESIZEMODE_ROWS, "ROWS", "FONT" ) + ")" ) DispScreen() CASE nKey == K_F10 @@ -393,7 +397,7 @@ PROCEDURE thFunc() s_nZy += 20 /* allocate own GT driver */ - hb_gtReload( "WVT" ) + hb_gtReload( hb_gtVersion( 0 ) ) hb_gtInfo( HB_GTI_PALETTE, 8, RGB( 120, 200, 240 ) ) IF ( s_nBrowser % 2 ) != 0 diff --git a/harbour/utils/hbi18n/hbi18n.prg b/harbour/utils/hbi18n/hbi18n.prg index ddc599c511..609b30bd71 100644 --- a/harbour/utils/hbi18n/hbi18n.prg +++ b/harbour/utils/hbi18n/hbi18n.prg @@ -63,13 +63,14 @@ ANNOUNCE HB_GTSYS REQUEST HB_GT_CGI_DEFAULT PROCEDURE Main( ... ) + LOCAL aParams, aFiles LOCAL cFileOut, cFileIn, cExt LOCAL lError, lEmpty, lQuiet LOCAL nMode, n - LOCAL param + LOCAL cParam - aParams := hb_aParams() + aParams := hb_AParams() IF Empty( aParams ) Syntax() ENDIF @@ -79,36 +80,36 @@ PROCEDURE Main( ... ) nMode := 0 FOR n := 1 TO Len( aParams ) IF LEFTEQUAL( aParams[ n ], "-" ) - param := SubStr( aParams[ n ], 2 ) - IF param == "m" + cParam := SubStr( aParams[ n ], 2 ) + IF cParam == "m" IF nMode != 0 lError := .T. ELSE nMode := _HB_I18N_MERGE ENDIF - ELSEIF param == "g" + ELSEIF cParam == "g" IF nMode != 0 lError := .T. ELSE nMode := _HB_I18N_GENHBL ENDIF - ELSEIF param == "a" + ELSEIF cParam == "a" IF nMode != 0 lError := .T. ELSE nMode := _HB_I18N_TRANS ENDIF - ELSEIF LEFTEQUAL( param, "o" ) - IF !Empty( param := SubStr( param, 2 ) ) - cFileOut := param + ELSEIF LEFTEQUAL( cParam, "o" ) + IF ! Empty( cParam := SubStr( cParam, 2 ) ) + cFileOut := cParam ELSEIF n < Len( aParams ) .AND. ! LEFTEQUAL( aParams[ n + 1 ], "-" ) cFileOut := aParams[ ++n ] ELSE lError := .T. ENDIF - ELSEIF param == "e" + ELSEIF cParam == "e" lEmpty := .T. - ELSEIF param == "q" + ELSEIF cParam == "q" lQuiet := .T. ELSE lError := .T. @@ -126,9 +127,9 @@ PROCEDURE Main( ... ) IF nMode == _HB_I18N_TRANS FOR n := 1 TO Len( aFiles ) hb_FNameSplit( aFiles[ n ],,, @cExt ) - IF !Lower( cExt ) == ".hbl" + IF ! Lower( cExt ) == ".hbl" cFileIn := aFiles[ n ] - HB_ADel( aFiles, n, .T. ) + hb_ADel( aFiles, n, .T. ) EXIT ENDIF NEXT @@ -139,7 +140,7 @@ PROCEDURE Main( ... ) Syntax() ENDIF - IF !lQuiet + IF ! lQuiet Logo() ENDIF @@ -153,34 +154,36 @@ PROCEDURE Main( ... ) RETURN - STATIC FUNCTION HBRawVersion() + RETURN StrTran( Version(), "Harbour " ) STATIC PROCEDURE Logo() - OutStd( "Harbour i18n .pot/.hbl file manager " + HBRawVersion() + hb_eol() +; - "Copyright (c) 2009-2012, Przemyslaw Czerpak" + hb_eol() + ; - "http://harbour-project.org/" + hb_eol() +; - hb_eol() ) - RETURN + OutStd( ; + "Harbour i18n .pot/.hbl file manager " + HBRawVersion() + hb_eol() + ; + "Copyright (c) 2009-2012, Przemyslaw Czerpak" + hb_eol() + ; + "http://harbour-project.org/" + hb_eol() + ; + hb_eol() ) + RETURN STATIC PROCEDURE Syntax() Logo() - OutStd( "Syntax: hbi18n -m | -g | -a [-o] [-e] [-q] " + hb_eol() + ; - hb_eol() + ; - " -m merge given .pot files" + hb_eol() + ; - " -g generate .hbl file from given .pot files" + hb_eol() + ; - " -a add automatic translations to 1-st .pot file using" + hb_eol() + ; - " translations from other .pot or .hbl files" + hb_eol() + ; - " -o output file name" + hb_eol() + ; - " default is first .pot file name with" + hb_eol() + ; - " .po (merge) or .hbl extension" + hb_eol() + ; - " -e do not strip empty translation rules from .hbl files" + hb_eol() + ; - " -q quiet mode" + hb_eol() + ; - hb_eol() ) + OutStd( ; + "Syntax: hbi18n -m | -g | -a [-o] [-e] [-q] " + hb_eol() + ; + hb_eol() + ; + " -m merge given .pot files" + hb_eol() + ; + " -g generate .hbl file from given .pot files" + hb_eol() + ; + " -a add automatic translations to 1-st .pot file using" + hb_eol() + ; + " translations from other .pot or .hbl files" + hb_eol() + ; + " -o output file name" + hb_eol() + ; + " default is first .pot file name with" + hb_eol() + ; + " .po (merge) or .hbl extension" + hb_eol() + ; + " -e do not strip empty translation rules from .hbl files" + hb_eol() + ; + " -q quiet mode" + hb_eol() + ; + hb_eol() ) IF hb_gtInfo( HB_GTI_ISGRAPHIC ) OutStd( "Press any key to continue..." ) @@ -189,7 +192,6 @@ STATIC PROCEDURE Syntax() ErrorLevel( 1 ) QUIT - STATIC PROCEDURE ErrorMsg( cErrorMsg ) OutStd( "error: " + StrTran( cErrorMsg, ";", hb_eol() ) + hb_eol() ) @@ -201,23 +203,25 @@ STATIC PROCEDURE ErrorMsg( cErrorMsg ) ErrorLevel( 1 ) QUIT - STATIC FUNCTION FileExt( cFile, cDefExt, lForce ) + LOCAL cPath, cName, cExt hb_FNameSplit( cFile, @cPath, @cName, @cExt ) IF lForce .OR. Empty( cExt ) cFile := hb_FNameMerge( cPath, cName, cDefExt ) ENDIF - RETURN cFile + RETURN cFile STATIC FUNCTION ExpandWildCards( aFiles ) /* do not expand wild cards in environments where SHELL already does it. * In *nixes it's possible that file name will contains "*" or "?". */ + #ifndef __PLATFORM__UNIX + LOCAL cFile, cRealFile LOCAL aRealFiles LOCAL lWild @@ -247,27 +251,28 @@ STATIC FUNCTION ExpandWildCards( aFiles ) RETURN aFiles STATIC FUNCTION LoadFiles( aFiles ) + LOCAL aTrans, aTrans2 LOCAL hIndex LOCAL cErrorMsg LOCAL n - aTrans := __I18N_potArrayLoad( aFiles[ 1 ], @cErrorMsg ) + aTrans := __i18n_potArrayLoad( aFiles[ 1 ], @cErrorMsg ) IF aTrans == NIL ErrorMsg( cErrorMsg ) ENDIF FOR n := 2 TO Len( aFiles ) - aTrans2 := __I18N_potArrayLoad( aFiles[ n ], @cErrorMsg ) + aTrans2 := __i18n_potArrayLoad( aFiles[ n ], @cErrorMsg ) IF aTrans2 == NIL ErrorMsg( cErrorMsg ) ENDIF - __I18N_potArrayJoin( aTrans, aTrans2, @hIndex ) + __i18n_potArrayJoin( aTrans, aTrans2, @hIndex ) NEXT RETURN aTrans - STATIC FUNCTION LoadFilesAsHash( aFiles ) + LOCAL cTrans, cExt, cErrorMsg LOCAL hTrans LOCAL aTrans @@ -276,28 +281,28 @@ STATIC FUNCTION LoadFilesAsHash( aFiles ) FOR n := 1 TO Len( aFiles ) hb_FNameSplit( aFiles[ n ],,, @cExt ) IF Lower( cExt ) == ".hbl" - cTrans := hb_memoRead( aFiles[ n ] ) - IF !HB_I18N_Check( cTrans ) + cTrans := hb_MemoRead( aFiles[ n ] ) + IF ! hb_i18n_Check( cTrans ) ErrorMsg( "Wrong file format: " + aFiles[ n ] ) ENDIF IF hTrans == NIL - hTrans := __I18N_hashTable( HB_I18N_RestoreTable( cTrans ) ) + hTrans := __i18n_hashTable( hb_i18n_RestoreTable( cTrans ) ) ELSE - __I18N_hashJoin( hTrans, __I18N_hashTable( HB_I18N_RestoreTable( cTrans ) ) ) + __i18n_hashJoin( hTrans, __i18n_hashTable( hb_i18n_RestoreTable( cTrans ) ) ) ENDIF ELSE - aTrans := __I18N_potArrayLoad( aFiles[ n ], @cErrorMsg ) + aTrans := __i18n_potArrayLoad( aFiles[ n ], @cErrorMsg ) IF aTrans == NIL ErrorMsg( cErrorMsg ) ENDIF - hTrans := __I18N_potArrayToHash( aTrans,, hTrans ) + hTrans := __i18n_potArrayToHash( aTrans,, hTrans ) ENDIF NEXT RETURN hTrans - STATIC PROCEDURE Merge( aFiles, cFileOut ) + LOCAL cErrorMsg IF Empty( cFileOut ) @@ -306,14 +311,14 @@ STATIC PROCEDURE Merge( aFiles, cFileOut ) cFileOut := FileExt( cFileOut, ".po", .F. ) ENDIF - IF !__I18N_potArraySave( cFileOut, LoadFiles( aFiles ), @cErrorMsg ) + IF ! __i18n_potArraySave( cFileOut, LoadFiles( aFiles ), @cErrorMsg ) ErrorMsg( cErrorMsg ) ENDIF RETURN - STATIC PROCEDURE GenHBL( aFiles, cFileOut, lEmpty ) + LOCAL cHBLBody LOCAL pI18N @@ -323,17 +328,17 @@ STATIC PROCEDURE GenHBL( aFiles, cFileOut, lEmpty ) cFileOut := FileExt( cFileOut, ".hbl", .F. ) ENDIF - pI18N := __I18N_hashTable( __I18N_potArrayToHash( LoadFiles( aFiles ), ; - lEmpty ) ) - cHBLBody := HB_I18N_SaveTable( pI18N ) - IF !hb_memoWrit( cFileOut, cHBLBody ) + pI18N := __i18n_hashTable( __i18n_potArrayToHash( LoadFiles( aFiles ), ; + lEmpty ) ) + cHBLBody := hb_i18n_SaveTable( pI18N ) + IF ! hb_MemoWrit( cFileOut, cHBLBody ) ErrorMsg( "cannot create file: " + cFileOut ) ENDIF RETURN - STATIC PROCEDURE AutoTrans( cFileIn, aFiles, cFileOut ) + LOCAL cErrorMsg IF Empty( cFileOut ) @@ -342,9 +347,9 @@ STATIC PROCEDURE AutoTrans( cFileIn, aFiles, cFileOut ) cFileOut := FileExt( cFileOut, ".po", .F. ) ENDIF - IF !__I18N_potArraySave( cFileOut, ; - __I18N_potArrayTrans( LoadFiles( { cFileIn } ), ; - LoadFilesAsHash( aFiles ) ), @cErrorMsg ) + IF ! __i18n_potArraySave( cFileOut, ; + __i18n_potArrayTrans( LoadFiles( { cFileIn } ), ; + LoadFilesAsHash( aFiles ) ), @cErrorMsg ) ErrorMsg( cErrorMsg ) ENDIF diff --git a/harbour/utils/hbmk2/examples/plug_bis.hb b/harbour/utils/hbmk2/examples/plug_bis.hb index 733dba2624..62c99b0779 100644 --- a/harbour/utils/hbmk2/examples/plug_bis.hb +++ b/harbour/utils/hbmk2/examples/plug_bis.hb @@ -34,6 +34,7 @@ #if defined( __HBSCRIPT__HBMK_PLUGIN ) FUNCTION hbmk_plugin_bison( hbmk ) + LOCAL cRetVal := "" LOCAL cSrc @@ -107,19 +108,20 @@ FUNCTION hbmk_plugin_bison( hbmk ) FOR EACH cSrc, cDst IN hbmk[ "vars" ][ "aBIS_Src" ], hbmk[ "vars" ][ "aBIS_Dst" ] IF hbmk[ "lINC" ] .AND. ! hbmk[ "lREBUILD" ] - lBuildIt := ! hb_FGetDateTime( cDst, @tDst ) .OR. ; - ! hb_FGetDateTime( cSrc, @tSrc ) .OR. ; - tSrc > tDst + lBuildIt := ; + ! hb_FGetDateTime( cDst, @tDst ) .OR. ; + ! hb_FGetDateTime( cSrc, @tSrc ) .OR. ; + tSrc > tDst ELSE lBuildIt := .T. ENDIF IF lBuildIt - cCommand := hbmk[ "vars" ][ "cBIS_BIN" ] +; - " -d -p hb_comp" +; - " -o " + hbmk_FNameEscape( hbmk_PathSepToTarget( hbmk, cDst ), hbmk[ "nCmd_Esc" ], hbmk[ "nCmd_FNF" ] ) +; - " " + hbmk_FNameEscape( hbmk_PathSepToTarget( hbmk, cSrc ), hbmk[ "nCmd_Esc" ], hbmk[ "nCmd_FNF" ] ) + cCommand := hbmk[ "vars" ][ "cBIS_BIN" ] + ; + " -d -p hb_comp" + ; + " -o " + hbmk_FNameEscape( hbmk_PathSepToTarget( hbmk, cDst ), hbmk[ "nCmd_Esc" ], hbmk[ "nCmd_FNF" ] ) + ; + " " + hbmk_FNameEscape( hbmk_PathSepToTarget( hbmk, cSrc ), hbmk[ "nCmd_Esc" ], hbmk[ "nCmd_FNF" ] ) IF hbmk[ "lTRACE" ] IF ! hbmk[ "lQUIET" ] @@ -148,8 +150,9 @@ FUNCTION hbmk_plugin_bison( hbmk ) CASE "post_all" IF ! hbmk[ "lINC" ] .OR. hbmk[ "lCLEAN" ] - AEval( hbmk[ "vars" ][ "aBIS_Dst" ], {| tmp | FErase( tmp ),; - FErase( HB_FNameExtSet( tmp, ".h" ) ) } ) + AEval( hbmk[ "vars" ][ "aBIS_Dst" ], {| tmp | ; + FErase( tmp ), ; + FErase( hb_FNameExtSet( tmp, ".h" ) ) } ) ENDIF EXIT @@ -159,6 +162,7 @@ FUNCTION hbmk_plugin_bison( hbmk ) RETURN cRetVal STATIC FUNCTION tool_detect( hbmk, cName ) + LOCAL cBIN LOCAL aEnvList := { "HB_BISONPATH" } @@ -182,7 +186,9 @@ STATIC FUNCTION tool_detect( hbmk, cName ) #else PROCEDURE Main() + ? "Cannot be run in standalone mode. Use it with -plugin= option of hbmk2." + RETURN #endif diff --git a/harbour/utils/hbmk2/examples/plug_tpl.hb b/harbour/utils/hbmk2/examples/plug_tpl.hb index 916cf05235..57548f0e01 100644 --- a/harbour/utils/hbmk2/examples/plug_tpl.hb +++ b/harbour/utils/hbmk2/examples/plug_tpl.hb @@ -34,6 +34,7 @@ #if defined( __HBSCRIPT__HBMK_PLUGIN ) FUNCTION hbmk_plugin_tpl( hbmk ) + LOCAL tmp IF hbmk[ "lTRACE" ] @@ -63,7 +64,9 @@ FUNCTION hbmk_plugin_tpl( hbmk ) #else PROCEDURE Main() + ? "Cannot be run in standalone mode. Use it with -plugin= option of hbmk2." + RETURN #endif diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 5f7474ee07..5b0fecbfe2 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -158,6 +158,9 @@ EXTERNAL HB_GT_CGI_DEFAULT EXTERNAL HB_GT_OS2 #elif defined( __PLATFORM__UNIX ) .AND. ! defined( __PLATFORM__VXWORKS ) .AND. ! defined( __PLATFORM__SYMBIAN ) EXTERNAL HB_GT_TRM + #if defined( HBMK_WITH_GTXWC ) + EXTERNAL HB_GT_XWC + #endif #endif #endif /* _HBMK_EMBEDDED_ */ @@ -576,6 +579,7 @@ STATIC s_lWasLoad := .F. STATIC s_lInteractive := .T. PROCEDURE _APPMAIN( ... ) + LOCAL aArgsProc LOCAL nResult LOCAL tmp, tmp1 @@ -801,6 +805,7 @@ STATIC PROCEDURE hbmk_COMP_Setup( cARCH, cCOMP, cBasePath ) #endif STATIC FUNCTION hbmk_new() + LOCAL hbmk[ _HBMK_MAX_ ] hbmk[ _HBMK_cBUILD ] := "" @@ -953,6 +958,7 @@ STATIC PROCEDURE hbmk_init_stage2( hbmk ) RETURN STATIC FUNCTION hbmk_harbour_dirlayout_detect( hbmk, /* @ */ l_cHB_INSTALL_PREFIX, lIgnoreEnvVar ) + LOCAL tmp hbmk[ _HBMK_cHB_INSTALL_LI3 ] := "" @@ -1014,6 +1020,7 @@ STATIC FUNCTION hbmk_harbour_dirlayout_detect( hbmk, /* @ */ l_cHB_INSTALL_PREFI /* This stage needs COMP and PLAT to be filled */ STATIC PROCEDURE hbmk_harbour_dirlayout_init( hbmk, l_cHB_INSTALL_PREFIX ) + LOCAL tmp LOCAL lDOSWinTokens @@ -1308,7 +1315,7 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) LOCAL aThreads LOCAL thread - LOCAL nStart := hb_milliSeconds() + LOCAL nStart := hb_MilliSeconds() LOCAL lDoSupportDetection LOCAL lDeleteWorkDir := .F. @@ -1565,19 +1572,19 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) ENDIF hbmk[ _HBMK_aLIB_BASE_WARN ] := ArrayAJoin( {; - aLIB_BASE_EXTERN ,; - aLIB_BASE_DEBUG ,; - aLIB_BASE_1 ,; - aLIB_BASE_1_MT ,; - aLIB_BASE_2 ,; - aLIB_BASE_2_MT ,; - aLIB_BASE_NULRDD ,; - aLIB_BASE_RDD ,; - aLIB_BASE_RDD_MT ,; - aLIB_BASE_CPLR ,; - aLIB_BASE_3 ,; - aLIB_BASE_3_MT ,; - { cLIB_BASE_PCRE } ,; + aLIB_BASE_EXTERN , ; + aLIB_BASE_DEBUG , ; + aLIB_BASE_1 , ; + aLIB_BASE_1_MT , ; + aLIB_BASE_2 , ; + aLIB_BASE_2_MT , ; + aLIB_BASE_NULRDD , ; + aLIB_BASE_RDD , ; + aLIB_BASE_RDD_MT , ; + aLIB_BASE_CPLR , ; + aLIB_BASE_3 , ; + aLIB_BASE_3_MT , ; + { cLIB_BASE_PCRE } , ; { cLIB_BASE_ZLIB } } ) hbmk[ _HBMK_nCOMPVer ] := Val( GetEnv( "HB_COMPILER_VER" ) ) /* Format: <15><00>[.<00>] = [.] */ @@ -1691,7 +1698,7 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) CASE hbmk[ _HBMK_cPLAT ] == "dos" #if ! defined( __PLATFORM__UNIX ) aCOMPDET := { ; - { {|| FindInPath( "gcc" ) }, "djgpp" },; + { {|| FindInPath( "gcc" ) }, "djgpp" }, ; { {|| FindInPath( "wcc386" ) }, "watcom" } } #endif aCOMPSUP := { "djgpp", "gcc", "watcom" } @@ -1704,7 +1711,7 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) CASE hbmk[ _HBMK_cPLAT ] == "os2" #if ! defined( __PLATFORM__UNIX ) aCOMPDET := { ; - { {|| FindInPath( "gcc" ) }, "gcc" },; + { {|| FindInPath( "gcc" ) }, "gcc" }, ; { {|| FindInPath( "wcc386" ) }, "watcom" } } #endif aCOMPSUP := { "gcc", "gccomf", "watcom" } @@ -1719,35 +1726,35 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) watcom also keeps a cl.exe in its binary dir. */ #if ! defined( __PLATFORM__UNIX ) aCOMPDET := { ; - { {|| FindInPath( "arm-mingw32ce-gcc" ) }, "mingwarm", "arm-mingw32ce-",, "wce" } ,; - { {|| FindInPath( "arm-wince-mingw32ce-gcc" ) }, "mingwarm", "arm-wince-mingw32ce-",, "wce" } ,; - { {|| FindInSamePath( "cygstart.exe", "gcc" ) }, "gcc",,, "cygwin" },; - { {|| FindInPath( "gcc-dw2" ) }, "mingw", "", "-dw2" },; /* tdragon DWARF-2 build */ - { {|| FindInPath( "x86_64-pc-mingw32-gcc" ) }, "mingw64" },; /* Equation Solution build */ - { {|| FindInPath( "i686-w64-mingw32-gcc" ) }, "mingw64", "i686-w64-mingw32-" },; /* mingw-w64 build */ - { {|| FindInSamePath( "x86_64-w64-mingw32-gcc.exe", "gcc" ) }, "mingw64" },; /* mingw-w64 TDM build */ - { {|| FindInPath( "x86_64-w64-mingw32-gcc" ) }, "mingw64", "x86_64-w64-mingw32-" },; /* mingw-w64 build */ - { {|| FindInPath( hbmk[ _HBMK_cCCPREFIX ] + "gcc" + hbmk[ _HBMK_cCCPOSTFIX ] ) }, "mingw" },; - { {|| iif( Empty( GetEnv( "WATCOM" ) ),; - NIL ,; - FindInPath( "wcc386" ) ) }, "watcom" },; - { {|| FindInPath( "clarm.exe" ) }, "msvcarm" },; - { {|| FindInPath( "armasm.exe" ) }, "msvcarm" },; - { {|| FindInPath( "ml64.exe" ) }, "msvc64" },; - { {|| FindInPath( "ias.exe" ) }, "msvcia64" },; - { {|| iif( FindInPath( "wcc386" ) == NIL,; - FindInPath( "cl.exe" ),; - NIL ) }, "msvc" },; - { {|| _BCC_BIN_DETECT() }, "bcc" },; - { {|| iif( FindInPath( "dbgeng.lib", GetEnv( "LIB" ) ) != NIL .AND. ( tmp1 := FindInPath( "pocc.exe" ) ) != NIL, tmp1, NIL ) }, "pocc64" },; - { {|| FindInPath( "pocc.exe" ) }, "pocc" },; - { {|| iif( ( tmp1 := FindInPath( "icl.exe" ) ) != NIL .AND. "itanium" $ Lower( tmp1 ), tmp1, NIL ) }, "iccia64" },; - { {|| FindInPath( "icl.exe" ) }, "icc" },; - { {|| FindInPath( "xCC.exe" ) }, "xcc" },; + { {|| FindInPath( "arm-mingw32ce-gcc" ) }, "mingwarm", "arm-mingw32ce-",, "wce" } , ; + { {|| FindInPath( "arm-wince-mingw32ce-gcc" ) }, "mingwarm", "arm-wince-mingw32ce-",, "wce" } , ; + { {|| FindInSamePath( "cygstart.exe", "gcc" ) }, "gcc",,, "cygwin" }, ; + { {|| FindInPath( "gcc-dw2" ) }, "mingw", "", "-dw2" }, ; /* tdragon DWARF-2 build */ + { {|| FindInPath( "x86_64-pc-mingw32-gcc" ) }, "mingw64" }, ; /* Equation Solution build */ + { {|| FindInPath( "i686-w64-mingw32-gcc" ) }, "mingw64", "i686-w64-mingw32-" }, ; /* mingw-w64 build */ + { {|| FindInSamePath( "x86_64-w64-mingw32-gcc.exe", "gcc" ) }, "mingw64" }, ; /* mingw-w64 TDM build */ + { {|| FindInPath( "x86_64-w64-mingw32-gcc" ) }, "mingw64", "x86_64-w64-mingw32-" }, ; /* mingw-w64 build */ + { {|| FindInPath( hbmk[ _HBMK_cCCPREFIX ] + "gcc" + hbmk[ _HBMK_cCCPOSTFIX ] ) }, "mingw" }, ; + { {|| iif( Empty( GetEnv( "WATCOM" ) ), ; + NIL , ; + FindInPath( "wcc386" ) ) }, "watcom" }, ; + { {|| FindInPath( "clarm.exe" ) }, "msvcarm" }, ; + { {|| FindInPath( "armasm.exe" ) }, "msvcarm" }, ; + { {|| FindInPath( "ml64.exe" ) }, "msvc64" }, ; + { {|| FindInPath( "ias.exe" ) }, "msvcia64" }, ; + { {|| iif( FindInPath( "wcc386" ) == NIL, ; + FindInPath( "cl.exe" ), ; + NIL ) }, "msvc" }, ; + { {|| _BCC_BIN_DETECT() }, "bcc" }, ; + { {|| iif( FindInPath( "dbgeng.lib", GetEnv( "LIB" ) ) != NIL .AND. ( tmp1 := FindInPath( "pocc.exe" ) ) != NIL, tmp1, NIL ) }, "pocc64" }, ; + { {|| FindInPath( "pocc.exe" ) }, "pocc" }, ; + { {|| iif( ( tmp1 := FindInPath( "icl.exe" ) ) != NIL .AND. "itanium" $ Lower( tmp1 ), tmp1, NIL ) }, "iccia64" }, ; + { {|| FindInPath( "icl.exe" ) }, "icc" }, ; + { {|| FindInPath( "xCC.exe" ) }, "xcc" }, ; { {|| FindInPath( "dmc.exe" ) }, "dmc" }} #endif aCOMPSUP := { ; - "mingw", "msvc", "bcc", "watcom", "icc", "pocc", "xcc",; + "mingw", "msvc", "bcc", "watcom", "icc", "pocc", "xcc", ; "mingw64", "msvc64", "msvcia64", "iccia64", "pocc64" } l_aLIBHBGT := { "gtwin", "gtwvt", "gtgui" } hbmk[ _HBMK_cGTDEFAULT ] := "gtwin" @@ -1761,14 +1768,14 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) CASE hbmk[ _HBMK_cPLAT ] == "wce" #if ! defined( __PLATFORM__UNIX ) aCOMPDET := { ; - { {|| FindInPath( "clarm.exe" ) }, "msvcarm" },; - { {|| FindInPath( "armasm.exe" ) }, "msvcarm" },; - { {|| FindInPath( "pocc.exe" ) }, "poccarm" },; - { {|| FindInPath( "arm-mingw32ce-gcc" ) }, "mingwarm", "arm-mingw32ce-" } ,; - { {|| FindInPath( "arm-wince-mingw32ce-gcc" ) }, "mingwarm", "arm-wince-mingw32ce-" } ,; - { {|| FindInPath( "i386-mingw32ce-gcc" ) }, "mingw" , "i386-mingw32ce-" } ,; - { {|| iif( ! Empty( hbmk[ _HBMK_cCCPREFIX ] ) .OR. ! Empty( hbmk[ _HBMK_cCCPOSTFIX ] ),; - FindInPath( hbmk[ _HBMK_cCCPREFIX ] + "gcc" + hbmk[ _HBMK_cCCPOSTFIX ] ),; + { {|| FindInPath( "clarm.exe" ) }, "msvcarm" }, ; + { {|| FindInPath( "armasm.exe" ) }, "msvcarm" }, ; + { {|| FindInPath( "pocc.exe" ) }, "poccarm" }, ; + { {|| FindInPath( "arm-mingw32ce-gcc" ) }, "mingwarm", "arm-mingw32ce-" } , ; + { {|| FindInPath( "arm-wince-mingw32ce-gcc" ) }, "mingwarm", "arm-wince-mingw32ce-" } , ; + { {|| FindInPath( "i386-mingw32ce-gcc" ) }, "mingw" , "i386-mingw32ce-" } , ; + { {|| iif( ! Empty( hbmk[ _HBMK_cCCPREFIX ] ) .OR. ! Empty( hbmk[ _HBMK_cCCPOSTFIX ] ), ; + FindInPath( hbmk[ _HBMK_cCCPREFIX ] + "gcc" + hbmk[ _HBMK_cCCPOSTFIX ] ), ; NIL ) }, "mingwarm" } } #endif aCOMPSUP := { "mingwarm", "msvcarm", "poccarm" } @@ -5373,7 +5380,7 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) ENDIF tmp4 := FNameDirExtSet( tmp3, cHarbourOutputDir, cHarbourOutputExt ) IF hbmk[ _HBMK_lDEBUGINC ] - _hbmk_OutStd( hbmk, hb_StrFormat( "debuginc: PRG %1$s %2$s",; + _hbmk_OutStd( hbmk, hb_StrFormat( "debuginc: PRG %1$s %2$s", ; tmp3, tmp4 ) ) ENDIF IF ! hb_FGetDateTime( tmp4, @tmp2 ) .OR. ; @@ -5431,14 +5438,14 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) ENDIF tmp := { ; - "platform" => hbmk[ _HBMK_cPLAT ],; - "compiler" => hbmk[ _HBMK_cCOMP ],; - "cpu" => hbmk[ _HBMK_cCPU ],; - "buildname" => hbmk[ _HBMK_cBUILD ],; - "targetname" => hbmk_TARGETNAME( hbmk ),; - "targettype" => hbmk_TARGETTYPE( hbmk ),; - "dynprefix" => iif( Empty( l_cDynLibDir ), "", l_cDynLibDir + hbmk[ _HBMK_cDynLibPrefix ] ),; - "dynsuffix" => hbmk_DYNSUFFIX( hbmk ),; + "platform" => hbmk[ _HBMK_cPLAT ], ; + "compiler" => hbmk[ _HBMK_cCOMP ], ; + "cpu" => hbmk[ _HBMK_cCPU ], ; + "buildname" => hbmk[ _HBMK_cBUILD ], ; + "targetname" => hbmk_TARGETNAME( hbmk ), ; + "targettype" => hbmk_TARGETTYPE( hbmk ), ; + "dynprefix" => iif( Empty( l_cDynLibDir ), "", l_cDynLibDir + hbmk[ _HBMK_cDynLibPrefix ] ), ; + "dynsuffix" => hbmk_DYNSUFFIX( hbmk ), ; "inc" => iif( hbmk[ _HBMK_lINC ], "yes", "no" ) } IF ! Empty( hbmk[ _HBMK_cPROGNAME ] ) @@ -5502,10 +5509,10 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) aThreads := {} FOR EACH aTO_DO IN ArraySplit( l_aPRG_TO_DO, l_nJOBS ) - aCommand := ArrayAJoin( { { iif( hbmk[ _HBMK_lCreateLib ] .OR. hbmk[ _HBMK_lCreateDyn ], "-n1", "-n2" ) },; - aTO_DO,; - iif( hbmk[ _HBMK_lBLDFLGP ], { hb_Version( HB_VERSION_FLAG_PRG ) }, {} ),; - ListToArray( iif( Empty( GetEnv( "HB_USER_PRGFLAGS" ) ), "", " " + GetEnv( "HB_USER_PRGFLAGS" ) ) ),; + aCommand := ArrayAJoin( { { iif( hbmk[ _HBMK_lCreateLib ] .OR. hbmk[ _HBMK_lCreateDyn ], "-n1", "-n2" ) }, ; + aTO_DO, ; + iif( hbmk[ _HBMK_lBLDFLGP ], { hb_Version( HB_VERSION_FLAG_PRG ) }, {} ), ; + ListToArray( iif( Empty( GetEnv( "HB_USER_PRGFLAGS" ) ), "", " " + GetEnv( "HB_USER_PRGFLAGS" ) ) ), ; hbmk[ _HBMK_aOPTPRG ] } ) IF hbmk[ _HBMK_lTRACE ] @@ -5933,7 +5940,7 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) This will ensure that we can build shared mode binaries even when static libs are not installed (typically on *nix systems). [vszakats] */ - FOR EACH tmp IN ArrayAJoin( { aLIB_BASE_CPLR,; + FOR EACH tmp IN ArrayAJoin( { aLIB_BASE_CPLR, ; aLIB_BASE_DEBUG } ) IF hb_FileExists( _HBLIB_FULLPATH( tmp ) ) AAdd( l_aLIBHB, tmp ) @@ -5943,13 +5950,13 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) l_aLIBHB := {} ENDIF ELSE - l_aLIBHB := ArrayAJoin( { aLIB_BASE_EXTERN,; - aLIB_BASE_DEBUG,; - iif( hbmk[ _HBMK_lMT ], aLIB_BASE_1_MT, aLIB_BASE_1 ),; - hbmk[ _HBMK_aLIBCOREGT ],; - iif( hbmk[ _HBMK_lNULRDD ], aLIB_BASE_NULRDD, iif( hbmk[ _HBMK_lMT ], aLIB_BASE_RDD_MT, aLIB_BASE_RDD ) ),; - l_aLIBHBBASE_2,; - iif( hbmk[ _HBMK_lMT ], aLIB_BASE_3_MT, aLIB_BASE_3 ),; + l_aLIBHB := ArrayAJoin( { aLIB_BASE_EXTERN, ; + aLIB_BASE_DEBUG, ; + iif( hbmk[ _HBMK_lMT ], aLIB_BASE_1_MT, aLIB_BASE_1 ), ; + hbmk[ _HBMK_aLIBCOREGT ], ; + iif( hbmk[ _HBMK_lNULRDD ], aLIB_BASE_NULRDD, iif( hbmk[ _HBMK_lMT ], aLIB_BASE_RDD_MT, aLIB_BASE_RDD ) ), ; + l_aLIBHBBASE_2, ; + iif( hbmk[ _HBMK_lMT ], aLIB_BASE_3_MT, aLIB_BASE_3 ), ; l_aLIBSTATICPOST } ) ENDIF ELSE @@ -6253,7 +6260,7 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) ENDIF tmp4 := FNameDirExtSet( tmp3, hbmk[ _HBMK_cWorkDir ], cObjExt ) IF hbmk[ _HBMK_lDEBUGINC ] - _hbmk_OutStd( hbmk, hb_StrFormat( "debuginc: CPRG %1$s %2$s",; + _hbmk_OutStd( hbmk, hb_StrFormat( "debuginc: CPRG %1$s %2$s", ; FNameDirExtSet( tmp3, hbmk[ _HBMK_cWorkDir ], ".c" ), tmp4 ) ) ENDIF IF ! hb_FGetDateTime( FNameDirExtSet( tmp3, hbmk[ _HBMK_cWorkDir ], ".c" ), @tmp1 ) .OR. ; @@ -7077,6 +7084,7 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) RETURN hbmk[ _HBMK_nErrorLevel ] STATIC PROCEDURE ProcEnvOption( cValue ) + LOCAL tmp IF ! Empty( cValue ) @@ -7107,6 +7115,7 @@ STATIC FUNCTION CheckLibParam( hbmk, cLibName ) RETURN .T. STATIC PROCEDURE convert_incpaths_to_options( hbmk, cOptIncMask, lCHD_Comp ) + LOCAL cBaseDir LOCAL cINCPATH @@ -7133,6 +7142,7 @@ STATIC PROCEDURE convert_incpaths_to_options( hbmk, cOptIncMask, lCHD_Comp ) RETURN STATIC FUNCTION hbmk_hb_FileExists( cFileName ) + #if defined( __PLATFORM__DOS ) LOCAL cName LOCAL cExt @@ -7227,9 +7237,9 @@ STATIC PROCEDURE vxworks_env_init( hbmk ) /* Conversion table between ours and vxworks CPU values required to target that CPU */ LOCAL aTable := {; - "x86" => { "pentium", "X86LH" , "_VX_SIMPENTIUM", "simpentium/SIMPENTIUM" },; - "arm" => { "arm" , "ARMV7LS", "_VX_ARMARCH7" , "arm/ARMARCH7" },; - "mips" => { "mips" , "" , "" , "" },; + "x86" => { "pentium", "X86LH" , "_VX_SIMPENTIUM", "simpentium/SIMPENTIUM" }, ; + "arm" => { "arm" , "ARMV7LS", "_VX_ARMARCH7" , "arm/ARMARCH7" }, ; + "mips" => { "mips" , "" , "" , "" }, ; "ppc" => { "ppc" , "" , "" , "" }} IF hbmk[ _HBMK_cCPU ] $ aTable @@ -7259,6 +7269,7 @@ STATIC PROCEDURE vxworks_env_init( hbmk ) RETURN STATIC PROCEDURE DoLinkCalc( hbmk ) + LOCAL cDir, cName, cExt LOCAL tmp @@ -7273,13 +7284,14 @@ STATIC PROCEDURE DoLinkCalc( hbmk ) hb_FNameSplit( hbmk[ _HBMK_cPROGNAME ],, @cName, @cExt ) tmp := { ; - /* */ hb_PathNormalize( PathMakeAbsolute( tmp, hb_FNameDir( hbmk[ _HBMK_cPROGNAME ] ) ) ),; + /* */ hb_PathNormalize( PathMakeAbsolute( tmp, hb_FNameDir( hbmk[ _HBMK_cPROGNAME ] ) ) ), ; /* */ hb_FNameMerge( cDir, cName, cExt ) } NEXT RETURN STATIC FUNCTION DoLinkDelete( hbmk ) + LOCAL tmp FOR EACH tmp IN hbmk[ _HBMK_aLINK ] @@ -7289,6 +7301,7 @@ STATIC FUNCTION DoLinkDelete( hbmk ) RETURN .T. STATIC FUNCTION DoLink( hbmk ) + LOCAL tmp FOR EACH tmp IN hbmk[ _HBMK_aLINK ] @@ -7302,6 +7315,7 @@ STATIC FUNCTION DoLink( hbmk ) RETURN .T. STATIC FUNCTION DoIMPLIB( hbmk, bBlk_ImpLib, cLibLibPrefix, cLibLibExt, aIMPLIBSRC, cPROGNAME, cInstCat, lDoSrc ) + LOCAL cMakeImpLibDLL LOCAL tmp, tmp1 LOCAL nNotFound @@ -7374,6 +7388,7 @@ STATIC FUNCTION DoIMPLIB( hbmk, bBlk_ImpLib, cLibLibPrefix, cLibLibExt, aIMPLIBS #define _INST_cData 2 STATIC PROCEDURE DoInstCopy( hbmk ) + LOCAL aInstPath LOCAL aInstFile LOCAL cInstPath @@ -7452,6 +7467,7 @@ STATIC PROCEDURE DoInstCopy( hbmk ) RETURN STATIC PROCEDURE DoBeep( lSuccess ) + LOCAL nRepeat := iif( lSuccess, 1, 2 ) LOCAL tmp @@ -7466,11 +7482,13 @@ STATIC PROCEDURE DoBeep( lSuccess ) RETURN STATIC FUNCTION hbmk_UTF8_BOM() - RETURN hb_BChar( 0xEF ) +; - hb_BChar( 0xBB ) +; - hb_BChar( 0xBF ) + RETURN ; + hb_BChar( 0xEF ) + ; + hb_BChar( 0xBB ) + ; + hb_BChar( 0xBF ) STATIC FUNCTION hbmk_MemoRead( cFileName ) + LOCAL cFile := MemoRead( cFileName ) /* NOTE: Intentionally using MemoRead() which handles EOF char. */ IF Left( cFile, Len( hbmk_UTF8_BOM() ) ) == hbmk_UTF8_BOM() @@ -7480,6 +7498,7 @@ STATIC FUNCTION hbmk_MemoRead( cFileName ) RETURN hb_UTF8ToStr( cFile ) STATIC FUNCTION hbmk_hb_compile( hbmk, ... ) + LOCAL cSaveCP LOCAL xRetVal @@ -7495,6 +7514,7 @@ STATIC FUNCTION hbmk_hb_compile( hbmk, ... ) RETURN xRetVal STATIC FUNCTION hbmk_hb_compileBuf( hbmk, ... ) + LOCAL cSaveCP LOCAL xRetVal @@ -7510,6 +7530,7 @@ STATIC FUNCTION hbmk_hb_compileBuf( hbmk, ... ) RETURN xRetVal STATIC FUNCTION CompileCLoop( hbmk, aTO_DO, cBin_CompC, cOpt_CompC, cObjExt, nOpt_Esc, nOpt_FNF, nJob, nJobs ) + LOCAL lResult := .T. LOCAL cCommand LOCAL tmp, tmp1 @@ -7609,6 +7630,7 @@ STATIC FUNCTION SetupForGT( cGT_New, /* @ */ cGT, /* @ */ lGUI ) [vszakats] */ STATIC FUNCTION FindNewerHeaders( hbmk, cFileName, tTimeParent, lCMode, cBin_CompC ) + LOCAL tTimeSelf LOCAL tTimeDependency LOCAL tmp @@ -7654,11 +7676,11 @@ STATIC FUNCTION FindNewerHeaders( hbmk, cFileName, tTimeParent, lCMode, cBin_Com _hbmk_OutStd( hbmk, hb_StrFormat( "debuginc: Calling Harbour compiler to detect dependencies of %1$s", cFileName ) ) ENDIF - aCommand := ArrayAJoin( { { "-q0", "-sm" },; - { iif( hbmk[ _HBMK_lCreateLib ] .OR. hbmk[ _HBMK_lCreateDyn ], "-n1", "-n2" ) },; - { cFileName },; - iif( hbmk[ _HBMK_lBLDFLGP ], { hb_Version( HB_VERSION_FLAG_PRG ) }, {} ),; - ListToArray( iif( Empty( GetEnv( "HB_USER_PRGFLAGS" ) ), "", " " + GetEnv( "HB_USER_PRGFLAGS" ) ) ),; + aCommand := ArrayAJoin( { { "-q0", "-sm" }, ; + { iif( hbmk[ _HBMK_lCreateLib ] .OR. hbmk[ _HBMK_lCreateDyn ], "-n1", "-n2" ) }, ; + { cFileName }, ; + iif( hbmk[ _HBMK_lBLDFLGP ], { hb_Version( HB_VERSION_FLAG_PRG ) }, {} ), ; + ListToArray( iif( Empty( GetEnv( "HB_USER_PRGFLAGS" ) ), "", " " + GetEnv( "HB_USER_PRGFLAGS" ) ) ), ; hbmk[ _HBMK_aOPTPRG ] } ) IF ! HB_ISSTRING( tmp := hbmk_hb_compileBuf( hbmk, "harbour", aCommand ) ) @@ -7800,95 +7822,95 @@ STATIC FUNCTION s_getIncludedFiles( hbmk, cFile, cParentDir, lCMode ) IF t_hExclStd == NIL t_hExclStd := {; - "assert.h" => NIL ,; /* Standard C */ - "ctype.h" => NIL ,; - "errno.h" => NIL ,; - "float.h" => NIL ,; - "limits.h" => NIL ,; - "locale.h" => NIL ,; - "math.h" => NIL ,; - "setjmp.h" => NIL ,; - "signal.h" => NIL ,; - "stdarg.h" => NIL ,; - "stddef.h" => NIL ,; - "stdio.h" => NIL ,; - "stdlib.h" => NIL ,; - "string.h" => NIL ,; - "time.h" => NIL ,; - "iso646.h" => NIL ,; /* ISO C NA1 */ - "wchar.h" => NIL ,; - "wctype.h" => NIL ,; - "complex.h" => NIL ,; /* ISO C C99 */ - "fenv.h" => NIL ,; - "inttypes.h" => NIL ,; - "stdbool.h" => NIL ,; - "stdint.h" => NIL ,; - "tgmath.h" => NIL ,; - "unistd.h" => NIL ,; /* Standard C POSIX */ - "aio.h" => NIL ,; - "arpa/inet.h" => NIL ,; - "cpio.h" => NIL ,; - "dirent.h" => NIL ,; - "dlfcn.h" => NIL ,; - "fcntl.h" => NIL ,; - "fmtmsg.h" => NIL ,; - "fnmatch.h" => NIL ,; - "ftw.h" => NIL ,; - "glob.h" => NIL ,; - "grp.h" => NIL ,; - "iconv.h" => NIL ,; - "langinfo.h" => NIL ,; - "libgen.h" => NIL ,; - "monetary.h" => NIL ,; - "mqueue.h" => NIL ,; - "ndbm.h" => NIL ,; - "net/if.h" => NIL ,; - "netdb.h" => NIL ,; - "netinet/in.h" => NIL ,; - "netinet/tcp.h" => NIL ,; - "nl_types.h" => NIL ,; - "poll.h" => NIL ,; - "pthread.h" => NIL ,; - "pwd.h" => NIL ,; - "regex.h" => NIL ,; - "sched.h" => NIL ,; - "search.h" => NIL ,; - "semaphore.h" => NIL ,; - "spawn.h" => NIL ,; - "strings.h" => NIL ,; - "stropts.h" => NIL ,; - "sys/ipc.h" => NIL ,; - "sys/mman.h" => NIL ,; - "sys/msg.h" => NIL ,; - "sys/resource.h" => NIL ,; - "sys/select.h" => NIL ,; - "sys/sem.h" => NIL ,; - "sys/shm.h" => NIL ,; - "sys/socket.h" => NIL ,; - "sys/stat.h" => NIL ,; - "sys/statvfs.h" => NIL ,; - "sys/time.h" => NIL ,; - "sys/times.h" => NIL ,; - "sys/types.h" => NIL ,; - "sys/uio.h" => NIL ,; - "sys/un.h" => NIL ,; - "sys/utsname.h" => NIL ,; - "sys/wait.h" => NIL ,; - "syslog.h" => NIL ,; - "tar.h" => NIL ,; - "termios.h" => NIL ,; - "trace.h" => NIL ,; - "ulimit.h" => NIL ,; - "unistd.h" => NIL ,; - "utime.h" => NIL ,; - "utmpx.h" => NIL ,; - "wordexp.h" => NIL ,; - "windows.h" => NIL ,; /* OS (win) */ - "winspool.h" => NIL ,; - "shellapi.h" => NIL ,; - "ole2.h" => NIL ,; - "dos.h" => NIL ,; /* OS (dos) */ - "os2.h" => NIL } /* OS (os2) */ + "assert.h" => NIL , ; /* Standard C */ + "ctype.h" => NIL , ; + "errno.h" => NIL , ; + "float.h" => NIL , ; + "limits.h" => NIL , ; + "locale.h" => NIL , ; + "math.h" => NIL , ; + "setjmp.h" => NIL , ; + "signal.h" => NIL , ; + "stdarg.h" => NIL , ; + "stddef.h" => NIL , ; + "stdio.h" => NIL , ; + "stdlib.h" => NIL , ; + "string.h" => NIL , ; + "time.h" => NIL , ; + "iso646.h" => NIL , ; /* ISO C NA1 */ + "wchar.h" => NIL , ; + "wctype.h" => NIL , ; + "complex.h" => NIL , ; /* ISO C C99 */ + "fenv.h" => NIL , ; + "inttypes.h" => NIL , ; + "stdbool.h" => NIL , ; + "stdint.h" => NIL , ; + "tgmath.h" => NIL , ; + "unistd.h" => NIL , ; /* Standard C POSIX */ + "aio.h" => NIL , ; + "arpa/inet.h" => NIL , ; + "cpio.h" => NIL , ; + "dirent.h" => NIL , ; + "dlfcn.h" => NIL , ; + "fcntl.h" => NIL , ; + "fmtmsg.h" => NIL , ; + "fnmatch.h" => NIL , ; + "ftw.h" => NIL , ; + "glob.h" => NIL , ; + "grp.h" => NIL , ; + "iconv.h" => NIL , ; + "langinfo.h" => NIL , ; + "libgen.h" => NIL , ; + "monetary.h" => NIL , ; + "mqueue.h" => NIL , ; + "ndbm.h" => NIL , ; + "net/if.h" => NIL , ; + "netdb.h" => NIL , ; + "netinet/in.h" => NIL , ; + "netinet/tcp.h" => NIL , ; + "nl_types.h" => NIL , ; + "poll.h" => NIL , ; + "pthread.h" => NIL , ; + "pwd.h" => NIL , ; + "regex.h" => NIL , ; + "sched.h" => NIL , ; + "search.h" => NIL , ; + "semaphore.h" => NIL , ; + "spawn.h" => NIL , ; + "strings.h" => NIL , ; + "stropts.h" => NIL , ; + "sys/ipc.h" => NIL , ; + "sys/mman.h" => NIL , ; + "sys/msg.h" => NIL , ; + "sys/resource.h" => NIL , ; + "sys/select.h" => NIL , ; + "sys/sem.h" => NIL , ; + "sys/shm.h" => NIL , ; + "sys/socket.h" => NIL , ; + "sys/stat.h" => NIL , ; + "sys/statvfs.h" => NIL , ; + "sys/time.h" => NIL , ; + "sys/times.h" => NIL , ; + "sys/types.h" => NIL , ; + "sys/uio.h" => NIL , ; + "sys/un.h" => NIL , ; + "sys/utsname.h" => NIL , ; + "sys/wait.h" => NIL , ; + "syslog.h" => NIL , ; + "tar.h" => NIL , ; + "termios.h" => NIL , ; + "trace.h" => NIL , ; + "ulimit.h" => NIL , ; + "unistd.h" => NIL , ; + "utime.h" => NIL , ; + "utmpx.h" => NIL , ; + "wordexp.h" => NIL , ; + "windows.h" => NIL , ; /* OS (win) */ + "winspool.h" => NIL , ; + "shellapi.h" => NIL , ; + "ole2.h" => NIL , ; + "dos.h" => NIL , ; /* OS (dos) */ + "os2.h" => NIL } /* OS (os2) */ ENDIF IF StrTran( Lower( cHeader ), "\", "/" ) $ t_hExclStd @@ -7939,6 +7961,7 @@ STATIC FUNCTION s_getIncludedFiles( hbmk, cFile, cParentDir, lCMode ) #define _HBMK_FILEDEF_LEN_ 4 STATIC PROCEDURE s_getFilesDep( hbmk, cFile, hFiles, cParentDir, lSystemHeader, lCMode ) + LOCAL aDep, tTime, aDeps, aFile IF ! cFile $ hFiles @@ -7962,10 +7985,10 @@ STATIC PROCEDURE s_getFilesDep( hbmk, cFile, hFiles, cParentDir, lSystemHeader, hFiles[ cFile ] := aFile FOR EACH aDep IN aDeps - s_getFilesDep( hbmk, aDep[ _HBMK_HEADER_cHeader ],; - hFiles,; - cParentDir,; - aDep[ _HBMK_HEADER_lSystemHeader ],; + s_getFilesDep( hbmk, aDep[ _HBMK_HEADER_cHeader ], ; + hFiles, ; + cParentDir, ; + aDep[ _HBMK_HEADER_lSystemHeader ], ; lCMode ) NEXT ENDIF @@ -7973,6 +7996,7 @@ STATIC PROCEDURE s_getFilesDep( hbmk, cFile, hFiles, cParentDir, lSystemHeader, RETURN STATIC FUNCTION s_getNewestTime( cFile, hFiles, lFileReq ) + LOCAL aFile, tTime, aDep, tDep, lReq tTime := t"00:00" @@ -8016,9 +8040,11 @@ STATIC FUNCTION s_getNewestTime( cFile, hFiles, lFileReq ) lFileReq := .T. ENDIF ENDIF + RETURN tTime STATIC FUNCTION getNewestTime( hbmk, cFile, hFiles, lCMode ) + LOCAL aFile, tTime IF hFiles == NIL @@ -8043,6 +8069,7 @@ STATIC FUNCTION getNewestTime( hbmk, cFile, hFiles, lCMode ) RETURN tTime STATIC FUNCTION checkDepTime( hbmk, cFile, tTime ) + LOCAL cDepFile, tDepTime IF hbmk[ _HBMK_lDEBUGINC ] @@ -8070,6 +8097,7 @@ STATIC FUNCTION checkDepTime( hbmk, cFile, tTime ) RETURN .F. STATIC FUNCTION clpfile_read( cFileName ) + LOCAL cFileBody := MemoRead( cFileName ) LOCAL aFiles LOCAL cFile @@ -8086,6 +8114,7 @@ STATIC FUNCTION clpfile_read( cFileName ) RETURN aFiles STATIC FUNCTION deplst_read( hbmk, hDeps, cFileName ) + LOCAL cFileBody := MemoRead( cFileName ) LOCAL cList := "" LOCAL cLine @@ -8117,6 +8146,7 @@ STATIC FUNCTION deplst_read( hbmk, hDeps, cFileName ) RETURN hDeps STATIC FUNCTION deplst_add( hDeps, cList ) + LOCAL cFile LOCAL aList LOCAL n @@ -8138,6 +8168,7 @@ STATIC FUNCTION deplst_add( hDeps, cList ) RETURN .T. STATIC FUNCTION inst_split_arg( cParam, /* @ */ cName, /* @ */ cData ) + LOCAL nPos /* separate install group from install file or path. @@ -8156,6 +8187,7 @@ STATIC FUNCTION inst_split_arg( cParam, /* @ */ cName, /* @ */ cData ) RETURN ! Empty( cData ) STATIC FUNCTION autohbc_split_arg( cParam, /* @ */ cHeader, /* @ */ cHBC ) + LOCAL nPos IF ( nPos := At( ":", cParam ) ) > 0 @@ -8175,6 +8207,7 @@ STATIC FUNCTION autohbc_split_arg( cParam, /* @ */ cHeader, /* @ */ cHBC ) RETURN ! Empty( cHeader ) .AND. ! Empty( cHBC ) STATIC FUNCTION dep_split_arg( hbmk, cParam, /* @ */ cName, /* @ */ cData ) + LOCAL nPos LOCAL dep @@ -8213,6 +8246,7 @@ STATIC FUNCTION dep_split_arg( hbmk, cParam, /* @ */ cName, /* @ */ cData ) RETURN .F. STATIC PROCEDURE dep_postprocess_one( hbmk, dep ) + LOCAL tmp LOCAL cControlL @@ -8280,6 +8314,7 @@ STATIC PROCEDURE dep_postprocess_one( hbmk, dep ) RETURN STATIC FUNCTION dep_evaluate( hbmk ) + LOCAL dep LOCAL aREQ := {} @@ -8290,11 +8325,11 @@ STATIC FUNCTION dep_evaluate( hbmk ) FOR EACH dep IN hbmk[ _HBMK_hDEP ] IF dep[ _HBMKDEP_lFound ] IF ! hbmk[ _HBMK_lQuiet ] - _hbmk_OutStd( hbmk, hb_StrFormat( I_( "Dependency '%1$s' found: %2$s%3$s%4$s%5$s" ),; - dep[ _HBMKDEP_cName ],; - dep[ _HBMKDEP_cFound ],; - iif( Empty( dep[ _HBMKDEP_cVersion ] ), "", " (" + dep[ _HBMKDEP_cVersion ] + ")" ),; - iif( dep[ _HBMKDEP_lFoundLOCAL ], " (local)", "" ),; + _hbmk_OutStd( hbmk, hb_StrFormat( I_( "Dependency '%1$s' found: %2$s%3$s%4$s%5$s" ), ; + dep[ _HBMKDEP_cName ], ; + dep[ _HBMKDEP_cFound ], ; + iif( Empty( dep[ _HBMKDEP_cVersion ] ), "", " (" + dep[ _HBMKDEP_cVersion ] + ")" ), ; + iif( dep[ _HBMKDEP_lFoundLOCAL ], " (local)", "" ), ; iif( dep[ _HBMKDEP_lForced ], " (forced)", "" ) ) ) ENDIF ELSE @@ -8355,6 +8390,7 @@ STATIC FUNCTION dep_evaluate( hbmk ) RETURN Empty( aREQ ) .AND. Empty( aWRN ) .AND. ! lAnyForcedOut STATIC PROCEDURE dep_try_detection( hbmk, dep ) + IF ! dep[ _HBMKDEP_lDetected ] dep_postprocess_one( hbmk, dep ) IF ! dep_try_pkg_detection( hbmk, dep ) @@ -8362,10 +8398,12 @@ STATIC PROCEDURE dep_try_detection( hbmk, dep ) ENDIF dep[ _HBMKDEP_lDetected ] := .T. ENDIF + RETURN /* Try '*-config' and 'pkg-config *' detection */ STATIC FUNCTION dep_try_pkg_detection( hbmk, dep ) + LOCAL cStdOut LOCAL cStdErr LOCAL cItem @@ -8484,6 +8522,7 @@ STATIC FUNCTION dep_try_pkg_detection( hbmk, dep ) /* Try detection by header */ STATIC FUNCTION dep_try_header_detection( hbmk, dep ) + LOCAL aINCPATH LOCAL cDirOri LOCAL cDir @@ -8494,7 +8533,7 @@ STATIC FUNCTION dep_try_header_detection( hbmk, dep ) /* Check dependency include path list */ IF ! dep[ _HBMKDEP_lFound ] - FOR EACH aINCPATH IN { dep[ _HBMKDEP_aINCPATH ],; + FOR EACH aINCPATH IN { dep[ _HBMKDEP_aINCPATH ], ; dep[ _HBMKDEP_aINCPATHLOCAL ] } FOR EACH cDirOri IN aINCPATH cDir := iif( aINCPATH:__enumIndex() == 1, dep[ _HBMKDEP_cINCROOT ], "" ) + cDirOri @@ -8528,6 +8567,7 @@ STATIC FUNCTION dep_try_header_detection( hbmk, dep ) RETURN .F. STATIC FUNCTION StrToDefine( cString ) + LOCAL cDefine := "" LOCAL c @@ -8542,6 +8582,7 @@ STATIC FUNCTION StrToDefine( cString ) RETURN cDefine STATIC FUNCTION AMerge( aDst, aSrc ) + LOCAL item FOR EACH item IN aSrc @@ -8553,6 +8594,7 @@ STATIC FUNCTION AMerge( aDst, aSrc ) RETURN aDst STATIC FUNCTION FindHeader( hbmk, cFileName, cParentDir, lSystemHeader, lSkipDept ) + LOCAL cDir LOCAL tmp @@ -8593,9 +8635,11 @@ STATIC FUNCTION FindHeader( hbmk, cFileName, cParentDir, lSystemHeader, lSkipDep RETURN NIL STATIC FUNCTION HeaderExists( cDir, cFileName ) + LOCAL tmp #if defined( __PLATFORM__DARWIN ) LOCAL nPos + IF ( nPos := At( "/", cFileName ) ) > 0 tmp := hb_DirSepAdd( PathSepToSelf( cDir ) ) + Left( cFileName, nPos - 1 ) + ".framework" + hb_ps() + "Headers" + hb_ps() + SubStr( cFileName, nPos + 1 ) IF hb_FileExists( tmp ) @@ -8604,11 +8648,13 @@ STATIC FUNCTION HeaderExists( cDir, cFileName ) ENDIF #endif tmp := hb_DirSepAdd( PathSepToSelf( cDir ) ) + PathSepToSelf( cFileName ) + RETURN iif( hb_FileExists( tmp ), tmp, NIL ) /* Replicating logic used by compilers. */ STATIC FUNCTION FindLib( hbmk, cLib, aLIBPATH, cLibPrefix, cLibExt ) + LOCAL cDir LOCAL tmp @@ -8659,6 +8705,7 @@ STATIC FUNCTION FindLib( hbmk, cLib, aLIBPATH, cLibPrefix, cLibExt ) RETURN NIL STATIC FUNCTION LibExists( hbmk, cDir, cLib, cLibPrefix, cLibExt ) + LOCAL tmp cDir := hb_DirSepAdd( PathSepToSelf( cDir ) ) @@ -8695,6 +8742,7 @@ STATIC FUNCTION LibExists( hbmk, cDir, cLib, cLibPrefix, cLibExt ) #if ! defined( __PLATFORM__UNIX ) STATIC FUNCTION FindInSamePath( cFileName, cFileName2, cPath ) + LOCAL cDir, cName, cExt cFileName := FindInPath( cFileName, cPath ) @@ -8723,6 +8771,7 @@ STATIC FUNCTION FindInSamePath( cFileName, cFileName2, cPath ) #endif STATIC PROCEDURE PlugIn_Load( hbmk, cFileName ) + LOCAL cFile LOCAL cExt LOCAL lOK @@ -8792,6 +8841,7 @@ FUNCTION hbmk_FNameToSymbol( ... ) ; RETURN FuncNameEncode( ... ) FUNCTION hbmk_StrStripQuote( ... ) ; RETURN StrStripQuote( ... ) FUNCTION hbmk_ArrayToList( array, cSeparator ) + LOCAL cString := "" LOCAL tmp @@ -8809,114 +8859,158 @@ FUNCTION hbmk_ArrayToList( array, cSeparator ) RETURN cString STATIC FUNCTION ctx_to_hbmk( ctx ) + LOCAL hbmk + IF HB_ISHASH( ctx ) .AND. s_cSecToken $ ctx hbmk := ctx[ s_cSecToken ] IF HB_ISARRAY( hbmk ) .AND. Len( hbmk ) == _HBMK_MAX_ RETURN hbmk ENDIF ENDIF + RETURN NIL FUNCTION hbmk_OutStdRaw( ctx, ... ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk == NIL .OR. hbmk[ _HBMK_lDumpInfo ] RETURN NIL ENDIF + RETURN ( OutStd( ... ), OutStd( _OUT_EOL ) ) FUNCTION hbmk_OutErrRaw( ctx, ... ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk == NIL .OR. hbmk[ _HBMK_lDumpInfo ] RETURN NIL ENDIF + RETURN ( OutErr( ... ), OutErr( _OUT_EOL ) ) FUNCTION hbmk_PathFromWorkdirToCWD( ctx ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk != NIL RETURN hb_DirSepAdd( hb_PathRelativize( hb_PathNormalize( PathMakeAbsolute( hbmk[ _HBMK_cWorkDir ], hb_cwd() ) ), hb_cwd(), .T. ) ) ENDIF + RETURN "" FUNCTION hbmk_Macro( ctx, cString ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk != NIL RETURN MacroProc( hbmk, cString ) ENDIF + RETURN "" FUNCTION hbmk_OutStd( ctx, cText ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk != NIL RETURN _hbmk_OutStd( hbmk, hb_StrFormat( I_( "plugin: %1$s" ), cText ) ) ENDIF + RETURN NIL FUNCTION hbmk_OutErr( ctx, cText ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk != NIL RETURN _hbmk_OutErr( hbmk, hb_StrFormat( I_( "plugin: %1$s" ), cText ) ) ENDIF + RETURN NIL FUNCTION hbmk_PathSepToTarget( ctx, ... ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk != NIL RETURN PathSepToTarget( hbmk, ... ) ENDIF + RETURN "" FUNCTION hbmk_AddInput_PRG( ctx, cFileName ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk != NIL .AND. HB_ISSTRING( cFileName ) AAdd( hbmk[ _HBMK_aPRG ], PathSepToSelf( cFileName ) ) hb_default( @hbmk[ _HBMK_cFIRST ], PathSepToSelf( cFileName ) ) ENDIF + RETURN NIL FUNCTION hbmk_AddInput_C( ctx, cFileName ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk != NIL .AND. HB_ISSTRING( cFileName ) AAdd( hbmk[ _HBMK_aC ], PathSepToSelf( cFileName ) ) hb_default( @hbmk[ _HBMK_cFIRST ], PathSepToSelf( cFileName ) ) ENDIF + RETURN NIL FUNCTION hbmk_AddInput_CPP( ctx, cFileName ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk != NIL .AND. HB_ISSTRING( cFileName ) AAdd( hbmk[ _HBMK_aCPP ], PathSepToSelf( cFileName ) ) hb_default( @hbmk[ _HBMK_cFIRST ], PathSepToSelf( cFileName ) ) ENDIF + RETURN NIL FUNCTION hbmk_AddInput_RC( ctx, cFileName ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk != NIL .AND. HB_ISSTRING( cFileName ) AAdd( hbmk[ _HBMK_aRESSRC ], PathSepToSelf( cFileName ) ) ENDIF + RETURN NIL FUNCTION hbmk_AddInput_OBJ( ctx, cFileName ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk != NIL .AND. HB_ISSTRING( cFileName ) AAdd( hbmk[ _HBMK_aOBJUSER ], PathSepToSelf( cFileName ) ) ENDIF + RETURN NIL FUNCTION hbmk_AddInput_INSTFILE( ctx, cFileName, cGroup ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk != NIL .AND. HB_ISSTRING( cFileName ) IF ! HB_ISSTRING( cGroup ) cGroup := "" ENDIF AAddNewINST( hbmk[ _HBMK_aINSTFILE ], { cGroup, PathSepToSelf( cFileName ) } ) ENDIF + RETURN NIL FUNCTION hbmk_Register_Input_File_Extension( ctx, cExt ) + LOCAL hbmk := ctx_to_hbmk( ctx ) + IF hbmk != NIL .AND. HB_ISSTRING( cExt ) IF ! Empty( cExt ) IF !( Left( cExt, 1 ) == "." ) @@ -8925,52 +9019,54 @@ FUNCTION hbmk_Register_Input_File_Extension( ctx, cExt ) hbmk[ _HBMK_hPLUGINExt ][ Lower( cExt ) ] := NIL ENDIF ENDIF + RETURN NIL /* ; */ STATIC FUNCTION PlugIn_make_ctx( hbmk, cState ) RETURN {; - "cSTATE" => cState ,; - "params" => hbmk[ _HBMK_aPLUGINPars ] ,; - "vars" => hbmk[ _HBMK_hPLUGINVars ] ,; - "cPLAT" => hbmk[ _HBMK_cPLAT ] ,; - "cCOMP" => hbmk[ _HBMK_cCOMP ] ,; - "nCOMPVer" => hbmk[ _HBMK_nCOMPVer ] ,; - "cCPU" => hbmk[ _HBMK_cCPU ] ,; - "cBUILD" => hbmk[ _HBMK_cBUILD ] ,; - "cOUTPUTNAME" => hbmk[ _HBMK_cPROGNAME ] ,; - "cTARGETNAME" => hbmk_TARGETNAME( hbmk ) ,; - "cTARGETTYPE" => hbmk_TARGETTYPE( hbmk ) ,; - "lREBUILD" => hbmk[ _HBMK_lREBUILD ] ,; - "lCLEAN" => hbmk[ _HBMK_lCLEAN ] ,; - "lDEBUG" => hbmk[ _HBMK_lDEBUG ] ,; - "lMAP" => hbmk[ _HBMK_lMAP ] ,; - "lSTRIP" => hbmk[ _HBMK_lSTRIP ] ,; - "lDONTEXEC" => hbmk[ _HBMK_lDONTEXEC ] ,; - "lIGNOREERROR" => hbmk[ _HBMK_lIGNOREERROR ] ,; - "lTRACE" => hbmk[ _HBMK_lTRACE ] ,; - "lQUIET" => hbmk[ _HBMK_lQuiet ] ,; - "lINFO" => hbmk[ _HBMK_lInfo ] ,; - "lBEEP" => hbmk[ _HBMK_lBEEP ] ,; - "lRUN" => hbmk[ _HBMK_lRUN ] ,; - "lINC" => hbmk[ _HBMK_lINC ] ,; - "cCCPATH" => hbmk[ _HBMK_cCCPATH ] ,; - "cCCPREFIX" => hbmk[ _HBMK_cCCPREFIX ] ,; - "cCCPOSTFIX" => hbmk[ _HBMK_cCCPOSTFIX ] ,; - "cCCEXT" => hbmk[ _HBMK_cCCEXT ] ,; - "nCmd_Esc" => hbmk[ _HBMK_nCmd_Esc ] ,; - "nScr_Esc" => hbmk[ _HBMK_nScr_Esc ] ,; - "nCmd_FNF" => hbmk[ _HBMK_nCmd_FNF ] ,; - "nScr_FNF" => hbmk[ _HBMK_nScr_FNF ] ,; - "cWorkDir" => hbmk[ _HBMK_cWorkDir ] ,; - "nErrorLevel" => hbmk[ _HBMK_nErrorLevel ] ,; + "cSTATE" => cState , ; + "params" => hbmk[ _HBMK_aPLUGINPars ] , ; + "vars" => hbmk[ _HBMK_hPLUGINVars ] , ; + "cPLAT" => hbmk[ _HBMK_cPLAT ] , ; + "cCOMP" => hbmk[ _HBMK_cCOMP ] , ; + "nCOMPVer" => hbmk[ _HBMK_nCOMPVer ] , ; + "cCPU" => hbmk[ _HBMK_cCPU ] , ; + "cBUILD" => hbmk[ _HBMK_cBUILD ] , ; + "cOUTPUTNAME" => hbmk[ _HBMK_cPROGNAME ] , ; + "cTARGETNAME" => hbmk_TARGETNAME( hbmk ) , ; + "cTARGETTYPE" => hbmk_TARGETTYPE( hbmk ) , ; + "lREBUILD" => hbmk[ _HBMK_lREBUILD ] , ; + "lCLEAN" => hbmk[ _HBMK_lCLEAN ] , ; + "lDEBUG" => hbmk[ _HBMK_lDEBUG ] , ; + "lMAP" => hbmk[ _HBMK_lMAP ] , ; + "lSTRIP" => hbmk[ _HBMK_lSTRIP ] , ; + "lDONTEXEC" => hbmk[ _HBMK_lDONTEXEC ] , ; + "lIGNOREERROR" => hbmk[ _HBMK_lIGNOREERROR ] , ; + "lTRACE" => hbmk[ _HBMK_lTRACE ] , ; + "lQUIET" => hbmk[ _HBMK_lQuiet ] , ; + "lINFO" => hbmk[ _HBMK_lInfo ] , ; + "lBEEP" => hbmk[ _HBMK_lBEEP ] , ; + "lRUN" => hbmk[ _HBMK_lRUN ] , ; + "lINC" => hbmk[ _HBMK_lINC ] , ; + "cCCPATH" => hbmk[ _HBMK_cCCPATH ] , ; + "cCCPREFIX" => hbmk[ _HBMK_cCCPREFIX ] , ; + "cCCPOSTFIX" => hbmk[ _HBMK_cCCPOSTFIX ] , ; + "cCCEXT" => hbmk[ _HBMK_cCCEXT ] , ; + "nCmd_Esc" => hbmk[ _HBMK_nCmd_Esc ] , ; + "nScr_Esc" => hbmk[ _HBMK_nScr_Esc ] , ; + "nCmd_FNF" => hbmk[ _HBMK_nCmd_FNF ] , ; + "nScr_FNF" => hbmk[ _HBMK_nScr_FNF ] , ; + "cWorkDir" => hbmk[ _HBMK_cWorkDir ] , ; + "nErrorLevel" => hbmk[ _HBMK_nErrorLevel ] , ; s_cSecToken => hbmk } STATIC FUNCTION PlugIn_ctx_get_state( ctx ) RETURN ctx[ "cSTATE" ] STATIC FUNCTION PlugIn_call_low( hbmk, cName, hrb, ctx ) + LOCAL xResult LOCAL oError LOCAL lSuccess := .T. @@ -8994,6 +9090,7 @@ STATIC FUNCTION PlugIn_call_low( hbmk, cName, hrb, ctx ) RETURN lSuccess STATIC FUNCTION PlugIn_Execute_All( hbmk, cState ) + LOCAL hrb LOCAL ctx LOCAL lSuccess := .T. @@ -9010,6 +9107,7 @@ STATIC FUNCTION PlugIn_Execute_All( hbmk, cState ) RETURN lSuccess STATIC FUNCTION hbmk_ErrorMessage( oError ) + /* start error message */ LOCAL cMessage := iif( oError:severity > ES_WARNING, "Error", "Warning" ) + " " @@ -9035,6 +9133,7 @@ STATIC FUNCTION hbmk_ErrorMessage( oError ) RETURN cMessage STATIC FUNCTION FindInPathPlugIn( /* @ */ cFileName ) + LOCAL cDir LOCAL cName LOCAL cExt @@ -9054,6 +9153,7 @@ STATIC FUNCTION FindInPathPlugIn( /* @ */ cFileName ) RETURN FindInPath( cFileName ) STATIC FUNCTION FindInPath( cFileName, xPath, aExtDef ) + LOCAL cDir LOCAL cName LOCAL cExt @@ -9125,6 +9225,7 @@ STATIC FUNCTION ArrayJoinNoClone( arraySrc1, arraySrc2 ) */ STATIC FUNCTION ArrayJoin( arraySrc1, arraySrc2 ) + LOCAL arrayNew := AClone( arraySrc1 ) LOCAL nLen1 := Len( arrayNew ) @@ -9133,6 +9234,7 @@ STATIC FUNCTION ArrayJoin( arraySrc1, arraySrc2 ) RETURN ACopy( arraySrc2, arrayNew, , , nLen1 + 1 ) STATIC FUNCTION ArrayAJoin( arrayList ) + LOCAL array := AClone( arrayList[ 1 ] ) LOCAL tmp LOCAL nLenArray := Len( arrayList ) @@ -9154,6 +9256,7 @@ STATIC FUNCTION ArrayAJoin( arrayList ) RETURN array STATIC FUNCTION ArraySplit( arrayIn, nChunksReq ) + LOCAL arrayOut LOCAL nChunkSize LOCAL nChunkPos @@ -9236,6 +9339,7 @@ STATIC FUNCTION DepTreeToList( aTree ) */ STATIC PROCEDURE DepTreeWorker( aList, aTree ) + LOCAL xItem FOR EACH xItem IN aTree DESCEND @@ -9250,6 +9354,7 @@ STATIC PROCEDURE DepTreeWorker( aList, aTree ) RETURN STATIC FUNCTION ListDirExt( arraySrc, cDirNew, cExtNew, lStripClpAt ) + LOCAL array := AClone( arraySrc ) LOCAL cFileName @@ -9274,6 +9379,7 @@ STATIC FUNCTION ListDirExt( arraySrc, cDirNew, cExtNew, lStripClpAt ) /* Forms the list of libs as to appear on the command line */ STATIC FUNCTION ListCookLib( hbmk, aLIB, aLIBA, array, cPrefix, cExtNew ) + LOCAL cDir LOCAL cLibName LOCAL cLibNameCooked @@ -9320,6 +9426,7 @@ STATIC FUNCTION ListCookLib( hbmk, aLIB, aLIBA, array, cPrefix, cExtNew ) RETURN array STATIC FUNCTION FN_CookLib( cLibName, cPrefix, cExtNew ) + LOCAL cDir LOCAL cName LOCAL cExt @@ -9337,6 +9444,7 @@ STATIC FUNCTION FN_CookLib( cLibName, cPrefix, cExtNew ) /* Append optional prefix and optional extension to all members */ STATIC FUNCTION ListCook( arraySrc, cExtNew ) + LOCAL array := AClone( arraySrc ) LOCAL cItem @@ -9349,6 +9457,7 @@ STATIC FUNCTION ListCook( arraySrc, cExtNew ) RETURN array STATIC FUNCTION ArrayToList( array, cSeparator, nEscapeMode, nFNNotation, cPrefix, cPostfix ) + LOCAL cString := "" LOCAL tmp @@ -9375,6 +9484,7 @@ STATIC FUNCTION ArrayToList( array, cSeparator, nEscapeMode, nFNNotation, cPrefi RETURN cString STATIC FUNCTION ListToArray( cList, cSep ) + LOCAL array := {} LOCAL cItem @@ -9387,20 +9497,23 @@ STATIC FUNCTION ListToArray( cList, cSep ) RETURN array STATIC FUNCTION PathSepCount( cPath ) + LOCAL nCount := 0 LOCAL c + FOR EACH c IN cPath IF c == hb_ps() ++nCount ENDIF NEXT + RETURN nCount STATIC FUNCTION PathSepToForward( cFileName ) RETURN StrTran( cFileName, "\", "/" ) STATIC FUNCTION PathSepToSelf( cFileName, nStart ) - RETURN iif( nStart == NIL, StrTran( cFileName, iif( hb_ps() == "\", "/", "\" ), hb_ps() ),; + RETURN iif( nStart == NIL, StrTran( cFileName, iif( hb_ps() == "\", "/", "\" ), hb_ps() ), ; Left( cFileName, nStart - 1 ) + StrTran( SubStr( cFileName, nStart ), iif( hb_ps() == "\", "/", "\" ), hb_ps() ) ) STATIC FUNCTION PathSepToTarget( hbmk, cFileName, nStart ) @@ -9416,6 +9529,7 @@ STATIC FUNCTION PathSepToTarget( hbmk, cFileName, nStart ) RETURN Left( cFileName, nStart - 1 ) + StrTran( SubStr( cFileName, nStart ), "\", "/" ) STATIC FUNCTION FNameEscape( cFileName, nEscapeMode, nFNNotation ) + LOCAL cDir, cName, cExt, cDrive IF ! HB_ISNUMERIC( nEscapeMode ) @@ -9496,16 +9610,20 @@ STATIC FUNCTION FNameEscape( cFileName, nEscapeMode, nFNNotation ) RETURN cFileName STATIC FUNCTION StrHasSpecialChar( cString ) + LOCAL c + FOR EACH c IN cString IF !( hb_asciiIsAlpha( c ) .OR. hb_asciiIsDigit( c ) .OR. c $ "/." ) RETURN .T. ENDIF NEXT + RETURN .F. /* Remove all extensions from name */ STATIC FUNCTION FNameNameGetNoExt( cFileName ) + LOCAL cName := cFileName hb_FNameSplit( cFileName,, @cName ) @@ -9517,6 +9635,7 @@ STATIC FUNCTION FNameNameGetNoExt( cFileName ) RETURN cName STATIC FUNCTION FNameDirName( cFileName ) + LOCAL cDir, cName hb_FNameSplit( cFileName, @cDir, @cName ) @@ -9524,6 +9643,7 @@ STATIC FUNCTION FNameDirName( cFileName ) RETURN hb_FNameMerge( cDir, cName ) STATIC FUNCTION FNameDirExtSet( cFileName, cDirNew, cExtNew ) + LOCAL cDir, cName, cExt hb_FNameSplit( cFileName, @cDir, @cName, @cExt ) @@ -9538,6 +9658,7 @@ STATIC FUNCTION FNameDirExtSet( cFileName, cDirNew, cExtNew ) RETURN hb_FNameMerge( cDir, cName, cExt ) STATIC FUNCTION FN_Expand( cFileName, lCommandLine ) + LOCAL aFileList LOCAL aFile @@ -9571,6 +9692,7 @@ STATIC FUNCTION FNameHasWildcard( cFileName ) "*" $ cFileName STATIC FUNCTION HBC_Find( hbmk, cFile, nNesting ) + LOCAL cLibPath LOCAL lFound @@ -9596,17 +9718,19 @@ STATIC FUNCTION HBC_Find( hbmk, cFile, nNesting ) RETURN lFound STATIC FUNCTION AutoConfPathList() + #if defined( __PLATFORM__UNIX ) - RETURN { hb_DirSepAdd( GetEnv( "HOME" ) ) + ".harbour",; - "/etc/harbour",; - hb_DirSepAdd( hb_DirBase() ) + "../etc/harbour",; - hb_DirSepAdd( hb_DirBase() ) + "../etc",; + RETURN { hb_DirSepAdd( GetEnv( "HOME" ) ) + ".harbour", ; + "/etc/harbour", ; + hb_DirSepAdd( hb_DirBase() ) + "../etc/harbour", ; + hb_DirSepAdd( hb_DirBase() ) + "../etc", ; hb_DirBase() } #else RETURN { hb_DirBase() } #endif STATIC PROCEDURE HBC_ProcessAuto( hbmk ) + LOCAL cDir LOCAL cFileName @@ -9623,6 +9747,7 @@ STATIC PROCEDURE HBC_ProcessAuto( hbmk ) RETURN STATIC FUNCTION HBC_ProcessOne( hbmk, cFileName, nNestingLevel ) + LOCAL cFile LOCAL cLine LOCAL cItem @@ -10201,22 +10326,26 @@ STATIC FUNCTION HBC_ProcessOne( hbmk, cFileName, nNestingLevel ) RETURN .T. STATIC FUNCTION IsGTRequested( hbmk, cWhichGT ) + /* Check if it's a core/user GT. */ RETURN AScan( hbmk[ _HBMK_aLIBCOREGT ], {| tmp | Lower( tmp ) == Lower( cWhichGT ) } ) > 0 .OR. ; AScan( hbmk[ _HBMK_aLIBUSERGT ], {| tmp | Lower( tmp ) == Lower( cWhichGT ) } ) > 0 STATIC FUNCTION StrStripQuote( cString ) - RETURN iif( Left( cString, 1 ) == '"' .AND. Right( cString, 1 ) == '"',; - SubStr( cString, 2, Len( cString ) - 2 ),; + RETURN iif( Left( cString, 1 ) == '"' .AND. Right( cString, 1 ) == '"', ; + SubStr( cString, 2, Len( cString ) - 2 ), ; cString ) STATIC FUNCTION ValueIsT( cString ) + cString := Lower( cString ) RETURN cString == "yes" .OR. ; cString == "1" /* Compatibility */ STATIC FUNCTION ValueIsF( cString ) + cString := Lower( cString ) + RETURN cString == "no" .OR. ; cString == "0" /* Compatibility */ @@ -10230,17 +10359,23 @@ STATIC FUNCTION hbmk_builtin_File_hb_pkg_install() #define _HBMK_BUILDIN_FILENAME_MARKER_ "$" STATIC FUNCTION hbmk_builtin_List() - STATIC s_hHBM_BuildIn := {; + + STATIC s_hHBM_BuildIn := { ; _HBMK_BUILDIN_FILENAME_MARKER_ + "hb_pkg_install.hbm" => {|| hbmk_builtin_File_hb_pkg_install() } } + RETURN s_hHBM_BuildIn STATIC FUNCTION hbmk_builtin_Is( cFileName ) + cFileName := hb_FNameNameExt( cFileName ) + RETURN LEFTEQUAL( cFileName, _HBMK_BUILDIN_FILENAME_MARKER_ ) .AND. ; Len( cFileName ) > Len( _HBMK_BUILDIN_FILENAME_MARKER_ ) STATIC FUNCTION hbmk_builtin_Exists( cFileName ) + cFileName := hb_FNameNameExt( cFileName ) + RETURN hbmk_builtin_Is( cFileName ) .AND. cFileName $ hbmk_builtin_List() STATIC FUNCTION hbmk_builtin_Load( cFileName ) @@ -10249,6 +10384,7 @@ STATIC FUNCTION hbmk_builtin_Load( cFileName ) /* ; */ STATIC FUNCTION HBM_Load( hbmk, aParams, cFileName, nNestingLevel, lProcHBP, cParentFileName ) + LOCAL cFile LOCAL cLine LOCAL cParam @@ -10370,6 +10506,7 @@ STATIC FUNCTION HBM_Load( hbmk, aParams, cFileName, nNestingLevel, lProcHBP, cPa */ STATIC FUNCTION ArchCompFilter( hbmk, cItem, cFileName ) + LOCAL nStart, nEnd LOCAL cFilterSrc LOCAL cFilterHarb @@ -10420,8 +10557,8 @@ STATIC FUNCTION ArchCompFilter( hbmk, cItem, cFileName ) cChar := SubStr( cFilterSrc, nPos, 1 ) IF cValue == NIL - IF iif( Empty( cKeyword ),; - HB_ISFIRSTIDCHAR( cChar ),; + IF iif( Empty( cKeyword ), ; + HB_ISFIRSTIDCHAR( cChar ), ; HB_ISNEXTIDCHAR( cChar ) ) cKeyword += cChar ELSEIF cChar $ "=<>" .AND. SubStr( cFilterSrc, nPos + 1, 1 ) == "'" @@ -10496,6 +10633,7 @@ STATIC FUNCTION ArchCompFilter( hbmk, cItem, cFileName ) RETURN cItem STATIC FUNCTION MacroProc( hbmk, cString, cFileName, cMacroPrefix ) + LOCAL nStart LOCAL nEnd LOCAL cMacro @@ -10642,7 +10780,9 @@ STATIC FUNCTION MacroGet( hbmk, cMacro, cFileName ) RETURN cMacro STATIC FUNCTION IsValidHarbourID( cName ) + LOCAL c + IF HB_ISFIRSTIDCHAR( Left( cName, 1 ) ) FOR EACH c IN SubStr( cName, 2 ) IF ! HB_ISNEXTIDCHAR( c ) @@ -10651,9 +10791,11 @@ STATIC FUNCTION IsValidHarbourID( cName ) NEXT RETURN .T. ENDIF + RETURN .F. STATIC FUNCTION FuncNameEncode( cName ) + LOCAL cResult, c LOCAL nPos @@ -10666,6 +10808,7 @@ STATIC FUNCTION FuncNameEncode( cName ) cResult += "x" + Lower( hb_NumToHex( Asc( c ), 2 ) ) ENDIF NEXT + RETURN cResult STATIC FUNCTION IsHexDigit( c ) @@ -10678,6 +10821,7 @@ STATIC FUNCTION IsHexDigit( c ) * [druzus] */ STATIC FUNCTION getFirstFunc( hbmk, cFile ) + LOCAL cFuncList, cExecNM, cFuncName, cExt, cLine, n, c cFuncName := "" @@ -10725,6 +10869,7 @@ STATIC FUNCTION getFirstFunc( hbmk, cFile ) RETURN cFuncName STATIC PROCEDURE PlatformPRGFlags( hbmk, aOPTPRG ) + LOCAL aUn LOCAL aDf LOCAL cMacro @@ -10992,6 +11137,7 @@ STATIC PROCEDURE rtlnk_filetrans( aFileList ) */ STATIC FUNCTION rtlnk_read( cFileName, aPrevFiles ) + LOCAL cFileBody LOCAL cPath, cFile, cExt LOCAL hFile @@ -11035,6 +11181,7 @@ STATIC FUNCTION rtlnk_read( cFileName, aPrevFiles ) RETURN cFileBody STATIC FUNCTION rtlnk_tokens( cLine ) + LOCAL cCh FOR EACH cCh IN @cLine @@ -11047,6 +11194,7 @@ STATIC FUNCTION rtlnk_tokens( cLine ) STATIC FUNCTION rtlnk_process( hbmk, cCommands, cFileOut, aFileList, aLibList, ; aPrevFiles ) + LOCAL cLine, cWord LOCAL nMode @@ -11139,6 +11287,7 @@ STATIC FUNCTION rtlnk_process( hbmk, cCommands, cFileOut, aFileList, aLibList, ; /* .po generation */ STATIC PROCEDURE RebuildPO( hbmk, aPOTIN ) + LOCAL cLNG LOCAL fhnd LOCAL cPOTemp @@ -11203,6 +11352,7 @@ STATIC PROCEDURE RebuildPO( hbmk, aPOTIN ) /* .po update */ STATIC PROCEDURE UpdatePO( hbmk, aPOTIN ) + LOCAL cLNG LOCAL aUpd := {} @@ -11229,6 +11379,7 @@ STATIC PROCEDURE UpdatePO( hbmk, aPOTIN ) /* .hbl generation */ STATIC PROCEDURE MakeHBL( hbmk, cHBL ) + LOCAL cPO LOCAL tPO LOCAL cLNG @@ -11283,6 +11434,7 @@ STATIC PROCEDURE MakeHBL( hbmk, cHBL ) RETURN STATIC FUNCTION LoadPOTFiles( hbmk, aFiles, cFileBase, lIgnoreError ) + LOCAL aTrans, aTrans2 LOCAL hIndex LOCAL cErrorMsg @@ -11315,6 +11467,7 @@ STATIC FUNCTION LoadPOTFiles( hbmk, aFiles, cFileBase, lIgnoreError ) RETURN aTrans STATIC FUNCTION LoadPOTFilesAsHash( hbmk, aFiles ) + LOCAL cErrorMsg LOCAL hTrans LOCAL aTrans @@ -11336,6 +11489,7 @@ STATIC FUNCTION LoadPOTFilesAsHash( hbmk, aFiles ) RETURN hTrans STATIC PROCEDURE POTMerge( hbmk, aFiles, cFileBase, cFileOut ) + LOCAL cErrorMsg LOCAL aTrans := LoadPOTFiles( hbmk, aFiles, cFileBase, .T. ) @@ -11348,6 +11502,7 @@ STATIC PROCEDURE POTMerge( hbmk, aFiles, cFileBase, cFileOut ) RETURN STATIC PROCEDURE AutoTrans( hbmk, cFileIn, aFiles, cFileOut ) + LOCAL cErrorMsg LOCAL hTrans := LoadPOTFilesAsHash( hbmk, aFiles ) @@ -11362,6 +11517,7 @@ STATIC PROCEDURE AutoTrans( hbmk, cFileIn, aFiles, cFileOut ) RETURN STATIC FUNCTION GenHBL( hbmk, aFiles, cFileOut, lEmpty ) + LOCAL cHBLBody LOCAL pI18N LOCAL aTrans := LoadPOTFiles( hbmk, aFiles, NIL, .F. ) @@ -11406,6 +11562,7 @@ STATIC FUNCTION win_implib_command( hbmk, cCommand, cSourceDLL, cTargetLib, cFla #define _COFF_LIB_SIGNATURE "!" STATIC FUNCTION IsCOFFLib( cFileName ) + LOCAL fhnd := FOpen( cFileName, FO_READ ) LOCAL cBuffer @@ -11423,6 +11580,7 @@ STATIC FUNCTION IsCOFFLib( cFileName ) #define _OMF_LIB_SIGNATURE hb_BChar( 0xF0 ) STATIC FUNCTION IsOMFLib( cFileName ) + LOCAL fhnd := FOpen( cFileName, FO_READ ) LOCAL cBuffer @@ -11438,6 +11596,7 @@ STATIC FUNCTION IsOMFLib( cFileName ) RETURN .F. STATIC FUNCTION win_implib_coff( hbmk, cSourceDLL, cTargetLib ) + LOCAL cSourceLib /* Try to find COFF .lib with the same name */ @@ -11453,6 +11612,7 @@ STATIC FUNCTION win_implib_coff( hbmk, cSourceDLL, cTargetLib ) RETURN _HBMK_IMPLIB_NOTFOUND STATIC FUNCTION win_implib_omf( hbmk, cSourceDLL, cTargetLib ) + LOCAL cSourceLib /* Try to find COFF .lib with the same name */ @@ -11468,6 +11628,7 @@ STATIC FUNCTION win_implib_omf( hbmk, cSourceDLL, cTargetLib ) RETURN _HBMK_IMPLIB_NOTFOUND STATIC FUNCTION win_implib_def( hbmk, cCommand, cSourceDLL, cTargetLib, cFlags ) + LOCAL cSourceDef /* Try to find .def file with the same name */ @@ -11512,6 +11673,7 @@ STATIC FUNCTION win_implib_copy( hbmk, cSourceDLL, cTargetLib ) [vszakats] */ STATIC FUNCTION win_implib_command_gcc( hbmk, cCommand, cSourceDLL, cTargetLib, cFlags ) + LOCAL nResult IF ( nResult := win_implib_coff( hbmk, cSourceDLL, cTargetLib ) ) != _HBMK_IMPLIB_NOTFOUND @@ -11525,6 +11687,7 @@ STATIC FUNCTION win_implib_command_gcc( hbmk, cCommand, cSourceDLL, cTargetLib, RETURN win_implib_copy( hbmk, cSourceDLL, cTargetLib ) STATIC FUNCTION win_implib_command_bcc( hbmk, cCommand, cSourceDLL, cTargetLib, cFlags ) + LOCAL nResult IF ( nResult := win_implib_omf( hbmk, cSourceDLL, cTargetLib ) ) != _HBMK_IMPLIB_NOTFOUND @@ -11541,6 +11704,7 @@ STATIC FUNCTION win_implib_command_watcom( hbmk, cCommand, cSourceDLL, cTargetLi RETURN win_implib_command( hbmk, cCommand, cSourceDLL, cTargetLib, cFlags ) STATIC FUNCTION win_implib_command_pocc( hbmk, cCommand, cSourceDLL, cTargetLib, cFlags ) + LOCAL nResult IF ( nResult := win_implib_coff( hbmk, cSourceDLL, cTargetLib ) ) != _HBMK_IMPLIB_NOTFOUND @@ -11550,6 +11714,7 @@ STATIC FUNCTION win_implib_command_pocc( hbmk, cCommand, cSourceDLL, cTargetLib, RETURN win_implib_command( hbmk, cCommand, cSourceDLL, cTargetLib, cFlags ) STATIC FUNCTION win_implib_command_msvc( hbmk, cCommand, cSourceDLL, cTargetLib, cFlags ) + LOCAL nResult LOCAL cExports @@ -11655,6 +11820,7 @@ STATIC FUNCTION VCSDetect( cDir ) RETURN _VCS_UNKNOWN STATIC FUNCTION VCSID( hbmk, cDir, cVCSHEAD, /* @ */ cType ) + LOCAL cStdOut LOCAL nType := VCSDetect( cDir ) LOCAL cCommand @@ -11863,6 +12029,7 @@ STATIC FUNCTION hbmk_DYNSUFFIX( hbmk ) /* Keep this public, it's used from macro. */ FUNCTION hbmk_KEYW( hbmk, cFileName, cKeyword, cValue, cOperator ) + LOCAL tmp IF cKeyword == hbmk[ _HBMK_cPLAT ] .OR. ; @@ -11942,6 +12109,7 @@ FUNCTION hbmk_KEYW( hbmk, cFileName, cKeyword, cValue, cOperator ) RETURN .F. STATIC PROCEDURE ParseCOMPPLATCPU( hbmk, cString, nMainTarget ) + LOCAL aToken := hb_ATokens( Lower( cString ), "/", .T., .T. ) LOCAL cToken @@ -11971,6 +12139,7 @@ STATIC PROCEDURE ParseCOMPPLATCPU( hbmk, cString, nMainTarget ) RETURN STATIC FUNCTION MacOSXFiles( hbmk, nType, cPROGNAME ) + LOCAL cString HB_SYMBOL_UNUSED( hbmk ) @@ -12033,6 +12202,7 @@ STATIC FUNCTION MacOSXFiles( hbmk, nType, cPROGNAME ) RETURN cString STATIC FUNCTION mk_extern( hbmk, cInputName, cBin_LibHBX, cOpt_LibHBX, cLibHBX_Regex, cOutputName ) + LOCAL aExtern IF ( aExtern := __hb_extern_get_list( hbmk, cInputName, cBin_LibHBX, cOpt_LibHBX, cLibHBX_Regex ) ) != NIL @@ -12043,6 +12213,7 @@ STATIC FUNCTION mk_extern( hbmk, cInputName, cBin_LibHBX, cOpt_LibHBX, cLibHBX_R RETURN .F. STATIC FUNCTION __hb_extern_get_list( hbmk, cInputName, cBin_LibHBX, cOpt_LibHBX, cLibHBX_Regex ) + LOCAL aExtern := NIL LOCAL hExtern @@ -12099,6 +12270,7 @@ STATIC FUNCTION __hb_extern_get_list( hbmk, cInputName, cBin_LibHBX, cOpt_LibHBX #define _HB_SELF_SUFFIX "__" STATIC PROCEDURE __hb_extern_get_exception_list( cInputName, /* @ */ aInclude, /* @ */ aExclude, /* @ */ hDynamic ) + LOCAL cFile LOCAL pRegex LOCAL tmp @@ -12128,6 +12300,7 @@ STATIC PROCEDURE __hb_extern_get_exception_list( cInputName, /* @ */ aInclude, / RETURN STATIC FUNCTION __hb_extern_gen( hbmk, aFuncList, cOutputName ) + LOCAL aExtern LOCAL cExtern LOCAL tmp @@ -12139,9 +12312,10 @@ STATIC FUNCTION __hb_extern_gen( hbmk, aFuncList, cOutputName ) LOCAL cSelfName := _HB_SELF_PREFIX + StrToDefine( hb_FNameName( cOutputName ) ) + _HB_SELF_SUFFIX LOCAL cLine := "/* " + Replicate( "-", 68 ) + hb_eol() - LOCAL cHelp := " * Syntax: // HB_FUNC_INCLUDE " + hb_eol() +; - " * // HB_FUNC_EXCLUDE " + hb_eol() +; - " */" + hb_eol() + LOCAL cHelp := ; + " * Syntax: // HB_FUNC_INCLUDE " + hb_eol() +; + " * // HB_FUNC_EXCLUDE " + hb_eol() +; + " */" + hb_eol() __hb_extern_get_exception_list( cOutputName, @aInclude, @aExclude, @hDynamic ) @@ -12343,6 +12517,7 @@ STATIC FUNCTION hbmk_CoreHeaderFiles() #define _EXT_ENV_ "HB_EXTENSION" STATIC PROCEDURE __hbshell( cFile, ... ) + LOCAL aExtension := {} LOCAL hbmk LOCAL cHBC @@ -12418,7 +12593,7 @@ STATIC PROCEDURE __hbshell( cFile, ... ) - dynamic libs are installed into bin dir. (this is not true on *nix, there they are in lib dir, and it is a problem in configurations where lib dir contains component, so to solve it - we use the same values as was used to build itself.) */ + we use the same values as was used to build itself.) */ __hbshell_LoadExtFromSource( aExtension, cFile ) @@ -12470,6 +12645,7 @@ STATIC PROCEDURE __hbshell( cFile, ... ) RETURN STATIC FUNCTION __hbshell_FileSig( cFile ) + LOCAL hFile LOCAL cBuff, cSig, cExt @@ -12488,6 +12664,7 @@ STATIC FUNCTION __hbshell_FileSig( cFile ) RETURN cExt STATIC FUNCTION __hbshell_ConfigDir() + LOCAL cEnvVar LOCAL cDir @@ -12510,6 +12687,7 @@ STATIC FUNCTION __hbshell_ConfigDir() RETURN cDir + hb_ps() STATIC PROCEDURE __hbshell_LoadExtFromFile( aExtension, cFileName ) + LOCAL cItem FOR EACH cItem IN hb_ATokens( StrTran( MemoRead( cFileName ), Chr( 13 ) ), Chr( 10 ) ) @@ -12524,6 +12702,7 @@ STATIC PROCEDURE __hbshell_LoadExtFromFile( aExtension, cFileName ) RETURN STATIC PROCEDURE __hbshell_LoadExtFromString( aExtension, cString ) + LOCAL cItem FOR EACH cItem IN hb_ATokens( cString,, .T. ) @@ -12535,6 +12714,7 @@ STATIC PROCEDURE __hbshell_LoadExtFromString( aExtension, cString ) RETURN STATIC PROCEDURE __hbshell_LoadExtFromSource( aExtension, cFileName ) + LOCAL cFile := MemoRead( cFileName ) LOCAL pRegex LOCAL tmp @@ -12556,13 +12736,14 @@ STATIC PROCEDURE __hbshell_LoadExtFromSource( aExtension, cFileName ) RETURN STATIC PROCEDURE __hbshell_ext_static_init() + LOCAL tmp LOCAL nCount LOCAL cName - nCount := __dynsCount() + nCount := __dynSCount() FOR tmp := 1 TO nCount - cName := __dynsGetName( tmp ) + cName := __dynSGetName( tmp ) IF LEFTEQUAL( cName, "__HBEXTERN__" ) .AND. ; ! HBMK_IS_IN( cName, "__HBEXTERN__HBCPAGE__" ) s_hLibExt[ Lower( SubStr( cName, Len( "__HBEXTERN__" ) + 1, Len( cName ) - Len( "__HBEXTERN__" ) - Len( "__" ) ) ) ] := NIL @@ -12572,6 +12753,7 @@ STATIC PROCEDURE __hbshell_ext_static_init() RETURN STATIC PROCEDURE __hbshell_ext_init( aExtension ) + LOCAL cName IF ! Empty( aExtension ) @@ -12587,6 +12769,7 @@ STATIC PROCEDURE __hbshell_ext_init( aExtension ) /* TODO: Load .hbc file (handle -stop command in it) and extend header search path accordingly */ FUNCTION hbshell_ext_load( cName ) + LOCAL cFileName LOCAL hLib LOCAL tmp @@ -12594,7 +12777,7 @@ FUNCTION hbshell_ext_load( cName ) IF ! Empty( cName ) IF hb_Version( HB_VERSION_SHARED ) IF !( cName $ s_hLibExt ) - cFileName := FindInPath( tmp := hb_libName( cName + hb_libPostfix() ),; + cFileName := FindInPath( tmp := hb_libName( cName + hb_libPostfix() ), ; iif( hb_Version( HB_VERSION_UNIX_COMPAT ), GetEnv( "LD_LIBRARY_PATH" ), GetEnv( "PATH" ) ) ) IF Empty( cFileName ) OutErr( hb_StrFormat( I_( "'%1$s' (%2$s) not found." ), cName, tmp ) + _OUT_EOL ) @@ -12625,6 +12808,7 @@ FUNCTION hbshell_ext_unload( cName ) RETURN .F. FUNCTION hbshell_ext_get_list() + LOCAL aName := Array( Len( s_hLibExt ) ) LOCAL hLib @@ -12648,22 +12832,25 @@ STATIC FUNCTION __plugin_ext() FUNCTION __hbshell_plugin() RETURN {; - "id" => "ext",; - "init" => {| hConIO | __init( hConIO ) } ,; - "exit" => {| context | HB_SYMBOL_UNUSED( context ) } ,; + "id" => "ext", ; + "init" => {| hConIO | __init( hConIO ) } , ; + "exit" => {| context | HB_SYMBOL_UNUSED( context ) } , ; "cmd" => {| context, cCommand | __command( context, cCommand ) } } STATIC FUNCTION __init( hConIO ) RETURN { hConIO, { ; - "load" => { "" , "Load." , {| context, cCommand | load( context, cCommand ) } },; - "unload" => { "" , "Unload." , {| context, cCommand | unload( context, cCommand ) } },; + "load" => { "" , "Load." , {| context, cCommand | load( context, cCommand ) } }, ; + "unload" => { "" , "Unload." , {| context, cCommand | unload( context, cCommand ) } }, ; "list" => { "" , "List." , {| context, cCommand | list( context ) } } } } STATIC PROCEDURE __disp( context, cText ) + Eval( context[ 1 ][ "displine" ], cText ) + RETURN STATIC FUNCTION __command( context, cCommand ) + LOCAL aCommand LOCAL nPos @@ -12680,6 +12867,7 @@ STATIC FUNCTION __command( context, cCommand ) /* Commands */ STATIC PROCEDURE load( context, cCommand ) + LOCAL aToken := hb_ATokens( cCommand, " " ) LOCAL tmp @@ -12690,6 +12878,7 @@ STATIC PROCEDURE load( context, cCommand ) RETURN STATIC PROCEDURE unload( context, cCommand ) + LOCAL aToken := hb_ATokens( cCommand, " " ) LOCAL tmp @@ -12700,6 +12889,7 @@ STATIC PROCEDURE unload( context, cCommand ) RETURN STATIC PROCEDURE list( context ) + LOCAL cName FOR EACH cName IN hbshell_ext_get_list() @@ -12717,6 +12907,7 @@ STATIC PROCEDURE list( context ) \[ <"cExpr"> \] := STATIC FUNCTION __hbshell_plugins() + LOCAL hPlugins := { => } LOCAL cDir LOCAL cExt @@ -12742,7 +12933,7 @@ STATIC FUNCTION __hbshell_plugins() STATIC FUNCTION __hbshell_plugins_load( hPlugins, aParams ) LOCAL hConIO := {; - "displine" => {| c | __hbshell_ToConsole( c ) } ,; + "displine" => {| c | __hbshell_ToConsole( c ) } , ; "gethidden" => {|| __hbshell_GetHidden() } } LOCAL plugin @@ -12790,6 +12981,7 @@ STATIC FUNCTION __hbshell_plugins_load( hPlugins, aParams ) RETURN plugins STATIC FUNCTION __hbshell_plugins_command( plugins, cCommand, cDomain ) + LOCAL plugin FOR EACH plugin IN plugins @@ -12807,6 +12999,7 @@ STATIC FUNCTION __hbshell_plugins_command( plugins, cCommand, cDomain ) RETURN .F. STATIC FUNCTION __hbshell_plugins_valid_id( plugins, cID ) + LOCAL plugin FOR EACH plugin IN plugins @@ -12818,6 +13011,7 @@ STATIC FUNCTION __hbshell_plugins_valid_id( plugins, cID ) RETURN .F. STATIC FUNCTION __hbshell_plugins_valid_id_list( plugins ) + LOCAL plugin LOCAL aList := {} @@ -12828,6 +13022,7 @@ STATIC FUNCTION __hbshell_plugins_valid_id_list( plugins ) RETURN aList STATIC PROCEDURE __hbshell_plugins_unload( plugins ) + LOCAL plugin FOR EACH plugin IN plugins @@ -12843,6 +13038,7 @@ STATIC PROCEDURE __hbshell_plugins_unload( plugins ) #define _HBMK_AUTOSHELL_NAME "hbstart.hb" STATIC PROCEDURE __hbshell_ProcessStart() + LOCAL cDir LOCAL cFileName @@ -12857,6 +13053,7 @@ STATIC PROCEDURE __hbshell_ProcessStart() /* TODO: rewrite the full-screen shell to be a simple stdout/stdin shell */ STATIC PROCEDURE __hbshell_prompt( aParams, aCommand ) + LOCAL GetList LOCAL cLine LOCAL nMaxRow, nMaxCol @@ -12941,7 +13138,7 @@ STATIC PROCEDURE __hbshell_prompt( aParams, aCommand ) {|| cLine := iif( nHistIndex < Len( s_aHistory ), ; s_aHistory[ ++nHistIndex ], ; ( nHistIndex := Len( s_aHistory ) + 1, Space( HB_LINE_LEN ) ) ) } ) - bKeyResize := SetKey( HB_K_RESIZE,; + bKeyResize := SetKey( HB_K_RESIZE, ; {|| lResize := .T., hb_KeyPut( K_ENTER ) } ) ReadModal( GetList ) @@ -13009,10 +13206,13 @@ STATIC PROCEDURE __hbshell_prompt( aParams, aCommand ) RETURN STATIC PROCEDURE __hbshell_ToConsole( cText ) + QQOut( cText + hb_eol() ) + RETURN STATIC FUNCTION __hbshell_GetHidden() + LOCAL GetList := {} LOCAL cPassword := Space( 128 ) LOCAL nSavedRow @@ -13097,6 +13297,7 @@ STATIC PROCEDURE __hbshell_Err( oErr, cCommand ) Break( oErr ) STATIC PROCEDURE __hbshell_Exec( cCommand ) + LOCAL pHRB, cHRB, cFunc, bBlock, nRowMin cFunc := "STATIC FUNCTION __HBDOT()" + hb_eol() +; @@ -13149,6 +13350,7 @@ EXIT PROCEDURE __hbshell_exit() RETURN STATIC PROCEDURE __hbshell_HistoryLoad() + LOCAL cHistory LOCAL cLine @@ -13170,6 +13372,7 @@ STATIC PROCEDURE __hbshell_HistoryLoad() RETURN STATIC PROCEDURE __hbshell_HistorySave() + LOCAL cHistory LOCAL cLine LOCAL cDir @@ -13202,6 +13405,7 @@ DYNAMIC win_regWrite DYNAMIC win_regDelete STATIC FUNCTION __hbshell_win_reg_self( lRegister, lAllUser ) + IF ! hb_IsFunction( "__HBEXTERN__HBWIN__" ) .AND. ; ! hbshell_ext_load( "hbwin" ) RETURN .F. @@ -13210,20 +13414,22 @@ STATIC FUNCTION __hbshell_win_reg_self( lRegister, lAllUser ) ! hb_IsFunction( "win_regDelete" ) RETURN .F. ENDIF + RETURN __hbshell_win_reg_app( lRegister, lAllUser, hb_ProgName() ) STATIC FUNCTION __hbshell_win_reg_app( lRegister, lAllUser, cAppPath ) + LOCAL cHive := iif( HB_ISLOGICAL( lAllUser ) .AND. lAllUser, "HKEY_CLASSES_ROOT", "HKEY_CURRENT_USER\Software\Classes" ) LOCAL lSuccess := .T. LOCAL tmp LOCAL aEntries := {; - cHive + "\" , "" ,; - cHive + "\.hb\" , "HarbourScript" ,; - cHive + "\HarbourScript\" , "Harbour Script file" ,; - cHive + "\HarbourScript\DefaultIcon\" , cAppPath + ",-1" ,; - cHive + "\HarbourScript\Shell\" , "Run" ,; - cHive + "\HarbourScript\Shell\Run\" , "" ,; + cHive + "\" , "" , ; + cHive + "\.hb\" , "HarbourScript" , ; + cHive + "\HarbourScript\" , "Harbour Script file" , ; + cHive + "\HarbourScript\DefaultIcon\" , cAppPath + ",-1" , ; + cHive + "\HarbourScript\Shell\" , "Run" , ; + cHive + "\HarbourScript\Shell\Run\" , "" , ; cHive + "\HarbourScript\Shell\Run\Command\", cAppPath + ' "%1"' } IF lRegister @@ -13244,54 +13450,54 @@ STATIC FUNCTION __hbshell_win_reg_app( lRegister, lAllUser, cAppPath ) a full-screen CUI ("interactive") app */ STATIC FUNCTION __hbshell_detect_CUI_extern_positive() RETURN { ; - "COL" => NIL ,; - "DISPBEGIN" => NIL ,; - "DISPBOX" => NIL ,; - "DISPCOUNT" => NIL ,; - "DISPEND" => NIL ,; - "DISPOUT" => NIL ,; - "DISPOUTAT" => NIL ,; - "HB_CLRAREA" => NIL ,; - "HB_DISPBOX" => NIL ,; - "HB_DISPOUTAT" => NIL ,; - "HB_DISPOUTATBOX" => NIL ,; - "HB_KEYCLEAR" => NIL ,; - "HB_KEYINS" => NIL ,; - "HB_KEYLAST" => NIL ,; - "HB_KEYNEXT" => NIL ,; - "HB_KEYPUT" => NIL ,; - "HB_KEYSETLAST" => NIL ,; - "HB_KEYSTD" => NIL ,; - "HB_MGETBOUNDS" => NIL ,; - "HB_MMIDDLEDOWN" => NIL ,; - "HB_SCRMAXCOL" => NIL ,; - "HB_SCRMAXROW" => NIL ,; - "HB_SCROLL" => NIL ,; - "HB_SHADOW" => NIL ,; - "INKEY" => NIL ,; - "LASTKEY" => NIL ,; - "MAXCOL" => NIL ,; - "MAXROW" => NIL ,; - "MCOL" => NIL ,; - "MDBLCLK" => NIL ,; - "MHIDE" => NIL ,; - "MLEFTDOWN" => NIL ,; - "MPRESENT" => NIL ,; - "MRESTSTATE" => NIL ,; - "MRIGHTDOWN" => NIL ,; - "MROW" => NIL ,; - "MSAVESTATE" => NIL ,; - "MSETBOUNDS" => NIL ,; - "MSETCURSOR" => NIL ,; - "MSETPOS" => NIL ,; - "MSHOW" => NIL ,; - "NEXTKEY" => NIL ,; - "RESTSCREEN" => NIL ,; - "ROW" => NIL ,; - "SAVESCREEN" => NIL ,; - "SCROLL" => NIL ,; - "SETMODE" => NIL ,; - "SETPOS" => NIL ,; + "COL" => NIL , ; + "DISPBEGIN" => NIL , ; + "DISPBOX" => NIL , ; + "DISPCOUNT" => NIL , ; + "DISPEND" => NIL , ; + "DISPOUT" => NIL , ; + "DISPOUTAT" => NIL , ; + "HB_CLRAREA" => NIL , ; + "HB_DISPBOX" => NIL , ; + "HB_DISPOUTAT" => NIL , ; + "HB_DISPOUTATBOX" => NIL , ; + "HB_KEYCLEAR" => NIL , ; + "HB_KEYINS" => NIL , ; + "HB_KEYLAST" => NIL , ; + "HB_KEYNEXT" => NIL , ; + "HB_KEYPUT" => NIL , ; + "HB_KEYSETLAST" => NIL , ; + "HB_KEYSTD" => NIL , ; + "HB_MGETBOUNDS" => NIL , ; + "HB_MMIDDLEDOWN" => NIL , ; + "HB_SCRMAXCOL" => NIL , ; + "HB_SCRMAXROW" => NIL , ; + "HB_SCROLL" => NIL , ; + "HB_SHADOW" => NIL , ; + "INKEY" => NIL , ; + "LASTKEY" => NIL , ; + "MAXCOL" => NIL , ; + "MAXROW" => NIL , ; + "MCOL" => NIL , ; + "MDBLCLK" => NIL , ; + "MHIDE" => NIL , ; + "MLEFTDOWN" => NIL , ; + "MPRESENT" => NIL , ; + "MRESTSTATE" => NIL , ; + "MRIGHTDOWN" => NIL , ; + "MROW" => NIL , ; + "MSAVESTATE" => NIL , ; + "MSETBOUNDS" => NIL , ; + "MSETCURSOR" => NIL , ; + "MSETPOS" => NIL , ; + "MSHOW" => NIL , ; + "NEXTKEY" => NIL , ; + "RESTSCREEN" => NIL , ; + "ROW" => NIL , ; + "SAVESCREEN" => NIL , ; + "SCROLL" => NIL , ; + "SETMODE" => NIL , ; + "SETPOS" => NIL , ; "SETPOSBS" => NIL } STATIC FUNCTION __hbshell_detect_CUI_extern_negative() @@ -13299,6 +13505,7 @@ STATIC FUNCTION __hbshell_detect_CUI_extern_negative() "HB_GT_CGI_DEFAULT" => NIL } STATIC FUNCTION __hbshell_detect_GT( hHRB ) + LOCAL aFunction LOCAL cFunction LOCAL hFilter @@ -13340,6 +13547,7 @@ FUNCTION hbshell_ProgName() RETURN s_cProgName_hbshell FUNCTION hbshell_gtSelect( cGT ) + IF ! HB_ISSTRING( cGT ) cGT := __hbshell_gtDefault() ENDIF @@ -13349,6 +13557,7 @@ FUNCTION hbshell_gtSelect( cGT ) hb_gtInfo( HB_GTI_COMPATBUFFER, .F. ) hb_gtInfo( HB_GTI_BOXCP, hb_cdpSelect() ) ENDIF + RETURN NIL STATIC FUNCTION __hbshell_gtDefault() @@ -13371,6 +13580,7 @@ STATIC FUNCTION __hbshell_gtDefault() /* ------------------------------------------------------------- */ STATIC PROCEDURE convert_hbmake_to_hbp( hbmk, cSrcName, cDstName ) + LOCAL cSrc := MemoRead( cSrcName ) LOCAL cDst LOCAL aDst := {} @@ -13500,6 +13710,7 @@ STATIC PROCEDURE convert_hbmake_to_hbp( hbmk, cSrcName, cDstName ) RETURN STATIC PROCEDURE convert_xbp_to_hbp( hbmk, cSrcName, cDstName ) + LOCAL cSrc := MemoRead( cSrcName ) LOCAL cDst LOCAL aDst := {} @@ -13628,6 +13839,7 @@ STATIC PROCEDURE convert_xbp_to_hbp( hbmk, cSrcName, cDstName ) RETURN STATIC PROCEDURE convert_xhp_to_hbp( hbmk, cSrcName, cDstName ) + LOCAL cSrc := MemoRead( cSrcName ) LOCAL cDst LOCAL aDst := {} @@ -13776,6 +13988,7 @@ STATIC PROCEDURE convert_xhp_to_hbp( hbmk, cSrcName, cDstName ) RETURN STATIC FUNCTION GetUILang() + LOCAL cLNG IF Empty( cLNG := GetEnv( "HB_LANG" ) ) @@ -13787,6 +14000,7 @@ STATIC FUNCTION GetUILang() RETURN StrTran( cLNG, "_", "-" ) STATIC PROCEDURE SetUILang( cUILNG ) + LOCAL tmp /* Setup input CP of the translation */ @@ -13824,6 +14038,7 @@ INIT PROCEDURE ClipInit() RETURN STATIC PROCEDURE ShowHeader( hbmk ) + LOCAL cTrsText LOCAL cTrsTextI @@ -13851,202 +14066,202 @@ STATIC FUNCTION HBRawVersion() STATIC PROCEDURE ShowHelp( hbmk, lLong ) LOCAL aText_Basic := {; - I_( "Syntax:" ),; - "",; - hb_StrFormat( I_( " %1$s [options] [] " ), _SELF_NAME_ ),; - "",; + I_( "Syntax:" ), ; + "", ; + hb_StrFormat( I_( " %1$s [options] [] " ), _SELF_NAME_ ), ; + "", ; I_( "Options:" ) } LOCAL aText_Supp := {; - "",; - I_( "Supported values for each supported value:" ),; - " - linux : gcc, clang, icc, watcom, sunpro, open64, pcc",; - " - darwin : gcc, clang, icc, pcc",; - " - win : mingw, msvc, bcc, watcom, icc, pocc, xcc,",; - " mingw64, msvc64, msvcia64, iccia64, pocc64",; - " - wce : mingwarm, mingw, msvcarm, poccarm",; - " - os2 : gcc, gccomf, watcom",; - " - dos : djgpp, watcom",; - " - bsd : gcc, clang, pcc",; - " - hpux : gcc",; - " - beos : gcc",; - " - qnx : gcc",; - " - android : gcc, gccarm",; - " - vxworks : gcc, diab",; - " - symbian : gcc",; - " - cygwin : gcc",; - " - minix : gcc, clang, ack",; - " - aix : gcc",; + "", ; + I_( "Supported values for each supported value:" ), ; + " - linux : gcc, clang, icc, watcom, sunpro, open64, pcc", ; + " - darwin : gcc, clang, icc, pcc", ; + " - win : mingw, msvc, bcc, watcom, icc, pocc, xcc,", ; + " mingw64, msvc64, msvcia64, iccia64, pocc64", ; + " - wce : mingwarm, mingw, msvcarm, poccarm", ; + " - os2 : gcc, gccomf, watcom", ; + " - dos : djgpp, watcom", ; + " - bsd : gcc, clang, pcc", ; + " - hpux : gcc", ; + " - beos : gcc", ; + " - qnx : gcc", ; + " - android : gcc, gccarm", ; + " - vxworks : gcc, diab", ; + " - symbian : gcc", ; + " - cygwin : gcc", ; + " - minix : gcc, clang, ack", ; + " - aix : gcc", ; " - sunos : gcc, sunpro, pcc" } LOCAL aOpt_Basic := {; - { "-o" , I_( "output file name" ) },; - { "-l" , I_( "link with library. should be without path, extension and 'lib' prefix (unless part of libname). Do not add core Harbour libraries, they are automatically added as needed." ) },; - { "-L" , I_( "additional path to search for libraries" ) },; - { "-i

|-incpath=

" , I_( "additional path to search for headers" ) },; - { "-static|-shared" , I_( "link with static/shared libs" ) },; - { "-mt|-st" , I_( "link with multi/single-thread Harbour VM" ) },; - { "-gt" , I_( "link with GT GT driver, can be repeated to link with more GTs. First one will be the default at runtime" ) },; - { "-hbexe" , I_( "create executable (default)" ) },; - { "-hblib" , I_( "create static library" ) },; - { "-hbdyn" , I_( "create dynamic library (without linked Harbour VM)" ) },; - { "-hbdynvm" , I_( "create dynamic library" ) },; + { "-o" , I_( "output file name" ) }, ; + { "-l" , I_( "link with library. should be without path, extension and 'lib' prefix (unless part of libname). Do not add core Harbour libraries, they are automatically added as needed." ) }, ; + { "-L" , I_( "additional path to search for libraries" ) }, ; + { "-i

|-incpath=

" , I_( "additional path to search for headers" ) }, ; + { "-static|-shared" , I_( "link with static/shared libs" ) }, ; + { "-mt|-st" , I_( "link with multi/single-thread Harbour VM" ) }, ; + { "-gt" , I_( "link with GT GT driver, can be repeated to link with more GTs. First one will be the default at runtime" ) }, ; + { "-hbexe" , I_( "create executable (default)" ) }, ; + { "-hblib" , I_( "create static library" ) }, ; + { "-hbdyn" , I_( "create dynamic library (without linked Harbour VM)" ) }, ; + { "-hbdynvm" , I_( "create dynamic library" ) }, ; { "-hbimplib" , I_( "create import library" ) }} LOCAL aOpt_Help := {; { "-help|--help" , I_( "long help" ) } } LOCAL aOpt_Long := {; - NIL,; - { "-gui|-std" , I_( "create GUI/console executable" ) },; - { "-main=" , I_( "override the name of starting function/procedure" ) },; - { "-request=" , I_( "force function/procedure to be linked" ) },; - { "-fullstatic" , I_( "link with all static libs" ) },; - { "-pic[-]" , I_( "create position independent object code (always enabled in -hbdyn/-hbdynvm modes)" ) },; - { "-[full|fix]shared" , I_( "create shared Harbour binaries without/with absolute dir reference to Harbour library (default: 'fullshared' when Harbour is installed on system location, 'fixshared' otherwise) (fix/full option in *nix only)" ) },; - { "-nulrdd[-]" , I_( "link with nulrdd" ) },; - { "-[no]debug" , I_( "add/exclude C compiler debug info. For Harbour level debug, use Harbour option -b as usual" ) },; - { "-[no]optim" , I_( "toggle C compiler optimizations (default: on)" ) },; - { "-[no]cpp[=def]" , I_( "force C/C++ mode or reset to default" ) },; + NIL, ; + { "-gui|-std" , I_( "create GUI/console executable" ) }, ; + { "-main=" , I_( "override the name of starting function/procedure" ) }, ; + { "-request=" , I_( "force function/procedure to be linked" ) }, ; + { "-fullstatic" , I_( "link with all static libs" ) }, ; + { "-pic[-]" , I_( "create position independent object code (always enabled in -hbdyn/-hbdynvm modes)" ) }, ; + { "-[full|fix]shared" , I_( "create shared Harbour binaries without/with absolute dir reference to Harbour library (default: 'fullshared' when Harbour is installed on system location, 'fixshared' otherwise) (fix/full option in *nix only)" ) }, ; + { "-nulrdd[-]" , I_( "link with nulrdd" ) }, ; + { "-[no]debug" , I_( "add/exclude C compiler debug info. For Harbour level debug, use Harbour option -b as usual" ) }, ; + { "-[no]optim" , I_( "toggle C compiler optimizations (default: on)" ) }, ; + { "-[no]cpp[=def]" , I_( "force C/C++ mode or reset to default" ) }, ; /* { "-c=[]" , I_( "select C standard. Allowed values are: iso90, iso99, iso1x, gnu90, gnu99, gnu1x" ) }, */; /* { "-cpp=[]" , I_( "select C++ standard. Allowed values are: iso98, iso03, iso0x, gnu98, gnu0x" ) }, */; - { "-[no]map" , I_( "create (or not) a map file" ) },; - { "-[no]implib" , I_( "create (or not) an import library (in -hbdyn/-hbexe mode). The name will have a postfix added." ) },; - { "-implib=" , I_( "create import library (in -hbdyn/-hbexe mode) name to (default: same as output)" ) },; - { "-ln=" , I_( "create symbolic link pointing to ( is considered relative to )" ) },; - { "-[no]strip" , I_( "strip (no strip) binaries" ) },; - { "-[no]trace" , I_( "show commands executed" ) },; - { "-[no]beep" , I_( "enable (or disable) single beep on successful exit, double beep on failure" ) },; - { "-[no]ignore" , I_( "ignore errors when running compiler tools (default: off)" ) },; - { "-[no]hbcppmm" , I_( "override standard C++ memory management functions with Harbour ones" ) },; - { "-winuni[-]" , I_( "select between UNICODE (WIDE) and ANSI compilation modes (default: ANSI) (Windows only. For WinCE it is always set to UNICODE)" ) },; - { "-nohblib[-]" , I_( "do not use static core Harbour libraries when linking" ) },; - { "-nodefgt[-]" , I_( "do not link default GTs (effective in -static mode)" ) },; - { "-nolibgrouping[-]" , I_( "disable library grouping on gcc based compilers" ) },; - { "-nomiscsyslib[-]" , I_( "do not add extra list of system libraries to default library list" ) },; - { "-traceonly" , I_( "show commands to be executed, but do not execute them" ) },; - { "-[no]warn[=lev]" , I_( "set C compiler warning level\n can be: max, yes, low, no, def (default: yes)" ) },; - { "-[no]compr[=lev]" , I_( "compress executable/dynamic lib (needs UPX)\n can be: min, max, def" ) },; - { "-[no]run" , I_( "run/do not run output executable" ) },; - { "-vcshead=" , I_( "generate .ch header file with local repository information. SVN, CVS, Git, Mercurial, Bazaar, Fossil and Monotone are currently supported. Generated header will define macro _HBMK_VCS_TYPE_ with the name of detected VCS and _HBMK_VCS_ID_ with the unique ID of local repository" ) },; - { "-tshead=" , I_( "generate .ch header file with timestamp information. Generated header will define macros _HBMK_BUILD_DATE_, _HBMK_BUILD_TIME_, _HBMK_BUILD_TIMESTAMP_ with the date/time of build" ) },; - { "-icon=" , I_( "set as application icon. should be a supported format on the target platform" ) },; - { "-manifest=" , I_( "embed manifest in executable/dynamic lib (Windows only)" ) },; - { "-sign=" , I_( "sign executable with (Windows and Darwin only)" ) },; - { "-signpw=" , I_( "use as password when signing executable (Windows and Darwin only)" ) },; - { "-instfile=" , I_( "add in to the list of files to be copied to path specified by -instpath option. is an optional copy group (case sensitive), it must be at least two characters long. In case you don't specify , the list of files in that group will be emptied." ) },; - { "-instpath=" , I_( "copy target to . if is a directory, it should end with path separatorm, in this case files specified by -instfile option will also be copied. can be specified multiple times. is an optional copy group, it must be at least two characters long. Build target will be automatically copied to default (empty) copy group." ) },; - { "-instforce[-]" , I_( "copy target to install path even if it is up to date" ) },; - { "-depimplib[-]" , I_( "enable (or disable) import library generation for import library sources specified in -depimplibs= options (default: yes)" ) },; - { "-stop[=]" , I_( "stop without doing anything and display if specified" ) },; - { "-echo=" , I_( "echo text on screen" ) },; - { "-pause" , I_( "force waiting for a key on exit in case of failure (with alternate GTs only)" ) },; - { "-info" , I_( "turn on informational messages" ) },; - { "-quiet[-]" , I_( "suppress all screen messages" ) },; - NIL,; - { "-bldf[-]" , I_( "inherit all/no (default) flags from Harbour build" ) },; - { "-bldf=[p][c][l]" , I_( "inherit .prg/.c/linker flags (or none) from Harbour build" ) },; - { "-F" , I_( "link with framework (Darwin only)" ) },; - { "-prgflag=" , I_( "pass flag to Harbour" ) },; - { "-cflag=" , I_( "pass flag to C compiler" ) },; - { "-resflag=" , I_( "pass flag to resource compiler (Windows only)" ) },; - { "-ldflag=" , I_( "pass flag to linker (executable)" ) },; - { "-aflag=" , I_( "pass flag to linker (static library)" ) },; - { "-dflag=" , I_( "pass flag to linker (dynamic library)" ) },; - { "-iflag=" , I_( "pass flag to import library creation command" ) },; - { "-runflag=" , I_( "pass flag to output executable when -run option is used" ) },; - { "-cflag+=" , hb_StrFormat( I_( "pass flag to C compiler overriding C compiler flags added by %1$s itself. Use with caution." ), _SELF_NAME_ ) },; - { "-3rd=" , hb_StrFormat( I_( "options/flags reserved for 3rd party tools, always ignored by %1$s itself" ), _SELF_NAME_ ) },; - { "-jobs=" , I_( "start n compilation threads (multiprocess platforms only)" ) },; - { "-inc" , I_( "enable incremental build mode" ) },; - { "-[no]head[=]" , I_( "control source header parsing (in incremental build mode)\n can be: native (uses compiler to extract dependencies), full (default, uses simple text parser on the whole file), dep, off" ) },; - { "-rebuild" , I_( "rebuild (in incremental build mode)" ) },; - { "-rebuildall" , I_( "rebuild with sub-projects (in incremental build mode)" ) },; - { "-clean" , I_( "clean (in incremental build mode)" ) },; - { "-workdir=

" , hb_StrFormat( I_( "working directory\n(default: %1$s/plat/comp in incremental mode, OS temp directory otherwise)" ), _WORKDIR_BASE_ ) },; - NIL,; - { "-hbl[=]" , hb_StrFormat( I_( "output .hbl filename. %1$s macro is accepted in filename" ), _LNG_MARKER ) },; - { "-lng=" , hb_StrFormat( I_( "list of languages to be replaced in %1$s macros in .pot/.po filenames and output .hbl/.po filenames. Comma separared list:\n-lng=en,hu-HU,de" ), _LNG_MARKER ) },; - { "-po=" , I_( "create/update .po file from source. Merge it with previous .po file of the same name" ) },; - { "-[no]minipo" , I_( "do (not) add Harbour version number and source file reference to .po (default: add them)" ) },; - { "-rebuildpo" , I_( "recreate .po file, thus removing all obsolete entries in it" ) },; - NIL,; - { "-hbx=[<.ch>]" , I_( "Create Harbour header (in .hbx format) with all external symbols. Empty parameter will disable it." ) },; - { "-autohbc=<.ch:.hbc>", I_( "<.ch> is a header file name. <.hbc> is a .hbc filename to be automatically included in case the header is found in any of the compiled sources. (EXPERIMENTAL)" ) },; - NIL,; - { "-deppkgname=" , I_( " is the name of the dependency. name of the package depedency. Can be specified multiple times." ) },; - { "-depkeyhead=" , I_( " is the name of the dependency. is the key header (.h) of the package dependency. Multiple alternative headers can be specified." ) },; - { "-depoptional=" , I_( " is the name of the dependency. can be 'yes' or 'no', specifies whether the dependency is optional. Default: no" ) },; - { "-depcontrol=" , I_( " is the name of the dependency. is a value that controls how detection is done. Accepted values: no, yes, force, nolocal, local. Default: content of envvar HBMK_WITH_" ) },; - { "-depincroot=" , I_( " is the name of the dependency. Set as root directory for paths specified in -depincpath options." ) },; - { "-depincpath=" , I_( " is the name of the dependency. Add to the header detection path list." ) },; - { "-depincpathlocal= " , I_( " is the name of the dependency. Add to the header detection path list, where is pointing to a directory local to the project and containing an embedded (or locally hosted) dependency." ) },; - { "-depimplibs=" , I_( " is the name of the dependency. Add to the import library source list." ) },; - { "-depimplibd=" , I_( " is the name of the dependency. Set generated import library name to " ) },; - NIL,; - { "-plugin=" , I_( "add plugin. can be: .hb, .prg, .hrb" ) },; - { "-pi=" , I_( "pass input file to plugins" ) },; - { "-pflag=" , I_( "pass flag to plugins" ) },; - NIL,; - { "Options below are available on command line only:" },; - NIL,; - { "-target=