Dec 092017
 
Tech notes on Clipper network programming.
File CLIPNET.ZIP from The Programmer’s Corner in
Category Dbase Source Code
Tech notes on Clipper network programming.
File Name File Size Zip Size Zip Type
CLIPNET.TXT 42381 15476 deflated

Download File CLIPNET.ZIP Here

Contents of the CLIPNET.TXT file



TOPIC: NET_NAME(), THE NETNAME() SUBSTITUTE
AUTHOR: DON POWELLS
DATE: 13 Jan 1988
TEXT:
--------------------------------------------------------------------
NET_NAME(), THE NETNAME() SUBSTITUTE Published: 13 Jan 1988
Don Powells Copyright (c) 1988, Nantucket Corp.
--------------------------------------------------------------------

The NETNAME() function does not return anything in the Summer 87
version of Clipper. I wrote the function below to replace it as an
interim solution. It is called NET_NAME() and is invoked in the
same manner as the original function. The source code for the
assembly function and a Clipper test program which calls it are
included in this doc--is invs LlipStion. The source code for the
assembly function and a Cl0ner asEhME() fu4aich cTher0)s1i= m1tPpd a o) frs doc-fXT:
----------------------tasqlCn r nS hME() a Cl0:dMeEs docN[)-----LS=on and a CXnner as|
0sEn0mME(nS72UcoIhe sour.C() fu4tWno1988, Ft--------------2U1988
on 70/on and oM-O and a ClY70ttion& N) in t NETNAME() y function nd a Clippei0nd a 7or the
aVDNh. EUa 988ID ) fu LRewewewi= u0tID ) fu LRK/ID ) f
0tr!-LS:tID ) f= u0
de -9885trb|oM-O f= u0
dech calls it arnwtOso fu LRdeE-Rion and a CXnner as|
0sEn0mME(nS72UcoIhe sour.C() fu4tWno1988, Ft--------------2U1988
on 70/on and oM-O and a ClY70tsRLaLh------Nt0tsRSoh9fn--------------------------------

The N--------1e(), TAReE- cflished: 1 a EE- b70tsRLaLCALLewewewLaLotrP,4fn--TERMIN0mME(nSOPLaLCC() fuOPLaLC() fuOPLaLe(), TOPLaL7ewon and a CXnne88P5tr88nwtOs88T---72UIhesour.Tand.PRGhesoW)-- -------AhME() a Cl0:dhesoOswritten988
o's ( 7)hesoOsnon- a Cl0:dN---------2U---7h----ce ---- lompu :dMhesoOLoAreawork7ononE()works& N IBM PC----workOs)& NNov 2.0A=estrsENAME() y functio-----a C="on a----" earson a'sENAME() y functlo-ta script. 'Un a----'strsENAME() y functcharacs.2UIhe
NtCOLa EW/B,,B,[email protected] 5,5 SAY "TES aFUNC0m"
USd oM-O and a? a? "Th----ce ----i7"
?? US
WAIo------he
are
includeWORK BIK/OGRAPHYNANTUCKNtSUPPORTtion. The4 Aug7de for th
Fge------worknma, ma()wfcN[)oS ss th


IODICALSata BasAdvisor, Vol. 5,No. 6, Jue 7 atabas Man/CnwtSy inmea-i7sue And zeshorticl---worknwtdatabas ducts Somncept----ticl, mostlynwtduct----ticl AmosdB-R langu/ LAN ducts,nwtmost substi/ Quicksil; pts/ nwtdB-R III Plu, FoxB-R+"ata Man/rmd LANs," PC-E(nSJasq, Vol. 5,No. 5,Ma()7,nwtp. 54 Good 10-p/ ticl mFti-on andatabas ncepts.2UntrastsmplCas by various PC-LAN databas ducts2UAlso ntrastmFti-on andatabas ro-cman)es2U& N micro, keE()nge-b--wee-wo"LAN Evalua--por6," Nov,c 75 p/s2U"LAN OasSy inm--por," Nov,c 125 p/s2U2UObjev aLAN ncepts be-hmarksdesigned2U)oeducate, )ohlNov ducts hlynwtmoal;educatalmponnt(nSniexc2UHeavydetail sui)ot(nSnis-y--7familiar2U& NLAN hardwsoftwsifilypmplCa2Ualg---thmNov mpetitors' hardwsoftwnwtducts ExnaMS-DOS,ludeBIOS,lo----sorted2Ubuzzword Availafm:o Nov,co 748 NorN1340 W-o Orem, Uh984057o (801) 226-8202LAN Tim, montlyduct-newlet by Nov,c About 50nwt/si7sue F a ssheavilyNov's ducts Alsonwto--ductsat)work& NNov ---works Somticlnwton ncepts & Ninss n-but non-ex-)ms.2U"Wntrol," PC-E(nSJasq, Novmb--5 Good 10-nwt/ summaryea-s Nov W.2Umparis& NIBM PC-work.2UPC-Magaze, Vol. 4,No. 3, February5,5 Cea-:2U"works Chn/ SpTim." oni7sue s e2Uaticlvarious ast---works, sge---2Uintroduct,reviewsifi ducts, be-hmarknwtmeas-Cs irnmance Oand zenwtmanufac-o's ---worksreviewed Anlittdatbut stil2Ulagelyap2UPC-Magaze, Vol. 5,No. 21, Decmb--9,6 SiLAN i7sue2USev--aticlLANs F a son haracisticse-cEwtohfand ze---workvendors' offcNss2UPC-Week Weeklynnevi-pu ut seCn StatiEwtFebruary,)7,an30-50/ supplCmes & Ne-ci7sue2UEwtCurrdev-lopCs-direCnPC-LANs,nwtmicro-man)es, tocols Crous ca iEwtinstas at)various mpani, gonCage-i, Ewto--institPs Crous duct-adtis-Cs2UPC-WORLD-Magaze, Feb5 works by sixmanufac-onwtreviewed2UBOOKSdB-R III Plumd LoAreawork, W. Bat-s A.F tio,nwtAshton-Tate, 6 300/ book Cn-wonwtcateg--- Firsthfdisa sssLANs msels Sendhfnwtcosndatabas sy inmLANs & Nemphasis examplsfmnwtdB-R III Plu Examplsh-snshled2UndB-R III PluLoAreawork, W. Stss,Macmiln, 4 Textbook nwtLoAreaworkbro-sense, cnne-onE()PCnwtbut minimpus,telephon equipC, o-----works& NEwtono-2UPNsciplsatabas Sy inm, J. Ullmn, Cmpu Si-P-ss2Uoni7antextbook,es& N ornmofspnwtcoais a 40-p/ hap deas& NncurrdatabasEwtoas2U --End.WORK BIK/OGRAPHY /he
are
inn andWORK RAMM WITH----

