Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Subscript out of range?
#2
You're better off putting ```INT()``` around the ```RND * 16```. Because the C++ compiler code is forced to do a type-casting or something else to handle a float value to fit it as integer and then rounding errors could happen. (shrugs)

Code: (Select All)
P.Title = Titles(INT(RND * 16))

Also you might lose some information assigning an element from ```Titles()``` array which is an array of VLS's, while "Title" field from UDT could hold only 24 characters.
Reply


Messages In This Thread
Subscript out of range? - by Cobalt - 12-18-2023, 11:08 PM
RE: Subscript out of range? - by mnrvovrfc - 12-18-2023, 11:21 PM
RE: Subscript out of range? - by SMcNeill - 12-19-2023, 01:16 AM
RE: Subscript out of range? - by bobalooie - 12-19-2023, 02:43 AM



Users browsing this thread: 1 Guest(s)