March 20th, 2005, 05:55 PM
CLng() to Int()?
I'm trying to convert VB6 code to Python, and the VB6 program is using CLng(). Here is one of the lines that I'm trying to translate:
I realized that lngKey is being turned into a double, and the new name is dblKey. In Python all I could think of was to use int(). But this obviously isn't going to do what I need it to do. What else is there I can use?
lngKey = CLng(dblKey)
March 20th, 2005, 07:14 PM
You have it the wrong way round. dblKey is being turned into a long called lngKey. The int() function is what you want. If you ever need to do it the other way use float().
Dave - The Developers' Coach
March 20th, 2005, 08:00 PM