IBM SC34-5764-01 Bedienungsanleitung Seite 227

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 481
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 226
/* Alternative to period as placeholder */
stars='Arcturus Betelgeuse Sirius Rigil'
parse var stars drop junk brightest rest /* brightest='Sirius' */
A placeholder saves the overhead of unneeded variables.
Templates Containing String Patterns
A string pattern matches characters in the source string to indicate where to split it. A string pattern can be
a:
Literal string pattern
One or more characters within quotation marks.
Variable string pattern
A variable within parentheses with no plus (+) or minus (-) or equal sign (=) before the left
parenthesis. (See page 209 for details.)
Here are two templates: a simple template and a template containing a literal string pattern:
var1 var2 /* simple template */
var1 ', ' var2 /* template with literal string pattern */
The literal string pattern is: ', '. This template:
v Puts characters from the start of the source string up to (but not including) the first character of the
match (the comma) into var1
v Puts characters starting with the character after the last character of the match (the character after the
blank that follows the comma) and ending with the end of the string into var2.
A template with a string pattern can omit some of the data in a source string when assigning data into
variables. The next two examples contrast simple templates with templates containing literal string
patterns.
/* Simple template */
name='Smith, John'
parse var name ln fn /* Assigns: ln='Smith,' */
/* fn='John' */
Notice that the comma remains (the variable ln contains 'Smith,'). In the next example the template is ln
','fn. This removes the comma.
/* Template with literal string pattern */
name='Smith, John'
parse var name ln ', ' fn /* Assigns: ln='Smith' */
/* fn='John' */
First, the language processor scans the source string for ', '. It splits the source string at that point. The
variable ln receives data starting with the first character of the source string and ending with the last
character before the match. The variable fn receives data starting with the first character after the match
and ending with the end of string.
A template with a string pattern omits data in the source string that matches the pattern. (There is a
special case (on page 212) in which a template with a string pattern does not omit matching data in the
source string.) We used the pattern ', ' (with a blank) instead of ',' (no blank) because, without the
blank in the pattern, the variable fn receives ' John' (including a blank).
If the source string does not contain a match for a string pattern, then any variables preceding the
unmatched string pattern get all the data in question. Any variables after that pattern receive the null
string.
A null string is never found. It always matches the end of the source string.
Parsing
Chapter 15. Parsing 205
Seitenansicht 226
1 2 ... 222 223 224 225 226 227 228 229 230 231 232 ... 480 481

Kommentare zu diesen Handbüchern

Keine Kommentare

Longshine LCS-844MT manuels

Manuels d'utilisation et guides de l'utilisateur pour Équipement Longshine LCS-844MT.
Nous fournissons des manuels en pdf 1 Longshine LCS-844MT à télécharger gratuitement par type de document : Manuel de l'utilisateur






Plus de produits et de manuels pour Équipement Longshine

Modèles Type de document
LCS-FS6108-B Manuel de l'utilisateur        Longshine LCS-FS6108-B User Manual [de] [en] , 40 pages
LCS-FS6116-C Manuel de l'utilisateur   Longshine LCS-FS6116-C User Manual, 7 pages
LCS-GS7104+1 Manuel de l'utilisateur   Longshine LCS-GS7104+1 User Manual [pl] [cs] [en] [de] , 8 pages
LCS-GS7105-D Manuel de l'utilisateur        Longshine LCS-GS7105-D User Manual [en] [de] [fr] , 34 pages
LCS-GS7108-D Manuel de l'utilisateur        Longshine LCS-GS7108-D User Manual [en] , 36 pages
LCS-GS8116-A Manuel de l'utilisateur        Longshine LCS-GS8116-A User Manual, 32 pages
LCS-GS8208-A V.1 Manuel de l'utilisateur   Longshine LCS-GS8208-A V.1 User Manual [en] [de] , 22 pages
LCS-GS8208-A V.2 Manuel de l'utilisateur   Longshine LCS-GS8208-A V.2 User Manual [fr] [de] , 41 pages
LCS-GS9120 Manuel de l'utilisateur   Longshine LCS-GS9120 User Manual, 9 pages
LCS-GS9428 Manuel de l'utilisateur   Longshine LCS-GS9428 User Manual, 46 pages
LCS-IR2114-D Manuel de l'utilisateur   Longshine LCS-IR2114-D User Manual [en] [de] , 53 pages
LCS-K602-A Manuel de l'utilisateur   Longshine LCS-K602-A User Manual [pl] [cs] [en] [de] , 13 pages
LCS-K916 Manuel de l'utilisateur   Longshine LCS-K916 User Manual [pl] [de] , 21 pages
LCS-KL-2716M Manuel de l'utilisateur   Longshine LCS-KL-2716M User Manual, 38 pages
LCS-PS112 Manuel de l'utilisateur   Longshine LCS-PS112 User Manual, 81 pages
LCS-US204 Manuel de l'utilisateur   Longshine LCS-US204 User Manual [de] [en] , 43 pages
LCS-WA5-45 Manuel de l'utilisateur   Longshine LCS-WA5-45 User Manual, 32 pages
LCS-WARC-N Manuel de l'utilisateur       Longshine LCS-WARC-N User Manual, 265 pages
LCS-WRN-3211 Manuel de l'utilisateur   Longshine LCS-WRN-3211 User Manual, 58 pages