Created
November 5, 2020 13:08
-
-
Save MarkGoldberg/67850c17f8656126b0e3fe29babd4de5 to your computer and use it in GitHub Desktop.
How to reset an ANY so it can take on a new data type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROGRAM | |
MAP | |
END | |
INCLUDE('debuger.inc'),ONCE | |
dbg debuger | |
SomeGroup GROUP | |
LongVar LONG | |
RealVar REAL | |
END | |
CurrentField ANY | |
CODE | |
dbg.MG_Init('TestClearAny') | |
SomeGroup.LongVar = 42 | |
SomeGroup.RealVar = 56.789 | |
CurrentField &= WHAT(SomeGroup, 1) | |
dbg.ODS('1: CurrentField['& CurrentField &']') ! expecting 42 | |
! got 42 | |
CurrentField = 'Hello There' | |
dbg.ODS('2: CurrentField['& CurrentField &']') ! expecting 0 | |
! got 0 | |
CLEAR(CurrentField) ! FAILS to reset the ANY so it can take on a new data type | |
CurrentField = 'Round #2' | |
dbg.ODS('3: CurrentField['& CurrentField &']') ! hoping for 'Round #2' | |
! got 0 | |
CurrentField &= NULL ! SUCCEEDS resetting the ANY so it can take on a new data type | |
CurrentField = 'Yet another try' | |
dbg.ODS('4: CurrentField['& CurrentField &']') ! hoping for 'Yet another try' | |
! got 'Yet another try | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment