#COMMAND MOVEVAR #L "TO" #GLEURC . #IFCLASS !1 "G" // MOVE INDICATOR // 12.0 note: this logic, which has been in fmac forever #CHECK !1 _VWFC // would never work. !A [] $4020 !1 |GB[0] !3 IN$GLALL |3 #ELSE // Type independent move as of 2.3 !A [] $086 !1 !3 #ENDIF #ENDCOMMAND changed for 12.0 to support moving indicators
// The ability to move to and from indicators was added to 12.0 along with the #IFLOGICAL compiler command.
// This allows developers to treat indicators just like booleans removing the need to create
// indicate and indicator commands. The Move command can now and should be used for all assignments.
#IFCLASS !1 "G" // allowing this case through hangs the compiler .. error is reported already above in argument check
#ELSE
#IFLOGICAL !1
#IFLOGICAL !3
Indicate !3 as [!1] // Move Indicator to Indicator becomes: Indicate Indicator as [Indicator]
#ELSE
Movevar (!1) to !3 // Move Indicator to Var
#ENDIF
#ELSE
#IFLOGICAL !3
// if dest is indicator, check source to decide what kind of statement to build
#IFSAME !1 true false dftrue dffalse
Indicate !3 !1 // Move true|false to Indicator becomes: Indicate Indicator true|false
#ELSE
#IFCLASS !1 _E
Indicate !3 as !1 // Move (exp) to Indicator becomes: Indicate Indicator as (exp)
#ELSE
Indicate !3 as (!1) // Move var to Indicator becomes: Indicate Indicator as (var)
#ENDIF
#ENDIF
#ELSE
// if source and dest are both not indicators use the standard Move logic
//Type independent move as of 2.3
!A [] $086 !1 !3
#ENDIF
#ENDIF
#ENDIF