Android Question Unknown Member

Tim Chapman

Active Member
Licensed User
Longtime User
When I put this code in a sub in my larger app, I get Unknown member: MeasureMultilineTextHeight
When I put the same code in a brand new b4a app by itself, I don't get the error.
This code is from the
MeasureMultilineTextHeight
entry here: https://www.b4x.com/android/help/stringutils.html#stringutils_measuremultilinetextheight

B4X:
Dim Label1 As Label 
Label1.Initialize("") 
Label1.Text = "this is a long sentence, and we need to " _ 
 & "know the height required in order To show it completely." 
Label1.TextSize = 20 
Activity.AddView(Label1, 10dip, 10dip, 200dip, 30dip) 
Dim su As StringUtils 
Label1.Height = su.MeasureMultilineTextHeight(Label1, Label1.Text)

Any ideas?
 

Tim Chapman

Active Member
Licensed User
Longtime User
StringUtils library was added to the library list long before I put this code in. I use StringUtils elsewhere in the code with no problem.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
See if there are local variables with the same name (SU) but which are not StingUtils but Declared as another data type
 
Upvote 0

Tim Chapman

Active Member
Licensed User
Longtime User
No such luck. There is one Dim su statement in my entire code. I put one in globals and removed all others to see if the problem would change. Nothing changed.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Post your code so we can better understand
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I tried your code and it compiles perfectly.
I look for the "MyClasses.csv" file but I suppose you keep your device, so I could not run it.
But I can say that is compiled perfectly
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I had to use 6.80 because by 6.50 report mistake with CSBuilder
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I put in the REM sub ItemView that contains a variable declared CSBuilder. So it is compiled without errors also from 6.50
 
Upvote 0

Tim Chapman

Active Member
Licensed User
Longtime User
I tried it on another of my computers. That one has B4A version 6.80. It works.
My normal computer has 6.80 Beta #3. It does not work. I am trying to switch my main computer to 6.80 non-beta. Will post results.
 
Upvote 0
Top