ebook img

4tH, the friendly Forth compiler PDF

223 Pages·2005·0.745 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview 4tH, the friendly Forth compiler

4tH, the friendly Forth compiler J.L.Bezemer 23rdDecember2005 Contents 1 What’snew 7 1.1 What’snewinversion3.4f . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.2 What’snewinversion3.3d,release2 . . . . . . . . . . . . . . . . . . . . 11 1.3 What’snewinversion3.3d . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.4 What’snewinversion3.3c . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.5 What’snewinversion3.3a . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1.6 What’snewinversion3.2e . . . . . . . . . . . . . . . . . . . . . . . . . . 18 1.7 What’snewinversion3.1d . . . . . . . . . . . . . . . . . . . . . . . . . . 20 I GettingStarted 24 2 Overview 25 2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2.2 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2.3 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.4 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.4.1 The4tHlanguage . . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.4.2 H-code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 2.4.3 H-codecompiler . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 2.4.4 Errorhandling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.4.5 InterfacingwithC . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3 InstallationGuide 32 3.1 Aboutthispackage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3.1.1 Examplecode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3.1.2 Mainprogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3.1.3 Unixpackage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.1.4 Linuxpackage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 1 CONTENTS 2 3.1.5 MS-DOSpackage . . . . . . . . . . . . . . . . . . . . . . . . . . 36 3.1.6 MS-Windowspackage . . . . . . . . . . . . . . . . . . . . . . . . 36 3.2 Nowwhat? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.3 Pedigree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.4 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.4.1 4tHWebsite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 3.4.2 4tHMailinglist . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 3.4.3 Newsgroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4 Aguidedtour 39 4.1 4tHinteractive. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4.2 Startingup4tH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4.3 Runningaprogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.4 Startinganeditingsession . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.5 Writingyour(cid:2)rst4tHprogram . . . . . . . . . . . . . . . . . . . . . . . . 41 4.6 Amorecomplexprogram . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 4.7 Advancedfeatures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.8 Suspendingaprogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 4.9 Calculatormode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 4.10 Epilogue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 II Primer 60 5 Introduction 61 6 4tHfundamentals 62 6.1 Makingcalculationswithoutparenthesis . . . . . . . . . . . . . . . . . . . 62 6.2 Manipulatingthestack . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 6.3 Deepstackmanipulators . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.4 Passargumentstofunctions. . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.5 Makingyourownwords . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.6 Addingcomment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 6.7 Text-formatof4tHsource. . . . . . . . . . . . . . . . . . . . . . . . . . . 66 6.8 Displayingstringliterals . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.9 Declaringvariables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.10 Usingvariables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.11 Built-invariables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.12 Whatisacell?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 CONTENTS 3 6.13 Whatisaliteralexpression? . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.14 Declaringarraysofnumbers . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.15 Usingarraysofnumbers . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 6.16 Declaringandusingconstants . . . . . . . . . . . . . . . . . . . . . . . . 69 6.17 Built-inconstants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 6.18 Usingbooleans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 6.19 IF-ELSEconstructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 6.20 FOR-NEXTconstructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 6.21 WHILE-DOconstructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 6.22 REPEAT-UNTILconstructs . . . . . . . . . . . . . . . . . . . . . . . . . 72 6.23 In(cid:2)niteloops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 6.24 Includingsource(cid:2)les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 6.25 Gettinganumberfromthekeyboard . . . . . . . . . . . . . . . . . . . . . 73 7 4tHarrays 74 7.1 Aligningnumbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 7.2 Creatingarraysofconstants. . . . . . . . . . . . . . . . . . . . . . . . . . 74 7.3 Usingarraysofconstants . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 7.4 Usingvalues. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 7.5 Creatingstrings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 7.6 Whatisanaddress? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 7.7 Stringliterals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 7.8 Stringconstants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 7.9 Initializingstringvariables . . . . . . . . . . . . . . . . . . . . . . . . . . 78 7.10 Gettingthelengthofastringvariable . . . . . . . . . . . . . . . . . . . . 78 7.11 Printingastringvariable . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 7.12 Copyingastringvariable . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 7.13 Thestringterminator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 7.14 Slicingstrings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 7.15 Appendingstrings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 7.16 Comparingstrings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 7.17 Findingasubstring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 7.18 Replacingsubstrings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 7.19 Deletingsubstrings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 7.20 Removingtrailingspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 7.21 Removingleadingspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 7.22 Upperandlowercase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 CONTENTS 4 7.23 Stringliteralsandstringvariables . . . . . . . . . . . . . . . . . . . . . . 86 7.24 Printingindividualcharacters . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.25 Distinguishingcharacters . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.26 GettingASCIIvalues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 7.27 Printingspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 7.28 Fetchingindividualcharacters . . . . . . . . . . . . . . . . . . . . . . . . 88 7.29 Storingindividualcharacters . . . . . . . . . . . . . . . . . . . . . . . . . 89 7.30 Gettingastringfromthekeyboard . . . . . . . . . . . . . . . . . . . . . . 90 8 CharacterSegment 91 8.1 TheCharacterSegment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 8.2 WhatistheTIB? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 8.3 WhatisthePAD? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 8.4 HowdoIuseTIBandPAD? . . . . . . . . . . . . . . . . . . . . . . . . . 92 8.5 Simpleparsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 8.6 Convertingastringtoanumber. . . . . . . . . . . . . . . . . . . . . . . . 94 8.7 Controllingtheradix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 8.8 Picturednumericoutput. . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 8.9 Convertinganumbertoastring. . . . . . . . . . . . . . . . . . . . . . . . 100 8.10 Abortingaprogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 8.11 Openinga(cid:2)le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 8.12 Readingandwritingfrom/toa(cid:2)le . . . . . . . . . . . . . . . . . . . . . . 101 8.13 Closinga(cid:2)le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 8.14 Writingtext-(cid:2)les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 8.15 Readingtext-(cid:2)les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 8.16 Readinglonglines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 8.17 Readingbinary(cid:2)les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 8.18 Writingbinary(cid:2)les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 8.19 Parsingtext(cid:2)les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 8.20 Parsingbinary(cid:2)les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 8.21 Parsingcomma-delimited(cid:2)les . . . . . . . . . . . . . . . . . . . . . . . . 107 8.22 Advancedparsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 8.23 Appendingtoexisting(cid:2)les . . . . . . . . . . . . . . . . . . . . . . . . . . 109 8.24 Usingpipes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 8.25 Openinga(cid:2)leinread/writemode . . . . . . . . . . . . . . . . . . . . . . 111 8.26 Usingaprinter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 8.27 ThelayoutoftheCharacterSegment . . . . . . . . . . . . . . . . . . . . . 112 CONTENTS 5 9 IntegerSegmentandCodeSegment 113 9.1 TheCodeSegment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 9.2 Theaddressofacolon-de(cid:2)nition . . . . . . . . . . . . . . . . . . . . . . . 113 9.3 Vectoredexecution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 9.4 TheIntegerSegment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 9.5 Aportablewaytoaccessapplicationvariables . . . . . . . . . . . . . . . . 116 9.6 Returningaresulttothehostprogram . . . . . . . . . . . . . . . . . . . . 116 9.7 Usingcommandlinearguments . . . . . . . . . . . . . . . . . . . . . . . . 116 9.8 ThelayoutoftheVariableArea . . . . . . . . . . . . . . . . . . . . . . . . 117 9.9 Thestacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 9.10 Savingtemporaryvalues . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 9.11 TheReturnStackandtheDO..LOOP . . . . . . . . . . . . . . . . . . . . 120 9.12 OtherReturnStackmanipulations . . . . . . . . . . . . . . . . . . . . . . 121 9.13 Alteringthe(cid:3)owwiththeReturnStack . . . . . . . . . . . . . . . . . . . 121 9.14 Leavingacolon-de(cid:2)nition . . . . . . . . . . . . . . . . . . . . . . . . . . 122 9.15 ThelayoutoftheStackArea . . . . . . . . . . . . . . . . . . . . . . . . . 123 9.16 Booleansandnumbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 9.17 Using’withothernames . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 9.18 Assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 9.19 Randomnumbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 9.20 Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 9.21 Time&Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 9.22 Whatisnotimplemented . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 9.23 Knownbugsandlimitations . . . . . . . . . . . . . . . . . . . . . . . . . 131 10 Advancedprogramming 132 10.1 Compiletimecalculations . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 10.2 Conditionalcompilation . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 10.3 Checkingtheenvironmentatcompiletime . . . . . . . . . . . . . . . . . . 136 10.4 Checkingade(cid:2)nitionatcompiletime . . . . . . . . . . . . . . . . . . . . . 136 10.5 Exceptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 10.6 Mixingcharacterandnumberdata . . . . . . . . . . . . . . . . . . . . . . 140 10.7 Enumerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 10.8 Dynamicmemoryallocation . . . . . . . . . . . . . . . . . . . . . . . . . 142 10.9 Tweakingdynamicmemory. . . . . . . . . . . . . . . . . . . . . . . . . . 144 10.10Applicationstacks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 10.11Lookuptableswithintegerkeys . . . . . . . . . . . . . . . . . . . . . . . 146 CONTENTS 6 10.12Lookuptableswithstringkeys . . . . . . . . . . . . . . . . . . . . . . . . 148 10.13Interpreters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 10.14Addingyourownlibrary . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 10.15Addingtemplates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 10.16Privatedeclarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 10.17Changingbehaviourofdata . . . . . . . . . . . . . . . . . . . . . . . . . . 155 10.18Multidimensionalarrays . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 10.19Recordsandstructures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 10.20Fixedpointcalculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 10.21Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 10.22Complexcontrolstructures . . . . . . . . . . . . . . . . . . . . . . . . . . 160 10.23Forwarddeclarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 10.24Sorting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 10.25Tokenizingstrings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 10.26Running4tHprogramsfromtheUnixshell . . . . . . . . . . . . . . . . . 166 10.27Thisistheend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 III Reference guide 167 11 Glossary 168 Chapter 1 What’s new 1.1 What’s new in version 3.4f Words (cid:15) The words ’WORD’, (cid:148)(cid:148), ’TOKEN’,’COPY’, ’TEXT’and ’WAIT’ have beendis- carded. (cid:15) The words ’NUMBER’, ’ARGS’, ’IS’, ’REPEAT’, ’AGAIN’ and ’UNTIL’ have beenchanged. (cid:15) Renamed’@(cid:148)to’@C’,’SKIP’to’OMIT’and’RESULT’to’OUT’. (cid:15) Thewords’PARSE-WORD’,’IMMEDIATE’,’NOT’,’INCLUDE’,’[UNDEFINED]’, ’4TH#’,’SLEEP’,’,(cid:148)’,’2DUP’,’2DROP’,’2SWAP’,’2>R’,’2R>’,’S|’,’,|’,’+PLACE’, ’-ROT’, ’BOUNDS’, ’2R@’, ’R’@’, ’UNLOOP’, ’SOURCE’, ’SOURCE!’, ’DE- FER@’,’DEFER!’,’>BODY’,’SCONSTANT’,’:THIS’,’DOES>’,’FIELDS’,’STRUC- TURE’,’->’,’FIELD’,’ENUM’and’FORGET’havebeenadded. Functionality (cid:15) Theexecutionofa4tHprogramcanbesuspended. (cid:15) Asuspended4tHprogramcanbesavedandreloaded. (cid:15) Userde(cid:2)nedwordscanbemadeprivate. (cid:15) Userde(cid:2)nedterminalinputbuffersaresupported. (cid:15) Complete,ANS-Forthcompatibleredesignofallstringhandlingwords. (cid:15) MultipleWHILEsaresupportedwithREPEAT,AGAINandUNTIL. (cid:15) Supportforstructuresandenumerationshasbeenadded. (cid:15) Filescannowbeopenedinread/writemode. (cid:15) LimitedDOES>supporthasbeenadded. (cid:15) MoreANS-Forth,COMUSandTOOLKITwordshavebeenadded. 7 CHAPTER1. WHAT’SNEW 8 Bug(cid:2)xes (cid:15) Severalsmallbugsintheeditorwere(cid:2)xed. (cid:15) Asmallbugin’FILL’was(cid:2)xed. (cid:15) Abuginhgen_4th.cthatcausedSEGFAULTwas(cid:2)xed. (cid:15) Asecurityvulnerabilityin4th.cwas(cid:2)xed. Developer (cid:15) Severalchangesinexec_4th(),comp_4th(),save_4th()andload_4th()tosupportsus- pension. (cid:15) Thefunctioninst_4th()hasbeenrenamedtofetch_4th(). (cid:15) Thefunctionstore_4th()hasbeenadded. (cid:15) The Hcode structure has been expanded with the members CellSeg, UnitSeg and Offset. (cid:15) PADhasbeenconvertedtoacircularbufferfortemporarystrings. (cid:15) Mostofthestringhandlingand(cid:2)lefunctionsinexec_4th()havebeenrewritten. (cid:15) Mostinternal4tHvariablesarenowlocatedinahiddenareaoftheIntegerSegment. (cid:15) Theperformanceof’MOVE’hasbeensigni(cid:2)cantlyimproved. (cid:15) Thelibrary(cid:2)leshavebeenupdatedandexpandedsigni(cid:2)cantly. Documentation (cid:15) Alldocumentationnowre(cid:3)ectsthefunctionalityofthecurrentversion. (cid:15) Thereisnowonesinglemanual. Hints Porting your V3.3d Release 2 programs to V3.4f may require some effort. In previous versions,stringsupportwasquiteamess(IMHO),requiringawkwardwordslike’COPY’. Some words returnedorexpectedan address, othersan address/countpair. With version 3.4fstringsupportwascompletelyredesigned. Consequently,source(cid:2)lesusingstringsor arraysofstringconstantswillhavetobepartiallyrewritteninordertomakethemcompile andrunproperly.Thereareseveralthingstoconsider: Strings TherehasbeenaconversiontotheformatrecommendedbytheANS-Forthstandard. All strings are now represented by an address/count pair, with the exception of string vari- ablesandstringaddressesreturnedby’@C’.Forthispurpose,’WORD’hasbeenreplaced by’PARSE-WORD’.’NUMBER’and’ARGS’nowreturnanaddress/countpair. Parsed stringsarenolongercopiedtoPAD,butremaininTIBandarenotzero-terminated.How- ever,sinceparsedstringsarenowrepresentedbyanaddress/countpairthisshouldnotbea problem. Mostprogramsweexaminedusedconstructionslikethis: CHAPTER1. WHAT’SNEW 9 [char] ; word count type s" 567" drop number 1 args count my_variable place Thosecaneasilybeconvertedto: [char] ; parse-word type s" 567" number 1 args my_variable place Asaruleofthethumb,weadviseyoutouse’COUNT’onlyonstringvariablesandstring addressesreturnedby’@C’.Youmight(cid:2)ndafterawhile,thatthesearetheonlysituations where ’COUNT’ is actually required. In all other situations, you use the count on the stack. Special operatorslike ’2DUP’, ’2DROP’ and ’2SWAP’ have been added to make manipulationofaddress/countpairseasier. Pleasenotethat’OPEN’alreadyrequiredanaddress/countpair,butsimplydiscardedthe count. In version 3.4f the count is required. If you didn’t program properly, this might causeerrorsnow.Welldesignedprogramswillcontinuetofunctionproperly. We advise against the use of ’MOVE’ or ’CMOVE’ for moving strings. Most of these constructionswillcontinuetowork,butsomemayfail. Inanycase,theyarenotportable. Use’PLACE’and’+PLACE’whereveryoucan. PAD PADhasbeenconvertedintoacircularstringbuffer.Becausesomeroutinesdirectlyinter- facewiththeirCcounterparts,temporaryzero-terminatedstringsarestoredinPAD.When thebufferover(cid:3)owsitwrapsaround,overwritingwhateveristhere. Somepreviouslycor- rectlyrunningprogramsmaycorruptthePADthisway. Ifthishappens,youcansolvethis bystoringthe overwrittenstring intoastring variable. Thereasonforall thisis thatthis nowworks: s" This is not overwritten" s" By this string" compare Numberrepresentationsarenotclobberedunlessyouuseextremelylongnumberformats. Arraysofstringconstants Considerthisconstruction: 16 string weekday create weekdays " Monday" , " Tuesday" , " Wednesday" , " Thursday" , " Friday" , " Saturday" , " Sunday" , weekdays 4 th @’ weekday copy count type cr

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.