andyr00d Member Licensed User Longtime User Aug 22, 2016 #1 Hi, Got a strange error that I can't quite understand. Rnd function expects two min/max integers to be given, and I am passing two integers to it, which are the dimensions of a view which has already been added. Code: Copy Dim rndXRight As Int rndXRight = Rnd(ivNation.Left + ivNation.Width,ivNation.Width * 2) Which is throwing the following error: java.lang.IllegalArgumentException Any ideas what I am doing wrong? Do I need to create a separate int for the two joined values from the view and pass that instead?
Hi, Got a strange error that I can't quite understand. Rnd function expects two min/max integers to be given, and I am passing two integers to it, which are the dimensions of a view which has already been added. Code: Copy Dim rndXRight As Int rndXRight = Rnd(ivNation.Left + ivNation.Width,ivNation.Width * 2) Which is throwing the following error: java.lang.IllegalArgumentException Any ideas what I am doing wrong? Do I need to create a separate int for the two joined values from the view and pass that instead?
Erel B4X founder Staff member Licensed User Longtime User Aug 22, 2016 #2 You will get this error when ivNation.Left is larger than ivNation.Width. The min value must be smaller than the max value. Upvote 0
You will get this error when ivNation.Left is larger than ivNation.Width. The min value must be smaller than the max value.
andyr00d Member Licensed User Longtime User Aug 22, 2016 #3 Ah that makes sense, although I thought the first value would have been larger. Thanks @Erel Upvote 0