INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Why does this Expression only partially work?  (Read 259 times)

rbmjr

  • World Citizen
  • ***
  • Posts: 124
Why does this Expression only partially work?
« on: July 10, 2024, 09:45:40 am »

I have tried so many iterations of this Expression and they all fail in nearly the same location. It's as if the Global Variables are not being updated as the Expression is processing. Would someone please explain how to fix this? What I am doing wrong? The attached image is what I am seeing as the audio file is playing. You will notice when it gets to "F ==>" that the Global Variable says it is set, yet the SetField statement that follows never receives the updated information from the Global Variable. Are there local variables that can be used within an Expression?

Code: [Select]
Save( , GVFileName )
Save( , GVFileKey )
Save( , GVNow )
Save( , GVWorkList3x )
Save( , GVWorkDays3x )
Save( , GVWorkDate3x )
Save( , GVWorkList2x )
Save( , GVWorkDays2x )
Save( , GVWorkDate2x )
Save( , GVWorkList1x )
Save( , GVWorkDays1x )
Save( , GVWorkDate1x )

If( And( [IsPlaying] = 1, IsPlaying() )
,
Save( [Name], GVFileName )
A ==> [GVFileName]
Save( FileKey(), GVFileKey )
B ==> [GVFileKey]
Save( FormatDate( Now(), MM//dd//yyyy ), GVNow )
C ==> [GVNow]
SetField( RVFileKey, [GVFileKey] )
D ==> [RVFileKey]
SetField( RVNow, [GVNow] )
E ==> [RVNow]
,
)

If( And( [IsPlaying] = 1, IsPlaying(), FileKey() = [GVFileKey], IsEmpty( [RVWorkList2x] )  )
,
    Save( NoData, GVWorkList3x) SetField( RVWorkList3x, [GVWorkList3x] )
,
    Save( [RVWorkList2x], GVWorkList3x ) SetField( RVWorkList3x, [GVWorkList3x] )
)
F ==> [GVWorkList3x] - [RVWorkList3x]

If( And( [IsPlaying] = 1, IsPlaying(), FileKey() = [GVFileKey], IsEmpty( [RVWorkDate2x] ) )
,
    Save( NoData, GVWorkDate3x ) SetField( RVWorkDate3x, [GVWorkDate3x] )
,
    Save( [RVWorkDate2x], GVWorkDate3x ) SetField( RVWorkDate3x, [GVWorkDate3x] )
)
G ==> [GVWorkDate3x] - [RVWorkDate3x]

If( And( [IsPlaying] = 1, IsPlaying(), FileKey() = [GVFileKey], IsEmpty( [RVWorkList1x] )  )
,
    Save( NoData, GVWorkList2x) SetField( RVWorkList2x, [GVWorkList2x] )
,
    Save( [RVWorkList1x], GVWorkList2x ) SetField( RVWorkList2x, [GVWorkList2x] )
)
H ==> [GVWorkList2x] - [RVWorkList2x]
 
If( And( [IsPlaying] = 1, IsPlaying(), FileKey() = [GVFileKey], IsEmpty( [RVWorkDate1x] ) )
,
    Save( NoData, GVWorkDate2x ) SetField( RVWorkDate2x, [GVWorkDate2x] )
,
    Save( [RVWorkDate1x], GVWorkDate2x ) SetField( RVWorkDate2x, [GVWorkDate2x] )
)
I ==> [GVWorkDate2x] - [RVWorkDate2x]

If( And( [IsPlaying] = 1, IsPlaying(), FileKey() = [GVFileKey], IsEmpty( [SmartList] )  )
,
    Save( NoData, GVWorkList1x) SetField( RVWorkList1x, [GVWorkList1x] )
,
    Save( [SmartList], GVWorkList1x ) SetField( RVWorkList1x, [GVWorkList1x] )
)
J ==> [GVWorkList1x] - [RVWorkList1x]

If( And( [IsPlaying] = 1, IsPlaying(), FileKey() = [GVFileKey], IsEmpty( [SmartDate] ) )
,
    Save( NoData, GVWorkDate1x ) SetField( RVWorkDate1x, [GVWorkDate1x] )
,
    Save( [SmartDate], GVWorkDate1x ) SetField( RVWorkDate1x, [GVWorkDate1x] )
)
K ==> [GVWorkDate1x] - [RVWorkDate1x]

If( IsEmpty( [SmartList] ), Save( , GVSmartList ), Save( [SmartList], GVSmartList ) )
If( IsEmpty( [SmartList] ), , SetField( RVSmartList, [GVSmartList] ) )
L ==> [GVSmartList] - [RVSmartList]

If( IsEmpty( [SmartDate] ), Save( , GVLastPlayed ), Save( [SmartDate], GVLastPlayed ) )
If( IsEmpty( [SmartDate] ), , SetField( RVLastPlayed, [GVLastPlayed] ) )
M ==> [GVLastPlayed] - [RVLastPlayed]

If( IsEmpty( [SmartDate] ), Save( , GVSmartDate ), Save( [SmartDate], GVSmartDate ) )
If( IsEmpty( [SmartDate] ), , SetField( RVSmartDate, [GVSmartDate] ) )
N ==> [GVSmartDate] - [RVSmartDate]

If( Or( And( IsEmpty( [GVWorkDate1x] ), IsEmpty( [GVNow] ) ), IsEmpty( [GVWorkDate1x] ) )
,
    Save( NoData, GVWorkDays1x )
,
    If( IsEqual( [GVWorkDate1x], [GVNow], 1 )
    ,
        Save( NoData, GVWorkDays1x )
    ,
        Save( FormatNumber( Extract( 2, CompareDates( ConvertDate( [GVWorkDate1x] ), ConvertDate( [GVNow] ), d ), days), 0 ), GVWorkDays1x )
        SetField( RVWorkDays1x, [GVWorkDays1x])
    )
)
O ==> [GVWorkDays1x] - [RVWorkDays1x]

If( Or( And( IsEmpty( [GVWorkDate2x] ), IsEmpty( [GVWorkDate1x] )), IsEmpty( [GVWorkDate2x] ) )
,
    Save( NoData, GVWorkDays2x )
,
    If( IsEqual( [GVWorkDate2x], [GVWorkDate1x], 1 )
    ,
        Save( NoData, GVWorkDays2x )
    ,
        Save( FormatNumber( Extract( 2, CompareDates( ConvertDate( [GVWorkDate2x] ), ConvertDate( [GVWorkDate1x] ), d), days ), 0 ), GVWorkDays2x )
        SetField( RVWorkDays2x, [GVWorkDays2x] )
    )
)
P ==> [GVWorkDays2x] - [RVWorkDays2x]

If( And([IsPlaying] = 1, IsPlaying() )
,
    Save( SDate: [GVSmartDate] SList: [GVSmartList] FKey: [GVFileKey] GVNow: [GVNow] GVDays1: [GVWorkDays1x] GVWDate1: [GVWorkDate1x] GVWList1: [GVWorkList1x] GVDays2: [GVWorkDays2x] GVWDate2: [GVWorkDate2x] GVWList2: [GVWorkList2x], GVWorkString )
    SetField( RVWorkString, [GVWorkString] )
,
)
Q ==> [GVWorkString] - [RVWorkString]

If( And([IsPlaying] = 1, IsPlaying() )
,
>>>> - FormatDate( Now(), mm:ss ) - Filekey()
,
<<<< - FormatDate( Now(), mm:ss ) - FileKey()
)

Logged
Pages: [1]   Go Up