RTP Series - RTP42
VERBatim - V65
Argument passing - Subroutines and Functions - Mike Pope
SecureUser
VERBatim - V86
Advanced Revelation Initialisation Sequence (Overview) by Mike Pope
Reader's Clinic - Different Id Same Record
Reader's Clinic - Scaled Masked Decimal Conversions
Base Conversions
User Defined Conversions
Reader's Forum - Numeric Precision in R/Basic - Hal Wyman
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)
@ATTACK - @Attrbt.Ptr
@ATTACK - @Query.Table
REVMEDIA Revisited
Uncommon Knowledge - WC_Table_Exit_Mode%
QTIPS - New Catalyst Option
Version 3 Technical Highlights - Deleting Tables Programmatically
Version 3 Technical Highlights - Aliasing Tables Programmatically
Version 3 TCL Subroutines - Creating Tables
Version 3 TCL Subroutines - Deleting Tables
Version 3 TCL Subroutines - Aliasing Tables
Symbol Table Structure
Utility Diskette # 3 - Part II
Reader's Clinic - Slow Multivalued Screen Display
QTIPS - Using @Upper.Case and @Lower.Case with Foreign Languages
@ATTACK - @Lower.Case
@ATTACK - @Upper.Case
Sorting out Collation Sequences by Mike Pope
@ATTACK - @CPU.Type
Vroom
RTP Series - RTP32
Utility Diskette # 3 - Part I
Bugs and PCs - Indexing 01 vs 1
RTP Series - RTP33
@ATTACK - @File.Error
@ATTACK - @Rn.Counter
Reader's Clinic - Related Windows
VERBatim - V126
Esc.To.Exit
Uncommon Knowledge - WC_WST_CHAR%
RTP Series - RTP26
Base Conversions
IConvs / OConvs
User Defined Conversions
@ATTACK - @File.Error
@ATTACK - @File.Error.Mode
@ATTACK - @Last.Error
A RevTechie Replies - And Miscellaneous Jottings - Mike Pope - Revelation Technologies (UK) Ltd
RTP5 and RTP51
QTIPS - Standardising Error Message Display
QTIPS - Interrupt Proof Error Messages
Version 3 Technical Highlights - ValidateName
Version 3 Technical Highlights - Customising NewApplication Creation
Version 2
RTP Series - RTP19
VERBatim - V22
Reader's Clinic - Scaled Masked Decimal Conversions
VROOM - Window Processing II
Base Conversions
IConvs / OConvs
User Defined Conversions
SecureUser
VERBatim - V25
@ATTACK - @Files.System
Advanced Revelation Initialisation Sequence (Overview) by Mike Pope
REVMEDIA Revisted
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 - Page Marks in Windows

RevMedia FKB

DocumentV3I1A2
TitleUser Defined Conversions
KeywordsCONVERSION
OCONV
ICONV
TextOne of the most common forms of user DEFINED conversion is that which takes
a code and USING it extracts a description FROM a code table for display
For example

SUBROUTINE CODE_LOOKUP(TYPE PASSED BRANCH RETURNED)
BEGIN CASE
CASE TYPE = "ICONV"
* Assuming codes are MVs in field 5 and descs in 6
CODES = XLATE("CODES" BRANCH[ 1 "B*"] 5 "X")
LOCATE PASSED IN CODES USING @VM SETTING POS THEN
STATUS() = 0
END ELSE
STATUS() = 1 ; PASSED = ""
END
RETURNED = PASSED
CASE TYPE = "OCONV"
CODES = XLATE("CODES" BRANCH[ 1 "B*"] "" "X")
LOCATE PASSED IN CODES<5> USING @VM SETTING POS THEN
RETURNED = CODES<6 POS>
END ELSE
RETURNED = PASSED
END
END CASE
RETURN


Note that in this EXAMPLE the DATA logic is kept separate FROM the
APPLICATION logic (the ICONV itself does not suggest replacements it flags
that an error has occurred and lets the application logic suggest
alternatives This leads to more portable code (see future articles on
system design))

However when the user presses Ctrl F10 and then F2 the uncoded version shows
up If the user then chooses the uncoded version the OCONV logic is
invoked and it redisplays as the coded version If the user then selects
this version and F9s it the system attempts to re ICONV the OCONVed value
even though the internal form is available fails to ICONV it and thus
finds no hits To fix this problem amend the code as follows :


CODES = XLATE("CODES" BRANCH[ 1 "B*"] "" "X")
LOCATE PASSED IN CODES<5> USING @VM SETTING POS THEN
RETURNED = PASSED
END ELSE
LOCATE PASSED IN CODES<6> USING @VM SETTING POS THEN
RETURNED = CODES<5 POS>
END ELSE
STATUS() = 1 ; RETURNED = ""
END
END


(Volume 3 Issue 1 Page 7)
[revmedia/copyrigh.htm]

Page last modified: 08/02/03