PICK BASIC Reference Manual --~I

Total Page:16

File Type:pdf, Size:1020Kb

PICK BASIC Reference Manual --~I PICK BASIC reference manual --~i 88AOO778A02 "'':: . CCIl ICOOI 01 I Tn .. ..OTlnll I RECORD OF REVISIONS Title: PICK BASIC Reference Manual DOOlment No. 88A00778A02 Da te Revis ion Record --------------+------------------------------------------------------------- Mar 84 Original Issue Feb 85 Revision A02 - Change Package (85A00517A01) THIS DOCUMENT CONTAINS PROPRIETARY INFORMATION WHICH SHALL NOT BE REPRODUCED OR TRANSFERRED TO OTHER DOCUMENTS OR DISCLOSED TO OTHERS, OR USED FOR MANUFACTURING OR ANY OTHER PURPOSE WITHOUT PRIOR WRITTEN PERMISSION OF GENERAL AUTOMATION, INC. ii PICK BASIC reference manual 88AOO778A02 Copyright CI by Gener,' Automation. Inc. 1045 South East Street P.O. Box 4883 An,heim. Ca'ifornia 92803 (7141778-4800 (800)854-6234 TWX 91 ().591.1695 TELEX 685·513 RECORD OF REVISIONS Title: PICK BASIC Reference Manual Document No. 88A00778A02 I \ Da te I Revis ion Record I \--------------+-------------------------------------------------------------1 I 1 \ 1 Mar 84 1 Original Issue I I I \ Feb 85 I Revision A02 - Change Package (85A00517A01) 1 I \ I \ I \ I \ I I I I I I I I I 1 I I I THIS DOCUMENT CONTAINS PROPRIETARY INFORMATION WHICH SHALL NOT BE REPRODUCED OR TRANSFERRED TO OTHER DOCUMENTS OR DISCLOSED TO OTHERS, OR USED FOR MANUFACTURING OR ANY OTHER PURPOSE WITHOUT PRIOR WRITTEN PERMISSION OF GENERAL AUTOMATION, INC. ii 88A00778A FOREWORD This document is one of a family of ZEBRA reference manuals devoted to PICK processors that are on call within the PICK operating system. Before reading this document and using the processor described, it is recommended that you first become familiar with the PICK terminal control language and file structure. These subjects are thoroughly covered in 88A00782A, listed below with other documents covering PICK processors. Document No. Title 88A00757A PICK Operator Guide 88A00758A ACCU-PLOT Operator Guide 88A00759A COMPU-SHEET Operator Guide 88A00760A Quick Guide for the PICK Operating System 88A00774A PICK Utilities Guide 88A00776A PICK ACCESS Reference Manual 88A00777A PICK SPOOLER Reference Manual 88A00779A PICK EDITOR Referance Manual 88A00780A PICK PROC Reference Manual 88A00781A PICK RUNOFF Reference Manual 88A00782A Introduction to PICK TCL and FILE STRUCTURE 88A00783A PICK JET Word Processor Guide !MACCU-PLOT is a trademark of ACCUSOFT Enterprises TMcOMPU-SlmET is a trademark of Raymond-Wayne Corporation !MpICK is a trademark of PICK Systems TMZEBRA is a trademark of General Automation, Inc. iii/iv 88A00778A TABLE OF CONTENTS Section Title 1 INTRODUCTION • • • • • • • • • • • • • 1-1 1.1 THE BASIC LANGUAGE. • • • • • ••• . 1-1 1.2 BASIC FILE STRUCTURE. • • • • • •••• . 1-3 1.2.1 CREATING BASIC FILES: CREATE-PFILE • . 1-3 1.3 BASIC PROGRAMS • • • • • • • • • • • • • • • • • • 1-4 1.3.1 BASIC StATEMENTS. • • • • • • • • • • • 1-4 1.3.2 COMMENTS WITHIN THE BASIC PROGRAM. • • •• 1-5 1.3.3 SPECIAL PICK USE OF BASIC. • • • • •••••• 1-5 1.4 CREATING AND COMPILING WITH BASIC. • • • • • • • 1-6 1.4.1 FORMAT VERB. • • • • • • • • • • • • 1-7 1.4.2 BASIC COMPILER OPTIONS ••••••••• 1-8 1.5 EXECUTING BASIC PROGRAMS • • • • • • • • • • 1-10 1.5.1 RUNNING BASIC PROGRAMS FROM A PROC • • • • 1-11 1.5.2 ALTERING EXECUTION TIME: RQM AND SLEEP STATEMENTS. 1-12 1.6 PROGRAM SHARING. • • • • • • • • • • • • 1-13 1.6.1 CATALOG VERB. 1-13 1.6.2 DECA1ALOG VERB • 1-14 2 DATA REPRESENTATION •••••••••••••• . 2-1 2.1 CONSTANTS AND VARIABLES. 2-1 2.2 ASSIGNING VALUES TO VARIABLES •• 2-3 2.2.1 SIMPLE ASSIGNMENT STATEMENT. 2-3 2.2.2 CLEAR STATEMENT. • • • • • • • • 2-3 2.2.3 EQUATE STATEMENT • • . 2-5 2.3 MULTIPLE DATA REPRESENTATION • 2-7 2.3.1 ARRAyS •••••• . 2-7 2.3.2 DIM STATEMENT •••• . 2-8 2.4 ASSIGNING VALUES TO ARRAYS • 2-9 2.4.1 MAT ASSIGNMENT STATEMENT ••••••• 2-9 2.4.2 MAT COpy STATEMENT • 2-9 2.5 SELECTING NUMERIC PRECISION: PRECISION DECLARATION • 2-11 3 FORMING EXPRESSIONS. • • • • • • • • • 3-1 3.1 ARITHMETIC EXPRESSIONS 3-1 3.2 STRING EXPRESSIONS •• 3-4 3.3 RELATIONAL EXPRESSIONS ••••• 3-6 3.3.1 PATTERN MATCHING •• 3-8 3.4 LOGICAL EXPRESSIONS. • • 3-10 4 PROGRAM CONTROL AND OPERATION. • • • • 4-1 4.1 UNCONDITIONAL BRANCHING. 4-1 4.1.1 GOTO STATEMENT. 4-1 4.2 COMPUTED BRANCHING •••• . 4.-2 4.2.1 ON GOTO STATEMENT. 4-2 4.3 CONDITIONAL BRANCHING. • • 4-4 4.3.1 SINGLE-LINE IF STATEMENT. 4-4 4.3.2 MULTI-LINE IF STATEMENT. 4-6 4.3.3 CASE STATEMENT •••••• 4-8 v 88A00778A Section Title Page 4.4 NO OPERATIONS. 4-10 4.4.1 NULL STATEMENT •••• . 4-10 4.5 PROGRAM LOOPING. • • • • • 4-11 4.5.1 FOR AND NEXT STATEMENTS. 4-11 4.5.1.1 WHILE and UNTIL Clauses. 4-13 4.5.1.2 Nesting. 4-14 4.5.2 LOOP STATEMENTS. 4-15 4.6 PROGRAM TERMINATION. • • · . 4-17 4.6.1 END, STOP AND ABORT STATEMENTS. 4-17 4.7 PROGRAM SECURITY • • • • 4-19 4.7.1 BREAK AND ECHO STATEMENTS. 4-19 5 SUBROUTINES AND INTERPROGRAM COMMUNICATION • 5-1 5.1 INTERNAL SUBROUTINES • 5-1 5.1.1 GOSUB STATEMENT. 5-1 5.1.2 COMPUTED GOSUB STATEMENT • . 5-1 5.1.3 RETURN AND RETURN TO STATEMENTS. 5-3 5.2 EXTERNAL SUBROUTINES • . 5-5 5.2.1 CALL STATEMENT ••••••• 5-5 5.2.2 SUBROUTINE STATEMENT • . 5-5 5.2.3 ARRAY PASSING AND INDIRECT CALLS • 5-7 5.2.4 EXECUTE STATEMENT. 5-9 5.2.4.1 EXECUTE Statement I/O • 5-9 5.2.4.2 Allocating EXECUTE Workspaces and Nested EXECUTE Levels • • 5-11 5.2.4.3 Environment Changes After Using the EXECUTE Statement • • • • • 5-12 5.3 INTERPROGRAM COMMUNICATION • • . 5-14 5.3.1 CHAIN STATEMENT. 5-14 5.3.2 DATA STATEMENT ••••• 5-16 5.3.3 COMMON STATEMENT 5-18 5.3.4 ENTER STATEMENT. 5-20 6 INTRINSIC FUNCTIONS. 6-1 6.1 NUMERIC FUNCTIONS. 6-1 6.1.1 ABS •• 6-1 6.1.2 INT. 6-1 6.1.3 REM AND MOD. 6-1 6.1.4 SQRT •••• 6-2 6.1.5 RND •• . · . 6-2 6.2 TRIGONOMETRIC FUNCTIONS. 6-4 6.2.1 COSINE. 6-4 6.2.2 SINE. 6-4 6.2.3 TANGENT. 6-4 6.2.4 LOGARITHM. 6-4 6.2.5 EXPONENTIAL. 6-5 6.2.6 POWER. · . 6-5 6.3 LOGICAL FUNCTIONS. 6-6 6.3.1 NOT. 6-6 6.3.2 NUM AND ALPHA. 6-6 vi 88A00778A Section Title 7 FILE HANDLING • • • • • • • • • • • • • • 7-1 7.1 FILE SELECTION FOR I/O • • • • 7-1 7.1.1 OPEN STATEMENT. • • • • • • • • 7-1 7.2 CLEARING A FILE. • • • • • • • • • • • • • • • • 7-3 7.2.1 CLEARFILE STATEMENT. •• • • • • • • 7-3 7.3 ACCESSING FILE ITEMS • • • • • • • • • • • • 7-5 7.3.1 READ STATEMENT. • • • • • • 7-5 7 .3.2 SELECT STATEMENT • • • • • • • • • • • 7-7 7.3.3 READNEXT STATEMENT. • • • • • • • • 7-9 7.4 MODIFYING AND DELETING FILE ITEMS. • 7-11 7.4.1 WRITE STATEMENT. • • • • • • • • • . 7-11 7.4.2 DELETE STATEMENT. • • • • • • • • • • • • • 7-11 7.5 ACCESSING AND UPDATING SINGLE ATTRIBUTES. 7-13 7.5.1 READV STATEMENT. • • • • • • • • • • . • • • 7-13 7.5.2 WRITEV STATEMENT. • • • • • • • • 7-15 7.6 ACCESSING AND UPDATING MULTIPLE ATTRIBUTES. 7-17 7.6.1 MATREAD STATEMENT. • • • • 7-17 7.6.2 MATWRITE STATEMENT. • • • • • • • • 7-17 7.7 MULTIUSER FILE AND EXECUTION LOCKS. • • • • 7-19 7.7.1 BASIC LOCKS. • • • • • • • • • • •• 7-19 7.7.1.1 LOCK Statement. • • 7-19 7.7.1.2 UNLOCK Statement. 7-19 7.7.2 READ WITH LOCK FOR UPDATING: READU, READVU, AND MATREADU STATEMENTS. • • • • • • • • • • 7-21 7.7.3 WRITE WITH LOCK FOR UPDATING: WRITEU, WRITEVU, AND MATWRITEU STATEMENTS • • • • • 7-23 7.7.3.1 RELEASE Statement. • • • • 7-23 7.8 PROC I/O • • • • • • • • • • 7-25 7 .8. 1 PROCREAD STATEMENT • • • • • 7-25 7.8.2 PROCWRITE STATEMENT. 7-25 7.9 TAPE I/O • • • • • • • • • • 7-26 7.9.1 READT STATEMENT. • • • • • • • 7-26 7.9.2 WRITET STATEMENT. • • • • • • • 7-26 7.9.3 WEOF AND REWIND STATEMENT. 7-27 7.10 STRING HANDLING. • • • • • • • • 7-28 7.10.1 STRING SEARCHING: FIELD, COL1 AND COL2 FUNCTIONS. 7-28 7.10.1.1 FIELD. • • • • • • • • • • • • • • • •• 7-28 7.10.1.2 COL1, COL2 • • • • • • • • • • • • • • • 7-28 7.10.2 SEARCHING FOR A SUBSTRING: INDEX FUNCTION. • • • • 7-30 7.10.3 COUNTING OCCURRENCES OF A SUBSTRING: COUNT FUNCTION 7-32 7.10.4 COUNTING DELIMITED VALUES: DCOUNT FUNCTION. 7-33 7.10.5 STRING SPACING: SPACE AND TRIM FUNCTIONS. • • • • 7-34 7.10.5.1 SPACE. • • • • • • • • • • • • • • • • • 7-34 7.10.5.2 TRIM. • • • • • • • • • • • • • • 7-34 7.10.6 STRING REPETITION AND LENGTH DETERMINATION 7-36 7.10.6.1 STR. • • • •• •••• • • 7-36 7.10.6.2 LEN. • • • • • • • • • • • • • • • • 7-36 vii 88A00778A Section Title 7.11 DYNAMIC ARRAY OPERATIONS • • 7-38 7 • 11. 1 DYNAMIC ARRAY STRUCTURE. 7-38 7.11.2 LOCATE STATEMENT. 7-40 7.11.3 EXTRACT FUNCTION ••••••• 7-42 7.11.4 REPLACE FUNCTION. 7-44 7.11.5 INSERT FUNCTION. 7-46 7.11.6 DELETE FUNCTION. 7-48 8 TERMINAL AND PRINTER INPUT AND OUTPUT. 8-1 8. 1 TERMINAL INPUT • • • • • • • • • • • 8-1 8.1.1 INPUT AND PROMPT STATEMENTS. 8-1 8.1.2 MASKED INPUT • • • • • • • • • • • 8-3 8.1.3 OTHER INPUT FOR}tS ••••• 8-4 8.2 SYSTEM OUTPUT: DEVICE SELECTION. 8-5 8.2.1 PRINTER STATEMENTS ••• 8-5 8.2.2 PRINT STATEMENT •••••• 8-7 8.2.2.1 Tabulation and Concatenation in PRINT Statement • 8-9 8.2.3 CRT STATEMENT. • • • • • • • • • • • • • 8-11 8.3 OUTPUT FORMATTING. • • • • • • • • • • • • • • • 8-12 8.3.1 TERMINAL CURSOR CONTROL AND SCREEN FUNCTIONS: @•• 8-12 8.3.2 FORMAT STRINGS: NUMERIC AND FORMAT MASK CODES. 8-14 8.3.3 HEADING AND FOOTING STATEMENTS • • • • • • 8-18 8.3.4 PAGE STATEMENT •••• 8-20 8.3.5 CURRENT TIME AND DATE: TIME, DATE, AND TIMEDATE FUNCTIONS • • • • • • • • 8-21 8.3.6 QUERYING CURRENT VALUE OF SYSTEM FUNCTIONS: SYSTEM 8-23 8.3.7 INPUT AND OUTPUT CONVERSION: ICONV AND OCONV • 8-24 8.3.8 FORMAT CONVERSION: ASCII, EBCDIC, CHAR AND SEQ 8-26 9 DEBUGGING BASIC PROGRAMS • • • • 9-1 9.1 THE BASIC DEBUGGER ••• , .
Recommended publications
  • Chapter 4 Programming in Perl
    Chapter 4 Programming in Perl 4.1 More on built-in functions in Perl There are many built-in functions in Perl, and even more are available as modules (see section 4.4) that can be downloaded from various Internet places. Some built-in functions have already been used in chapter 3.1 and some of these and some others will be described in more detail here. 4.1.1 split and join (+ qw, x operator, \here docs", .=) 1 #!/usr/bin/perl 2 3 $sequence = ">|SP:Q62671|RATTUS NORVEGICUS|"; 4 5 @parts = split '\|', $sequence; 6 for ( $i = 0; $i < @parts; $i++ ) { 7 print "Substring $i: $parts[$i]\n"; 8 } • split is used to split a string into an array of substrings. The program above will write out Substring 0: > Substring 1: SP:Q62671 Substring 2: RATTUS NORVEGICUS • The first argument of split specifies a regular expression, while the second is the string to be split. • The string is scanned for occurrences of the regexp which are taken to be the boundaries between the sub-strings. 57 58 CHAPTER 4. PROGRAMMING IN PERL • The parts of the string which are matched with the regexp are not included in the substrings. • Also empty substrings are extracted. Note, however that trailing empty strings are removed by default. • Note that the | character needs to be escaped in the example above, since it is a special character in a regexp. • split returns an array and since an array can be assigned to a list we can write: splitfasta.ply 1 #!/usr/bin/perl 2 3 $sequence=">|SP:Q62671|RATTUS NORVEGICUS|"; 4 5 ($marker, $code, $species) = split '\|', $sequence; 6 ($dummy, $acc) = split ':', $code; 7 print "This FastA sequence comes from the species $species\n"; 8 print "and has accession number $acc.\n"; splitfasta.ply • It is not uncommon that we want to write out long pieces of text using many print statements.
    [Show full text]
  • Featuring the Multivalue Database Players Featuring the Multivalue Database Players
    INSIDE! UNLOCK THE POWER OF YOUR MULTIVALUE DATABASE $7.00 U.S. INTERNATIONAL ® SPECTRUMSPECTRUMTHE BUSINESS COMPUTER MAGAZINE MAY/JUNE 2002 • AN IDBMA, INC. PUBLICATION IndependentIndependent Databa se Revie Featur Appearing! ing Featuring the M Database Review ult PLAYERS iV DatabaseDATABASE a DatabaseMULTIVALUE l Now Appearing! Review of the tabases MV Da IndustryIndustry yers base Pla eData ReviewReviewFeaturing the MultiValue Database Players Come in from the rain Featuring the UniVision MultiValue database - compatible with existing applications running on Pick AP, D3, R83, General Automation, Mentor, mvBase and Ultimate. We’re off to see the WebWizard Starring a “host” centric web integration solution. Watch WebWizard create sophisticated web-based applications from your existing computing environment. Why a duck? Featuring ViaDuct 2000, the world’s easiest-to-use terminal emulation and connectivity software, designed to integrate your host data and applications with your Windows desktop. Caught in the middle? With an all-star cast from the WinLink32 product family (ViaOD- BC, ViaAPI for Visual Basic, ViaObjects, and mvControls), Via Sys- tems’ middleware solutions will entertain (and enrich!) you. Appearing soon on a screen near you. Advanced previews available from Via Systems. Via Systems Inc. 660 Southpointe Court, Suite 300 Colorado Springs, Colorado 80906 Phone: 888 TEAMVIA Fax: 719-576-7246 e-mail: [email protected] On the web: www.via.com The Freedom To Soar. With jBASE – the remarkably liberating multidimensional database – there are no limits to where you can go. Your world class applications can now run on your choice of database: jBASE, Oracle, SQL Server or DB2 without modification and can easily share data with other applications using those databases.
    [Show full text]
  • 1. Introduction to Structured Programming 2. Functions
    UNIT -3Syllabus: Introduction to structured programming, Functions – basics, user defined functions, inter functions communication, Standard functions, Storage classes- auto, register, static, extern,scope rules, arrays to functions, recursive functions, example C programs. String – Basic concepts, String Input / Output functions, arrays of strings, string handling functions, strings to functions, C programming examples. 1. Introduction to structured programming Software engineering is a discipline that is concerned with the construction of robust and reliable computer programs. Just as civil engineers use tried and tested methods for the construction of buildings, software engineers use accepted methods for analyzing a problem to be solved, a blueprint or plan for the design of the solution and a construction method that minimizes the risk of error. The structured programming approach to program design was based on the following method. i. To solve a large problem, break the problem into several pieces and work on each piece separately. ii. To solve each piece, treat it as a new problem that can itself be broken down into smaller problems; iii. Repeat the process with each new piece until each can be solved directly, without further decomposition. 2. Functions - Basics In programming, a function is a segment that groups code to perform a specific task. A C program has at least one function main().Without main() function, there is technically no C program. Types of C functions There are two types of functions in C programming: 1. Library functions 2. User defined functions 1 Library functions Library functions are the in-built function in C programming system. For example: main() - The execution of every C program starts form this main() function.
    [Show full text]
  • Eloquent Javascript © 2011 by Marijn Haverbeke Here, Square Is the Name of the Function
    2 FUNCTIONS We have already used several functions in the previous chapter—things such as alert and print—to order the machine to perform a specific operation. In this chap- ter, we will start creating our own functions, making it possible to extend the vocabulary that we have avail- able. In a way, this resembles defining our own words inside a story we are writing to increase our expressive- ness. Although such a thing is considered rather bad style in prose, in programming it is indispensable. The Anatomy of a Function Definition In its most basic form, a function definition looks like this: function square(x) { return x * x; } square(12); ! 144 Eloquent JavaScript © 2011 by Marijn Haverbeke Here, square is the name of the function. x is the name of its (first and only) argument. return x * x; is the body of the function. The keyword function is always used when creating a new function. When it is followed by a variable name, the new function will be stored under this name. After the name comes a list of argument names and finally the body of the function. Unlike those around the body of while loops or if state- ments, the braces around a function body are obligatory. The keyword return, followed by an expression, is used to determine the value the function returns. When control comes across a return statement, it immediately jumps out of the current function and gives the returned value to the code that called the function. A return statement without an expres- sion after it will cause the function to return undefined.
    [Show full text]
  • Control Flow, Functions
    UNIT III CONTROL FLOW, FUNCTIONS 9 Conditionals: Boolean values and operators, conditional (if), alternative (if-else), chained conditional (if-elif-else); Iteration: state, while, for, break, continue, pass; Fruitful functions: return values, parameters, local and global scope, function composition, recursion; Strings: string slices, immutability, string functions and methods, string module; Lists as arrays. Illustrative programs: square root, gcd, exponentiation, sum an array of numbers, linear search, binary search. UNIT 3 Conditionals: Boolean values: Boolean values are the two constant objects False and True. They are used to represent truth values (although other values can also be considered false or true). In numeric contexts (for example when used as the argument to an arithmetic operator), they behave like the integers 0 and 1, respectively. A string in Python can be tested for truth value. The return type will be in Boolean value (True or False) To see what the return value (True or False) will be, simply print it out. str="Hello World" print str.isalnum() #False #check if all char are numbers print str.isalpha() #False #check if all char in the string are alphabetic print str.isdigit() #False #test if string contains digits print str.istitle() #True #test if string contains title words print str.isupper() #False #test if string contains upper case print str.islower() #False #test if string contains lower case print str.isspace() #False #test if string contains spaces print str.endswith('d') #True #test if string endswith a d print str.startswith('H') #True #test if string startswith H The if statement Conditional statements give us this ability to check the conditions.
    [Show full text]
  • The Return Statement a More Complex Example
    We Write Programs to Do Things Anatomy of a Function Definition • Functions are the key doers name parameters Function Call Function Definition def plus(n): Function Header """Returns the number n+1 Docstring • Command to do the function • Defines what function does Specification >>> plus(23) Function def plus(n): Parameter n: number to add to 24 Header return n+1 Function Precondition: n is a number""" Body >>> (indented) x = n+1 Statements to execute when called return x • Parameter: variable that is listed within the parentheses of a method header. The vertical line Use vertical lines when you write Python indicates indentation on exams so we can see indentation • Argument: a value to assign to the method parameter when it is called The return Statement A More Complex Example • Format: return <expression> Function Definition Function Call § Used to evaluate function call (as an expression) def foo(a,b): >>> x = 2 § Also stops executing the function! x ? """Return something >>> foo(3,4) § Any statements after a return are ignored Param a: number • Example: temperature converter function What is in the box? Param b: number""" def to_centigrade(x): x = a A: 2 """Returns: x converted to centigrade""" B: 3 y = b C: 16 return 5*(x-32)/9.0 return x*y+y D: Nothing! E: I do not know Understanding How Functions Work Text (Section 3.10) vs. Class • Function Frame: Representation of function call Textbook This Class • A conceptual model of Python to_centigrade 1 Draw parameters • Number of statement in the as variables function body to execute next to_centigrade x –> 50.0 (named boxes) • Starts with 1 x 50.0 function name instruction counter parameters Definition: Call: to_centigrade(50.0) local variables (later in lecture) def to_centigrade(x): return 5*(x-32)/9.0 1 Example: to_centigrade(50.0) Example: to_centigrade(50.0) 1.
    [Show full text]
  • Subroutines – Get Efficient
    Subroutines – get efficient So far: The code we have looked at so far has been sequential: Subroutines – getting efficient with Perl do this; do that; now do something; finish; Problem Bela Tiwari You need something to be done over and over, perhaps slightly [email protected] differently depending on the context Solution Environmental Genomics Thematic Programme Put the code in a subroutine and call the subroutine whenever needed. Data Centre http://envgen.nox.ac.uk Syntax: There are a number of correct ways you can define and use Subroutines – get efficient subroutines. One is: A subroutine is a named block of code that can be executed as many times #!/usr/bin/perl as you wish. some code here; some more here; An artificial example: lalala(); #declare and call the subroutine Instead of: a bit more code here; print “Hello everyone!”; exit(); #explicitly exit the program ############ You could use: sub lalala { #define the subroutine sub hello_sub { print "Hello everyone!\n“; } #subroutine definition code to define what lalala does; #code defining the functionality of lalala more defining lalala; &hello_sub; #call the subroutine return(); #end of subroutine – return to the program } Syntax: Outline review of previous slide: Subroutines – get efficient Syntax: #!/usr/bin/perl Permutations on the theme: lalala(); #call the subroutine Defining the whole subroutine within the script when it is first needed: sub hello_sub {print “Hello everyone\n”;} ########### sub lalala { #define the subroutine The use of an ampersand to call the subroutine: &hello_sub; return(); #end of subroutine – return to the program } Note: There are subtle differences in the syntax allowed and required by Perl depending on how you declare/define/call your subroutines.
    [Show full text]
  • Msc THESIS Exploiting the Reconfigurability of Ρ-VEX Processor for Real-Time Robotic Applications
    Computer Engineering 2016 Mekelweg 4, 2628 CD Delft The Netherlands http://ce.et.tudelft.nl/ MSc THESIS Exploiting the Reconfigurability of ρ-VEX Processor for Real-Time Robotic Applications Muhammad Muneeb Yousaf Abstract Autonomous mobile robots generally have limited computational power on-board, and they have to perform their tasks in real-time in order to interact with their surroundings effectively. Therefore, there is a need to utilize the available computational capabilities ef- ficiently. The ρ-VEX is a run-time reconfigurable VLIW processor. CE-MS-2016-10 This unique processor allows separation of its issue lanes to form independently operating processing cores. Switching between these configurations during run-time allows optimizing the computing re- sources for the task(s) it is performing. In this project FreeRTOS is ported to the ρ-VEX processor and a control layer is developed. FreeRTOS manages the applications based on given real time parameters. The control layer decides the number of active cores (hardware contexts) and issue width of each core to best match the processing requirements of the applications. In this way, FreeRTOS and the control layer together can reconfigure the number of active cores at run-time. This is a very unique feature of this thesis project and can not be found in any other multicore implementation of FreeRTOS. The control layer along with FreeR- TOS provides the user a facility to run applications under real-time constraints and with the best possible efficiency. In order to evaluate the performance, the overhead of the FreeRTOS is quantified and a performance comparison is made between several configurations of this system.
    [Show full text]
  • PHP: Constructs and Variables Introduction This Document Describes: 1
    PHP: Constructs and Variables Introduction This document describes: 1. the syntax and types of variables, 2. PHP control structures (i.e., conditionals and loops), 3. mixed-mode processing, 4. how to use one script from within another, 5. how to define and use functions, 6. global variables in PHP, 7. special cases for variable types, 8. variable variables, 9. global variables unique to PHP, 10. constants in PHP, 11. arrays (indexed and associative), Brief overview of variables The syntax for PHP variables is similar to C and most other programming languages. There are three primary differences: 1. Variable names must be preceded by a dollar sign ($). 2. Variables do not need to be declared before being used. 3. Variables are dynamically typed, so you do not need to specify the type (e.g., int, float, etc.). Here are the fundamental variable types, which will be covered in more detail later in this document: • Numeric 31 o integer. Integers (±2 ); values outside this range are converted to floating-point. o float. Floating-point numbers. o boolean. true or false; PHP internally resolves these to 1 (one) and 0 (zero) respectively. Also as in C, 0 (zero) is false and anything else is true. • string. String of characters. • array. An array of values, possibly other arrays. Arrays can be indexed or associative (i.e., a hash map). • object. Similar to a class in C++ or Java. (NOTE: Object-oriented PHP programming will not be covered in this course.) • resource. A handle to something that is not PHP data (e.g., image data, database query result).
    [Show full text]
  • Control Flow Statements
    Control Flow Statements http://docs.oracle.com/javase/tutorial/java/nutsandbolts/flow.html http://math.hws.edu/javanotes/c3/index.html 1 Control Flow The basic building blocks of programs - variables, expressions, statements, etc. - can be put together to build complex programs with more interesting behavior. CONTROL FLOW STATEMENTS break up the flow of execution by employing decision making, looping, and branching, enabling your program to conditionally execute particular blocks of code. Decision-making statements include the if statements and switch statements. There are also looping statements, as well as branching statements supported by Java. 2 Decision-Making Statements A. if statement if (x > 0) y++; // execute this statement if the expression (x > 0) evaluates to “true” // if it doesn’t evaluate to “true”, this part is just skipped // and the code continues on with the subsequent lines B. if-else statement - - gives another option if the expression by the if part evaluates to “false” if (x > 0) y++; // execute this statement if the expression (x > 0) evaluates to “true” else z++; // if expression doesn’t evaluate to “true”, then this part is executed instead if (testScore >= 90) grade = ‘A’; else if (testScore >= 80) grade = ‘B’; else if (testScore >= 70) grade = ‘C’; else if (testScore >= 60) grade = ‘D’; else grade = ‘F’; C. switch statement - - can be used in place of a big if-then-else statement; works with primitive types byte, short, char, and int; also with Strings, with Java SE7, (enclose the String with double quotes);
    [Show full text]
  • C Programming Tutorial
    C Programming Tutorial C PROGRAMMING TUTORIAL Simply Easy Learning by tutorialspoint.com tutorialspoint.com i COPYRIGHT & DISCLAIMER NOTICE All the content and graphics on this tutorial are the property of tutorialspoint.com. Any content from tutorialspoint.com or this tutorial may not be redistributed or reproduced in any way, shape, or form without the written permission of tutorialspoint.com. Failure to do so is a violation of copyright laws. This tutorial may contain inaccuracies or errors and tutorialspoint provides no guarantee regarding the accuracy of the site or its contents including this tutorial. If you discover that the tutorialspoint.com site or this tutorial content contains some errors, please contact us at [email protected] ii Table of Contents C Language Overview .............................................................. 1 Facts about C ............................................................................................... 1 Why to use C ? ............................................................................................. 2 C Programs .................................................................................................. 2 C Environment Setup ............................................................... 3 Text Editor ................................................................................................... 3 The C Compiler ............................................................................................ 3 Installation on Unix/Linux ............................................................................
    [Show full text]
  • Codebridge User's Guide Contents • Iii Passing Miscellaneous Information
    Micro Focus RM/COBOL CodeBridge User’s Guide Micro Focus The Lawn 22-30 Old Bath Road Newbury, Berkshire RG14 1QN UK http://www.microfocus.com © Copyright 2017-2020 Micro Focus or one of its affiliates. The only warranties for products and services of Micro Focus and its affiliates and licensors (“Micro Focus”) are as may be set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. Micro Focus shall not be liable for technical or editorial errors or omissions contained herein. The information contained herein is subject to change without notice. Revised 2020-05-06 for version 12.17 Contents Preface ...................................................................................................... 1 Welcome to CodeBridge ............................................................................................................ 1 Who Should Use CodeBridge .................................................................................................... 1 Organization of Information ...................................................................................................... 2 Related Publications................................................................................................................... 3 Symbols and Conventions .......................................................................................................... 3 Technical Support .....................................................................................................................
    [Show full text]