| Version 2 |
| Bugs and PCs - Xlate with Multipart Keys |
| RTP Series - RTP16 |
| SecureUser |
| Indexing on Xlates |
| Reader's Clinic - Slow Multivalued Screen Display |
| Caching in on the Frames Array - Mike Pope |
| Playing with Scan Codes |
| QTIPS - Compiling Protection Code |
| QTIPS - Invalid Code and Command |
| QTIPS - Code/Command Help |
| Compiling 64K on a Shoestring by Blaise Wrenn (LexStat Systems Ltd) |
| Reader's Clinic - Functions and Subroutines |
| Reader's Letters - Jim Owen |
| Playing with Scan Codes |
| Argument passing - Subroutines and Functions - Mike Pope |
| File Variables |
| Argument passing - Subroutines and Functions - Mike Pope |
| RevTech Replies - Mike Pope (RevTech UK Ltd) |
| Symbol Table Structure |
| Argument passing - Subroutines and Functions - Mike Pope |
| Caching in on the Frames Array - Mike Pope |
| QTIPS - Fast Dynamic Array Building |
| Vroom |
| QTIPS - Replacing GAS.BAR routine during PERFORM "SELECT" |
| QTIPS - Extended Select BY |
| QTIPS - PERFORM Arguments and FMT Specifications |
| What's New (and un(der)documented!) In 2.12 |
| Catalyst |
| @ATTACK - @Ans |
| QTIPS - Compiling Work around on runtimes |
| QTIPS - Potential Problem When Using @ANS |
| Form.List.S |
| QTIPS - Aesthetically Improving RLIST Reports |
| QTIPS - Form Processor |
| QTIPS - Suppressing Initial Form Feed |
| QTIPS - Using RTP29 In Place of V6 |
| Reader's Clinic - Incorrect Indexes |
| Redisplaying Multi-Values |
| RTP Series - RTP21 |
| Bugs and PCs - MultiValued Keys on Windows |
| Reader's Clinic - Slow Multivalued Screen Display |
| QTIPS - Btree.Extract |
| Comp |
| Reader's Clinic - Removing "Searching Cross References" Message |
| @ATTACK - @List.Active |
| IConvs / OConvs |
| Reader's Clinic - Stop Lists |
| REVMEDIA Revisited |
| REVMEDIA Revisited |
| SecureUser |
| VERBatim - V25 |
| @ATTACK - @Files.System |
| Advanced Revelation Initialisation Sequence (Overview) by Mike Pope |
| REVMEDIA Revisted |
| QTIPS - Border.Colour |
| QTIPS - Overriding Menu Colours |
| Utility Diskette # 3 - Part II |
| QTIPS - Query Windows - Changing Colours |
RevMedia FKB
| Document | V1I2A9 |
| Title | RTP Series - RTP16 |
| Keywords | RTP16 XLATE |
| Text | The XLATE processor This is actually a very useful tool for more than just standard extractions of descriptions FROM code files et al The full syntax of XLATE is XLATE(file rec field action levels drop) and it is the variants of field that make this function more powerful than it might at first seem To deal WITH the options in turn: file this can be a literal or a variable (but not a file variable) It can ALSO be a dict file rec this is the key of the record that is to be extracted FROM the file It can be any valid expression and it can be multivalued If it is multivalued all of the records specified will be read and the values returned in a multivalued array field this can be of four types: Number this just returns the field specified FROM the record and is the standard use for XLATE Zero this does not return a field but rather returns the key This is VERY useful in conjunction WITH the X action code If we request a field number in place of a 0 we have no way of knowing if the record was on file or not as WITH an X a "" would be returned if the field was null OR if the record did not exist WITH a field number of 0 we can perform a Verifile operation easily If the record is there the id will be returned if it is not on file a "" will be returned E G IF NOT(XLATE("CODES" @ANS 0 "X")) THEN CALL MSG("Code not found" "" "" "") Null ("") this returns the entire record instead of a field It can be used to save having to open a file for a quick one off utility program or used in conjunction WITH the levels drop (q v ) it can form a quick way of taking entire records to form a multivalued array (e g for stuffing a popup etc ) If we set levels drop to 1 the record will be returned as a multivalued array and thus require no further processing to treat as a multivalue E G POP LIST=XLATE("LISTS" "TEMP" "" "X" 1) IF POP LIST THEN WRITEV POP LIST ON POPS ID 4 Field Name can be used in place of field number and is more readable although slower Has the great advantage that it can be used to extract symbolics action can be X or C X means return null if record not found C means return the ID Note that omitting X and C will be treated as an C levels drop this tells the system how to treat delimiters found in the field/record being XLATED to This could be useful in the above EXAMPLE where we extracted an entire record USING a null field as it changed the field marks to value marks (and of course any value marks to sub value marks) It is ALSO very useful when XLATEing FROM a multivalued field to a multivalued field This is best illustrated by reference to a list STATEMENT in this EXAMPLE every record on the main file can store multiple parts Every part is available in a number of colours The symbolic Colour Choice simply extracts the corresponding choices FROM the parts file Firstly using @ANS=XLATE("PARTS" {PNO} "COL" "X") we get Key Parts Colour Choice 1 P123 Red P200 Blue P300 Green P400 Yellow P563 Purple P789 Blue Red Green Lilac Cyan Now using @ANS = XLATE("PARTS" {PNO} "COL" "X" 1) we get Key Parts Colour Choice 1 P123 Red Blue P200 Green P300 Yellow Purple Blue P400 Red P563 Green P789 Lilac Cyan a much more meaningful list because the MULTIVALUES in the target have been dropped one LEVEL to sub values and the LIST processor recognises this Note that under certain circumstances XLATEs can be more efficient than straightforward READs as they have their own BUFFERS in the FRAME array (Volume 1 Issue 2 Pages 5 7) |
Page last modified: 08/02/03