lets me think that some type of data is invalid.
Can you please insert the following lines ahead of the failing statement in line #242?
Consolewrite("Value of $amount: '" & $amount & "', Variable Type of $amount: " & VargetType($amount) & @CRLF)
Consolewrite("Value of $Text: '" & $Text & "', Variable Type of $Text: " & VargetType($Text) & @CRLF)