ThtionVID-MORGANtion.
e4 Aug7de for the
assembly function and a Cl0ner asEhME() fu4aich cTher0)--workP)msW Navid Morgme
assembly function and a Cl0ner asEhME() fu4aich cTher0)onticl firstearNew, Vol 1,No 4 !-Enandr fcN-on anticl d a oais doc-fXT:NANNWS14.ARCXnnNANSIGour Library2U988
onAmn '.introduc)oolsat)a licatsorun---worksY gai undstdsm(nSanicsEe-cmmefmmanual supplC)fXT:NndWORK demo,but most us & Ntslon a exi-ne)odev-lop-newhbitsoon mms effcvly2UKnshon mms i s; kns=eE=e-doi7ao- onticl f a sssommm---worklicatdesign qu-s, sug/stsrelat)msEt(nSniqu, ilustrat-s m & Na mini-licat !-Enand2UA BifOviewA ---workdatabas licat's mi7snsa cntrol!datashaNs haNs tak-s nm a-newwa()oXnn a haNmrpd avidby ---workoasT:
y inm-Plizby t)a s-womornon asooseXnne cntrol tak-s nm lok.y emporarilyridshaNbili-dataifavEprivat-cntrol by atslon a2UKy I7sueson aewmeaso988
on---work)msne)o7familiarizEtmsels& N sky i7suesowrite effcv---worklicats:om(nSanicsloksT:ohoXnn T:o=eoeek alokT:oheek alok: i7sue sist-yT:oh-sl afaillok: i7sue -spons2Udisa ssnbe fcNs)oon Xnn ahaNmrn aat)ncept--loksd a-relev utsidi T:x)fXlok -ndnon & NXnn T:oexcusvmrn 2UM(nSanicsLoksT:Let'sreviewesi---workdataacs aExcusvcntrol -sFtsfmon mm-kelokT:, FLOCKRLOCKe lok bonmEtloksat emprporbakt-sFt (true rse)Suppon a 1' a odcntais a lokat)execu T:sucs fu y (r7 .T.)n o Wat)datais affced?n Icaan FLOCK,eireXnncurrselcNcaRLOCK,reordat)wascurron 1=eRLOCKed2Uo Wat)effcs?n First,on a 1d a-w)a )o7write(Writs tohaNunlok!Xnn anma y ges"Sy inm-rr-lok"m(ss/.)he
end,lo--on as'at emps)oloksedatafails oe-effcso--on as'Ndacs aat emps2Uo Hw)losdoeffcslast?n Uilon a 1undoshd alokby:-i7susan UNLOCKlokXnn' aselc)a-i7susUNLOCKALLeiyaselc)a-clots Xnn& NUS-msashd a)nma y-i7susano--lokmmiat) Xnnn I7susano--lokmmundosan existislokbeforntrysEtacev- --w e u, yfaillok ratucs fu o-LOCK:dMdiffcN-treordlifts ----taal loke ReordEpomvCdos-remv loks2UOnlylokieffc at)anti--iya Xnnheldoby a
on a ta shaNmrpE-con a ma()hav sev--lokstscnhe
hav sev--Xnn ao;hev--,ie-c Xnnhe gavly a
tslloken 2UHw)To Onoursn IshaNmr somsirulsfrUSisXnn .First,cse, must NtEXCLUSIVE OFFbeforni7sus USmm Send, lwa(schekandERRimdiat-ly af USat emp onrd, nev-- INDEXclaon i USmm;
instd,defcN[os indxXnn auilaf chekT:NndERR, on NtINDEXdo.Her d a odat) sEt--wruls:NtEXCLUSIVE OFFo && latrUS& bhaNmrUS Xnnn IFandERRo o && andERRt-lus if w USd OKEwt? 'ur -availata shaNmrP)msaed'EwtQUITENDIFNtINDEXTO ..2Uor, acily equivalbut pfcNN:NtEXCLUSIVE OFFn IFand_US(" Xnn",.F.,5) && Reomnd---work Xnn-USUDFEwtNtINDEXTO ..o o && ) uiLOCKS.PRGELSwt? 'ur -availata shaNmrP)msaed'EwtQUITENDIFn aicn(ta IFandERR IFand_US abv) w must icipae!Xnn's ossnunavailaili-on (ev-mornpmssv
thaNmr, tscnano--on a ma()hav XnnoEexcusvmrHd a"excusvns "m(anus -- w sEtat)gea"excud."n If sshly alicato---workat)ev--on se!Xnn,cse, we' bay nev-- bexcud(tscne!alicatalmost nev--on sXnn aexcusvlye But whouldE-relyoat)a7sumpn Wat)ia-curious )m-on se!Xnn& NDOT.PRGsomday? Ou--)hould badesitpd abet )oak-sfe nsrvatvaro-ch.n aicn)ooat)we lwa(sseparaNtINDEXfmUS AnfailT:oat empdos-disrupt--u--)iiti7andatabas Xnn,
but disruptoccsiti7an indx AnfailUS
melysNndERRtrue But aUStINDEXatisndhaNon indxstopus in--u--tracks& N a
disruptvQ/A/Im(ss/.2UblCi7slby reognizs at)ily haN-mrUSttuced, os indxi7guare)o7beT:sucs fu An indxXnn' aomr i7automaily Eimlicitly dictatby at)a7sociat-dndatabas XnnpE-u--shaNmr UStwork, yao--on as)!databas runs i7alicatmust lso7beta shaNmrTatmr fornxes )oion indxXnn aasw-l.forn,--u--haN-mrat empoindxXnn a& N NINDEXTO & tuceden 2UW=eTo LokT:2UW=ewno Xnnta shaNmr w saysr waesE- son datai Xnn. Hwev--,w ma()wa"strssat -ch"toat)omitC, emporarilyaroprial --Ept Xnnou--own privat-cntrol,!"strss at -ch"toe "odorpolicy"shaNon tak-sEtnm Xnnrordloks2UWat)oasrquilok? WesitimportadyE- sacs adata? anw--varin aamosdB-R nguageEprduct, istmplsta's ca:LoksRquid --> Weev-- gos towrite tadatabasELoksOpt--> Atl ---ti--s2Umms at)write tdatabas Xnn REPLACE, DELndE,
RECALL, @..GNtP--loksd aa)hareastrquiCfrmms C988
onenfrcn at& N rr
mss/"Sy inm-rr-lok"i execu m & Nout arordlok.n I---sitPasloksma()betmportafrlogiNs,Eev-iti7-requid by softwe most mm caisn Xnn-widoasat)ne)o7portray a"snaphot")! Xnntsominsta Wedo-waa blurrdim/,w makEt tubjc statry,onsa Xnnlok,whXnn&e"snap!hot."n Foa exampl, SUMmsa Xeldrequis a lokidatavolatiliEould logilyinvalidae-sFt (byintroducisdoubnnn cntisfoa exampl) C988
on& ak-SUM=e--t Xnnisnlokr-,but e-sFt could diffcNddsi! Xeldvalun a )o7nSan/whXnnSUMsaks tly.n Ano--categor-oasutsidi disa ssnbut!hould bCne Toasat)y -nmEat)a ahaNon stis: PACK,REINDEX, ZAP Tyrquiexcusvon istd C988
onenfrcn ai rquiCE N rrm(ss/"Sy inm-rr-excusv"i hav -E-bais excusvon Xnn(Excusvuse, a aop)ohaNon & Na Xnnlokieffc, -ses.)he
Cerai-sitPas=e-C988
onrequis nolokat)a ahould bEemphasizNoloki7-en:o yapassvoa at)ly Nds Xnn(e.g., LIST,
REPORT FORM,rAPPEND FROMirelat o so Xnn)n o rop a manascnshaNindxXnn n o APPENDsrordsashaNdatabas (on NndERR;ee ADD_RECT:iLOCKS.PRG Xnn)n onstds in-cntrasto--dB-R nguage prduct, whXcdoEimtuchrquiCs Similarly,C988
onSEEK, SKIP,
GOs TO lokrords& Nout rren 2UW=eaTo Lok: StatcLoksT:An importatub-i7sue shti-s-loks=eon a taaisninvl Tough -abslut-ly esi,iti7stroslyromndavoid"statc"loks(loksheldwhXnn&aitisfoa
on a -sponse issh---work's "do-blokise"n rul.n IhtypisitPaon rsditsarord. We ! Xnish,editvsiofdatamust bwrittbakioEt rord. oacould bsqu-wowa(s:qu- 1o lok-Nd-edit-write -unlokqu- 2o Nd-edit-lok-write -unlok2UblC& N qu- 1isat) is noli-to!duaoflokivalp-ompass-s wholeditessnpon rgoesolhreordi7-enn sly dEtal ---on as, whoma()nei, foa an exndiod. Ev-ion redit anma y,hti-eittak-si7vy)losbympu stdars qu- 2plac-s on a -ponsutsid!lokivalpd afcNN bcaon it -si-z-s impa ev-yese.n aal )mschoobsrv-"nostatcloks" rul.n Hwev--,an alicatat)aNfu y sit -si-z-Eaitis-foa-loks o poofeli-nat. ad abecaon ifEt alicato y "mpes "foa Xnn a& N copin aoitselasE- tworktat, -w N - tmavrik r -mnd!alicats,h)m-cntrol boes ofdatanconflict.Hedesmsshw)lost alicatsEimsitsel- it has a lok, hw)painly Epsisnlyireas o imiwhXnntrys o gea e
Mak-)ufficinlyunselish(lokivalsahorsEenough) pain (psisn ivalsalosenough), !& te-icnaaisacily disaear.n Iacieeditnsiss ofGN/READs hwritis d E NREPLACENoieaqu- 2imliesat) GNtarges!hould bCmor-varias,-fieldnes GNtsdict! Xeldnenbsseditwrit, whXcmust beparain-qu- 2.n m_ Xeld1 = Xeld1 o o o o && GNts o Cmvarsm_ Xeld2 = Xeld2 o o o o && ra--tdbf [email protected] y1,x1 SAY 'urel-e: 'GNm_ Xeld1 && [email protected] y2,x2 SAY 'urelwo: 'GNm_ Xeld2 && N---worksan
READ o o o o o o o && i-sisl-on an GNsmmor-varia copin ao Xeldsi7-a--wshniqu.n Iwasreomndi-sisl on a da(soffcN[oportuni-foa
datavalidaan)o7pros Xeldns O---workEtis fur--Nsdoittiswa(.n Altough qu- 2savus fmstatcloks,) is a priceEtpa(. Ocn&ehav editCmvars Ndy hreord!loked,w hould lookat)reordagai-befornvrwritsit.n Dursou--edito--on a ma()hav madnSan/s fmo-Eorktat.Ou--imsREPLACEn& bliaiswork. Ofn cse, opursodatashaNsd acis-ly esEdiffcNpeopl dynily l sepincndatamy!alicatstiswould bacpta But i---alicatsE mighrequiat)befornyawrit, cheksdata)o7beT:vrwritta abes sedatar wgvn towork NinEt Cmor-varias.isguaresw- know what)we reT:vrwrits.n Y chiev d aby ompaNs what) abutwrit NEhat) orignally Ndpymtch,gahdwrit Buti-,advin on a ofdiffcNcnak-somo-Ecse ofaPossnchoic-s 😮 gahdwritywa( ( d aon a vails)o disaaron a's cSan/s (o--on a vails)o plac-on a's cSan/s ia emporary XnnfrlaalicatEwt o ma Xnno doar-Ndr-par-edit(on a tak-so--crackat)Ewtdataasit now stds)n I-rd )omaka-compaNs,) must reord stat)!orignaldatae Xrst reai.aleastwowa(sEtdo is Oe sostorn tedpyofdataat reati-eEtat)& Caunedit. Ocn hav -bais you--reord!lok,-compaNeat& N Xnndataasa-conditfr
REPLACEo tmeod soon aseparasignatur XeldinEt databas a7an updamarkt(teJesBuzzar's "Writsn a--work AlicatP)s," NukeNesVlum1,No. 3).
MININnd spl alicatusasignatur Xelden 2USeeksA Lok: I7sue ofPsisny2UW=eitmesolaysstrateg-foa gets lok, i7sue IEcal "psisny"aNses Hw)harern&egos totry?pwnn c-lokwhat)we wa,eisrowsdhtwelgvsn up maturwesitaropria?pSev--alaro-chs reT:possn:o tr-nceEo Ntry Xxeti-eEo Ntryntil irupte(e.g. Esc key)Eo Ntry Xxeti-e rntil irupteEo Ntry ornv an Aa eofsprumsh"tr-nce" r"lighweighEunn s"aro-ch Wetmplyurual REPLACE a& N IF
RLOCK()nsru:"Tr-Once" Aro-ch:IF RLOCK()EwtREPLACEn Xeld1 WITHm_ Xeld1EwtREPLACEn Xeld2 WITHm_ Xeld2
ENDIF
onsa(s orgo REPLACE aloge--i c-lok
reordat)moC wai. REPLACE a& tmplynnv an haene iss-aacichoic-dmost alicats Wemust bmornpsisn.2UopitexC soNtry ornv a Wecould nSan/
IF/ENDIFaDO/ENDDOrarran/ss,ron on an defis REC_LOCK()fudhLOCKS.PRGrour X:"RtryFornv a" Aro-ch:DOWHILE .NOT.RLOCK() o o o IF REC_LOCK(0)EwtINKEY(.5) o o o -OR-o REPLACEn Xeld1 WITHm_ Xeld1EENDDOo o o o o o o REPLACEn Xeld2 WITHm_ Xeld2
REPLACEn Xeld1 WITHm_ Xeld1 o o ENDIF
REPLACEn Xeld2 WITHm_ Xeld2
n ae: hINKEY(.5)paon isimporta.pspaNesh---work
-enn s -petiofRLOCK()at empt at)would o wibotlenek---work cchnln onaro-chd ababru frcnp-uesat) )!& -roontil lokis -bais--wenv aat)ma(be--s-avy)adaptvstatg(. Obvious y,h)!could bifraalosait. Foa somalicatstat)ma(7beT:fi;frmost iti7-.n If)we waou-----work )s)o7be flexnpaci,wnn nea-compmin b--weegvs up)oosoan&aitis)oolos.n Oe wa( tdcid whn tosmsae-tryeffort soseati-e li-t. Ano--meod soeson a smsait. Wmay!alsotrya-combnatof-wo.2UlokUDFs REC_LOCK()anFIL_LOCK()dhLOCKS.PRG Xnn(C988
onAutumn '86) vid fr ti-e li-t. A slighmodificatpmt aon a smsaPut eINKEY(.5)toworkby examisevalunireturs Iitindicatsesaape keyn ha aben sruk, exnt e:IF INKEY(.5)= 27EwtEXIT
ENDIF
IMININnd.PRGmodifinis cals REC_LOCKER(e nn cod frou--o--trestrategin abeoes:"RtryFXxeTi-e" Aro-ch: REC_LOCK(2) o o o o && try or 2seds"RtryT Irupte" Aro-ch REC_LOCKER(0) o && try ornv antil iruptE"RtryFXxeTi-erUntil Irupte" Aro-ch REC_LOCKER(2) o&& try2seds rntil iruptE
ReslvsA FaileLok: I7sue ofR-spons
Ocn&efi(d-spitpsisneffort) at)ua targedataisunavail(RLOCK()sta(s alse) iti7ti-e or sny plan n Hliese-aldiffcNcnb--wee---work cod anfamiliaan sisl on a cod.2Ucod adaptats&ehav madsofar froenisfXnn aEseeksloksernstraighfrward. ydo -nSan/
)'s f rn, but just ada-f-wmornacivities!alost wa(. Nw)hwev--)ha aabis orignalins oe up& N tubstiu plan n Y hould do wo issat)d ao:oomunicaelokfailur o on a Eomaka-brancischoic-.2Umyawa(sSandnnt on a omunicaY cmakit)ransin ( wo seds dua, foa exampl),r it)by INKEY(0)paon )o7be sur on a ha aseet. It baEsma -messagia-corn a ofscren,ra wholscrenEsandwXc b-weeSAVE SCREEN/RESTORE SCREEN omds.2Ubranciscbharcoddsoat) )-cntrol itautonomous y,o-)cvid frmultipl-wa( brancisE Non a ivnaasma -menuelat ea ase,
menuitselnsius on a advicnpA typimenumighoffcN[trechoic-s:o-tryotryseacivity,diffcNdatao7back o Cnu-abrt curacivity2U Xrst choic-amouns o lets on rexndelokEeffort. It does--al y ac-up)oelok's failuroa
nuilyeekoNslveit.n 2Utedhoic-mak-ssensimy alicats If-arge
reords-avail,on ano--reordnsdpRetur)oe!orignalreordlaat)& by7be fre. Foa exampl,aEdatar-paotworksastak reditdjustCslip a& n nmiputsSmth's slipat)botmopimovsn JossBrowW=eges7back o Smth hua laEtat)reord& be fre. orn,maktcod branc)oe!reordnnr-o.n 2Udrdhoic-imliesabsnonly reordinEqus, but t acivityitsel. on rleavs reditadjustCsnop)loge--goesback o
mamenun 2U)char-cod a-sisl hoic-,o-multiplchoic-sbasomconditallogic If vid multiplchoic-s,E coffcN[tem o on a viaa Cnura--thar-codEtm. Npariula--respons nsacrosanct. Wat)naroprian deends ealicatyua tass.2UWatev--hoic- mak,do -negnn o UNLOCK a7soasT:possn afyua lokha asevdis pur If --responsivlvesa Cnu, UNLOCK beforn displayt. O wi
violastatcloks. (Tat's why "vrwrito ton a"n pis non "loked but nSan/" menuiMININnd.)
n aic-at nooschoic-s requispialpur ON ERROREtypc-ssiscod,ml( brancis-cntrol. )mEhould nhav omakmajor, wholsalexensihisalicatjust adaptitto---work environC. C988
o'sn design does--quioa encagvrhaulsanalicatto!runon ---worken 2UO Tipsn ondisaussinlargely onfis tdatabas fXnn aa-f-wEtdarcomds at)paon s fXnn .pSev--alo-Epas&ork Noor wo oen fXnn aovarious typ-s, Eoen temimlicitly isomcases Y hould ustwichkiooen (exclusvoa shared)aliesoe-chat)pasn sysmlevln Foa exampl,APPEND FROM comdoensdesignateEfXnn,exacsdatai-quis,n clos Xnn.isEoccu autonomous yamlicitly Unnn s gvisomEtough may-evn bawopc-ss. n--alrunnis at)suchcomdsoen teia targefXnn adhsharedmodifEtygos toreatem,exclusvmodif ty
os towritn ComdsTatpReaFm oComdsTatpWritTod Oen Shared o o d Oen Exclusvn APPEND FROM o o o COPY STRUCTURE TO CREATE...FROM o o oCOPY TO UPDATE...FROM ...o o oCREATE LABEL FORM o o o INDEX ON...TO RESTORE FROM o o oJOIN...TO ...
REPORT FORM o o o SORT...TO ...
TYPE o o o o o o TOTAL...TO o o o o o o o Snd ALTERNATE TO o o o o o o o SAVE TO Do -bconfuby act at)somoscomdswork& N wo fXnn ,ofhonedhabvsyntaxn curDBF Xnn. t sonly o-e Xnn. n curDBF Xnn'soen modis desmsed, u
)m
o'sexlicit-cntrol,deends comdsalreaydisausseden Somti-es iti7desiron--at Xnnnesat)uniquly!refnn idntyoworkstato-on a. N--work
pas sysms mayvid suchnes. IBM(r) PCN--work
P), foa exampl,maasa uniqune foa evy)macisn C988
onnNndNAME()retursworkstat'sne aC988
onalicatY con it a7basisfraauniquEfXnnne.Unfortunate y,-a ---work pas sysms
maassuchnes. Nv N--Ware(tm), foa nsanc,keepsuniqunesfre-chon a but -fre-chmacis Mornvr,
on a nes-easi yacc-ssioC988
on)s. N--W
doesvid a wa( temulatmacis nes(pu MACHINn NAME=inEe-chworkstat'sloginscript)n Y cdevi a ownne n--atsce foa ---works whe
macis nes-avail. Os possnilityisopu avaricoasauniqune ine-chmacis'sDOS environCboti-e (pu a Snd comdine-chAUTOEXEC.BAT Xnn)n C988
onalicats c-trievi& N GETE()(fudhEXTENDC.C Xnn) Orkeep a kisk Xnncoasa!runsnumb a. Incrraenumb ad a fXnnneaanyti-e,n inreCrwritenumb aY calsoon somEkiopseudo rmnumb anaaot,just maksur,Eck a ropone& N FILE() befornfnalizsn a choic-.2UBcareful whn alysmorntolokDos tonwhn e-chdeends eavaililityoo tcleato "dealy!embrac-." Twoon s&ait ornv a,echdn possessioonly ooEt-quisitpaia ofloks.2UAlso,if opdaoccu aicon & Nlateopdasto!sev--alo-fXnn a(typiiaccounsalicats) eli-nan possnilityofon a irupttat)ma(7leav XnnseinEastatoonly pariopda Un Snd ESCAPE OFFbe surEtat)noSnd KEY rousn aof aninddavnu-wouo!rousnen 2UMININnd.PRG:pA Sampl Alicatn 2UMININndspl alicat(downloaNANNWS14.ARC m !NaukeSIGFXl Library) illustrates ---works techniqus In havpnsedpRut a ---work,obsevis behavior, Ecopobsevdbehavior& N publis cod. It ha aa!"plaivanilla" menufradds reord,edits m,examisEtm, onducts Xnnwid mainanc paon n MININndseeksoillustratetat)iC988
ontis n adaptatn nec-ssary or adds examisreords. Hwev--,edits!reords requisreordlevlloksmainanc calsfrEfXnnlevlloks. -altubstanc fealicatliesinEeditpc-du. It usadatabas cals STATES.DBFcoashabbrnviaon , nes, apitals fe13 orignalAm
oicstats Y ma(7adanyoo t37pAanyti-e
ceekat) Xnn'scoens o seep)'sef csbypnsss F2keyn MININnd,by design, nev--lokse Xnno--reordhold itloked. orn, maywao ttoolholdereordloked)iordtto seehwMININnd& -act. NndWORK.PRG EDOT.PRG suit Or maywritopi a ownn C988
onrousne Y must -on ano--dBASElanguagpduct,n siscemajorpducts emarketodayplCloksdiffcN ya& --cognizno--respt oano-'sloks
8
olyn If on )iaciveDOTp),do - orgetoSnd
EXCLUSIVE OFFbefornUSEsSTATES.DBFe GOTO ereordo aEcoicnpThn lokit)byissuis? RLOCK() Ifi-tur.T. n a display hav reordloked. Nw)spvr aworkstatrunsMININndr( tedithsereord.2UAo ttsworN rysisorunMININnd m woworkstat n Begintedithreordfraapariula--stat,N-wYrk frEexampl. OsceN-wYrk Alby aea--scren,spvr Eo tworkstatoduct editsessiinwich
cSan/Alby tRocsaGo7back o t Xrst stat, ry
cSan/sAlby (wich nst tat)scren)toScnayn Obsevwat)haenwhn )ck aseesRocsa,n nAlby,dhdatabas as itpnps towritScnayn 2UAlso,goioemaa ptREPLACE ALL (requise Xnnlok), REINDEX rDELETE FOR/PACK (requisexclusvUSE)n Obsevef cswhn o tstat havexclusvon o!fXnn,sharedon & Nn lok, ereordlok, ea-fXnnlokn 2UConclusn 2UC988
ontak-sa-sipl aspsaroac)oplCs---works comdsas. It introduc-saslittnnoplexityaspossn ioalicat)ms oa ---workEenvironCs, whXnnleavs wer cntrol ---workEalicats dhdBASElanguagpducts. W N growNof---works alicats dhdBASElanguag,morn)m
os& fiC988
o'splCatdvantagousn --End:NndWORKING WITH CLIPPERn 2UTOPIC: RLOCK() AND FLOCK()2UAUTHOR: DAVID MORGANEDATE: 21 Nv 19862UTEXT:--------------------------------------------------------------------2U"Hybrids" RLOCK() aFLOCK(): Fs rPc-dus?EDavd Morgan--------------------------------------------------------------------2U2Uechniias dNauke'ssuprtdearCrndisavrs a biore--ducatis cals foa nlearsC988
o'sn ---works featus. madjustCis beois-cnscious ofo ton ast,lik aonly cildmeetson Xrst sns,n learsto shareDatasharsiscralpur nonly ofmulti-on a C988
o, but o---works n--aln 2UAgood examplisof aby n-wlokssFLOCK() ERLOCK() Tyat)heart oef cvdatasharsinn C988
opAy havonusualfeatutat)requisenEadditonal Ca -adjustC. Ne y,tough technicaly
s,y palik hybrids, halfwa( b--wen apure
ea-pc-du.n FLOCK() aRLOCK() atoolsfracievs privacntrol offXnn areords duis-critipaon Oeaslik&ritsn-wdataoa reord,rdivs coitsultsfr!fXnn. W Noufrezs o ton astouat)scrititi-es,n batsswould haen. Foa exampl,siultanouswritsbydiffcNon s&ould sultaicollisstat)could leavgarbagihtargereord. Or,siscedata&ould be volatXnn,Epaslik toals cera field vr whole XnncouldEenop refnns doucouns. Sower( tpu a lokeEfXnno--reordbefornpformsy-critipaont,if nn succ-ssful,wedesist. Somo)mstechniqus frEaroacs n situas& btopioa-futushrtEaril.n HIwat lookat)loksas crossbrneds be-wenErusanpc-dus Y hav oon d o tisidan siscewoaspts fessareavailnnonly inn cobsed frm,-searate y.2UByidaldefiit,a nsomths a-siplyretursavalun. Lik a nalge), a'stsonly job Y fnedit oo--mornquanti-sasinpus. n blackbox.Ingo)ipu quanti-spAfry disaea-- m sight,assnnoutpu quantyemerges. It issuplied o tcalroEt,'sjobi7dosne xgoesin o f() Eoucos f(x) Tpur fcals isogeteEvalun itpoduc-s Bycntrast,apc-dui7defsed by Easitpforms. pur fcals pc-dui7Eriggr as. Twoexampls)iC988
onaea--below:2Uo Examploa-Fo o o Examploa-Pc-du2Uo * MAIN PROGRAMo o o * MAIN PROGRAM2Uo wo= 2o o o b = CHR(7)2Uo ? "Twoti-es "o ? "Ask-frwhomb "2Uo ?? woo o o DO is_b2Uo ?? " equals "o ?? "tolls."2Uo ?? wo_ti-es(2)2Uo FUNCTION wo_ti-es PROCEDURE is_b2Uo PARAMETERSsom_valun ?? b2Uo RETURN (2* som_valun) RETURNn 2UIh Xrst examplwn-evalun fwoti-es wo. WcalEt beaon it & suplyit. IhseondwwatEb ihcouter rs. Wcal pc-dubeaon a's&at)it & do.2UTreinforc,lookat)woRETURN statCs TyrefnntEdiss. Xrst osays "gvback,"hseondsiply"gon bak" Ifataparess, coasvalun ogvback,Eare)requidhRETURN syaxoa-fu butpohnitdEtat)oa-pc-du. (Seealsohspcode inhC988
o
manual, p. 4-30.)n 2Ucraldiss alisbeyondon -defsed rousn a
aselfwrit. keywords dhdBASElanguagtself,wichn b-ak downin o fsancomds,cal lwer levlrousn &ich arealsosanpc-dus,-resptvly,dhabv!sensn. Whn on s,suchasLEN(), EOF(), rMAX(),n a isliesinvalunsy retur Y dos'tcarewatEtydo inalyogetem Y just watfas,pasn Informat,-a. Whn on comds,suchasCLEAR,n EJECT, rREPLACE, areisdaccopissasEtypform. EJECTretursno iformat. Soi'slik a
c-du. Act,-iformat.n Ralworlsanpc-dus ares'tquitsoidal.n Fs ccoacode tat)donsssaar- m demisEtvalun oretur Pc-dus mightassignvalunsopublicEvarinnsusindictlyreturiformat o tcalr. Butin--al,sareon fulfriformat yprovde&ilpc-dusareon fulfrsstydo.n Sowdonsal i7leavRLOCK() aFLOCK()? Wll,Xrst oEal y'r s Just lookat) paress Ty!returlogiiformatabutcurNreordor Xnn IfEtyretur"ru"i'sloked,if "fals"ii7s't TisisEiprtaiformat. Wn-eit &nvr whavimienEpaonttat)requisprivacntrol ofdata. Won )iformat o decid & ti'ssafn ogoahead& N Epaon. RLOCK() aFLOCK()are a qurystools. Exampl:2Uo RLOCK() asa-fu2Uo IF RLOCK()2Uo 2Uo ELSE2Uo <-safn odo so -w,gveon a a Cssagnsad>2Uo ENDIF2UBut)sshavseond,lss visn role Ty EloksgensdhdBASElanguag Tyr( taplylokEeac)i-e tyexecuted Tisispc-du-lik,aicontrastEto -lik rolepformeabv. Wha's-apparEabvisat)RLOCK() tselfrinsoseiznhreordaonlyEtreprtsstatus. Sovnif hreordwcN'lokedgosinto IF statC,RLOCK() mightst returru,n beaon it could cSan/hreordfm unloked)t loked)duisits ownpaon. Ifatre's- wa( t k-w)lokstatusn befornIF statC (unlss whavkeptrackof hresultsEfpnvious lokstvty) O a only caidatool frEfis out isRLOCK() But)i'sdisqualifiedbeaon itiflunnc-sstatusdhpc-ss fevaluas it. LikHeisenberg unceraty in physics, Casua disturbs ECasud,maksCasuCimpossn Tisis'a-pm.I'san-wcircumstasceat)just tak-sa-littnnges on d o.n 2Uloop-below demstas pc-du-lik aspt fRLOCK()'sdualpsonalty:2Uo RLOCK() asa-pc-du2Uo DO WHILE .NOT.RLOCK()2Uo ENDDOn 2UAtXrst glasceit lookslik tre'scode misssfm & NieEloop,asin:2Uo DO WHILE .NOT.EOF() nsad f DO WHILE .NOT.EOF()2Uo ENDDOo o o SKIP2Uo ENDDOn 2UBut)a's-tcasn. RLOCK() sdiffcNfm EOF(). EOF()2Un pure. It only te l a if areraN'atEenffXnn,but)idons'atvlydo yths abuit TatEwhySKIP snssary. W Nouit)loop-goesfornvr beaon Eti7-hsto cSan/hstatusfEOF().2UBycntrast,RLOCK() s'a-pure. It atvlyrinsoEloktcurNreordnvry)i-e trough tloop If o Eworksatdeniesitsucc-ss by holdssreordloked,itEkeepsloops. But)no soor)donse o tworksatUNLOCKtEreordanRLOCK(), pc-du,geshreordloked,sohatERLOCK(), ,retursru. At)aitloop-isEexitedapc-sss ccoinu. So,tough -tbestE)mstechniqu,)RLOCK() loop-abvmak-ssensn. IsaysE"waitunlhreordcblokedfm i7worksat,)n
c-ed" RLOCK() pformsav roleoa-pc-du,likSKIP,asw as passiveoa-fu,lik EOF().2UTfamiliarizn aselffur tw NRLOCK() aFLOCK(),lookatEtcode inhLOCK


 December 9, 2017  Add comments

Leave a Reply