lhtSI‘i GAN STATE :Nlllzl l IUHIHHINN!!!Ullfllllllllll 23 01570 6959 This is to certify that the thesis entitled THE CQIPUTER PROGRAM DEVElDPMENT FOR THE SWIPES DDDEL. presented by Natgritta Taveesook has been accepted towards fulfillment of the requirements for .mster___ degree in 23:19am ik zflz. M Major professor Date ‘g/zg/Y} 0.7639 MS U is an Affirmative Action/Equal Opportunity Institution LIBRARY MIchIgan State Unlverslty PLACE III RETURN BOX to romanthb checkout from your record. - TO AVOID FINES return on or More data duo. DATE DUE DATE DUE DATE DUE MAY ”1:49 2002 . usu IsAnNflrmuIlvo ActIon/Equul Opportunity InstIIutIon WM‘ THE COMPUTER PROGRAM DEVELOPMENT FOR THE SWIPES MODEL By Natgritta Taveesook A THESIS Submitted to Michigan State University in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE School of Packaging 1997 ABSTRACT THE COMPUTER PROGRAM DEVELOPMENT FOR THE SWIPES MODEL By Natgritta Taveesook Nowadays, packages have necessary roles in all products we concern Although packaging can show great fimctions, it releases many environmental problems in its waste stream. Solid Waste integrated Packaging Evaluation System was developed by Brian Saputo as his Master’s thesis to determine the volume of packaging waste. The goal of this thesis is to develop software for SWIPES Model that can be used in the packaging business. Because this model will be used by packaging engineers and any other concerning people, it should run easily and conveniently. The Visual Basic language is considered. The software includes a data file, which will be able to update at any time, a welcome screen, and programs to evaluate the value for different materials. In this software, users not only can choose the data provided in the updated file, but also they can input their own data The calculated results can be printed out or stored to recall later. ACKNOWLEDGMENTS I wrote this, but a lot ofpeople’s influences are in it. And there are others who may not have contributed to the thesis, but have contributed to me. First of all, there are my three committees: Chairperson Dr. Susan Selke, and Dr. Diana Twede of the School of packaging, and Dr. Matt Mutka of the College of Engineering without whom this would not be possible. MyparentsandmyfamilyhavesupportedmetostudyinMichiganState University. Their importance in both emotional way and financial way help me reach my achievement. Then I would like to thank you all my friends: Mr. Natawut Nupairoj who helped me about computer problems, Mr. Chatpetch Saipetch who corrected my English, Chatchaiwhon-iedtounderstandmcandallotherswhohelpedmethroughmy obstructions. i.i Table of Contents Page Chapter 1: Introduction 1 Chapter 2: Computer Programming and Visual Basic Language 17 Chapter 3: Computer Program for SWIPES Formula 28 Chapter 4: Conclusions 42 List of References 44 Additional Sources for Computer Programming 45 Appendix A: Computer Source Code for SWIPES 46 Appendix B: Material Data in Standard DataFile 137 iv List of Figures Page Figure 1.1: US population and municipal solid waste generation, 1960-1993 4 Figme 1.2: Products generated in MSW by weight, 1993 (Total Weight 206. 9 million tons) 5 Figure 1.3: Material generated in MSW by weight, 1993 (Total Weight 206.9 million tons) 6 Tim 1.4: Landfill volume of products in MSW, 1993 (in percent of total) 7 Figme 1.5: Landfill volume of materials in MSW, ' 1993 (in percent of total) 8 Figure 2.1: Machine language 18 Figure 2.2: Assembly language 19 Figure 2.3: Sample of a Visual Basic program 20 Figure 2.4: Main windows of Visual Basic design screen 22 Figme 2.5: The menu window in Visual Basic design screen 22 Figure 2.6: Form window 23 Figure 2.7: Toolbox window 24 Figure 2.3} Project window 25 Figure 2.9: Properties window 26 List of Figures (Continued) Figure 2.10: Code window Figure 3.1: Main menu screen Figure 3.2: About SWIPES program screen Figure 3.3: Product and packaging information screen Figure 3.4: Component information screen Figure 3.5: Material menu screen Figm'e 3.6: Material information screen Figure 3.7: Packaging production information screen Figure 3.8: Arbitrary value information screen Figure 3.9: Material SWIPES value screen Figure 3.10: Total SWIPES value screen Figure 3.11: SWIPES value file selection screen Figm'e 3.12: Data file selection screen Figure 3.13: Data information screen vi Page 27 29 29 31 32 33 34 35 36 37 38 39 41 41 CHAPTER I INTRODUCTION 1.! Packaging Packaging is always differently defined by many people depending on how they deal with it. From those definitions, one of the best is given in the “Glossary of Packaging Terms” (Manypenny et al, 1996) as following; “Packaging is the enclosme of products, items or packages in a wrap, pouch, bag, box, cup. tray, can. tube. bottle, or other container form to perform one or more of the following major functions. ._1 . Containment for handling, transportation and use. "2. Preservation and protection of the contents for required shelf and use life and sometimes protection of the external environment from any hazards of contact with the contents. 3. Identification of contents, quantity, quality, and manufacturer- usually by means of printing, decoration, labelling, package shape or transparency. Usually the design and decoration must facilitate selection and motivate sales, and increasingly they must meet government requirements including ingredients listing, nutrative value and the like. ’ 4. Facilitate dispensing and use, including case or opening, reclosure (if required), portioning application, rmit-of-use, multipacks, safety, seconduseorre-useandworkingfeatmessuchasareformdinaemsolsprays, cook-in-bag, “memory packs” and especially provision for instructions or If the device or container performs one or more of these fimctions it is considered a package. Packaging is also the development and production of packages (filling, closing, labelling) by trained professionals or operators employing methods and equipment designed for specific product lines and types of “packages. Some 30 difl’erent categories of packaging machines are employed, for example, fillers, counters, cappers, labelers, wrapping equipment, cartoners, case loaders, and sealers, as well as a wide range of support equipment for package making, inspection, monitoring, handling, and the like. Increasingly, packaging machinery is designed and integrated to provide a complete system. Packaging is often referred to as consumer type, industrial type, military type, shipping type, and the like, designations that are more or less self- explanatory. Consumer packages are intended for retail merchandising and emphasize sales features. Industrial packages are intended for use in manufacturing, services and repair outlets. Sometimes characteristics and functions are overlapping and terminology is used loosely.” Packaging (Abbott, 1989) has been a part of the human race since the beginning of its existence. Although quite simple in technology at first, the development of the process itself is as extraordinary as that of any other technology. The primitive packages were simple in design and were created for transporting easily gathered and handled foods. The evolution of primitive people into highly cultured and industrialized societies created a demand for more advanced and specialized packaging that is the norm today. The requirements placed on modern packaging containers not only include that the contents be held together physically, but also may involve the preservation of other chemically sensitive qualities which can be infinitely more inconstant than physical appearance. And as our population grows, the need for new and more efficient forms of packaging will increase accordingly. Today, Heated papers, metals and synthetic materials make up the core of the available packaging systems. Instead of containers created from mollusk shells and bamboo, modern packaging science now employs a variety of materials from timber and steel to plastics and revolutionary composite materials. The pace of change within the world of packaging (Abbott, 1989) really intensified after 5 revolutionary advances (metal cans, collapsible tubes, folding cartons, corrugated shipping cases, and crown closmes) were introduced (during the Industrial Revolution). However, the introduction of these modern materials does have its disadvantages. The increasing rate of municipal solid waste is one of the most important problems facing us today. 1.2 Solid Waste Problems From Packaging Municipal solid waste (MSW), as defined by the United States Environmental Protection Agency (EPA), includes wastes such as drn'able goods, nondurable goods, containers and packaging, yard trimmings, and food waste. To eliminate the MSW, many processes including reuse, recycling, combustion, and incineration are used together in one combination or another. However, all of these processes are still not capable of absolutely eliminating MSW. The remaining waste is sent to the process known as landfill, a method of solid waste disposal in which refuse is buried between layers of dirt. EPA (1994) records show that fi'om 1960 to 1993, while the population of the United States. was annually increasing at the rate of 1.1 %, the annual growth of MSW was 2.7 percent (fi'om 88 million tons per capita to 207 million tons per year), illustrated in Figure 1.1. This trend cannot be allowed to continue. Our current level of technology does not permit us the luxury of producing that great amount of waste and still expect the same proportion of generation for all eternity. A way of dealing with the problem of MSW is crucial to the livelihood of futme generations. Thus, is the birth of the field of Solid Waste Management. .. .. -——-.-_——.—_— .— . _— ——— _—-————— Fignre 1.1 US. population and municipal solid waste generation, g 1960 to 1993 - 0.e L4 r Lii‘e41r.%%% L'--¢~l%+' 9 N eeonveeeouvsoee§m I‘l‘hl‘hflflflfl” E §§§§§°~ea°~°~22222_§ Year +Population, ave. annual growth = 1.1% + MSW generated, ave. annual growth = 2.7%? l __J gnu—4...“ __._. -n... Sauce: EPA Characterization of Municipal Solid Waste in the united States: 1994 Update, MSW is divided into 3 main categories: durable goods, non-durable goods, and containers and packaging. In 1993 (EPA, 1994), containers and packaging equalled 70.6 million tons or 34.1% of the wastes generated (Figure 1.2). Paper and paperboard, some of which are included in the containers and packaging category (EPA, 1994), accounted for 38% (by weight), Figure 1.3. Other packaging materials contributing to the total MSW included glass, metals, plastics, and wood, and ranged from 6 to 9 percent (by weight.) Figure 1.2 Products generated in MSW by weight, 1993 (Total weight = 206.9 million tons) Nondurable goods, Containers & 54.8 million tons paCkaglng, 70.6 26.5% mrlslzorliéons . O Durable goods, 31.9 , . ”mi” ‘0“5 Food and other,16.9 Yard trimmings. 154% minim. tons 32.8 million tons 8.2% 15.8% Source: EPA Characterization of Mimic-W Solid Waste in the united States: 1994 Update Figure 1.3 Materials generated in MSW by weight, 1993 (Total weight = 206.9 million tons) Yard Wgs, 32.8 Paper & m 153°” paperboard. 77.8 ' ° million tons Other, 18.7 trillion 37.6% tons 9.0% Food, 13.8 trillion ’_ tons 6.7% _, __ . ,' ’, Class, 13.7 trillion w°°d"'°3l;: "flh‘likstics, l9.3 trillion Mmk: 17-1 "'1'“ tons 6 60/. tons tons 6.6% ' 93%, 8.3%: Source: EPA Characterization of Municipal Solid Waste in the united States: 1994 Update Thewasteproduced fromthesepackagingmaterialsisprocessedthroughasystem of waste management programs; however, even with all of today’s technology, packaging remairied the largest contributor after recycling and composting, Figure 1.4 (EPA, 1994). Again, in Figure 1.5, paper & paperboard and plastics were the top of the list at 30.2% and 23.9% respectively (EPA, 1994). Figure 1.4 Landfill volume of products in MSW, 1993 (in percent of total) Other 12% Durables Containers & . packaging 32% Nondurables 29% Source: EPA Characterization of Municipal Solid Waste in the united States: 1994 Update Figure 1.5 Landfill volume of materials in MSW, 1993 (in percent of total) I'Eifi'oimniiiff— I I Ferrous metals ! El Rubber & leather ! E1 Wood I Textiles i D Food wastes ; I Aluminum i El Glass i I Other l Paper & paperboard Source: EPA Characterization of Municipal Solid Waste in the united States: 1994 Update EPA (1994) states that integrated solid waste management emphasizes source reduction of wastes before they enter the waste stream, recovery of generated wastes for recycling and composting, and environmentally sound disposal through combustion facilities and landfills that meet specified standards. The four stages are defined as follow (Saputo, 1991.) - “Source Reduction: The optimum way to reduce waste is by not producing it in the first place. Source reduction includes: reducing the amount of packaging materials used, developing products with longer useful lives, utilizing reusable and multi-use packages, and selecting the appropriate materials for the application. Rmcling: Recycling involves the separation and marketing of a waste material (e.g. paper, glass, aluminum) from the waste stream so that it can be rcmanufactured into a usable product. Combustion: Incinerators can burn wastes strictly to reduce the volume of waste that must be landfilled. Waste-to-energy incinerators also reduce the volmne of waste, but these facilities are designed to recover energy in the form of steam or electricity. Landfillmg’ : This option involves burying waste in “sanitary” landfills. It should only be necessary (in an optimum system) for items that cannot be managed by the other three approaches.” 1.3 SWIPES Model SWIPES stands for Solid Waste Integrated Packaging Evaluation System. This model was derived and written by Brian Saputo as his thesis project for the Master of Science degree, submitted to the School of Packaging, Michigan State University. Saputo said in his thesis that “The goal of the SWIPES model is to quantify the volume ofwaste that the package can contribute to a landfill.” In this model, volume, compaction density, number of uses, recyclability, combustion, composting, manufacturing scrap, and protective effectiveness were considered and used in quantitative terms (because landfill is affected more by volume than by weight.) This model works based on the following flowchart: SWIPES Flowchart 10 One Package Paper Corr. Alluminum Steel ou~<-l Douro-‘0 Plastic Compacted Density P &ei ht PKG Volume Manufacturing Scrap Number of Uses Reqyclabilily ecycled Conte Com Landfill Volgme Package Damage Compensation [—Compacted LandfiT antn‘butign 930L329— 11 ' Variables affecting the SWIPES formula can be interpreted in many different ways. For the consistent understanding of each variable’s effect on the model, all will be briefly discussed. SWIPES Egm'on l-Xr l-Xr 1 Yo l-e l Zi l-a 1+b +P+S l + W(n-l) Note: W2le and W2Y_>_Z are suggested. where: a = fraction of ash afier combustion b = average percent product damage in distribution c = composting rate d,“ = compaction density of package clpr = compaction density of product e = residue afier compost screen f = fraction of scrap disposed of i = incineration rate mm = mass or weight of package mp, = mass or weight of product m, = mass or weight ofscrap per package n = number of uses P = product correction factor 12 = b(SWIPES value for product) or = b(mp,/ dm)[1 - (iZ)(% combustible of product)] rc = recycled content rr = recycling rate S = Correction factor for manufacturing scrap = flms/ dpth XIX rt) s = SWIPES W = arbitrary value for reuse (03W51) X; & X2 = arbitrary value for recycling (05 X51) and (0_<_ X251) Y = arbitrary value for composting (OsYsl) Z = arbitrary value for combustion (05231) PaclLamg' Volme (mph/4n); The SWIPES model was designed to be based on volume because landfills are alw ..ys filled up by volume, not weight. However, it is much easier to measure waste by weight as it is done in most experiments and research; therefore it became necessary to develop a method of conversion in which volume can be calculated consistently without bmdensomc calculations. Volume of packaging wastes is different for each form of package (1 pound of flat sheet paper and 1 pound of paper carton, for example) and also differs according to the landfill environmental conditions. For consistency, MSW volume is calculated by dividing weight by compaction density. Common Density (dm); In each landfill, waste will be compacted by heavy equipment. In general, only data on mixed wastes is available, but a study by the 13 EPA-Franklin Associates, 1990 update, found that it is possible to get some information of the ideal separated waste stream from the type of waste involved. figs; [1 + W(n-l)]; The compacted volume is divided by this factor to credit the package if it has multiple use cycles. W is an arbitrary factor which represents discounting of a portion of the reuse credited to account for the environmental impact of reuse. Some types of packaging that have been found successful as reusable packages are glass bottles, industrial returnable packaging, and distribution packaging. It is possible for a packaging engineer to design a package that can be used more than once. However, the problem of reusable packages is returning the packages to a goods manufacturer who can reuse them. Cleaning and reconditioning may also be required. Although the industrial rettnnable packaging and distribution packaging systems are growing rapidly, a more efiicient return system must be developed to increase the effectiveness of this method as a part of the source reduction of packaging solid waste. It is also vital that 1 similar processes be developed for other packaging material. Rgc_v_cled Content (l-erc); The compacted volume is multiplied by this factor to credit the packaging component if it has a portion of recycled material. X2, like W, is an arbitrary value which represents discounting of a portion of recycled content comtained in the material. To reduce packaging materials going to the waste stream, every attempt should be made to incorporate recycled materials into the production of new packaging. The emphasis should be to maintain the highest possible level of secondary materials (derived from post-consumption residuals) within the production. Most packages, except glass and metal, cannot be produced at 100% recycled content because those materials always have different physical and chemical properties from a l4 virgin one. Moreover, the problems of using recycled materials are their costly processing and the migration of contaminants from recycled contents, which might cause an undesirable change in products, especially in foods and drugs. W (l-er,); The compacted volume is multiplied by this factor to credit the packaging component if it can be recycled after use. X. is an arbitrary value which represents discounting of a component with recycling capability. By theory almost all packaging materials can be recycled, but practically, only some materials are put through a recycling process efficiently while others might be never recycled at all. The recycling rate of each material is controlled by its feasibility of cost and technology in processes, and its use after recycling. Some packaging materials, especially composite materials, though they can be technically recycled, need to be broken .ip first, which is impractical, and some even if it is practical to recycle, are not stable enough to be processed in the next steps. Therefore, even through the recycling rate of many materials is measurable, at present, those recycled materials are not thoroughly beneficial until manufacturers have enough capability to use them. Cgmbustign [lo(Zi)(l-a)]; The compacted volume is multiplied by this factortocredit the packaging component ifitcanbe incineratedafteruse. Zisan arbitrary value which represents discounting of waste reduction by combustion. This has the goal of reduction of waste volume by burning the organic flammable part of the waste. There are two burning systems used at present: incineration which is the old style, tends to be dirty, and Operates with little or no pollution control; and waste-to—energy facilities which are not only designed for volume reduction but also focus on energy recovery from burning waste. 15 99mm [l-(Yc)(1 -e)]; The compacted volume is multiplied by this factor. to credit the packaging component if it can be composed after use. Y is an arbitrary value which represents discounting of a component with composting capability (with some organic substances). In this step, a large portion of organic waste can be separated from the waste stream and be decomposed. Packaging materials that are involved in composting most are papers. Anyway, as mentioned before, paper and paperboard are the biggest groups in the waste stream; thus the reduction of paper volume discarded will have a great efi‘ect on MSW amount.- Mflfflggjgap [S, 1+f(m,/mm_)]; This factor is included in the formula to account for scrap produced during the packaging production. In any production line, the efficiency of every machine and efiiciency of using material supplies can never reach 100 percent. Then some of the remaining supplies might be recycled and - the others might be dumped as scrap. The scrap which is disposed of fi'om those processes is defined as manufactming scrap. Dme Common (1 + b); Like the manufacturing scrap factor, this factor is a multiplier of the compacted density to account for the value of the packages which are excessively produced because of damages during the distribution. In many cases, packaging is designed to use more materials than is necessary for containment alone, to make me that the package is strong enough to protect goods until customers get and use them. Besides the quality of the products, the protection properties of packages are very important to the amount of the waste stream. If the product fails because of inadequate protection by packaging, both product and package must go to the waste stream. That means the MSW is unnecessarily increased. However, the amount of 16 materials used in a packaging system tends to be minimized because of the development of new technology and new synthetic materials which give lighter and stronger packages without compromising protection. Product Com'on Factgr [P, b(mm/dmfll -(iZ)(°/ocombustible of product)]; This value can be defined as the SWIPES value of the product included in packaging systems. Therefore, this factor is added once into the whole packaging system. However, some of the product variables, such as reuse and recycling rate, are not available or very small: thus the factor cannot be calculated by the same formula as the packaging materials. Therefore, it is simplified by involving its compaction density and combustion alone. 1.4 The Need for the Computer Program As shown above, the SWIPES equation is composed of many comprehensive parts. There are almost 20 factors we need in the one equation. Even for only one packaging component, it really takes time to calculate this value. Unfortunately, most packaging systems in the world would never be a single component. Therefore, a computer program will minimize the time we lose in packaging design. However, as Saputo said, the studies about solid waste management are still not completed. More study might help us get better solutions and more comprehensive equations. This computer program should be useful during the period of study. Then after we have a developed model, because this program is written by a user-friendly computer language, it can be easily revised. CHAPTER II COMPUTER PROGRAMMING AND VISUAL BASIC LANGUAGE 2.1 Introduction to Visual Basic Visual Basic (abbreviated “VB”, (Millard, 1997)) is a programming language initially developed by the Microsoft Company. This language has an ability to provide programmers with a quick and easy method of developing Windows applications. Visual Basic provides the programmers with an integrated environment where they can use tools to create a point and shoot interface and use event-driven programming techniques. A programmer can quickly and easily create a user interface, then write the code to respond to specific events which «cm as a result of user input. Currently, there are two difi‘erent “flavors” of Visual Basic; the original which was developed for Windows, and Visual Basic for DOS. Visual Basic for Windows gives the programmers the capability of creating applications which run in Windows, while Visual Basic for DOS gives the ability to develop an application which does not need Windows to runs. Visual Basic (VB) is one of the new computer languages developed in the world. Just as human beings commtmicate with each other through the use of languages like English, French, Spanish, or Thai, programmers communicate with computers through 17 18 special programming languages which are comparably varietal. Each programming language differs from others and has its own structure and grammar. For example, VB is more visually oriented than the others, and might be thought of as a sort of sign language (Zak, 1995). However, most computer programming languages basically have the same development history. The development of programming technology resulted in many levels of computer languages = A Machine Language (Zak, 1995) is the very first computer programming methodinthewofldandusesonandofi‘electrical systemstocreateaseriesofmachine instructions. Figure 2.1 Machine language oloo . oorror looooooonor 110001 00101 loom loooo orrro lllool lllool 001 llOOOOOl llooo oorlloo 10001000110 Source: Zak, Diane Programming with Microsoft Visual Basic 2.0/3. 0for Windows, 1995 19 An Assembly Language (Zak, 1995) uses mnemonics (alphabetic abbreviations) instead of the on-and-ofi‘ system. It needs a program called the assembler to convert the assembly instructions into machine code. 'Figure 2.2 Assembly language min procpay nova. dies mov ax, 0b00h add ax. dx mov al,bl mul but: mov bl,04h Source: Zak, Diane Programming with Microsoft Visual Basic 2. 0/3. 0 for WW, 1995 A High-Level Language’s instructions (Zak, 1995) are closer to the English language. They require either an interpreter (translating the high-level code into machine code line byline while running the program) or a compiler (translating the entire code into machine code before running the program.) Most high-level languages are procedm'e-oriented (the sequence of instructions is followed step by step.) An Object-OrientedlEvent-Driven High-Level Language (Perry, 1995) simplifies the task of programming application for Windows by providing a graphical user interface (GUI). This system is very user-friendly because it allows for interaction betWeen the user and whatever they see, but it requires more difficult and complicated programming tools. The emphasis of a program is on the objects in an interface (such as 20 a command button and a scroll bar) and the events occurring on those objects (such as clicking and scrolling). Visual Basic (VB) can be classified as an Object-Oriented/Event-Driven Language (Perry, 1995). One of the most important components of VB is its procedural Basic-like (Beginner’s All-Purpose Symbolic Instruction Code) programming language underneath the visual environment. Each part of the program is broken up and focus is placed on each object independent from others. In addition, all executable codes in a VB program exist in either a subprogram or ftmction that is activated by events or by calling from other routines. Figure 2.3 is a sample of a Visual Basic program. Figure 2.3 Sample of a Visual Basic program Insert Procedure a I‘ I ’ '31 “as—W - Me‘s-.7— , ,~ .. ,. Private Function OpenFilelFileName As String) As Boolean Din FNum As Integer On Error GoTo OpenFileError FNum = FreeFile Open FileName For Input As FNum txtFile.Text = Input(LOF(FNum). #FNum) Close FNum m_fFileDirty = False m_strFileName = FileName OpenFile = True Exit Function OpenFileError: , MsgBox Err.Description. vixclamation OpenFile = False Close End Function 21 2.2 Strengths and Weaknesses of Visual Basic Visual Basic’s great strength lies in its ability to enable a programmer to quickly and effortlessly develop application interfaces. The interface being developed is exactly what users will see. Visual Basic’s Rapid Application Development (RAD) environment (Norton, 1996) is useful for rapidly refining interface design and development approaches. Additionally, in today’s world, applications must be written in such a way that they can-be easily changed in order to keep them from being obsolete. For example, a tax-processing application needs to be changed very often to accommodate the provisions of the Internal Revenue code. Visual Basic is a perfect tool for developing this kind of application. However, there are disadvantages inherent to Visual Basic. The most obvious one is that Visual Basic is an interpreted programming language, which means the code is interpreted on-the-fly. Although all Visual Basic programs are first compiled to pseudo- code,calledp-code,thisp-codemustbeinterpreteddmingtherun-timebyanexternal library called VBRUNxOODLL (VBRUN300.DLL in this thesis.) Thus, a VB application cannot be run outside Windows and its speed is much slower than applications developed from other programming languages. However, as Windows becomes standard on most IBM/PC compatible systems and computers’ speeds have often been drastically increased, these drawbacks become insignificant. 22 2.3 Visual Basic Environment and Programming In VB, programmers work with several open windows most of the time (Perry, 1995). Information from different opened windows always needs to be used together. Figure 2.4 illustrates the major part of the Visual Basic screen and each of the 5 primary windows is described as follows: Figure 2.4 Main windows of Visual Basic design screen Source: Visual Basic 3.0, Microsoft Corp., I995 23 Figure 2.5 The Menu Window in Visual Basic design screen MICROSOEI yrsrUAL BASICW-_7P_R_O_J‘EVCVTlirDuFb‘lGNr Eu ‘Ifl’ m pass-r 3a- loom one. ”so Source: Visual Basic 3.0, Microsoft Corp., I995 The Form Window (Perry, 1995) contains the background for the applications being developed. Programmers can draw and place items on the form which will be the user interface. Figure 2.6 Form Window Source: Visual Basic 3.0, Microsofl Corp” 1995 24 The Toolbox Window (Perry, 1995) contains the set of tools (or controls) used to design a Visual Basic application. These tools allow programmers to place an object on the form. Figure 2.7 Toolbox Window Source: Visual Basic 3.0, Microsoft Corp., 1995 25 The Project Window (Perry, 1995) contains the list of all files used in the current application. It is easy for a small program to include all instructions together into only one file. In contrast, in a long and more complex program, having all instructions in only one file might cause complications and confirsion. It is much easier to break a long program into many modules contained in different files. This programming style allows the programmer to easily check and correct his/her program. Figure 2.8 Project Window lama-n— . KNEW Forml View Code] .3‘"‘ T““:‘:.""‘.“'""."—r‘..~ .-1'a'*1{ “. 12".“..L..'.' .'.’.'_'.:,'.'...'. ‘7' ' ' ‘~ 5 ~ . _ . _ ~ . .' . _ . a . , g , , g . .‘ -‘ ‘ . ~ . .r - ' l- .- - - . .‘ - ‘ .flah ~ . . . . . . u . 7‘0”“ ....-..4-...-u-o~--L......~."r »‘—‘-‘—.-J- ‘3“»-‘.". .,~L>.:; --~- - -‘» -.. A~.nl -. Source: Visual Basic 3.0, Microsoft Corp., 1995 26 The Properties Window (Perry, 1995) lists a set of characteristics associated with each object in an application, such as size and color. A programmer can control an object’s appearances and activities (for example, the caption on a button) by setting that property in the properties window. Figure 2.9 Properties Window new L.“ m1: mm7 FM" Fm" 1 - 30 False &H80(IBO0F& m - - 2-Sizd3le AMVO'W . .. . ' Forml . . W 7.... Arm/Fabem True _, 13- Pen MW H ‘(olist O-Soid dpqaiblevdm'l 1 TM _ ,. trimmer. ‘ Aw‘d‘” 1.r - . Adenine-operate Aimivolua; a Source: Visual Basic 3.0, Microsoft Corp., 1995 27 The Code Window (Perry, 1995) allows programmers to describe behaviors of each object in the form when a particular event occurs. For example, a programmer has to describe how an application should respond when a user clicks a mouse on an OK button. Figure 2.10 Code Window Source: Visual Basic 3.0, Microsoft Corp., 1995 CHAPTERIII COMPUTER PROGRAM FOR SWIPES FORMULA The SWIPES computer program was designed to calculate the SWIPES value of packaging materials. This program is divided into 3 major sections according to their purposes: the calculation part, the SWIPES value recording part and the data recording part. Their working systems are going to be explained together with each screen. 3.1 Calculation First, when the program is executed, its welcome screen is shown and automatically passed to the main menu screen. On the main menu screen, Figure 3.1, users have 5 different paths to choose. One option is to bypass the program by clicking the button marked “EXIT”, which will shut down the program. The button marked “ABOUT SWIPES” will lead to a screen showing background and historical information of the program, Figure 3.2. The next two buttons, “SWIPES FILE” and “DATA FILE” buttons, will be discussed later in the SWIPES value recording part and data recording part. 28 29 Figure 3.1 Main menu screen If you want to estimate the SWIPES value of a product click here. SWIPES VALUE . Click here to get all information and SWIPES value from a SMPES value file. SWIPES FILE If you wantto create or change data in a data file click here. DATA FILE Click here for more information about SWIPES program. . ABOUT ”PBS If you want to exit this program click here. EXIT Figure 3.2 About SWIPES program screen ABOUT SWIPES This computer program was written by Natgritta Taveesook and is based on the Solid Waste Integrated Packaging Evaluation System (SWIPES) model developed by Brian Peter Saputo as his thesis project for Master of Science degree. submitted to the School of Packaging. Michigan State University. RETURN TO WHATTO DO MENU 30 To calculate the SWIPES value for a set of packaging, information can be input via keyboard by clicking the “SWIPES VALUE” button or by accessing a stored data file. In the next screen, users have to enter information about the product that this packaging system will be used for. Users may use a mouse or the “Tab” button on the keyboard to position the information they want to enter. When finished, clicking the “NEXT” button willbringupthenextscreen. Inthecaseofmissingunits,whicharenecessaryfor calculations, the program will show a warning message and allow the users to complete the information. After the information is completed, the NEXT button will take a user to the packaging component information screen. The “CANCEL” button gives a user choices to return to the main menu, to clear all information in this screen and re-enter, or to keep all information and stay on the screen. 31 Figure 3.3 Product and packaging information screen PRODUCT AND PACKAGE INFORMATION Please enter your product and package information Type of product that the package is used for I Manufacturer I Uri ‘ ' Mass of product In— J r Lb. r‘ g. , unit ~ - Compacted densrty of product In P thh‘3r‘ 9"“.3 Combustible Fraction of Product _ [0 “NOTE: Product information will be calculated only once in SWIPES formula with first material.’ CANCEL ; NEXT .1 In the component information screen, users are given the options to access materialinformationfromadatafile;thiswillbediscussedinmoredetailinthedata recording section. Users should select the type of package fi'om the automatically loaded choicesorinputanewonetohelpwithmaterialidentification(suchasincasethereis more than one package with identical names but differing physical properties). Clicking the“NEX'I”’buttonwillshowusersthemater-ialmenuorgivewarningmessagesifthey did not input any necessary information. The “CANCEL” button, as in the product 32 informationscreen,willgiveauserchoicestoretmntothemainmenutoclearall information in this screen and re-enter, or to keep all information and stay on the screen. Figure 3.4 Component information screen COMPONENT INFORMATlON m bros-anon Please enter the component information Nyeuwulbgsttlmitiosmatiuniramaddafle. cickhmeudantmaflsnametareachmatarifl .DATAFILE- Type of package 8‘9 J ’ Type of material Ii J , Uri Mass of package I 1 r: Lb. r ,_ Number of Uses Number of Product Units per Package limmbdummmcickdnhflbsuunanmmattha nambuandrelidrsrtsftcamsrnfttu’sm The purpose of the program is to calculate the SWIPES value of the complete packagingsystemofaproduct. Inthecasethatthereismorethanonematerial component of the packaging system, necessary information on each component must be entered. Thepmgramwiflstoreallmatefialdatawithintheconespondingtypetheusers hadenteredinthepreviousscreen. For each component, theusersmust provide3 types of information: material information, packaging production information, and arbitrary 33 valueinformation. Userscanaccessthenecessaryareasbyselectingthescreenfiomthe material menu shown after the component information screen. Figure 3.5 Material menu screen —mmn_ Material Menu 1.Material Information 1 2.Packaging Production Information 2 3Mitary Value Information 3 {Calculate the material SWIPES 4 S.Retum to packaging component 5 information 6.Next Component from the same SWIPES 6 value file. 7Md additional components into the 7 packaging system. Utah-n to What to do menu and 9st “sitar-dim 8 from Initial SWIPES vfle fie. 34 Figure 3.6 Material information screen MATERIAL INFORMATION “I taro-name Material Informdion Uri Compacted density of package r J r “*5"? r 9'"? Fraction Recycled F] J Fraction Composted F] J Fraction Incinerated [Ir J Fraction of Ash after Combustion In J Residue Fraction After Compost Screen [IT J Ifthis information is not satisfactory. use mouse or press tab button to highlight those values and 01( change them. Then click OK button to go back to Material Menu. limmhm-yMcudmbflmnpm-mattbe mbunndselu’dmrlaltcosnaroftbispane 35 Figure 3.7 Packaging production information screen PACKAGING PRODUCTION INFORMATIOI‘ m lures-ram ' Packaging Production Information Please enter the following information or all default values are zero. 0 Massofscrapperpackage F IrLb (‘9 Fraction of scrap disposed of F] I Fraction of product damage in distribution [IT J Fraction of recycled content in package In J component It all values are satisfactory. click the OK button OK If’oueutochqrgsmMcickdlelaltbtatonnyotI-mneatdm mumbmorrtbeludmrleltcomarofth'soaoo 36 Figure 3.8 Arbitrary value information screen ARBITRAR‘1"‘JALUE INFORMATION‘ Arbitrary Value Information Reuse Value. W Recycling Rate Value. XI Rean Content Value. x2 Composting Value. Y Combustion Value. 2 If these values are not satisfactory.use mouse or tab button to enter new value. then click OK button to return to material OK limmhm-QMcickdmbfimonn-matdm manubuondlehidmrlsltcornaroftis’sm After completing the above steps, users might choose to immediately get the results of the calculation by clicking No. 4 “Calculate the material SWIPES Value”. User's Will encormter the SWIPES value screen. Here, users will need to specify the Maids and units before the program will perform the calculation. For a system composed ofmany materials, the total SWIPES value ofthe system will be calculated by °h°°8ine “Total SWIPES Value”, which is the last topic in the list of materials. The “RETLJRNTOMAT'ERIALMENWbuuonMHtaketheusersbacktothematerial menu. 37 Figure 3.9 Material SWIPES value screen MATERIAL SWIPES VALUE m urea-anon "UT MATE H J: g. , safajj Showdrorosd'lr (“'m‘3 (‘6..3 Compacted Volume Manufacturing Scrap Reuse Recycling RateIRecycIing Content Composting Damage Compensation Manufaduring Scrap Correction Factor Product Correction Factor“ ..____.L_____L___L___ MATERIAL SWIPES VALUE r“"'r‘7' RETURNTOMATERIALMENU pruudbcbumemidmafionmmfickdmfltmonmmatdm mbuondseh’drsrlsltcosnsrolllu’spano. ‘l’heor'mtcommandsslworkdter’ou William. 'NOTE:0dleniofprarhsctiscont-'mdirdlavelofpackaw’rg.lbon. Pathsctcosrecb'onlachuiscalcdatedorboncewitblhalistnackm fig 38 Figure 3.10 Total SWIPES value screen TOTAL SWIPES VALUE m turnout-mu Pool-r Total SWIPES Value [ 4.78 «~- (‘ cm“3 OK ’ ornitcicklbemonuontopofllsoss’mdoss. ; 2 i .I Thaps'mtco-lsdssimorkdtor lonvellispso'n ---—-———-._ . Users can also choose to go on to enter an additional component information by clicking No. 6 “Next Component from the same SWIPES value file” if users apply information and result from a SWIPES value file or No. 7 “ Add more components into the packaging system” if users want to enter additional information using a keyboard). Userscanaccessanyareaoftheprogramiftheyneedtore-enteranydatabyclickingthe member in all information screens. Users can print the information and results of calculation by clicking “Print” in the menu bar. 39 3.2 SWIPES Value Recording Users can store SWIPES values from the calculation of a packaging system by clicking “File” and entering the necessary information in the SWIPES value file selection screen. This information will be stored in the SWIPES value file. Data from the SWIPES value file can be recalled in the main menu screen by clicking the “SWIPES FILE” button. Figure 3.11 SWIPES value file selection screen SWIPES VALUE FILE SELECTION Fin Name: I'm! I OK CANCEL 3.3 Data Recording To create or change information on a data file, choose the “DATA FILE” button on the main menu. The data file selection screen, similar to the SWIPES value file selection screen, will appear. After selecting the data file, users will then enter the necessarydatawithinthedatascreen. Userscanchangeorviewstoreddatainthedata filebyclickingthedesiredtypesofmaterial. Theprogram will then showall storeddata on this specified material. Users can access the stored information in the data file from inside the component screen by clicking the “DATA FILE” button. 41 Figure 3.12 Data file selection screen DATA FILE BELECTION Fie Name: Diectosies: Fawn J ‘1‘ OK ‘3 'm‘ CANCEL- ‘Liarsuorrm Drives: Figure 3.13 Data information screen DATA INFORMATION Peerr senses m.mmm I!" 0‘ W“ [Alli-inu- [Deer a. Set J Arbiresy Vehse for cm om f,“ I has. Vdue E: (0‘ Ltht“3 f” ole-‘3 am Flats v“ Paulina Board-d [.634 | accruing Carlton! vac E5: Fraction Contested [o I cm v“ E Fraction Imus [o I cm van. [3 Fraction of Ash dies CM [1 I Fraction am dies cm Screen [1 I ' CANCEL RECORD CHAPTERIV CONCLUSIONS 4.1 Advantages of the Program In the SWIPES formula, many factors ( almost 20) are needed in the calculation for each material. It will take a plenty of time to work by hands. The SWIPES computer program is helpful in minimizing time loss which is important in industries and businesses. . The SWIPES computer program was developed based on the SWIPES model, which was a first fi'ontier model. Therefore, much more can be done to add usefulness to the model. This program is not only useful to reduce time in calculation during packaging design, but also useful in the next period of formula development. Moreover, to support the future changes in the model, the SWIPES computer program was designed in the Visual Basic environment which is very flexible. The way this program was designed allows users to change the formula, variables, information arrays, etc., in the Program whenever they need. Additionally, for the users’ conveniences, a material standard data file is supplied With the program. All information in this data file (average number in the US, in 1994) is analysed from the information in Characterization of Municipal Solid Waste in the United 42 43 States:l994 Update (EPA, 1994). However, if users want any different information, they can either change or input a specific data by keyboard or create a new data file for their uses. 4.2 Future Development In order to deveIOp this program, programmers can change all necessary commands by using a Microsoft Visual Basic Software version 3.0 or newer. The computer codes are recorded in “SWIPEMAK file. They are in alphabetic sequences of forms and objects. The original codes ofthe program are presented in Appendix A ofthis paper. Because the SWIPES model might be developed more with the fixture study, this program should be developed simultaneously, if possible. As mentioned above, the SWIPES formula and computer program are only the firststepinthisfield,hence,thereisnotastandardmeasme ofmanyfactorsusedinthe program, especially the arbitrary values. For this reason, Saputo stated in his thesis that “the SWIPES model had to have the flexibility to be explicit to each individual situation”. Thus, at present, users are allowed to ponder and weight the important levels of reuse, recycle, compose, and combustion, and then picked a number between 0 to l for these valuesbythemselves. Asaresultoffirtmestudy,theremightbeabettermethodto derive these factors and this should be part of the program development. LIST OF REFERENCES LIST OF REFERENCES Abbott, Donald L., Packaging Perspectives, Kendall/Hunt Publishing Co., Dubuque, Iowa (1989) EPA, Characterization of Municipal Solid Waste in the United States:1994 Update, US Environmental Protection Agency, EPA/530-R-94—042 (November 1994) EPA, Characterization of Municipal Solid Waste in the United States:l990 Update, US Environmental Protection Agency (1992) Manypenny, Gerry 0., Holmgren, R. Bruce, Beckman, Harold M., Egan, Richard, and McQueen, Gloria, Glossary of Packaging Terms, The Packaging Institute, USA, Stanford, Connecticut, Sixth edition, PP 166 (1996) Microsofi Visual Basic for Windows 95, Version 3. 0, Microsoft Corporation Millard, Peter 13., General Information about Microsoft Visual Basic, Internet: http :l/www.apexsc.com/vb/fip/vbfaq/vbfaqgen.nrt (1997) Norton, Peter, Guide to Visual Basic 4 for Windows 95, Sam Publishing , Indianapolis, IN (1995) Perry, Greg, Visual Basic in 12 Easy lessons, Sam Publishing , Indianapolis, IN (1995) Saputo, Brian Peter, Solid Waste Integrated Packaging Evaluation System, M.S. Thesis, Michigan State University (1991) Zak, Diane, Programming with Microsofi Visual Basic 2. 0/3. 0 for Windows, Course Technology, Inc., Cambridge, MA (1995) ADDITIONAL SOURCES FOR COMPUTER PROGRAMMING ADDITIONAL SOURCES FOR COMPUTER PROGRAMMING Socha, John and Hall, Devra, Teach yourself... Visual Basic 3. 0, MIS:Press, Inc., New York, NY (1994) Thomas, Zane, Amson, Robert, and Waite,Mitchell, Visual Basic How-to, Second edition, Waite Group Press, Inc., Corte Madcra, CA (1993) 45 APPENDIX A COMPUTER SOURCE CODE FOR SWIPES APPENDIX A COMPUTER SOURCE CODE FOR SWIPES AboutFrm.Frm Sub Cdeeturn_Click ( ) WhatFrm.Show AboutFrm.Hide End Sub Arbilnfo.Fr1n Sub CmeK_Click ( ) ‘Check negative information. IF Val(TxtW.Text) < 0 Or Val(TxtXl.Text) < 0 Or Val(TxtX2.Text) < 0 Or ‘Val(TxtY.Text) < 0 0r ValCI‘th.Text) < 0 Then Warn = MsgBox (“Information cannot be a negative number”, ‘MB_IconExclamation, “Please Check”) Exit Sub End If 46 47 ‘Check arbitrary information. If ValCIxtW.Text) > 1 Or Val(TxtXl .Text) > 1 Or Val(TxtX2.Text) > 1 Or ‘Val(TxtY.Text) > 1 Or Val(Tth.Text) > 1 Then Warn = MsgBox (“Arbitrary value cannot be more than one”, ‘MB_IconExc1amation, “Please Check”) Exit Sub End If ‘Assign variables from information array. W = Val(TxtW.Text) X1 = ValCl‘xtXl.Text) X2 = Val(TxtX2.Text) Y = Val(TxtY.Text) Z = Val(Tth.Text) ‘Record information into information array. InfoArray(MatCormt).W = W InfoArrayCMatCount).X1 = XI InfoArray(MatCormt).X2 = X2 InfoArray(MatCormt).Y = Y InfoArray(MatCount).Z = Z ‘Display MatMenuFrm and hide the screen. ArblnfoFrmJ-Iide EndSub 48 SubForm_Activate ( ) ‘Assign variables on this screen fiom data file. TxtW.Text = InfoArray(MatCormt).W TxtXl .Text = InfoArray(MatCormt).Xl TxtX2.Text = InfoArray(MatCount).X2 TxtY.Text = InfoArray(MatCount).Y Tth.Text = InfoArray(MatCount).Z End Sub Sub Form_Deactivate ( ) ‘Clear old information on the screen. ' TxtWRefresh TxtX1.Refresh TxtX2.Refresh TxtY.Refiesh Tth.Refi'esh End Sub Sub MnuFileExit_Click ( ) End End Sub 49 Sub MnuFiIeSwipe_Click ( ) ‘Record SWIPES information. Call SwipeFile EndSub Sub MnuInfoMat_Click ( ) ‘Work like OK button. Call CmeK_Click MatlnfoFrm. Show EndSub Sub MnuInfoPkg_Click ( ) ‘Clear FName variable, protect program from reading a closed file. IfFName <> “ “ Then Close #1 [Name = “ “ End If ‘Work like OK button. Call CmeK_Click ComInfoFrm.Show ‘Memo how to make the program work. 50 MsgBox (“Click on of Type of Package to get information”) End Sub Sub MnuInfoPro_Click ( ) ‘Clear FName variable, protect program fi'om reading a closed file. If FName <> “ “ Then Close #1 FName = “ “ End If ‘Work like OK button. Call CmeK__Click PPFrm.Show EndSub Sub MnuInfoScr_Click ( ) ‘Work like OK button. Call CmeK_Click ScrInfoFrm.Show End Sub BInfo.Fr-m Sub CmdBaek_Click ( ) 51 ‘Display the what to do menu and hide the screen. WhatFrm.Show PPan.Hide End Sub Sub Cdeancle_Click ( ) ‘Choises what the user want to do Ques = MsgBox (“Would you like to return to what to do menu? (Yes to return to ‘what to do menu, No to clear all information and enter again, or Cancle to keep all ‘information and stay in this interface)”, MB_IeonQuestion + MB_YesNoCancle, “ “) Select Case Ques Case IDYes WhatFrm.Show PPFrm.Hide , Case IDNo TXthgName.Te = “ “ TxthgMan.Text = “ “ TxtMassPr.Tex = “ “ TxtProden.Text = “ “ TxtComb.Te = “ “ OptGram.Value = False OptGramPro.Value = False 52 OptLb.Value = False OptLbPro.VaIue = False Case Else Exit Sub End Select End Sub Sub CmdNext_Click( ) ‘Check that all information are positive number. IfValCl'xtMassPr.Text) < 0 Or Val(TxtProdenIext) < 0 Then Warn = MsgBox(“Information cannot be a negative number”, ‘MB_leonExclamation, “Please check”) Exit Sub End If ‘Check the unit of mass and density of product. If Convert = Val(“ “) Or ConvertPro = Val(“ “) Then Warn = MsgBox (“Please check the units of mass and compacted density ‘of product”, MB_IconExclamation, “Please check”) Exit Sub End If ‘Assign values of all variables. ProType = TxthgName.Text 53 Man = TxthgMan.Text mPr = Val(TxtMassPr.Text) * Convert dPr = Val(TxtProden.Text) * ConvertPro Peomb = Val(TxtComb.Text) ProMass = Val(l‘xtMassPr.Text) ProDcn = Val(TxtProDen.Text) ‘Displaythenext screenandhidethisscreen. ComInfoFrm.Show PPFrm.Hide End Sub Sub FormfiActivate ( ) ‘Assign information onto screen. TxthgName.Text = ProType TxthgManText = Man TxtMassPr.Text = ProMass TxtProDenText '= ProDen , TxtComb.Text = Peomb Select Case Left(ProU, 1) . Case “L” Optlb.Value = True Case “g” 54 OptGram.Value = True End Select Select Case Lefi(Produ, 1) Case “L” OptLbPro.Value = True Case “g” OptGramPro.Value = True End Select End Sub Sub OptGrarn_Click ( ) ‘Assign the converter value. Convert = 1 / 454 ProU = “g.” EndSub Sub OptGramPro_Click ( ) ‘Assign the converter value. Converth = (2.54 " 3) / 454 Pmdu = “chm"3” EndSub 55 Sub OptLb_Click ( ) ‘Assign the converter value. Convert = 1 ProU = “Lb.” End Sub Sub OptLbPro__Click ( ) ‘Assign the converter value. ConvertPro = 1 Produ = “LbftnAB” EndSub ComlnfmFr-m Sub CmdBack_Click ( ) ‘Display the what to do menu and hide this form. WhatFrm.Show ComInfoFrmJ-Iide End Sub Sub CboPkgType_Click ( ) ‘Assign varialbles from information array to a responding package. Pk'gType = CboPkgType.Text 56 MatCount = 1 Found = “ “ Do While MatCount <= 10 If CboPkgType.Text = InfoArray(MatCount).pkg Then Found = “Yes” Exit Do ' End If MatCount = MatCount + 1 LOOP If Found = “Yes” Then CboTMat.Text = lnfoArray(MatCount).Mat If Lefi (InfoArray(MatCount).Png, 1) = “g” Then OptGramPkg.Value = True TxtMasstg.Text = InfoAnay(Ma:f‘ount).mPkg * 454 Else I OptLbPkg.Value = True TxtMasstg.Text = InfoArray(MatCormt).mPkg End If TxtNPro.Text = InfoArray(MatCount).Npro TxtNumUse.Text = InfoArray(MatCormt).n End If EndSub . 57 Sub Cdeancel_Click ( ) ‘Decide where to go. Ques = MsgBox (“Would you like to return to what to do menu? (Yes to return to ‘what to do menu, No to clear all information and enter again, or Cancel to keep all ‘information and stay in this interface)”, MB_IconQuestion + MB_YesNoCanoel, “ “) Select Case Ques ‘ Case IDYes WhatFrm.Show CboTMatClear TxtMasstg.Te = “ “ TxtNumUse.Text = “ “ OptLbPkg.Value = False OptGrarnPkg.Value = False ComlnfoFrm.I-Iide Case IDNo CboPkgType.I_.istIndex = O CboTMatClear TxtMasstg.Te = “ “ TxtNumUse.Text = “ “ OptLbPkg.Value = False OptGramPkg.Value = False 58 Case Else Exit Sub End select ‘Protect program from reading a closed file. IfFName <> “ “ Then Close #1 FName = “ “ End If End Sub Sub CmdFile_Click ( ) ‘Protect program from reading a closed file. IfFName <> “ “ Then 2 Close #1 FName = “ “ End If SelectForm = 2 FrmGetFile.Show End Sub Sub Cmd Next_Click ( ) ‘Check negative information. 59 If Val(‘l' xtMasstg.Text) < 0 Val(TxtNumUse.Text) < 0 Then Warn = MsgBox (“Information cannot be a negative number”, ‘MB_IconExclamation, “Please Check”) Exit Sub End If ‘Check needed information. If Val(TxtNumUse.Text) < 1 Then Warn = MsgBox (“Number of uses Should be at least one”, MB_IconExclamation, “Please Check”) ‘ Exit Sub End If ‘Check whether units are applied or not. If(OptLbPkg.Value <> True) and (OptGramPkg.Value <> True) Then Warn = MsgBox (“Please check the units of package and product mass”, MB_IconExclamation, “Please Check”) Exit Sub End If ‘Assign variables from screen information. MPkg = Val(‘l‘xtMasstg.Text) “ Converthg n = Val(TxtNumUse.Text) Npro = Val(TxtNPro.Text) ‘Getmater‘ialinfonnationfi'omdatafileiftheuserwant. Lett=1 DoWhileLett<=20 Tmat= CboTMaLText& “ “ IfMidCTmaLLetL l)=““T'hen SelectMat = Lefi(CboTMat.Text, (Lett - 1)) ExitDo Endlf Lett=Lett+1 Loop IfFName<>““Then DataNum=1 Get#l,DataNum, DataRec Do While Not EOE (1) Lett=1 DoWhileLett<= 20 If Mid(DataRec.MatType, Lett, 1) = “ “Then Mat = Lefi (DataRec.MatType, (Len -1)) ExitDo Endlf Lett=Lett+l Loop 1f Ucase (SelectMat) = Ucase (Mat) Then 61 Exit Do Else DataNum = DataNum + l DenPkg = Val(“ “) Get#l, DataNum, DataRec Endlf . DenPkg = DataRec.Den rr = DataRec.rr c = DataRec.c i = DataRec.i a = DataRec.a . e = DataRec.c W = DataRec.W X1 = DataRec.Xl X2 = DataRec.X2 Y = DataRec.Y . Z = DataRecZ Unit = DataRec.Unit Close #1 FName = “ “ ‘Check for available materials in the file. 62 If DenPkg = Val(“ “) Then Warn = MsgBox (“This type of material is not available on the ‘selected data file name, Would you like to try another file? (Yes to enter file name, No to ‘enter all informaiton by keyboard, or Cancel to stay in this interface)”, ‘MB_IeonExc1amaiton + MB_IconYesNoCancel, “Not Available”) Select Case Warn Case IDYes FrmGetFile.Show Exit Sub Case lDCancel Exit Sub End Select End If End If ‘Reeord Information in information array. MatCount = 1 Do While MatCormt <= 10 IbeoPkgType.Text = InfoArray(MatCount).pkg Then Found = “Yes” Exit Do End If MatCount = MatCount + l 63 Loon If Found <> “Yes” Then MatCount = 1 Do While MatCount <= 10 If InfoAn'ay(MatC0tmt).pkg = “ “ Then Exit Do End If MatCount = MatCormt + 1 LOOP InfoArray(MatCount).pkg = CboPkgType.Text InfoArray(MatCount).Mat = CboT'MatText InfoArray(MatCormt).mPkg = mPkg InfoArray(MatCount).Png = Png InfoArray(MatCount).n = n InfoArray(MatCount).NPro = NPro InfoAmy(MatCount).deg = DenPkg InfoArray(MatComrt).Pkgdu= Unit InfoArray(MatCount).rr = rr InfoArray(MatCmmt).c = c InfoArray(MatCount).i = i InfoArray(MatCount).a = a InfoArray(MatCount).e = e 64 InfoArray(MatCount).W = W InfoArray(MatCount).Xl = XI InfoArray(MatCount).X2= X2 InfoArray(MatCount).Y = Y InfoArray(MmCOtmt).Z = Z End If Mat = CboTMatText ‘Display material menu screen. MatMenuFrmShow ComInfoFrm.Hide EndSub Sub F orm_Actvate ( ) CboPkgType.Clear ‘Add items to the type of packaging combo box. MatNum = l IfInfoArray(MatNum).pkg =3 “ “ or AddMat = “Yes” Then . CboPkgTypeAddItem “Bag” CboPkgTypeAddItem “Bottle” CboPkgTypeAddItem “Box” CboPkgTypeAddltem “Can” CboPkgTypeAddltem “Carton” 65 CboPkgType.AddItem “Pallet” CboPkgType.AddItem “Pouch” CboPkgType.AddItem “Tube” CboPkgType.AddItem “Wrapper” CboPkgType.AddItem “Other” Else Do While InfoArray(MatNum).pkg <> “ “ CboPkgType.AddItem InfoArray(MatNum).pkg MmNum = MatNum + 1 Loop End If CboPkgType.ListIndex = 0 ‘Set default values. TxtMasstg.Text == “ “ OptGramPkg.Value = False OptLbPkg.Value '= False TxtNumUse.Text = “ “ TxtNPro.Text '= “ “ EndSub Sub MnuFiIeExit_Click ( ) Edd End Sub SuanuFileValue_Click ( ) Call SwipeFile EndSub SubInfoPro_Click( ) Call CmdNext_Click PPFrm.Show End Sub SubOptGramPkg_Click ( ) ‘Assign the converter value. Converthg = l / 454 Png = “g.” EndSub Sub OptLbPkg_Click ( ) ‘Assign the converter value. Converthg == 1 - Png = “Lb.” End Sub 67 DataFrmJ‘rm Sub CboTMat_Click ( ) ‘Clear old information on screen. TxtDen.Refresh TxtRRate.Refi'esh TxtCRate.Refresh TxtIRate.Refresh TxtW.Refresh TxtXl .Refi'esh TxtX2.Refresh TxtY.Refresh TthP. ; fresh TxtAshRefresh TxtRes.Refi'eSh OptGramPkg.Value = False OptLbPkg.Value '= False ‘Get informaiton from a file if it is opened. If FName <> “ “ Then DataNum = 1 Get #1, DataNum, DataRec Do While Not EOF (1) 68 Lett = 1 Do While Lett <= 20 If Mid(DataRec.MatType, Lett, 1 = “ “ Then Mat = Left(DataRec.MatType, (Lett - 1) Let: = 21 End If - Lett = Lett + 1 LOOP Lett = 1 Do While Let: <= 20 IfMid(CboTMat.Text, Lett, 1) = “ “ Then SelectMat = Left(CboTMat.Text, (Lett - 1)) Lett = 21 End IF Let: = Lett + l LOOP If Ucase(SelectMat) = Ucase(Mat) Then TxtRRate.Text = DataRec.Rrate TxtCRate.Text = DataRec.CRate TxtIRate.Text = DataRec.IRate TxtW.Text = DataRec.W TxtX1.Text = DataRec.Xl Endlf EndSub Else End If 69 TxtX2.Text = DataRec.X2 TxtY.Text = DataRec.Y Tth.Text = DataRecZ TxtAsh.Text = DataRec.Ash TxtRes.Text = DataRec.Res Unit = DataRec.Dnit If Unit = “g/cm"3” Then OptGramPkg.Value = True TxtDenText = DataRec.Den * 454 / (2.54"3) Else OptLbPkg.Value = True TxtDenText = DataRec.Den End If Exit Do DataNum = DataNum +1 Get #1, DataNum, DataRec 70 Sub Cdeaneel__Click ( ) ‘Show the what to do form and hide this fomrl Close #1 FName = “ “ Ques = MsgBox (Would ‘you like to get a different file.”, MB_IconQuestion + MB_YesNo, “Different File”) Select Case Ques ' Case IDYes FrmGetFile.Show DataFrrn.I-Iide Case IDNo WhatFrm.Show DataFrm.Hide End Select End Sub Sub Cdeecord_C1ick ( ) ‘Make sure one of the unit option boxes is checked. If Unit = “ “ Then Warn MsgBox (“Please Check the Units of package and product compacted density.”, MB_IconExclamation, “Please check”) Exit Sub 71 End If ‘Check negative informaiton. If Val(TxtDen.Text) < 0 Or Val(TxtRRate.Text) < 0 Or Val(TxtCRate.Text) < 0 ‘Or Val(TxtW.Text) < 0 Or Val(TxtX1.Text) < 0 Or Val(TxtX2.Text) < 0 Or ‘Val(TxtY.Text) < 0 Or Val(Tth.Text) < 0 Or Val(TxtAshText) < 0 Or ‘Val(TxtRes.Text) < 0 Then Warn = MsgBox (“Information cannot be a negative number”, ‘MB__IeonExclamation, “Please Check”) Exit Sub End If ‘Check arbitrary information. If Val(TxtW.Text) > 1 Or Val(TxtX1.Text) > 1 Or Val(TxtX2.Text) > 1 Or ‘Val(TxtY.Text) > 1 Or Val(Tth.Text) > 1 Then Warn = MsgBox (“Arbitrary values cannot be more than one”, ‘MB_IconExclamtion, “Please Check”) ‘ Exit Sub End e ‘Check fraction information. If Val(TxtAshText) >1 Or TxtRes.Text) > 1 Then Warn = MsgBox (Please enter all fraction number as fraction (less than 1, ‘without % Sign)”, MB_IconExclamation, “Please Check”) Exit Sub Endlf ‘Write the new information onto the data file, change the old information if the same ‘material isalreadyrecordedorwritetothebottom offile ifit is newmatcrial. DataNum = 1 Get #1, DataNum, DataRec Do While Not EOF(1) If DataRec.MatType o “ “ Then If Ucase(CboTMat.Text) = Ucase DataRec.MatType) Then Formd = “Yes” Exit Do End If Else Exit Do End If V DataNum = DataNum + 1 Get #1, DataNum. DataRec L001: DataRec.MatType = CboTMatText IfLefiOJnit, 1) = “8” Then DataRec.Den = Val(TxtDen.Text) * (2.54"3) / 454 Else DataRec.Den = Val(TxtDen.Text) End If DataRec.RRate = Val(TxtRRate.Text) DataRec.CRate = Val(TxtCRate.Text) DataRec.1Rate = Val(TxtIRate.Text) DataRec.W = Val(TxtW.Text) DataRec.Xl = Val(TxtXl .Text) DataRec.X2 = Val(TxtX2.Text) DataRec.Y = Val(TxtY.Text) DataRec.Z = Val(TthText) DataRec.Ash = Val(TxtAsh.Text) DataRec.Res = Val(‘l'xtRes.Text) DataRec.Unit = Unit Put #1, DataNum, DataRec Close #1 ‘Whether the user want to record more, where. Record = MsgBox “Would you like to record more in the same data file?”, ‘MB_IconQuestion + MB_YesNo, “Same File”) Select Case Record , Case IDYes Open FName For Random As #1 Len = Len(DataRec) Case IDNo Drecord = MsgBox (“More in a different file?”, MB_IconQuestion ‘+ MB_YesNo, “Different File”) 74 Select Case Drecord Case [D Yes FrmGetl-‘ileShow Case IDNo WhatFrm.Show DataFrm.Hide End Select End Select End Sub Sub Form_Activate ( ) ‘Clear old information. OptGramPkg.Value = False OptLbPkg.Value = False TxtAshRefiesh TxtCRate.Refresh TxtDenRefresh TxtIRate.Refresh CboTMaLClear TxtRes.Refresh TxtRRateRefiesh TxtW.Refresh 75 TxtX1.Refi'csh TxtX2.RefreSh TxtY.Refresh Tth.Refresh ‘Add items to CboTMat. IfFName <> “ “ Then DataNum = 1 Get #1 , DataNum. DataRec Do While Not EOF(1) CboTMat.AddIem DataRec.MatType DataNum = DataNum + 1 Get #1 , DataNum, DataRec Loop CboTMatListIndex = 0 End If End Sub Sub MnuPrint_Click( ) Cdeaneel.Visible = False CdeeoordVisible = False PrintForm CnidCancelNisible = True 76 Cdeecord.Visible = True End Sub Sub OptGramPkg_Click ( ) ‘Assign unit variable. Unit = “g/cm".3” End Sub Sub OptLbPkg_Click ( ) ‘Assign 1mit variable. Unit = “lb/in"3” EndSub DoWhaLFrm Sub CmdData__Click ( ) ‘Display the data form and hide this form. SelectForm = 1 FrmGetFile.LstFileType.Clear FrmGetFiIe.LstFileType.AddItem “SWIPES Data Files (‘.swp)” FrmGetFile.LstFileType.Addltem “All File (‘.")” FrmGetFile.LstFileType.ListIndex = 0 FrmGetFile.TxtFiles.Text = “*.SWp” FrmGetF i1e.Caption = “Data File Selection” F rmGetF ile.Show End Sub Sub Cdexit_Click ( ) End End Sub Sub CmdSwipeFile__Click ( ) ‘Protect program from reading a closed file. IfFName<> ““Then End If SelectForm = 3 FrmGetFile.LstFileType.Clear FrmGetFile.LstFi1eType.AddItem “SWIPES Value Files (*.val)” FrmGetFile.LstFileType.Addltem “All File (*.")” FrmGetFile.LstFileType.ListIndex = 0 FrmGetFileTxtFilesText = “*.val” FrmGetFile.Caption = “SWIPES Value File Selection” FrmGetFile.Show End Sub 78 Sub CmdAbouLClick ( ) AboutFrm.Show WhatFrm.1-Iide End Sub Sub Form_Activate ( ) ‘Clear old information in infoArray. For MatCount = 1 To 10 InfoArray(MatCormt).pkg = “ “ InfoArray(MatCount).Mat = “ “ InfoArray(MatCount).mPkg = 0 InfoArray(MatCotmt).Png = “ “ InfoArray(MatCount).n = O , InfoArray(MatCount).de = 0 InfoArray(MatCormt).Pkgdu = “ “ lnfoArray(MatCormt).rr = 0 InfoAnay(MatCormt).c = 0 InfoArray(MatCOtmt).i = 0 - InfoArray(MatCOtmt).a = 0 InfoArray(MatCount).e = 0 InfoArray(MatCormt).ms = 0 79 lnfoArray(MatCount).Scrapu = “ “ InfoArray(MatCount).f = 0 InfoArray(MatCount).b = O InfoArray(MatCount).rc = 0 InfoArray(MatCount).W = 0 InfoArray(MatCount).X1 = 0 InfoArray(MatCount).X2= 0 InfoArray(MatCount).Y = 0 InfoArray(MatCount).Z = 0 InfoArray(MatCount).NPro = 0 _ MatSwipeArray(MatCormt).Mat = “ “ MatSwipeArray(MatCount).VCom = 0 MatSwipeArray(MatCount).MScr = O MatSwipeAn'ay(MatC0tmt).Reuse = O MatSwipeArray(MatCount).Recy = 0 MatSwip'eArray(MatCount).Comp = O MatSwipeArray(MatCOtmt).Comb = O MatSwipeArray(MatCount).ProEf = O MatSwipeArray(MatCOtmt).Schac == 0 MatSwipeArray(MatCormt).PFac = 0 MatSwipeArray(MatCount).Swipe = 0 Next MatCount 80 End Sub Sub SwipeCmd_Click ( ) PPFrm.Show Whatan.I-Iide End Sub FrmGetFileFr-m Sub Cdeaneel_Click ( ) ‘Hide data file selection form. TxtFiles.Refiesh FrmGetFile.I-Iide End Sub Sub CmeK_Click ( ) ‘Assign data file name. Select Case SelectForm . Case 1 If Right (T xtF iles.Text, 3) = “swp” Then FName == TxtFileS.Text Else FName = TxtFileS.Text & “.swp” 81 End If Case 4 IfRight (T xtF iles.Text, 3) = “val” Then FName = TxtFiles.Text Else FName = TxtFiles.Text & “.val” End If Case Else FName = TxtFiles.Text End Select IfRight$(FilFile.Path, 1) = “\” Then FName = FilFile.Path & FName Else FName = FilFile.Path & “\” & FName End If ComInfoFrm.CboTMat.Clear ‘Check Ifthe FName is available or not. IfSelectForm <> 4 Or 1 Then IfDir$(FName) = “ “ Then MsgBox “The selected file name does not exist, please check the ‘name and enter again.” Exit Sub 82 End If End If ‘Open the data file if it is available. Open FName For Random As #1 Len = Len(DataRec) TxtFiles.Refresh Select Case SelectForm Case 1 DataFrm.Show Case 2 ComInfoFrm.CboTMat.Clear DataNum = 1 ‘Compare and get information fi'om data file. Get #1 , DataNum, DataRec Do While Not EOF(1) ComInfann.CboTMat.Addltem DataRec.MatType DataNum = DataNum + 1 Get #1 , DataNum, DataRec Loop ComInfoFrm.CboTMatListIndex = 0 Case 3 DataNum = 1 Get #1, DataNum, DataRec 83 ProType = DataRec.ProType Man = DataRec.Man ProMass = DataRec.ProMass ProDen = DataRec.ProDen PComb = DataRec.PComb ProU = DataRec.ProU Produ = DataRec.Produ Do While Not EOF (1) InfoArray(DataNum).pkg = DataRec.pkg InfoArray(DataNum).Mat = DataRec.Mat InfoArray(DataNum).mPkg = DataRecmPkg InfoArray(DataNum).Png = DataRecPng InfoArray(DataNum).n = DataRec.n InfoArray(DataNum).deg = DataRec.deg InfoArray(DataNum).Pkgdu = DataRecPkgdu InfoArray(DataNum).rr = DataRec.RRate InfoArray(DataNum).c= DataRec.CRate InfoArray(DataNum).i = DataRec.1Rate InfoArray(DataNum).a = DataRec.Ash InfoArray(DataNum).e = DataRec.Res InfoArray(DataNum).ms = DataRecmS InfoArray(DataNum).Scrapu = DataRec.Scrapu 84 InfoArray(DataNum).f = DataRec.f InfoArray(DataNum).b = DataRec.b InfoArray(DataNum).W = DataRec.W InfoArray(DataNum).X1 = DataRec.Xl InfoArray(DataNum).X2 = DataRec.X2 InfoArray(DataNum).Y = DataRec.Y InfoArray(DataNum).Z = DataRecZ InfoArray(DataNum).NPro= DataRec.NPro DataNum = DataNum + 1 Get #1 , DataNum, DataRec Loop Close #1 PPFrm.Show LstFileType.Clear LstFileType.AddItem “SWIPES Data Files (*.swp)” LstFileType.AddItem “All File ('.*)” LstFileType.ListIndex = 0 FrmGetFile.Caption = “Data File Selection” FName = “ “ Case 4 ‘Record SWIPES information onto a SWIPES value file. MatC==l 85 Do While MatC <= MatCount DataNum = 1 Get #1, DataNum, DataRec DataRecProType = ProType DataRec.Man '3 Man DataRecProMass = ProMass DataRec.ProDen = ProDen DataRec.PComb'—' PComb DataRec.ProU= ProU DataRecProdu = Produ Do While Not EOF(1) IfDataRec.pkg = “ “ Or DataRec.pkg = lnfoArray(MatC).pkg Then Exit Do End If DataNum = DataNum + 1 Get #1, DataNum, DataRec Loop DateRec.Pkg = InfoArray(MatC).Pkg DateRec.MatType = lnfoArray(MatC).MatType DateRecmPkg = InfoArray(MatC).mPkg DateRec.Png = InfoArray(MatC).Png DateRecn = InfoArray(MatC).n 86 DateRec.Den = InfoArray(MatC).deg DateRec.Unit = InfoArray(MatC).Pkgdu DateRec.RRate = InfoArray(MatC).rr DateRec.CRate = InfoArray(MatC).c DateRecJRate = InfoArray(MatC).i DateRec.Ash = InfoArray(MatC).a DateRecRes = InfoArray(MatC).e DateRecms = InfoArray(MatC).ms DateRec.Scrapu = InfoArray(MatC).Scrapu DateRec.f = InfoArray(MatC).f DateRec.b = InfoArray(MatC).b DateRec.rc = InfoArray(MatC).rc DateRec.W = InfoArray(MatC).W DateRec.Xl = lnfoArray(MatC).Xl . DataRec.X2 = InfoArray(MatC).X2 DateRec.Y = InfoArray(MatC).Y DateRecZ = InfoArray(MatC).z DateRec.NPro = lnfoArray(MatC).Npro Put #1, DataNum, DataRec MatC=MatC+l Clase #1 87 LstFileType.Clear LstFileType.AddItem “SWIPES Data Files (*.swp)” LstFileType.AddItem “All File (‘.")” LstFileType.ListIndex = 0 FrmGetFile.Caption = “Data File Selection” End Select ‘I-Iide data file selection form. FrmGetFile.Hide EndSub Sub DirList_Change ( ) ‘Change the file list with the selection of the directory. FilFile.Path = DirList.Path IfFilFileLiStCotmt > 0 Then FilFile.ListIndex = 0 End If Lleirs.Caption = DirList.Path End Sub Sub Derrive_Change () ‘Change the directory path with the change of drive selected. On' Error GoTo ErrHandler 88 DirLiSLPath = Derrive.Drive Exit Sub ErrHandler: Const MB_RetryCaneel = 5, MB_OK = 0 Const MB_IconExclamation = 48, MB_IconStop = 16 Const IDRetry = 4, IDCancel = 2 Select Case Err Case Deviee_Unavailable, DiSk_Not_Ready Warn = MsgBox(“Please Check the disk.”, MB_IconExclamation ‘+ MB_RetryCaneel, “Error”) If Warn = IDRetry Then Resume Else Derrive.Drive = DirList.Path Resume Next ‘Resume with DirList.Path = ‘DerriveDrive statement End If Case Else Warn = MsgBox (“Um'eeoverable errorz” & ErrorS, MB_IconStop ‘+ MB_OK, “Error”) Resume Next ‘Resume with Exit Sub Statement End Select 89 End Sub Sub FilFile_C1ick ( ) TxtFiles.Text = FilFile.List (FilFile.ListIndex) End Sub Sub FilFile_DblClick ( ) Call CmeK__Click End Sub Sub Form_Activate ( ) ‘Set default values. DerriveDrive = “c:” DirList.Path = “c:\” ‘Root directory Lleirs.Caption == DirList.Path ‘Select the first file in the list of files. FilFile.Refi'esh IfFiIFile.ListCormt > 0 then FilFile.ListIndex = 0 End If End Sub Sub LstFileType_Click ( ) ‘Change the file list pattern with the selection of the file type. Select Case LstFileType.Text Case “Swipes Data Files (‘.swp)” FilFile.Pattern = “‘.swp” Case “Swipes Value Files (*.va1)” FilFile.Pattern = “‘.val” Case “All File (‘.*)” FilFile.Pattern = “‘3” End Select End Sub Matlnfo.Fr-m Sub CmeK_Click ( ) ‘Check whether any density value is Zero, warn iftheylare. IfValCl‘xthgDenText) = 0 Then Warn= MsgBox (“The density cannot be 0 (Zero)”, MB_IconExclamation, ‘“Please Check”) Exit Sub End If ‘Check whether units are applied or not. If Convert 8 Val(“ “) Then 91 Warn = MsgBox (“Please check the units of package and product mass”, ‘MB_IconExc1amation, “Please check”) Exit Sub End If ‘Check negative information. If Val(TxthtDen.Text) < 0 Or Val (T‘xtRecRate.Text) < 0 Or ‘ValCTxtFracAshTexO < 0 Or Val(TxtIncRate.Text) < Or Val(TxtRes.Text < 0 Then Warn = MsgBox(“Information cannot be a negative number”, ‘MB_IconExclamation, “Please Check”) Exit Sub End If ‘Check fraction information. If Val(TxtFracAshText) > 1 Or Val(TxtRestext) > 1 Then Warn = MsgBox(“Please enter all fi'action number as fraction (less than 1, . ‘without % Sign)”, MB_IconExclamation, “Please Check”) Exit Sub End If ‘Assign variables fi'om those text boxes on the screen. deg '= Val(TxthgDen.Text) * Convert rr= Val(TxtRecRateText) c = Val(TxtCompRate.Text) i =' Val(TxtIncRate.Text) a = Val(TxtFracAshText) e = Val(TxtRes.Text) ‘Record information into information array. InfoArray(MatCount).de = deg InfoArray(MatCormt).Pkgdu = Pkgdu InfoArray(MatCormt).rr = rr InfoAnay(MatCount).c = c InfoArray(MatCount).i = i InfoArray(MatCount).a = a InfoArray(MatCount).e= e ‘Display MatMenufrm and hide this form. MatlnfoFrrn.Hidc End Sub Sub Form_Activate ( ) ‘Clear old information. TxthgDenRefresh TxtRecRateRefi'esh TxtCompRate.Refiesh TxtIncRate.Refi'esh TxtFracAshRefresh TxtRes.Refresh 93 OptLbPkg.Value = False OptGramPkg.Value = False ‘Assign variables from infoarray if available/ Unit = InfoArray(MatCount).Pkgdu Select Case Lefi(Ucase(Unit), 1) Case “ L” OptLbPkg.Value = True TxthgDenJ‘ext = InfoArray(MatCormthkg Case “ G” OptGramPkg.Value = True TxthgDen.Text = InfoAn'ayCMatCounthkg " 454 / (2.54"3) End Select TxtTecRate.Text = InfoArray(MatCount).rr TxtCompRate.Text = InfoArray(MatCormt).c TxtIncRate.Text = InfoArray(MatCormt).i TxtFracAshText = InfoAnay(MatCormt).a TxtRes.Text = InfoArray(MatCOtmt).e End Sub Sub MnuFileExit_Click () End EndSub Sub MnuFileSwipe_Click ( ) Call SwipeFile End Sub Sub MnuInfoArb_Click ( ) Call CmeK_Click ArbInfoFrmshow EndSub Sub MnuInfoPkg_Click ( ) If FName <> “ “ Then Close #1 FName = “ “ End If Call CmeK_Click ComInfoFrm.Show MsgBox “Click ont of Type of Packge to get information” End Sub Sub MnuInfoPro_Click ( ) IfFName<>““Then 95 Close #1 FName = “ “ End If Call CmeK_Click PPFrm.Show End Sub Sub MnuInfoScr_Click ( ) Call CmeK_Click ScrlnfoFrm.Show EndSub Sub OptGramPkg_Click ( ) ‘Assign the converter value. Convert = (2.54"3) / 454 Pkgdu = chm"3” End Sub Sub OptLbPkg_Click( ) ‘Assign the converter value. Convert = 1 Pkgdu = “Linn"3” End Sub MatMenu.Frm Sub Command1_Click ( ) ‘Display MatInfoFrm and hide this screen. MatInfoFrm.Show End Sub Sub Command2_Click ( ) ‘Display ScrlnfoFrm and hide the screen. ScrlnfoFrm.Show End Sub Sub Command3_Click ( ) ‘Display ArblnfoFrm and hide the screen. ArbInfoFrm.Show End Sub Sub Command4_Cl;ick ( ) ‘Display the material Swipe value form and hide this form. MatSwipeFrm.Show End Sub 97 Sub Command5_Click ( ) “Check necessary information. If InfoArray(MatCormt).deg = 0 Then Warn = MsgBox(“The density value ‘MB_IconExclamation, “Please Check”) - MatInfoFrm.Show MatMenuFrrn.Hide Exit Sub End If cannot be 0(Zero)”, ‘Check the previous material SWIPES values and record those values in MatSwipeArray. IfVcom = Val(“ “) Then Call Calculation Call SwipeRec End If ‘Display the component information form and hide this form. FName = “ “ ComInfoFrm.Show End Sub Sub Command6 -C1ick ( ) “Check necessary information. If InfoArray(MatCount).deg = 0 Then 98 Warn = MsgBox(“The density value ‘MB_IconExclamation, “Please Check”) MatInfoFrm.Show MatMenuFrm.I-lide Exit Sub End If IfVcom = Val(“ “) Then Call Calculation Call SwipeRec End If “Clear old information in array. For MatNum =1 T010 InfoArray(MatNum).pkg = “ “ InfoArray(MatNum).Mat = “ “ InfoArray(MatNum).mPkg = 0 InfoArray(MatNum).Png = “ “ InfoArray(MatNum).n = O InfoArray(MatNmn).deg = 0 InfoArray(MatNum).Pkgdu = “ “ InfoArray(MatNum).rr = O InfoArray(MatNum).c = 0 InfoArray(MatNum).i = 0 cannot be 0(Zero)”, InfoArray(MatNum).a = 0 InfoArray(MatNum).e = 0 ‘ InfoArray(MatNum).ms = O InfoArray(MatNum).Scrapu = “ “ InfoArray(MatNum).f = 0 InfoArray(MatNum).b = O InfoArray(MatNum).rc = 0 ‘ InfoArray(MatNum).W = 0 InfoArray(MatNum).X1 = 0 InfoArray(MatNum).X2 = 0 InfoArray(MatNum).Y = 0 InfoArray(MatNum).Z = 0 ‘ InfoAnay(MatNum).NPro = 0 Next MatNum WhatFrm.Show MatMenuFmHide End Sub Sub Command7_Click ( ) ‘Check necessary information. If InfoAnay(MatCount).deg = 0 Then Warn = MsgBox(“The density value cannot be 0 (2610)”, ‘MB_IconEx'clamation, “Please Check”) 100 MatInfoFrm.Show MatMenuFrm.Hide Exit Sub End If If Vcom = Val(“ “) Then Call Calculation Call SwipeRec End If ComInfoFrmShow MsgBox(“Click one of Type of Package to get informaiton”) End Sub Sub Command8_Click ( ) ‘Check neceSsary information. If InfoArray(MatCormt).deg = 0 Then Warn '= MsgBox(“The density value cannot be 0 (Zero)”. ‘MB_IconExclamation, “Please Check”) MatInfoFrm.Show MatMenuFrm.Hide Exit Sub End If IfVcom = Val(“ “) Then 101 Call Calculation Call SwipeRec End If AddMat = “Yes” ComInfoFrm.Show MatMenann.Hide End Sub Sub Form_Active ( ) Vcom = Val(“ “) EndSub MatSwipeFrm Sub Cdeeturn_Click ( ) ‘Display the material menu form and hide this form. MatMenuFmShow MatSwipeFrm.I-lide End Sub Sub Form_Active ( ) ‘Clear old information. LstMat.Clear 102 LblComb.Caption = “ “ LblComp.Caption = “ “ LblMScr.Caption = “ “ LblPFac.Caption = “ “ LblRecy.Caption = “ “ LblReuse.Caption = “ “ LblSchac.Caption = “ “ LblProEfCaption = “ “ LblVComCaption = “ “ LblSwipe.Caption = “ “ OptCm.Value = False OptIrLValue = False ‘Calculate SWIPES value and record values in MatSwipeArray for current material. Call Calculation Call SwipeRec ‘Add items to material list box. MatNum =1 Do While MatSwipeArray(MatNum).Mat <> “ “ LstMat.AddItem MatSwipeArray(MatNum).Mat ~ I..stMat.ltemData(LstMat.NewIndex) = MatNum MatNum = MatNum + 1 L001: 103 LstMat.AddItem “Total SWIPES Value” LstMaLListIndex = MatNum - 2 End Sub Sub LstMat_Click ( ) ‘Assign Variables on screen for selected material with data in MatSwipeArray. MatNum = 1 TSwipe = 0 Do While MatSwipeArray(MatNum).Mat <> “ “ TSwipe = MatSwipeArray(MatNum).Swipe + TSwipe MatNum = MatNum + 1 L001) If LstMat.Text = “Total SWIPES Value” Then TSwipeFrm.Show Else Selection = 1 + LstMaLListIndex VCom = MatSwipeAn'ay(Selection).VCom MScr = MatSwipeArray(Selection).MScr Reuse = MatSwipeArray(Selection).Reuse Recy = MatSwipeArray(Selection).ny ‘ Comp = MatSwipeArray(Selection).Comp Comb == MatSwipeArray(Selection).Comb 104 ProEf = MatSwipeArray(Selection).ProEf Schac = MatSwipeArray(Selection).MFac PFac = MatSwipeArray(Selection).PFac Swipe = MatSwipeArray(Selection).Swipe End If ‘Clear all labels before get new values. LblComb.Caption = “ “ LblComp.Caption = “ “ LblMScr.Caption = “ “ LblPFac.Caption = “ “ LblRecy.Caption = “ “ LblReuse.Caption = “ “ LblSchac.Caption = “ “ LblProEtZCaption‘ = “ “ LblVComCaption = “ “ LblSwipe.Caption = “ “ OptCm.Value == False OptIn.Value = False EndSub Sub MnuFileExit_Click 0 End. 105 End Sub Sub MnuFileSwipe_Click ( ) Call SwipeFile End Sub Sub MnuInfoArb_Click ( ) ArblnfoFrm.Show MatSwipeFrm.IIide EndSub Sub InfoMat_Click ( ) MatInfoFrm.Show MatSwipeFrmJ-Iide End Sub Sub MnuInfoPkg_Click ( ) ComInfoFrm.Show MatSwipeFrmJ-Iide MsgBox “Click out of Type of Packge to get information” EndSub 106 Sub MnuInfoPro_Click ( ) PPFrm.Show MatSwipeFrm.Hide End Sub Sub MnuInfoScr_Click ( ) SerinfoFmrShow MatSwipeFrm.Hide End Sub Sub MnuPt'intAll_Click( ) C811 PPrO Call Pmat Call Pswipe Printer.Print Tab(10); “ttilttttttttttttttttttttttfitttttttttttttttttttt #tttlttitttt##¢###¢¢¥tittttttttfifittttttfitttttttfittttttttttltiittttttttt” Printer.NewPage End Sub Sub MnuPrintInfo__Click ( ) Callero CaIIPmat 107 Primer prim Tab(10)- «tastescaucusseeearnestness:eceeeeeeceeeeeceeeece ‘ 9 ittC**¢*###*#¢##ttittitttt*t**#t*##**¢*t#ttt*ttttitttttt*tttttttttttttt” Printer.NewPage EndSub Sub MnuPrintResult_Click 9 ) Callero CallPswipe Primerprint Tab(10)° at.##Gttttttttttttttfitifitttttttttttttttittttfittt ' 9 ###tttttttttttttfitttttttittttttfitt‘tttttttttttttt*tfitttttttittttfittttit” Printer.NewPage EndSub Sub OptCm_Click ( ) ‘Assign the converter value. Convert = 2.54"3 ‘Show calculation results. LblVCom.Caption = VCom * Convert LblMScr.Caption = MScr LblReuse.Caption = Reuse LblRecy.Caption = Recy LblComp.Caption = Comp 108 LblComb.Caption = Comb LblProEfCaption = ProEf LblSchac.Caption = Schac " Convert LblPFac.Caption = PF ac " Convert LblSwipe.Caption = Swipe ‘Convert MatSwipeArray(MatNum).Convert = Convert End Sub Sub OptIn_Click ( ) ‘Assign the converter value. Convert = 1 ‘Show calculation results. LblVCom.Caption = VCom ” Convert LblMScr.Caption = MScr LblReuse.Caption = Reuse LblRecy.Caption = Recy LblComp.Caption = Comp LblComb.Caption = Comb LblProEfZCaption = ProEf LblSchac.Captio’n = Schac " Convert LblPFac.Caption = PFac "' Convert LblSwipe.Caption = Swipe ”Convert 109 MatSwipeArray(MatNum).Convert = Convert End Sub SerInfo.Frm SumedOK_Click ( ) ‘Make sure one of the unit option boxes is checked. If Val(TxtMassScr.Text) <> 0 And OptLb.Value <> True And (OptGram.Value ‘<> True) Then Warn MsgBox(“Please check the Units of package and product ‘compacted density.”, MB_IconExclamation, “Please Check”) Exit Sub End If ‘Check negative information. If Val(TxtFracSchext) < 0 Or Val(TxtMassScr.Text) < o 01' ‘ValCl‘xtProDam.Text) < 0 Or Val(TxtRecConText) < 0 Then Warn = MsgBox(“Information cannot be a negative number.”, MB_IconExclamation, “Please Check”) Exit Sub End If ‘Check fraction information. If .- Val(‘l‘xtFracScr.Text) > 1 Or Val(TxtProDam.Text) > 1 Or ‘VaI(TxtRecCon.Text) > 1 Then 110 Warn = MsgBox(“Please enter all fraction number as fraction (less than 1, ‘without % Sign).”,MB_IconExclamaiton, “Please Check”) Exit Sub End If ‘Check necessary information. IfValCl‘xtProDamText) <> InfoArray(l ).b And InfoArray(l).b <> 0 Then Warn = MsgBox(“F motion of product damage in distribution should be ‘the same value for every package. Would you like to change the number?”, ‘MB_IconQuestion + MB_YesNo, “ “) Select Case Warn Case IDYes InfoArray(l ).b = Val(TxtProDam.Text) b = Val(TxtProDam.Text) Case IDNo B = InfoAn'ay(1).b InfoArray(MatCotmt).b = InfoArray(l ).b End Select End If ‘Assign variables with informaiton from the screen. b = Val(TxtProDam.Text) ms = Val(TxtMassScr.Text) * Convert f = Val(TxtFracScr.Tcxt) Ill rc = Val(TxtRecCon) ‘Record information into information array. IfOptLb.Value = True Then lnfoArray(MatCount).Scrpu = “Lb.” Else IfOptGram.Value = True Then InfoArray(MatCOImt).Scrapu = “g.” End If End If IfInfoArray(l).b = 0 Then InfoArray(l ).b = Val(TxtProDam.Text) End If InfoArray(MatCount).b = Val(TxtProDam.Text) InfoArray(MatCount).ms = ms InfoArray(MatCount).f = f InfoAmy(MatCormt).rc = re ‘Display MatMenuFrm and hide the screen. ScrlnfoFrm.I-Iide EndSub Sub Form_Activate ( ) TxtFracScr.Refresh 112 TxtMassScr.Refresh TxtProDam.RefreSh TxtRecCon.Refi'esh OptGram.Val = False OptLb.Val = False Select Case Left(InfoArray(MatCount).Scrapu, 1) Case “g” OptGram.Value = True TxtMassScr.Text = InfoArray(MatCormt).ms "‘ 454 Case “L” OptLb.Value = True TxtMassScr.Text = InfoArray(MatCount).ms End Select TxtFracScr.Text = InfoArray(MatCount).f TxtFracProDam.Text = InfoArray(l).b TxtRecCon.Text == InfoArray(MatCount).rc End Sub Sub MnuFileExit_Click 0 End EndSub 113 Sub MnuFileSwipe_Click ( ) Call SwipeFile End Sub Sub MnuInfoArb_Click( ) Call CmeK_Click ArblnfoFrm.show End Sub Sub MnuInfoMat_Click ( ) Call CmeK_Click MatInfofrmShow EndSub Sub MnuInfoPkg_Click ( ) lfFName <> “ “ Then Close #1 FName = “ “ End n Call CmeK_Click ComInfoFrm.Show MSgBox “Click ont of Type of Packge to get information” 114 End Sub Sub MnuInfoPro_Click ( ) lfFName <> “ “ Then Close #1 FName = “ “ End If Call CmeK_Click PPFrm.Show End Sub SubOptGram_Click ( ) ‘Assign the converter value. Converthg = 1 I454 EndSub Sub OptLb_Click ( ) ‘Assign the converter value. Converthg = 1 EndSub SwipeFrm 115 Dim 81 AS Integer Dim 82 As Integer Dim S3 As Integer Dim S4 As Integer Sub Timer1_Timer ( ) ‘Display the what to do form and hide this form. 81 = S] + 1 If S1 > 1 Then Timer1.Enabled = False WhatFrmShow WelFrm.1-Iide End If End Sub Sub Timer2_Timer ( ) $2 = $2 + 1 1f 82 > 1 Then ‘ Timer2.Enabled = False . End If Label] .Visible = 'True End Sub 116 Sub Timer3_Timer( ) S3 = $3 + 1 1f S3 > 1 Then TimerB.Enabled = False End If Label2.Visible = True End Sub Sub Timer4_Timer( ) S4 = S4 + 1 If S4 > 1 Then Timer4.Enabled = False End If Labe13.Visible = True EndSub TSwipeFr-m Sub CmeK_Click ( 0 TSwipe = 0 TSwipeFrmJ-Iide End Sub 117 Sub Form_Active ( ) Call OptIn_Click End Sub Sub MnuFileExit_Click 0 End End Sub Sub MnuFileSwipe_Click ( ) Call SwipeFile End Sub Sub MnuInfoArb_Click ( ) ArblnfoFrm.Show TSwipeFrm.I-Iide End Sub Sub InfoMat_Click ( ) MatInfoFrm.Show TSwipeFmHide EndSub 118 Sub MnuInfoPkg_Click ( ) ComInfoFrm.Show TSwipeFrm.Hide MsgBox “Click one of Type of Package to get information” End Sub Sub MnuInfoPro_Click ( ) PPFrm.Show TSwipeFrm.I-lide End Sub Sub MnuInfoScr_Click ( ) ScrlnfoFrm.Show TSwipeFrm.I-Iide End Sub Sub MnuPrintAll_Click( ) Call Ppro Call Pmat Call Pswipe him.“ TauIO); “Ottitittttfittt##Otfititfittfittttttttttt#tttttttt tt.‘t$t¢¢ttt‘¢tttCtttttttttttitttitttttttittttltttt¢*#.¢O¢ttttttttfititt” 119 Printer.NewPage End Sub Sub MnuPrintlnfo_Click ( ) Call Ppro Calleat Primer prim Tabuo). «tsetseeceeeeeececeeeeaceeeceeceeaeececeeeeeecu ' 9 *ttttttttttt.tittlttltttttlttttttttifittttttfittt*‘tt*tttttttttttttittitt” Printer.NewPage EndSub Sub MnuPrintResult_Click 9 ) Call Ppro Call Pswipe Printenpfint TENIO); “tttttittittit...titttttttttttttttttttittttttttt ‘titttttttttttttttttttttttttttttttttttttttttttttfitttttttttttttttttttttt” Pnnter.NewPage End Sub Sub OptCm_Click ( ) ‘Assign the converter value. Convert = 2.5493 120 ‘Show calculation results. LblTSwipe.Caption = Format(T Swipe * Convert, “Fixed”) End Sub Sub OptIn_Click ( ) ‘Assign the converter value. Convert = 1 LblTSwipe.Caption = Format(T Swipe "' Convert, “Fixed”) End Sub Swipclfias Option Explicit Type DataStruc MatType As String " 20 Den As Single Unit As Suing * 7 Rate As Single CRatc As Single [Rate Single Ash As Single Res As Single W'AS Single 121 X1 ASSingle X2ASSingle YAsSingle ZAsSingle ProTypeAsString" 10 ManAsString' 10 ProMassAsSingle ProDenAsSingle PCombAsSingle ProUAsString“ 10 ProduAsString“ 10 pkgAsString“ 10 mPkgAsSingle PngAsString‘lO nAsInteger msAsSingle ScrapuASString“ 10 fAs Single bAsSingle rc~As Single NPro AsInteger End Type 122 Type MatSwipeSu'uc Mat As Suing VCom As Single MScr AS Single Reuse As Single Recy As Single Comp As Single V Comb As Single ProEf As Single Schac As Single PFac As Single Swipe As Single Convert As Single End Type Type InfoSu'uc pkg As Suing Mat As Suing mPkg As Single Png As Suing *10 nAsInteger 123 degAs String *10 Pkgdu As Suing ’10 rrAs Single cAs Single iAsSingle aAsSingle eAs Single mSAsSingle Scrapu As String " 10 fAs Single bAs Single rcAsSingle W As Single X1 As Single X2 As Single YAsSingle ZAsSingle NPro AsInteger EndType Global TMat AS Suing Global PComb As Single 124 Global deg As Suing Global denPkg As Suing Global dPr As Suing Global rr As Single Global c As Single Global i As Single Global a As Single Global e As Single Global ms As Single Global Scrapu As Suing Global f AS Single Global b As Single Global rc As Single Global W As Single Global X1 As Single Global X2 As Single Global Y As Single Global Z As Single Global mPkg AS Suing Global mPr As Suing Global 11 As Integer Global NPro As Integer 125 Global Convert As Single Global ConvertPro As Single Global Converthg As Single Global DataNum AS Integer Global DataRec As DataSu'uc Global FName As Suing Global Unit As Suing Global TSwipe As Single Global AIIMat As Integer Global MatNum As Integer Global MatCount As Integer Global Formd As Suing Global Selection As Integer Global Mat As Suing Global VCom As Single Global MScr As Single Global Reuse As Single Global Recy AS Single Global Comp As Single Global Comb As Single Global ProEf AS Single Global Schac As Single 126 Global PFac As Single Global Swipe As Single Global MatSwipeArray(l To 10) As MatSwipeStruc Global InfoArray(l To 10) As InfoStruc Global num As Integer Global ProType As Suing Global PkgType As Suing Global ProMass AS Single Global ProDen As Single Global ProU As Suing, Produ As Suing Global Png AS Suing, Pkgdu As Suing Global Man As Variant Global Warn As Variant Global Ques As Variant Global SelectForm As Integer Global SelectMat AS Suing Global AddMat AS Suing Global Const MB_IconExclamation = 48, MB_IconQuestion = 32 Global Const MBJconStop = 16 Global Const MB_YesNoCancel = 3, MB_YesNo = 4 Global Const IDYes = 6, IDNo = 7, IDCancel = 2 127 Sub Calculation ( ) If InfoArray(MatCount).deg .4. 0 Then Wam = MsgBox(“Packaging compacted density is unable to evaluate”, MB_IconStop, “Please Enter”) MatInfoFrm.Show Exit Sub End If Dim calmPr If MatCormt = I Then calmPr = mPr Else calmPr = 0 End If VCom = InfoArray(MatCount).mPkg / InfoArray(MatCormt).deg MScr = 1 + InfoArray(MatCormt).f * (InfoArray(MatCount).ms / ‘InfoArray(MatCount).mPkg) Reuse = 1 + InfoArray(MatCount).W ‘ (InfoArray(MatCount).n - l) Recy = (1 - 1nfoArray(MatCount).X1 "' InfoArray(MatCount).rr) " (l - ‘InfoAnay(MatCount).X2 “ InfoArray(MatCount).rc) Comp = l - InfoArray(MatCormt).Y " InfoArray(MatCormt).c ‘ (1 - ‘InfoArray(MatCount).e) Co'mb = l - InfoArray(MatCount).Z “ InfoArray(MatCount).i " (1 - ‘InfoAnayMatCount).a) 128 ProEf = 1 + InfoArray(MatCount).b Schac = InfoArray(MatCount).f “ InfoArray(MatCount).ms / ‘InfoArray(MatCount).deg "‘ InfoArray(MatCount).rr “ InfoArray(MatCount).X1 PFac = 1nfoArray(MatCount).b "‘ calmPr /dPr "‘ (1 - InfoArray(MatCount).i “ ‘InfoArray(MatCount).Z ‘ PComb) Swipe = ((VCom "' MScr *Recy * Comp * Comb "‘ ProEf / Reuse) + Schac + ‘PFac) INPro End Sub Sumeat() Primer prim Tab(10)- “etcaatenteeeeueeetuseat"structureless-nuns" ’ 9 ‘##‘tttttttttfittttt##tlifit*tttttitfitttitttittfitttttttttfiitttittfitttflttfi” Printer.FontBold = True Printer.Print Tab(15); “Material Information” Printer.Print Tab(10); “Material”; Tab(25); “Packaging”; Tab(35); “Mass”; Tab(45); “Compacted”; Tab(60); “Product Units”; Tab(77); “Number of” Printer.Print Tab(46); “Density”; Tab(61); “per Package”; Tab(79); “Uses” Printer.FontBold = False MatNum = 1 Do While InfoArray(MatNum).Mat <> “ “ IfLeft(InfoArray(MatNum).Pkgdu, 1) = “g” Then Convert = 454 / (2.54"3) 129 Else Convert = 1 End If IfLefianfoArray(MatNum).Png, 1) = “g” Then mPkg = InfoArray(MatNum).mPkg * 454 Else mPkg = InfoArray(MatNum).mPkg End If Printer.Print Tab(12); InfoArray(MatNum).W Tab(25); ‘InfoAmYWmm-pks; Tab(34); mPkg; Tab(4l); lnfoAmy(MatNum)-Png; Tab(48); ‘InfoArray(MatNum).deg; i Convert; Tab(52); InfoAnay(MatNum).Pkgdu; Tab(64); ‘InfoArray(MatNum).NPro; Tab(79); InfoArray(MatNum).n , MatNum = MatNum + 1 Loop Printer.Print Tab(10); “ Printer.FontBold = True Printer.Print Tab(10); “Material”; Tab(20); “Fraction”; Tab(35); “Fraction”; ‘Tab(50); “Fraction”; Tab(65); “Fraction”; Tab(80); “Residue” Printer.Print Tab(20); “Recycled”; Tab(35); “Composted”; Tab(48); Incinerated”; ‘Tab(67); “of Ash”; Tab(80); “Fraction” Printer.FontBold = False 130 MatNum = 1 Do While InfoAnay(MatNum).Mat <> “ “ Printer.Print Tab(12); InfoArray(MatNum).Mat; Tab(21); InfoArray(MatNum).rr; ‘Tab(37); InfoArray(MatNum).e; Tab(52); InfoArray(MatNum).i; Tab(67); ‘InfoArray(MatNmn).a; Tab(82); InfoArray(MatNum).e MatNum = MatNum + 1 L00p Printer.Print Tab(10); “ 99 Printer.FontBold = True Printer.Print Tab(10); “Material”; Tab(20); “Mass of”; Tab(35); “Fraction”; ‘Tab(50); “Fraction of"; Tab(65); “Recycled” Printer.Print Tab(21); “Scrap”; Tab(35); “of Scrap”; Tab(49); “Product Damage”; ‘Tab(66); “Content” Printer.Print Tab(3 5); “Disposed of” Printer.FontBlod = False MatNum = 1 Do While InfoArray(MatNum).W <> “ “ IfLeft(1nfoArray(MatNum).Scrapu, 1) = “g” Then ms = InfoArray(MatNum).ms * 454 Endlf 131 Printer.Print Tab(12); InfoArray(MatNurn).Mat; Tab(21); ms; Tab(27); ‘InfoArray(MatNum).Scrapu; Tab(3 7); InfoArray(MatNum).f; Tab(52); ‘InfoArrayMatNum).b; Tab(67); InfoArray(MatNum).rc MatNum = MatNum + 1 Loop Printer.Print Tab(10); “ Printer.FontBold = True Printer.Print Tab( 12); “Arbiuary Information for” Printer.Print Tab(10); “Material”; Tab(20); “Reuse”; Tab(31); “Recycling Rate”; Tab(46); “Recycled Content”; Tab(65); “Composting”; Tab(80); “Combustion” Printer.FontBold = False MatNum = 1 Do While InfoArray(MatNum).W <> “ ” Printer.Print Tab(12); InfoArray(MatNum).Mat; Tab(21); ‘InfoArrayCMatNum).W; Tab(37); InfoArray(MatNum).X1; Tab(52); ‘InfoArray(MatNum).X2; Tab(67); InfoArray(MatNum).Y; Tab(82); ‘InfoArrayCMatNum).Z MatNum = MatNum + 1 LOOP End Sub 132 Sub PPro () Printer.FontSize = 10 Printer Print Tab(10)o “ttttttttltltttlttttlttttitttttitttttttttttttttt ° 9 ‘ttttttttltt##1##...tttttttttttttttttttttlttttttttttttittttttttittttt*t” Printer.FontBold = True Printer.Print Tab(10); “SWIPES values of packaging for ” & ProType & “ by ” & ‘Man Printer.Print Tab(10); “Product Information” Printer.Print Tab(12); “Mass ” & ProMass & “ ” & ProU; Tab(30); “Compacted ‘Density ” & ProDen & “ ” & Produ; Tab(65); “Combustible Fraction ” & Pcom Printer.FontBold = False End Sub Sub PSwipe ( ) Dim Unit As Suing If MatSwipeArray(MatNum).Convert = lThen Unit = “in"3” Convert = 1 Else Unit = “cm"3” Convert = 2.54"3 EndIf 133 Printer Print Tab(10)- “trunk*ttttttttttttttttttttt*tttttttittdfltttttttt ’ 9 ‘t*ttt*tttttttt***#**tt*ttt*ttttttttttttt*ttt********************¥¢****” Printer.FontBold = True Printer.Print Tab(15); “SWIPES values in ” & Unit Printer.Print Tab(10); “Material”; Tab(20); “Compacted”; Tab(35); “‘Manufacturing”; Tab(50); “Reuse”; Tab(65); “Recycling”; Tab(80); “Composting” Printer.Print Tab(21); “Volume”; Tab(39); “Scrap” Printer.Bold = False MatNum = 1 Do While MatSwipeArray(MatNum).Mat <> “ ” Printer.Print Tab(12); MatSwipeArray(MatNum).Mat; Tab(22); ‘ (MatSwipeAnay(MatNum).VCom * Convert); Tab(39); ‘MatSwipeArray(MatNum).MScr; Tab(50); MatSwipeArray(MatNum).Reuse; Tab(67); ‘MatSwipeArray(MatNum).Recy; Tab(82); MatSwipeArray(MatNum).Comp MatNum = MatNum + 1 LOOP Printer.Print Tab(10); “ 9, Printer.FontBold = True Printer.Print Tab(10); “Material”; Tab(20); “Combustion”; Tab(3 8); “Damage”; Tab(50); “Scrap”; Tab(65); “Product”; Tab(80); “SWIPES Value” Printer.Print Tab(34); “Compensation”; Tab(53); “Correction Factor” I34 Printer.FontBold = False MatNum =1 TSwipe = 0 Do While MatSwipeArray(MatNum).Mat <> “ ” TSwipe = TSwipe + MatSwipeArray(MatNum).Swipe Printer.Print Tab(12); MatSwipeArray(MatNum).Mat; Tab(22); ‘MatSwipeArray(MatNum).Comb; Tab(38); MatSwipeArray(MatNum).ProEf; Tab(50); ‘(MatSwipeArray(MatNum).Schac * Convert); Tab(66); ‘(MatSwipeAnay(MatNum).PFac * Convert); Tab(80); ‘(MatSwipeArray(MatNum).Swipe ‘ * Convert) MatNum = MatNum + 1 LOOP Printer.Print Tab(20); “Total SWIPES Value is ” & TSwipe & “in"3 or ”& (T Swipe "‘ (2.54"3)) & “cm"3” End Sub Sub SwipeFile ( ) If FName <> “ ” Then ‘ Close #1 FName = “ ” End If SelectForm = 4 135 FrmGetFileLstFileTypeClear FrmGetFileLstFileTypeAddItem “SWIPES Value Files (*.val)” FrmGetFileLstFileTypeAddItem “All File (*.*)” FrmGetFileLstFileTypeListIndex = 0 FrmGetFile.TxtFiles.Text = “*.val” FrmGetFileCaption = “SWIPES Value File Selection” FrmGetFile.Show End Sub Sub SwipeRec ( ) MatNum = 1 Do While MatNum <= 10 If MatSwipeArray(MatNum).Mat = Mat MatSwipeArray(MatNum).Mat = “ ” Then Exit Do End If MatNum = MatNum + 1 L009 MatSwipeArray(MatNum).Mat = Mat MatSwipeArray(MatNum).VCom = VCom MatSwipeArray(MatNum).MScr = MScr MatSwipeArray(MatNum).Reuse = Reuse 136 MatSwipeArray(MatNum).Recy = Recy MatSwipeArray(MatNum).Comp = Comp MatSwipeArray(MatNum).Comb = Comb MatSwipeArray(MatNum).ProEf = ProEf MatSwipeArray(MatNum).Schac = Schac MatSwipeArray(MatNum).PFac = PFac MatSwipeArray(MatNum).Swipe = Swipe End Sub APPENDIX B MATERIAL DATA IN STANDARD DATA FILE APPENDIX B MATERIAL DATA IN STANDARD DATA FILE File name: stdmatmp Material' 1 2 3 4 5 6 7 Compacted Density .00536 .00536 .01680 .0600 .01586 .01758 .01436 (Linn‘3) Fraction Recycle .634 .091 .555 .246 .159 .142 .019 Fraction Composted 0 0 .05 0 .05 .05 0 Fraction Incinerated 0 0 .2 0 .02 .02 .18 Fraction of Ash after I l .01 l .01 .01 .03 Combustion Fraction Residue after Compost l I .05 l .01 .01 0 Screen Reuse Value .7 .7 .7 .8 .8 .7 .8 Recycling Rate Value .6 .6 .6 .6 .6 .65 .45 Recycling Content Value .5 .5 .5 .5 .5 .55 .4 Composting Value .2 .2 .4 O .4 .4 .2 Combustion Value .2 .2 .3 0 .4 .4 .2 1 is Aluminum (Beer & Soft Drink Can) 2 is Alunimun (Others) 3 is Corrugated Board 4 is Glass 5 is Paper 6 is Paperboard 7 is Plastic Film 137 138 Material. 8 9 10 l I 12 l3 l4 Compactor! Density .01436 .01436 .01436 .01715 .0120 .02175 .02175 (thm‘3) Fraction Recycle .019 .236 ..411 .047 .463 .140 0 Fraction Composted 0 0 0 0 0 .3 0 Fraction Incinerated .18 .18 .18 .18 0 .3 .15 Fraction of Ash after .03 .03 .03 .03 1 i' .3 0 Combustion Fraction Residue after Compost 0 0 0 0 1 .05 0 ' Screen Reuse Value .8 .8 .8 .6 .9 .9 .7 Recycling Rate Value .45 .45 .45 .45 .65 .4 , .4 Recycling Content Value .4 .4 .4 .4 .7 .2 .4 Composting Value .2 .2 .2 .2 0 .3 .2 Combustion Value .2 .2 .2 .2 0 .3 .2 ‘Note 8 is Plastic (Rigid Containers) 9 is Plastic (HDPE Milk Bottles) 10 is Plastic (PET Soft Drink Bottles) 11 is Plastic (Non—film of Rigid Containers) 12 is Steel 13 is Wood 14 is Other Miscellaneous "Illlllllllllllll‘ ‘dn .‘o . -- in. and. .—