Data Type Conversion Help
#1
Simply put how do I convert the type of the result of the operation in the () from LONG to DOUBLE in the snippet below?

Code: (Select All)
Answer# = 1.0 + (ARowEnd& - ARowStart&)

Thanks

TR
Reply
#2
I'm not sure you have to do anything other than use the suffix for the variable container.

If pressed this might work:
Answer# = Val(Str$(1 + (ARowEnd& - ARowStart&)))
Print Answer#
b = b + ...
Reply
#3
I would have used cdbl(ARowEnd& - ARowStart&)
Reply
#4
(05-02-2022, 08:26 PM)TarotRedhand Wrote: Simply put how do I convert the type of the result of the operation in the () from LONG to DOUBLE in the snippet below?

Code: (Select All)
Answer# = 1.0 + (ARowEnd& - ARowStart&)

Thanks

TR

Just use that line of code as is, you already specified Answer as DOUBLE using the # suffix, whatever the type of 1.0 + (ARowEnd& - ARowStart&) will evaluate to (probably SINGLE) will be automatically converted under the hood to mach your specified Answer# type.
Reply
#5
Thanks Guys. Looks like the 2622 line (includes comments) library of mine should be good to go.

TR
Reply




Users browsing this thread: 4 Guest(s)