Misplaced Pages

Picture clause: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editContent deleted Content addedVisualWikitext
Revision as of 17:29, 10 July 2007 edit205.211.50.10 (talk) Fixed headers← Previous edit Latest revision as of 02:33, 15 June 2017 edit undoTom.Reding (talk | contribs)Autopatrolled, Extended confirmed users, Page movers, Template editors3,888,592 editsm +{{Redirect category shell}} for multiple-{{R}} #Rs using AWB 
(36 intermediate revisions by 17 users not shown)
Line 1: Line 1:
#REDIRECT ]
A picture clause is an element in ] that is used to describe a ] item, by using sample characters that indicate the item characteristics and size.


{{Redirect category shell|1=
== History ==
{{R from merge}}
The picture clause was first used in the ] (Commercial Translator) language developed by ] of ] in 1957. In 1959, it was incorporated into the original definition of ]. Since then, many other programming languages have copied this feature.
{{R to section}}
}}


]
== Structure ==
A picture clause is made up of various characters, each of which represents a certain type of data item. The number of repeated characters indicates the size of the data item.
Here are some examples (from COBOL) of picture characters and what they represent:
*A -- an alphabetic character (A-Z or a-z, plus blank)
*B -- the blank character
*X -- any character, alphabetic, numeric, or other symbols
*9 -- a numeric digit
*Z -- a numeric digit, but zero-suppressed (replaced by a blank when equal to zero)
*S -- a sign for a number
*, -- the comma, used as a separator in displaying numbers<ref name="comma">The comma and decimal point can be switched for European use.</ref>
*. -- the period, used as a decimal point in displaying numbers<ref name="comma"/>
*+ -- the plus sign, used in displaying signed numbers
*- -- the minus sign, used in displaying signed numbers

Some picture characters are used in input data and data storage fields, some only in output fields, and some in both. For example, ''S'' is used for a signed number on input and storage fields, but output fields will display a ''+'' or ''-'' sign.

== Examples<ref>These examples are from COBOL.</ref> ==
{| border="1"
|- bgcolor="honeydew"
! picture clause!! data type!! sample contents
|-
||PICTURE IS 999 ||3-digit number || 123, 005, 087, any number from 000 through 999
|-
||PICTURE IS S999 ||3-digit signed number || +123, -005, +087, any number from -999 through +999
|-
||PICTURE IS ZZ9 ||3-digit number, leading zeros suppressed || 123, 5, 87, any number from 000 through 999
|-
||PICTURE IS A(8) ||up to 8-character alphabetic string || "Fredrick", "Fred ", any string up to 8 letters
|-
||PICTURE IS X(8) ||up to 8-character string || "Smithson", "O'Riley ", "Von-Jovi", any string up to 8 characters
|-
|}

== Footnotes ==
<references/>
{{Uncategorized|date=June 2007}}

Latest revision as of 02:33, 15 June 2017

Redirect to:

This page is a redirect. The following categories are used to track and monitor this redirect:
  • From a merge: This is a redirect from a page that was merged into another page. This redirect was kept in order to preserve the edit history of this page after its content was merged into the content of the target page. Please do not remove the tag that generates this text (unless the need to recreate content on this page has been demonstrated) or delete this page.
When appropriate, protection levels are automatically sensed, described and categorized.
Category: